diff --git a/.env.example b/.env.example index b529a0430..2c38804b9 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,10 @@ -RPC_URL=https://sepolia.blast.io +# Chain names based on: https://github.com/alloy-rs/chains/blob/main/src/named.rs +CHAIN=CHANGEME +RPC_URL=CHANGEME +ETHERSCAN_API_KEY=CHANGEME + DEPLOYER_PRIVATE_KEY=CHANGEME DEPLOYER_ADDRESS=CHANGEME -# Blast verification -VERIFIER_URL=https://api.routescan.io/v2/network/testnet/evm/168587773/etherscan -ETHERSCAN_API_KEY=verifyContract +# Set to override the default verifier URL for the chain +#VERIFIER_URL= diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6a98ffe2e..a1e259f4d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v4 with: - version: 8 + version: 9 - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 @@ -48,24 +48,25 @@ jobs: - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.3 - - name: Build local ecies-cli for use with testing - run: cd crates/ecies-cli && cargo build && cd ../.. - - - name: Repo Install Script + - name: Install Dependencies run: | - chmod +x ./install.sh - ./install.sh + pnpm install shell: bash - name: Run lint check run: pnpm run lint:check - - name: Run Forge build + - name: Build Solidity Contracts run: | forge --version forge build id: build + - name: Build ECIES CLI + run: | + pnpm run build:ecies-cli + id: build-ecies-cli + - name: Run Forge tests run: | pnpm run test diff --git a/.gitignore b/.gitignore index 7b16da948..eb560657a 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ node_modules/ # Bytecode bytecode/ + +# soldeer +dependencies/ diff --git a/.gitmodules b/.gitmodules index 81318a919..e69de29bb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,27 +0,0 @@ -[submodule "lib/forge-std"] - path = lib/forge-std - url = https://github.com/foundry-rs/forge-std -[submodule "lib/solady"] - path = lib/solady - url = https://github.com/vectorized/solady -[submodule "lib/solmate"] - path = lib/solmate - url = https://github.com/transmissions11/solmate -[submodule "lib/prb-math"] - path = lib/prb-math - url = https://github.com/PaulRBerg/prb-math -[submodule "lib/uniswap-v3-periphery"] - path = lib/uniswap-v3-periphery - url = https://github.com/uniswap/v3-periphery -[submodule "lib/uniswap-v3-core"] - path = lib/uniswap-v3-core - url = https://github.com/uniswap/v3-core -[submodule "lib/openzeppelin-contracts"] - path = lib/openzeppelin-contracts - url = https://github.com/openzeppelin/openzeppelin-contracts -[submodule "lib/openzeppelin-contracts-upgradeable"] - path = lib/openzeppelin-contracts-upgradeable - url = https://github.com/openzeppelin/openzeppelin-contracts-upgradeable -[submodule "lib/uniswap-v2-core"] - path = lib/uniswap-v2-core - url = https://github.com/uniswap/v2-core diff --git a/.solhintignore b/.solhintignore index be91ed51d..1e57ebe95 100644 --- a/.solhintignore +++ b/.solhintignore @@ -1,6 +1,6 @@ lib/** +dependencies/** src/modules/Modules.sol src/modules/Keycode.sol -src/lib/** -test/lib/uniswap-v2/*.sol -test/lib/uniswap-v3/*.sol +src/lib/clones/** +src/lib/permit2/** diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..dce836a5d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +## 0.5.1 + +- Migrates all dependencies over to soldeer packages and away from git submodules (#222) +- Removes redundant dependencies (prb-math, uniswap-v3-periphery) (#222) +- Packages the repository as a soldeer package (#222) +- Use implicit imports in interfaces (#223) +- Improvements to constant and deployment addresses (#220) + +## 0.5.0 + +- Adds SVG for derivative tokens deployed using the LinearVesting module (#210) +- Define the referrer fee on a per-auction basis (#216) +- Standardise percentages on 2 basis points (100% = 100e2) diff --git a/README.md b/README.md index 71649e9f1..cb44ea506 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Axis is built in Solidity using Foundry as the development and test environment. ### First-Run ```shell -pnpm run full-install +pnpm install ``` ### Build @@ -71,9 +71,8 @@ Many of the contracts (e.g. callbacks) require a specific address prefix or have - The code of a callback contract has been changed - This requires re-generating the salt for the contract. See the [test_salts.sh](/script/salts/test/test_salts.sh) script. -- There has been a change to the dependencies under `/lib`. The dependencies affect the build output, so any changes will affect the bytecode generated by the Solidity compiler. - - If the submodule change was inadvertent, this can be fixed by running `pnpm run full-install` to reset the changes. - - In some cases, such as the `g-uni-v1-core` dependency, installing npm packages will result in the remappings being changed. It is best to remove the dependency's respective dependencies in order to fix this. +- There has been a change to the dependencies under `/lib` or `/dependencies`. The dependencies affect the build output, so any changes will affect the bytecode generated by the Solidity compiler. + - If the change was inadvertent, this can be fixed by running `pnpm install` to reset the changes. - If the change to dependencies and invalidation of salts is expected, then new salts must be generated. In some cases (such as Uniswap V2 and V3 factories), the new addresses must be recorded in the `Constants.sol` file. ### Format @@ -96,4 +95,32 @@ Scripts are written in Solidity using Foundry and are divided into `deploy`, `sa ### Deployments -Deployments are listed in the [Axis documentation](https://docs.axis.finance/references/03-technical/). +Deployments are listed in the [env.json file](/script/env.json) and periodically updated in the [Axis documentation](https://axis.finance/developer/reference/contract-addresses). + +### Dependencies + +[soldeer](https://soldeer.xyz/) is used as the dependency manager, as it solves many of the problems inherent in forge's use of git submodules. Soldeer is integrated into `forge`, so should not require any additional installations. + +NOTE: The import path of each dependency is versioned. This ensures that any changes to the dependency version result in clear errors to highlight the potentially-breaking change. + +#### Updating Dependencies + +When updating the version of a dependency provided through soldeer, the following must be performed: + +1. Update the version of the dependency in `foundry.toml` or through `forge soldeer` +2. Re-run the [installation script](#first-run) +3. If the version number has changed: + - Change the existing entry in [remappings.txt](remappings.txt) to point to the new dependency version + - Update imports to use the new remapping + +### Packaging + +To publish a new package version to soldeer, run the following: + +```shell +pnpm run publish +``` + +On first run, this requires authentication with soldeer: `soldeer login` + +The [CHANGELOG](CHANGELOG.md) file should also be updated. diff --git a/foundry.toml b/foundry.toml index fb59ee307..aac350638 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,7 +1,6 @@ [profile.default] src = "src" out = "out" -# libs = ["lib"] fs_permissions = [{access = "read-write", path = "./bytecode/"}, {access = "read", path = "./script/"}, {access = "read-write", path = "./deployments/"}] ffi = true solc_version = "0.8.19" @@ -21,8 +20,14 @@ quote_style = "double" number_underscore = "thousands" wrap_comments = false ignore = [ - "lib/**", "src/lib/**", ] # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options + +[dependencies] +forge-std = { version = "1.9.1" } +solmate = { version = "6.7.0", url = "git@github.com:transmissions11/solmate.git", commit = "c892309933b25c03d32b1b0d674df7ae292ba925" } +solady = { version = "0.0.124" } +"@openzeppelin-contracts" = { version = "4.9.2" } +clones-with-immutable-args = { version = "1.1.1", git = "git@github.com:wighawag/clones-with-immutable-args.git", rev = "f5ca191afea933d50a36d101009b5644dc28bc99" } diff --git a/install.sh b/install.sh deleted file mode 100755 index df831cbb9..000000000 --- a/install.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -echo "*** Installing dependencies using pnpm" -pnpm install - -echo "" -echo "*** Setting up submodules" -git submodule init -git submodule update - -echo "" -echo "*** Running forge install" -forge install - -echo "" -echo "*** Restoring submodule commits" -# Lock the submodules to specific commits -echo "" -echo "forge-std" -cd lib/forge-std/ && git checkout v1.7.1 && cd ../.. - -echo "" -echo "prb-math" -cd lib/prb-math/ && git checkout 9dc06519f3b9f1659fec7d396da634fe690f660c && cd ../.. - -echo "" -echo "solady" -cd lib/solady/ && git checkout v0.0.124 && cd ../.. - -echo "" -echo "solmate" -cd lib/solmate/ && git checkout c892309933b25c03d32b1b0d674df7ae292ba925 && cd ../.. - -echo "" -echo "openzeppelin-contracts" -cd lib/openzeppelin-contracts && git checkout d6b63a48ba440ad8d551383697db6e5b0ef84137 && cd ../.. - -echo "" -echo "openzeppelin-contracts-upgradeable" -cd lib/openzeppelin-contracts-upgradeable && git checkout dda4972793c55bfdae604e8ef3388352e3e34bf1 && cd ../.. - -echo "" -echo "uniswap-v2-core" -cd lib/uniswap-v2-core && git checkout v1.0.1 && cd ../.. - -echo "" -echo "uniswap-v3-core" -cd lib/uniswap-v3-core && git checkout 6562c52e8f75f0c10f9deaf44861847585fc8129 && cd ../.. - -echo "" -echo "uniswap-v3-periphery" -cd lib/uniswap-v3-periphery && git checkout b325bb0905d922ae61fcc7df85ee802e8df5e96c && cd ../.. - -echo "" -echo "*** Running forge build" -forge build diff --git a/lib/forge-std b/lib/forge-std deleted file mode 160000 index f73c73d20..000000000 --- a/lib/forge-std +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f73c73d2018eb6a111f35e4dae7b4f27401e9421 diff --git a/lib/g-uni-v1-core/.circleci/config.yml b/lib/g-uni-v1-core/.circleci/config.yml deleted file mode 100644 index 317388595..000000000 --- a/lib/g-uni-v1-core/.circleci/config.yml +++ /dev/null @@ -1,47 +0,0 @@ -version: 2.1 # use CircleCI 2.1 -orbs: - coveralls: coveralls/coveralls@1.0.6 -jobs: # a collection of steps - build: # runs not using Workflows must have a `build` job as entry point - working_directory: ~/uni-v3-LP-ci # directory where steps will run - docker: # run the steps with Docker - - image: circleci/node:14.15.3 # ...with this image as the primary container; this is where all `steps` will run - steps: # a collection of executable commands - - checkout # special step to check out source code to working directory - - restore_cache: # restore the dependency cache - # Read about caching dependencies: https://circleci.com/docs/2.0/caching/ - name: Restore Yarn Package Cache - key: yarn-packages-{{ checksum "yarn.lock" }} - - run: - name: yarn install - command: yarn install --frozen-lockfile - - save_cache: # special step to save the dependency cache - name: Save Yarn Package Cache - key: yarn-packages-{{ checksum "yarn.lock" }} - paths: - - ./node_modules - - run: # Build - name: Build - command: yarn build - - run: # Formatting - name: Prettier - command: yarn format - - run: # Linting - name: ESLint - command: yarn lint - # - restore_cache: # restore the Hardhat Network Fork Cache - # name: Restore Hardhat Network Fork Cache - # key: v11-hardhat-network-fork-cache - - run: # Coverage - name: solidity-coverage - command: yarn hardhat coverage - # - save_cache: # special step to save the Hardhat Network Fork cache - # name: Save Hardhat Network Fork Cache - # key: v11-hardhat-network-fork-cache - # paths: - # - ./cache/hardhat-network-fork - - coveralls/upload # upload lcov.info to coveralls.io - # - store_artifacts: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/ - # path: coverage - # prefix: coverage - # See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples diff --git a/lib/g-uni-v1-core/.env.example b/lib/g-uni-v1-core/.env.example deleted file mode 100644 index 73e944907..000000000 --- a/lib/g-uni-v1-core/.env.example +++ /dev/null @@ -1,3 +0,0 @@ -# Wallets -ANVIL_PRIVATE_KEY= -DEPLOYER_PRIVATE_KEY= diff --git a/lib/g-uni-v1-core/.eslintignore b/lib/g-uni-v1-core/.eslintignore deleted file mode 100644 index 37b107e2f..000000000 --- a/lib/g-uni-v1-core/.eslintignore +++ /dev/null @@ -1,6 +0,0 @@ -cache -coverage -coverage -dist -typechain - diff --git a/lib/g-uni-v1-core/.eslintrc.json b/lib/g-uni-v1-core/.eslintrc.json deleted file mode 100644 index d40acfd0e..000000000 --- a/lib/g-uni-v1-core/.eslintrc.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "env": { - "commonjs": true, - "es2021": true, - "node": true, - "mocha": true - }, - "extends": ["eslint:recommended", "prettier"], - "parserOptions": { - "ecmaVersion": 12 - }, - // Typescript config - "overrides": [ - { - "files": ["*.ts"], - "parser": "@typescript-eslint/parser", - "parserOptions": { "project": "./tsconfig.json" }, - "plugins": ["@typescript-eslint", "prettier"], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/eslint-recommended", - "prettier" - ], - "rules": { - "prettier/prettier": "error", - "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "default", - "format": ["camelCase"] - }, - { - "selector": "variable", - "format": ["camelCase", "UPPER_CASE"] - }, - { - "selector": "parameter", - "format": ["camelCase"], - "leadingUnderscore": "allow" - }, - { - "selector": ["objectLiteralProperty"], - "format": ["camelCase", "PascalCase"] - }, - { - "selector": ["classProperty"], - "modifiers": ["private", "static"], - "format": ["PascalCase", "UPPER_CASE"] - }, - { - "selector": ["classProperty", "classMethod"], - "modifiers": ["private"], - "format": ["camelCase"], - "leadingUnderscore": "require" - }, - { - "selector": ["classProperty", "classMethod"], - "modifiers": ["protected"], - "format": ["camelCase"], - "leadingUnderscore": "require" - }, - { - "selector": "typeLike", - "format": ["PascalCase"] - }, - { - "selector": ["enumMember"], - "format": ["camelCase", "PascalCase"] - }, - { - "selector": "variable", - "types": ["boolean"], - "format": ["PascalCase"], - "prefix": ["is", "should", "has", "can", "did", "will"] - } - ] - } - } - ] -} diff --git a/lib/g-uni-v1-core/.gitattributes b/lib/g-uni-v1-core/.gitattributes deleted file mode 100644 index 52031de51..000000000 --- a/lib/g-uni-v1-core/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.sol linguist-language=Solidity diff --git a/lib/g-uni-v1-core/.gitignore b/lib/g-uni-v1-core/.gitignore deleted file mode 100644 index cc713dc92..000000000 --- a/lib/g-uni-v1-core/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# Dependency directory -node_modules - -# local env variables -.env - -# coverage -coverage -.nyc_output -coverage.json - -# cache -.eslintcache - -# hardhat -artifacts -cache - -# macOS -.DS_Store -*.icloud - -# redis -dump.rdb - -# typechain -typechain - -# typescript -dist - -# VS Code -.vscode - diff --git a/lib/g-uni-v1-core/.husky/.gitignore b/lib/g-uni-v1-core/.husky/.gitignore deleted file mode 100644 index 31354ec13..000000000 --- a/lib/g-uni-v1-core/.husky/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_ diff --git a/lib/g-uni-v1-core/.husky/pre-commit b/lib/g-uni-v1-core/.husky/pre-commit deleted file mode 100755 index 9012ad2e1..000000000 --- a/lib/g-uni-v1-core/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -yarn install && yarn clean && yarn build && yarn format && yarn lint:sol && yarn lint-staged diff --git a/lib/g-uni-v1-core/.husky/pre-push b/lib/g-uni-v1-core/.husky/pre-push deleted file mode 100755 index 2f8521c37..000000000 --- a/lib/g-uni-v1-core/.husky/pre-push +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -git fetch origin && HUSKY=0 git rebase origin/master && yarn test diff --git a/lib/g-uni-v1-core/.prettierignore b/lib/g-uni-v1-core/.prettierignore deleted file mode 100644 index 34a18ac8e..000000000 --- a/lib/g-uni-v1-core/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -artifacts -dist -cache -coverage -coverage.json - diff --git a/lib/g-uni-v1-core/.prettierrc.json b/lib/g-uni-v1-core/.prettierrc.json deleted file mode 100644 index 0967ef424..000000000 --- a/lib/g-uni-v1-core/.prettierrc.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/lib/g-uni-v1-core/.solcover.js b/lib/g-uni-v1-core/.solcover.js deleted file mode 100644 index c8b177370..000000000 --- a/lib/g-uni-v1-core/.solcover.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - skipFiles: [ - "__mocks__", - "abstract/GUni.sol", - "abstract/OwnableUninitialized.sol", - "interfaces", - "vendor", - "node_modules", - ], -}; diff --git a/lib/g-uni-v1-core/.solhint.json b/lib/g-uni-v1-core/.solhint.json deleted file mode 100644 index dc28be9a0..000000000 --- a/lib/g-uni-v1-core/.solhint.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "extends": "solhint:recommended", - "plugins": ["prettier"], - "rules": { - "prettier/prettier": "error", - "code-complexity": ["error", 5], - "function-max-lines": ["error", 40], - "max-line-length": ["error", 100], - "max-states-count": ["error", 3], - "no-empty-blocks": "error", - "no-unused-vars": "error", - "payable-fallback": "off", - "reason-string": ["off", { "maxLength": 32 }], - "constructor-syntax": "off", - "comprehensive-interface": "off", - "quotes": ["error", "double"], - "const-name-snakecase": "error", - "contract-name-camelcase": "error", - "event-name-camelcase": "error", - "func-name-mixedcase": "error", - "func-param-name-mixedcase": "error", - "modifier-name-mixedcase": "error", - "private-vars-leading-underscore": ["error", { "strict": false }], - "var-name-mixedcase": "error", - "imports-on-top": "error", - "ordering": "off", - "visibility-modifier-order": "error", - "avoid-call-value": "off", - "avoid-low-level-calls": "off", - "avoid-sha3": "error", - "avoid-suicide": "error", - "avoid-throw": "error", - "avoid-tx-origin": "off", - "check-send-result": "error", - "compiler-version": ["error", "0.8.4"], - "mark-callable-contracts": "off", - "func-visibility": ["error", { "ignoreConstructors": true }], - "multiple-sends": "error", - "no-complex-fallback": "error", - "no-inline-assembly": "off", - "not-rely-on-block-hash": "error", - "not-rely-on-time": "error", - "reentrancy": "error", - "state-visibility": "error" - } -} diff --git a/lib/g-uni-v1-core/.solhintignore b/lib/g-uni-v1-core/.solhintignore deleted file mode 100644 index f0ab30bf5..000000000 --- a/lib/g-uni-v1-core/.solhintignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -contracts/vendor \ No newline at end of file diff --git a/lib/g-uni-v1-core/README.md b/lib/g-uni-v1-core/README.md deleted file mode 100644 index 9f9eec8c6..000000000 --- a/lib/g-uni-v1-core/README.md +++ /dev/null @@ -1,171 +0,0 @@ -[![CircleCI](https://circleci.com/gh/gelatodigital/g-uni-v1-core/tree/master.svg?style=svg&circle-token=0a89a0c369a448314a37b2f2312cc1a3e5d3d4e8)](https://circleci.com/gh/gelatodigital/g-uni-v1-core/tree/master) -[![Coverage Status](https://coveralls.io/repos/github/gelatodigital/uni-v3-lp/badge.svg?branch=master&t=IlcAEC)](https://coveralls.io/github/gelatodigital/uni-v3-lp?branch=master) - -# G-UNI v1 Core - -A shared fungible (ERC20) position for Uniswap V3 passive liquidity providers. G-UNI pools are auto-compounded by gelato network to reinvest accrued fees into the position. The position bounds are static and immutable by default, unless creating a "managed" pool, in which case an `executiveRebalance` can be performed by the governance/manager account which will redeposit liquidity into a new range (see [docs](https://docs-g-uni.gelato.network) for more info). - -## G-UNI Pool Overview - -### mint - -``` - function mint(uint256 mintAmount, address receiver) - external - nonReentrant - returns ( - uint256 amount0, - uint256 amount1, - uint128 liquidityMinted - ) -``` - -Arguments: - -- `mintAmount` amount of G-UNI tokens to mint -- `receiver` account that receives the G-UNI tokens - -Returns: - -- `amount0` amount of token0 actually deposited into G-UNI -- `amount1` amount of token1 actually deposited into G-UNI -- `liquidityMinted` amount of liqudiity added to G-UNI position - -Note: to find out the amount of token0 and token1 you would owe by minting that many G-UNI tokens use getMintAmounts method. - -### burn - -``` - function burn(uint256 _burnAmount, address _receiver) - external - nonReentrant - returns ( - uint256 amount0, - uint256 amount1, - uint128 liquidityBurned - ) -``` - -Arguments: - -- `_burnAmount` number of G-UNI tokens to burn -- `_receiver` account that receives the remitted token0 and token1 - -Returns: - -- `amount0` amount of token0 remitted to \_receiver -- `amount1` amount of token1 remitted to \_receiver -- `liquidityBurned` amount of liquidity burned from G-UNI positon - -### getMintAmounts (view call) - -``` - function getMintAmounts(uint256 amount0Max, uint256 amount1Max) - external - view - returns ( - uint256 amount0, - uint256 amount1, - uint256 mintAmount - ) -``` - -Arguments: - -- `amount0Max` maximum amount of token0 to deposit into G-UNI -- `amount1Max` maximum amount of token1 to deposit into G-UNI - -Returns: - -- `amount0` actual amount of token0 to deposit into G-UNI -- `amount1` actual amount of token1 to deposit into G-UNI -- `mintAmount` amount of G-UNI tokens to pass to mint function (will cost exactly `amount0` and `amount1`) - -### rebalance - -``` - function rebalance( - uint160 _swapThresholdPrice, - uint256 _swapAmountBPS, - uint256 _feeAmount, - address _paymentToken - ) external gelatofy(_feeAmount, _paymentToken) { -``` - -Arguments: - -- `_swapThresholdPrice` a sqrtPriceX96 which is used as the slippage parameter in uniswap v3 swaps. -- `_swapAmountBPS` amount to swap passed as basis points of current amount of leftover token held (e.g. "swap 50% of balance" would be a value of 5000) -- `_feeAmount` amount that gelato will take as a fee (`GelatoDiamond` checks against gas consumption so bot is not allowed to overcharge) -- `_paymentToken` the token in which `_feeAmount` is collected - -Note: This method can only be called by gelato executors - -### executiveRebalance (for managed pools) - -If governance/admin wants to change bounds of the underlying position, or wants to force a rebalance for any other reason, they are allowed to call this executive rebalance function. - -``` - function executiveRebalance( - int24 _newLowerTick, - int24 _newUpperTick, - uint160 _swapThresholdPrice, - uint256 _swapAmountBPS, - bool _zeroForOne - ) external onlyOwner { -``` - -Arguments: - -- `_newLowerTick` the tick to use as position lower bound on reinvestment -- `_newUpperTick` the tick to use as position upper bound on reinvestment -- `_swapThresholdPrice` a sqrtPriceX96 which is used as the slippage parameter in uniswap v3 swaps. -- `_swapAmountBPS` amount to swap passed as basis points of current amount of leftover token held (e.g. "swap 50% of balance" would be a value of 5000) -- `_zeroForOne` which token to input into the swap (true = token0, false = token1) - -# test - -yarn - -yarn test - -## Setup - -```shell -yarn install -``` - -Set up environment variables: - -- Copy `.env.example` to `.env` -- Fill out environment variables - -## Deployment - -1. Ensure that the `Gelato`, `GelatoDevMultiSig` and `UniswapV3Factory` addresses are set in `src/addresses.ts` for the target chain. -1. Deploy the GUniPool, as that will serve as input to the GUniFactory: - - ```shell - HARDHAT_NETWORK="" yarn run deploy:pool - ``` - -1. Copy the address of the GUniPool (output to the terminal) into the value of the `GUniImplementation` key in `src/addresses.ts` for the target chain. -1. Deploy the GUniFactory: - - ```shell - HARDHAT_NETWORK="" yarn run deploy:factory - ``` - -Note that these scripts will not deploy to a particular chain if there have been no changes to the contracts since the last deployment on that chain. To override this, pass the `--reset` flag. - -## Verification - -1. Verify the contracts: - - ```shell - HARDHAT_NETWORK="" yarn run verify - ``` - - - If hardhat reports that a network is not supported, specify the API url using `--api-url ` - -NOTE: The GUniFactory contract will require additional steps to enable it to be viewed as a proxy. diff --git a/lib/g-uni-v1-core/audit/REP-Gelato-UNI-2021-07-22.pdf b/lib/g-uni-v1-core/audit/REP-Gelato-UNI-2021-07-22.pdf deleted file mode 100644 index 787cd3d91..000000000 Binary files a/lib/g-uni-v1-core/audit/REP-Gelato-UNI-2021-07-22.pdf and /dev/null differ diff --git a/lib/g-uni-v1-core/audit/WatchPug Audit Report for Gelato G-UNI.pdf b/lib/g-uni-v1-core/audit/WatchPug Audit Report for Gelato G-UNI.pdf deleted file mode 100644 index 630411448..000000000 Binary files a/lib/g-uni-v1-core/audit/WatchPug Audit Report for Gelato G-UNI.pdf and /dev/null differ diff --git a/lib/g-uni-v1-core/contracts/GUniFactory.sol b/lib/g-uni-v1-core/contracts/GUniFactory.sol deleted file mode 100644 index 638948e64..000000000 --- a/lib/g-uni-v1-core/contracts/GUniFactory.sol +++ /dev/null @@ -1,278 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import { - IUniswapV3Factory -} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol"; -import {IUniswapV3TickSpacing} from "./interfaces/IUniswapV3TickSpacing.sol"; -import {IGUniFactory} from "./interfaces/IGUniFactory.sol"; -import {IGUniPoolStorage} from "./interfaces/IGUniPoolStorage.sol"; -import {GUniFactoryStorage} from "./abstract/GUniFactoryStorage.sol"; -import {EIP173Proxy} from "./vendor/proxy/EIP173Proxy.sol"; -import {IEIP173Proxy} from "./interfaces/IEIP173Proxy.sol"; -import { - IERC20Metadata -} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; -import { - EnumerableSet -} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; - -contract GUniFactory is GUniFactoryStorage, IGUniFactory { - using EnumerableSet for EnumerableSet.AddressSet; - - constructor(address _uniswapV3Factory) - GUniFactoryStorage(_uniswapV3Factory) - {} // solhint-disable-line no-empty-blocks - - /// @notice createManagedPool creates a new instance of a G-UNI token on a specified - /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will - /// forever be associated with the G-UNI pool as it's `deployer` - /// @param tokenA one of the tokens in the uniswap pair - /// @param tokenB the other token in the uniswap pair - /// @param uniFee fee tier of the uniswap pair - /// @param managerFee proportion of earned fees that go to pool manager in Basis Points - /// @param lowerTick initial lower bound of the Uniswap V3 position - /// @param upperTick initial upper bound of the Uniswap V3 position - /// @return pool the address of the newly created G-UNI pool (proxy) - function createManagedPool( - address tokenA, - address tokenB, - uint24 uniFee, - uint16 managerFee, - int24 lowerTick, - int24 upperTick - ) external override returns (address pool) { - return - _createPool( - tokenA, - tokenB, - uniFee, - managerFee, - lowerTick, - upperTick, - msg.sender - ); - } - - /// @notice createPool creates a new instance of a G-UNI token on a specified - /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still - /// forever be associated with the G-UNI pool as it's `deployer` - /// @param tokenA one of the tokens in the uniswap pair - /// @param tokenB the other token in the uniswap pair - /// @param uniFee fee tier of the uniswap pair - /// @param lowerTick initial lower bound of the Uniswap V3 position - /// @param upperTick initial upper bound of the Uniswap V3 position - /// @return pool the address of the newly created G-UNI pool (proxy) - function createPool( - address tokenA, - address tokenB, - uint24 uniFee, - int24 lowerTick, - int24 upperTick - ) external override returns (address pool) { - return - _createPool( - tokenA, - tokenB, - uniFee, - 0, - lowerTick, - upperTick, - address(0) - ); - } - - function _createPool( - address tokenA, - address tokenB, - uint24 uniFee, - uint16 managerFee, - int24 lowerTick, - int24 upperTick, - address manager - ) internal returns (address pool) { - (address token0, address token1) = _getTokenOrder(tokenA, tokenB); - - pool = address(new EIP173Proxy(poolImplementation, address(this), "")); - - string memory name = "Gelato Uniswap LP"; - try this.getTokenName(token0, token1) returns (string memory result) { - name = result; - } catch {} // solhint-disable-line no-empty-blocks - - address uniPool = - IUniswapV3Factory(factory).getPool(token0, token1, uniFee); - require(uniPool != address(0), "uniswap pool does not exist"); - require( - _validateTickSpacing(uniPool, lowerTick, upperTick), - "tickSpacing mismatch" - ); - - IGUniPoolStorage(pool).initialize( - name, - "G-UNI", - uniPool, - managerFee, - lowerTick, - upperTick, - manager - ); - _deployers.add(msg.sender); - _pools[msg.sender].add(pool); - emit PoolCreated(uniPool, manager, pool); - } - - function _validateTickSpacing( - address uniPool, - int24 lowerTick, - int24 upperTick - ) internal view returns (bool) { - int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing(); - return - lowerTick < upperTick && - lowerTick % spacing == 0 && - upperTick % spacing == 0; - } - - function getTokenName(address token0, address token1) - external - view - returns (string memory) - { - string memory symbol0 = IERC20Metadata(token0).symbol(); - string memory symbol1 = IERC20Metadata(token1).symbol(); - - return _append("Gelato Uniswap ", symbol0, "/", symbol1, " LP"); - } - - function upgradePools(address[] memory pools) external onlyManager { - for (uint256 i = 0; i < pools.length; i++) { - IEIP173Proxy(pools[i]).upgradeTo(poolImplementation); - } - } - - function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas) - external - onlyManager - { - require(pools.length == datas.length, "mismatching array length"); - for (uint256 i = 0; i < pools.length; i++) { - IEIP173Proxy(pools[i]).upgradeToAndCall( - poolImplementation, - datas[i] - ); - } - } - - function makePoolsImmutable(address[] memory pools) external onlyManager { - for (uint256 i = 0; i < pools.length; i++) { - IEIP173Proxy(pools[i]).transferProxyAdmin(address(0)); - } - } - - /// @notice isPoolImmutable checks if a certain G-UNI pool is "immutable" i.e. that the - /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded - /// @param pool address of the G-UNI pool - /// @return bool signaling if pool is immutable (true) or not (false) - function isPoolImmutable(address pool) external view returns (bool) { - return address(0) == getProxyAdmin(pool); - } - - /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's - /// default deployer address (since anyone can deploy and manage G-UNI pools) - /// @return list of Gelato managed G-UNI pool addresses - function getGelatoPools() external view returns (address[] memory) { - return getPools(gelatoDeployer); - } - - /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool - /// @return deployers the list of deployer addresses - function getDeployers() public view returns (address[] memory) { - uint256 length = numDeployers(); - address[] memory deployers = new address[](length); - for (uint256 i = 0; i < length; i++) { - deployers[i] = _getDeployer(i); - } - - return deployers; - } - - /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer` - /// @param deployer address that has potentially deployed G-UNI pools (can return empty array) - /// @return pools the list of G-UNI pool addresses deployed by `deployer` - function getPools(address deployer) public view returns (address[] memory) { - uint256 length = numPools(deployer); - address[] memory pools = new address[](length); - for (uint256 i = 0; i < length; i++) { - pools[i] = _getPool(deployer, i); - } - - return pools; - } - - /// @notice numPools counts the total number of G-UNI pools in existence - /// @return result total number of G-UNI pools deployed - function numPools() public view returns (uint256 result) { - address[] memory deployers = getDeployers(); - for (uint256 i = 0; i < deployers.length; i++) { - result += numPools(deployers[i]); - } - } - - /// @notice numDeployers counts the total number of G-UNI pool deployer addresses - /// @return total number of G-UNI pool deployer addresses - function numDeployers() public view returns (uint256) { - return _deployers.length(); - } - - /// @notice numPools counts the total number of G-UNI pools deployed by `deployer` - /// @param deployer deployer address - /// @return total number of G-UNI pools deployed by `deployer` - function numPools(address deployer) public view returns (uint256) { - return _pools[deployer].length(); - } - - /// @notice getProxyAdmin gets the current address who controls the underlying implementation - /// of a G-UNI pool. For most all pools either this contract address or the zero address will - /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally - /// no longer upgradable (no one owns the zero address). - /// @param pool address of the G-UNI pool - /// @return address that controls the G-UNI implementation (has power to upgrade it) - function getProxyAdmin(address pool) public view returns (address) { - return IEIP173Proxy(pool).proxyAdmin(); - } - - function _getDeployer(uint256 index) internal view returns (address) { - return _deployers.at(index); - } - - function _getPool(address deployer, uint256 index) - internal - view - returns (address) - { - return _pools[deployer].at(index); - } - - function _getTokenOrder(address tokenA, address tokenB) - internal - pure - returns (address token0, address token1) - { - require(tokenA != tokenB, "same token"); - (token0, token1) = tokenA < tokenB - ? (tokenA, tokenB) - : (tokenB, tokenA); - require(token0 != address(0), "no address zero"); - } - - function _append( - string memory a, - string memory b, - string memory c, - string memory d, - string memory e - ) internal pure returns (string memory) { - return string(abi.encodePacked(a, b, c, d, e)); - } -} diff --git a/lib/g-uni-v1-core/contracts/GUniPool.sol b/lib/g-uni-v1-core/contracts/GUniPool.sol deleted file mode 100644 index e2514f1fd..000000000 --- a/lib/g-uni-v1-core/contracts/GUniPool.sol +++ /dev/null @@ -1,860 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -import { - IUniswapV3MintCallback -} from "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol"; -import { - IUniswapV3SwapCallback -} from "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol"; -import {GUniPoolStorage} from "./abstract/GUniPoolStorage.sol"; -import { - IUniswapV3Pool -} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; -import {TickMath} from "./vendor/uniswap/TickMath.sol"; -import { - IERC20, - SafeERC20 -} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol"; -import { - FullMath, - LiquidityAmounts -} from "./vendor/uniswap/LiquidityAmounts.sol"; - -contract GUniPool is - IUniswapV3MintCallback, - IUniswapV3SwapCallback, - GUniPoolStorage -{ - using SafeERC20 for IERC20; - using TickMath for int24; - - event Minted( - address receiver, - uint256 mintAmount, - uint256 amount0In, - uint256 amount1In, - uint128 liquidityMinted - ); - - event Burned( - address receiver, - uint256 burnAmount, - uint256 amount0Out, - uint256 amount1Out, - uint128 liquidityBurned - ); - - event Rebalance( - int24 lowerTick_, - int24 upperTick_, - uint128 liquidityBefore, - uint128 liquidityAfter - ); - - event FeesEarned(uint256 feesEarned0, uint256 feesEarned1); - - // solhint-disable-next-line max-line-length - constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks - - /// @notice Uniswap V3 callback fn, called back on pool.mint - function uniswapV3MintCallback( - uint256 amount0Owed, - uint256 amount1Owed, - bytes calldata /*_data*/ - ) external override { - require(msg.sender == address(pool), "callback caller"); - - if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed); - if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed); - } - - /// @notice Uniswap v3 callback fn, called back on pool.swap - function uniswapV3SwapCallback( - int256 amount0Delta, - int256 amount1Delta, - bytes calldata /*data*/ - ) external override { - require(msg.sender == address(pool), "callback caller"); - - if (amount0Delta > 0) - token0.safeTransfer(msg.sender, uint256(amount0Delta)); - else if (amount1Delta > 0) - token1.safeTransfer(msg.sender, uint256(amount1Delta)); - } - - // User functions => Should be called via a Router - - /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position - /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts - /// @param mintAmount The number of G-UNI tokens to mint - /// @param receiver The account to receive the minted tokens - /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount` - /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount` - /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position - // solhint-disable-next-line function-max-lines, code-complexity - function mint(uint256 mintAmount, address receiver) - external - nonReentrant - returns ( - uint256 amount0, - uint256 amount1, - uint128 liquidityMinted - ) - { - require(mintAmount > 0, "mint 0"); - - uint256 totalSupply = totalSupply(); - - (uint160 sqrtRatioX96, , , , , , ) = pool.slot0(); - - if (totalSupply > 0) { - (uint256 amount0Current, uint256 amount1Current) = - getUnderlyingBalances(); - - amount0 = FullMath.mulDivRoundingUp( - amount0Current, - mintAmount, - totalSupply - ); - amount1 = FullMath.mulDivRoundingUp( - amount1Current, - mintAmount, - totalSupply - ); - } else { - // if supply is 0 mintAmount == liquidity to deposit - (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity( - sqrtRatioX96, - lowerTick.getSqrtRatioAtTick(), - upperTick.getSqrtRatioAtTick(), - SafeCast.toUint128(mintAmount) - ); - } - - // transfer amounts owed to contract - if (amount0 > 0) { - token0.safeTransferFrom(msg.sender, address(this), amount0); - } - if (amount1 > 0) { - token1.safeTransferFrom(msg.sender, address(this), amount1); - } - - // deposit as much new liquidity as possible - liquidityMinted = LiquidityAmounts.getLiquidityForAmounts( - sqrtRatioX96, - lowerTick.getSqrtRatioAtTick(), - upperTick.getSqrtRatioAtTick(), - amount0, - amount1 - ); - - pool.mint(address(this), lowerTick, upperTick, liquidityMinted, ""); - - _mint(receiver, mintAmount); - emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted); - } - - /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens - /// @param burnAmount The number of G-UNI tokens to burn - /// @param receiver The account to receive the underlying amounts of token0 and token1 - /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount` - /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount` - /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position - // solhint-disable-next-line function-max-lines - function burn(uint256 burnAmount, address receiver) - external - nonReentrant - returns ( - uint256 amount0, - uint256 amount1, - uint128 liquidityBurned - ) - { - require(burnAmount > 0, "burn 0"); - - uint256 totalSupply = totalSupply(); - - (uint128 liquidity, , , , ) = pool.positions(_getPositionID()); - - _burn(msg.sender, burnAmount); - - uint256 liquidityBurned_ = - FullMath.mulDiv(burnAmount, liquidity, totalSupply); - liquidityBurned = SafeCast.toUint128(liquidityBurned_); - (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) = - _withdraw(lowerTick, upperTick, liquidityBurned); - _applyFees(fee0, fee1); - (fee0, fee1) = _subtractAdminFees(fee0, fee1); - emit FeesEarned(fee0, fee1); - - amount0 = - burn0 + - FullMath.mulDiv( - token0.balanceOf(address(this)) - - burn0 - - managerBalance0 - - gelatoBalance0, - burnAmount, - totalSupply - ); - amount1 = - burn1 + - FullMath.mulDiv( - token1.balanceOf(address(this)) - - burn1 - - managerBalance1 - - gelatoBalance1, - burnAmount, - totalSupply - ); - - if (amount0 > 0) { - token0.safeTransfer(receiver, amount0); - } - - if (amount1 > 0) { - token1.safeTransfer(receiver, amount1); - } - - emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned); - } - - // Manager Functions => Called by Pool Manager - - /// @notice Change the range of underlying UniswapV3 position, only manager can call - /// @dev When changing the range the inventory of token0 and token1 may be rebalanced - /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters - /// can be computed by simulating the whole operation: remove all liquidity, deposit as much - /// as possible into new position, then observe how much of token0 or token1 is leftover. - /// Swap a proportion of this leftover to deposit more liquidity into the position, since - /// any leftover will be unused and sit idle until the next rebalance. - /// @param newLowerTick The new lower bound of the position's range - /// @param newUpperTick The new upper bound of the position's range - /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96 - /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap. - /// @param zeroForOne Which token to input into the swap (true = token0, false = token1) - // solhint-disable-next-line function-max-lines - function executiveRebalance( - int24 newLowerTick, - int24 newUpperTick, - uint160 swapThresholdPrice, - uint256 swapAmountBPS, - bool zeroForOne - ) external onlyManager { - uint128 liquidity; - uint128 newLiquidity; - if (totalSupply() > 0) { - (liquidity, , , , ) = pool.positions(_getPositionID()); - if (liquidity > 0) { - (, , uint256 fee0, uint256 fee1) = - _withdraw(lowerTick, upperTick, liquidity); - - _applyFees(fee0, fee1); - (fee0, fee1) = _subtractAdminFees(fee0, fee1); - emit FeesEarned(fee0, fee1); - } - - lowerTick = newLowerTick; - upperTick = newUpperTick; - - uint256 reinvest0 = - token0.balanceOf(address(this)) - - managerBalance0 - - gelatoBalance0; - uint256 reinvest1 = - token1.balanceOf(address(this)) - - managerBalance1 - - gelatoBalance1; - - _deposit( - newLowerTick, - newUpperTick, - reinvest0, - reinvest1, - swapThresholdPrice, - swapAmountBPS, - zeroForOne - ); - - (newLiquidity, , , , ) = pool.positions(_getPositionID()); - require(newLiquidity > 0, "new position 0"); - } else { - lowerTick = newLowerTick; - upperTick = newUpperTick; - } - - emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity); - } - - // Gelatofied functions => Automatically called by Gelato - - /// @notice Reinvest fees earned into underlying position, only gelato executors can call - /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. - /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager. - function rebalance( - uint160 swapThresholdPrice, - uint256 swapAmountBPS, - bool zeroForOne, - uint256 feeAmount, - address paymentToken - ) external gelatofy(feeAmount, paymentToken) { - if (swapAmountBPS > 0) { - _checkSlippage(swapThresholdPrice, zeroForOne); - } - (uint128 liquidity, , , , ) = pool.positions(_getPositionID()); - _rebalance( - liquidity, - swapThresholdPrice, - swapAmountBPS, - zeroForOne, - feeAmount, - paymentToken - ); - - (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID()); - require(newLiquidity > liquidity, "liquidity must increase"); - - emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity); - } - - /// @notice withdraw manager fees accrued, only gelato executors can call. - /// Target account to receive fees is managerTreasury, alterable by manager. - /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager. - function withdrawManagerBalance(uint256 feeAmount, address feeToken) - external - gelatofy(feeAmount, feeToken) - { - (uint256 amount0, uint256 amount1) = - _balancesToWithdraw( - managerBalance0, - managerBalance1, - feeAmount, - feeToken - ); - - managerBalance0 = 0; - managerBalance1 = 0; - - if (amount0 > 0) { - token0.safeTransfer(managerTreasury, amount0); - } - - if (amount1 > 0) { - token1.safeTransfer(managerTreasury, amount1); - } - } - - /// @notice withdraw gelato fees accrued, only gelato executors can call. - /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager. - function withdrawGelatoBalance(uint256 feeAmount, address feeToken) - external - gelatofy(feeAmount, feeToken) - { - (uint256 amount0, uint256 amount1) = - _balancesToWithdraw( - gelatoBalance0, - gelatoBalance1, - feeAmount, - feeToken - ); - - gelatoBalance0 = 0; - gelatoBalance1 = 0; - - if (amount0 > 0) { - token0.safeTransfer(GELATO, amount0); - } - - if (amount1 > 0) { - token1.safeTransfer(GELATO, amount1); - } - } - - function _balancesToWithdraw( - uint256 balance0, - uint256 balance1, - uint256 feeAmount, - address feeToken - ) internal view returns (uint256 amount0, uint256 amount1) { - if (feeToken == address(token0)) { - require( - (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount, - "high fee" - ); - amount0 = balance0 - feeAmount; - amount1 = balance1; - } else if (feeToken == address(token1)) { - require( - (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount, - "high fee" - ); - amount1 = balance1 - feeAmount; - amount0 = balance0; - } else { - revert("wrong token"); - } - } - - // View functions - - /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max` - /// @param amount0Max The maximum amount of token0 to forward on mint - /// @param amount0Max The maximum amount of token1 to forward on mint - /// @return amount0 actual amount of token0 to forward when minting `mintAmount` - /// @return amount1 actual amount of token1 to forward when minting `mintAmount` - /// @return mintAmount maximum number of G-UNI tokens to mint - function getMintAmounts(uint256 amount0Max, uint256 amount1Max) - external - view - returns ( - uint256 amount0, - uint256 amount1, - uint256 mintAmount - ) - { - uint256 totalSupply = totalSupply(); - if (totalSupply > 0) { - (amount0, amount1, mintAmount) = _computeMintAmounts( - totalSupply, - amount0Max, - amount1Max - ); - } else { - (uint160 sqrtRatioX96, , , , , , ) = pool.slot0(); - uint128 newLiquidity = - LiquidityAmounts.getLiquidityForAmounts( - sqrtRatioX96, - lowerTick.getSqrtRatioAtTick(), - upperTick.getSqrtRatioAtTick(), - amount0Max, - amount1Max - ); - mintAmount = uint256(newLiquidity); - (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity( - sqrtRatioX96, - lowerTick.getSqrtRatioAtTick(), - upperTick.getSqrtRatioAtTick(), - newLiquidity - ); - } - } - - /// @notice compute total underlying holdings of the G-UNI token supply - /// includes current liquidity invested in uniswap position, current fees earned - /// and any uninvested leftover (but does not include manager or gelato fees accrued) - /// @return amount0Current current total underlying balance of token0 - /// @return amount1Current current total underlying balance of token1 - function getUnderlyingBalances() - public - view - returns (uint256 amount0Current, uint256 amount1Current) - { - (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0(); - return _getUnderlyingBalances(sqrtRatioX96, tick); - } - - function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96) - external - view - returns (uint256 amount0Current, uint256 amount1Current) - { - (, int24 tick, , , , , ) = pool.slot0(); - return _getUnderlyingBalances(sqrtRatioX96, tick); - } - - // solhint-disable-next-line function-max-lines - function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick) - internal - view - returns (uint256 amount0Current, uint256 amount1Current) - { - ( - uint128 liquidity, - uint256 feeGrowthInside0Last, - uint256 feeGrowthInside1Last, - uint128 tokensOwed0, - uint128 tokensOwed1 - ) = pool.positions(_getPositionID()); - - // compute current holdings from liquidity - (amount0Current, amount1Current) = LiquidityAmounts - .getAmountsForLiquidity( - sqrtRatioX96, - lowerTick.getSqrtRatioAtTick(), - upperTick.getSqrtRatioAtTick(), - liquidity - ); - - // compute current fees earned - uint256 fee0 = - _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) + - uint256(tokensOwed0); - uint256 fee1 = - _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) + - uint256(tokensOwed1); - - (fee0, fee1) = _subtractAdminFees(fee0, fee1); - - // add any leftover in contract to current holdings - amount0Current += - fee0 + - token0.balanceOf(address(this)) - - managerBalance0 - - gelatoBalance0; - amount1Current += - fee1 + - token1.balanceOf(address(this)) - - managerBalance1 - - gelatoBalance1; - } - - // Private functions - - // solhint-disable-next-line function-max-lines - function _rebalance( - uint128 liquidity, - uint160 swapThresholdPrice, - uint256 swapAmountBPS, - bool zeroForOne, - uint256 feeAmount, - address paymentToken - ) private { - uint256 leftover0 = - token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0; - uint256 leftover1 = - token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1; - - (, , uint256 feesEarned0, uint256 feesEarned1) = - _withdraw(lowerTick, upperTick, liquidity); - _applyFees(feesEarned0, feesEarned1); - (feesEarned0, feesEarned1) = _subtractAdminFees( - feesEarned0, - feesEarned1 - ); - emit FeesEarned(feesEarned0, feesEarned1); - feesEarned0 += leftover0; - feesEarned1 += leftover1; - - if (paymentToken == address(token0)) { - require( - (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount, - "high fee" - ); - leftover0 = - token0.balanceOf(address(this)) - - managerBalance0 - - gelatoBalance0 - - feeAmount; - leftover1 = - token1.balanceOf(address(this)) - - managerBalance1 - - gelatoBalance1; - } else if (paymentToken == address(token1)) { - require( - (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount, - "high fee" - ); - leftover0 = - token0.balanceOf(address(this)) - - managerBalance0 - - gelatoBalance0; - leftover1 = - token1.balanceOf(address(this)) - - managerBalance1 - - gelatoBalance1 - - feeAmount; - } else { - revert("wrong token"); - } - - _deposit( - lowerTick, - upperTick, - leftover0, - leftover1, - swapThresholdPrice, - swapAmountBPS, - zeroForOne - ); - } - - // solhint-disable-next-line function-max-lines - function _withdraw( - int24 lowerTick_, - int24 upperTick_, - uint128 liquidity - ) - private - returns ( - uint256 burn0, - uint256 burn1, - uint256 fee0, - uint256 fee1 - ) - { - uint256 preBalance0 = token0.balanceOf(address(this)); - uint256 preBalance1 = token1.balanceOf(address(this)); - - (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity); - - pool.collect( - address(this), - lowerTick_, - upperTick_, - type(uint128).max, - type(uint128).max - ); - - fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0; - fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1; - } - - // solhint-disable-next-line function-max-lines - function _deposit( - int24 lowerTick_, - int24 upperTick_, - uint256 amount0, - uint256 amount1, - uint160 swapThresholdPrice, - uint256 swapAmountBPS, - bool zeroForOne - ) private { - (uint160 sqrtRatioX96, , , , , , ) = pool.slot0(); - // First, deposit as much as we can - uint128 baseLiquidity = - LiquidityAmounts.getLiquidityForAmounts( - sqrtRatioX96, - lowerTick_.getSqrtRatioAtTick(), - upperTick_.getSqrtRatioAtTick(), - amount0, - amount1 - ); - if (baseLiquidity > 0) { - (uint256 amountDeposited0, uint256 amountDeposited1) = - pool.mint( - address(this), - lowerTick_, - upperTick_, - baseLiquidity, - "" - ); - - amount0 -= amountDeposited0; - amount1 -= amountDeposited1; - } - int256 swapAmount = - SafeCast.toInt256( - ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000 - ); - if (swapAmount > 0) { - _swapAndDeposit( - lowerTick_, - upperTick_, - amount0, - amount1, - swapAmount, - swapThresholdPrice, - zeroForOne - ); - } - } - - function _swapAndDeposit( - int24 lowerTick_, - int24 upperTick_, - uint256 amount0, - uint256 amount1, - int256 swapAmount, - uint160 swapThresholdPrice, - bool zeroForOne - ) private returns (uint256 finalAmount0, uint256 finalAmount1) { - (int256 amount0Delta, int256 amount1Delta) = - pool.swap( - address(this), - zeroForOne, - swapAmount, - swapThresholdPrice, - "" - ); - finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta); - finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta); - - // Add liquidity a second time - (uint160 sqrtRatioX96, , , , , , ) = pool.slot0(); - uint128 liquidityAfterSwap = - LiquidityAmounts.getLiquidityForAmounts( - sqrtRatioX96, - lowerTick_.getSqrtRatioAtTick(), - upperTick_.getSqrtRatioAtTick(), - finalAmount0, - finalAmount1 - ); - if (liquidityAfterSwap > 0) { - pool.mint( - address(this), - lowerTick_, - upperTick_, - liquidityAfterSwap, - "" - ); - } - } - - // solhint-disable-next-line function-max-lines, code-complexity - function _computeMintAmounts( - uint256 totalSupply, - uint256 amount0Max, - uint256 amount1Max - ) - private - view - returns ( - uint256 amount0, - uint256 amount1, - uint256 mintAmount - ) - { - (uint256 amount0Current, uint256 amount1Current) = - getUnderlyingBalances(); - - // compute proportional amount of tokens to mint - if (amount0Current == 0 && amount1Current > 0) { - mintAmount = FullMath.mulDiv( - amount1Max, - totalSupply, - amount1Current - ); - } else if (amount1Current == 0 && amount0Current > 0) { - mintAmount = FullMath.mulDiv( - amount0Max, - totalSupply, - amount0Current - ); - } else if (amount0Current == 0 && amount1Current == 0) { - revert(""); - } else { - // only if both are non-zero - uint256 amount0Mint = - FullMath.mulDiv(amount0Max, totalSupply, amount0Current); - uint256 amount1Mint = - FullMath.mulDiv(amount1Max, totalSupply, amount1Current); - require(amount0Mint > 0 && amount1Mint > 0, "mint 0"); - - mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint; - } - - // compute amounts owed to contract - amount0 = FullMath.mulDivRoundingUp( - mintAmount, - amount0Current, - totalSupply - ); - amount1 = FullMath.mulDivRoundingUp( - mintAmount, - amount1Current, - totalSupply - ); - } - - // solhint-disable-next-line function-max-lines - function _computeFeesEarned( - bool isZero, - uint256 feeGrowthInsideLast, - int24 tick, - uint128 liquidity - ) private view returns (uint256 fee) { - uint256 feeGrowthOutsideLower; - uint256 feeGrowthOutsideUpper; - uint256 feeGrowthGlobal; - if (isZero) { - feeGrowthGlobal = pool.feeGrowthGlobal0X128(); - (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick); - (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick); - } else { - feeGrowthGlobal = pool.feeGrowthGlobal1X128(); - (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick); - (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick); - } - - unchecked { - // calculate fee growth below - uint256 feeGrowthBelow; - if (tick >= lowerTick) { - feeGrowthBelow = feeGrowthOutsideLower; - } else { - feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower; - } - - // calculate fee growth above - uint256 feeGrowthAbove; - if (tick < upperTick) { - feeGrowthAbove = feeGrowthOutsideUpper; - } else { - feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper; - } - - uint256 feeGrowthInside = - feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove; - fee = FullMath.mulDiv( - liquidity, - feeGrowthInside - feeGrowthInsideLast, - 0x100000000000000000000000000000000 - ); - } - } - - function _applyFees(uint256 _fee0, uint256 _fee1) private { - gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000; - gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000; - managerBalance0 += (_fee0 * managerFeeBPS) / 10000; - managerBalance1 += (_fee1 * managerFeeBPS) / 10000; - } - - function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1) - private - view - returns (uint256 fee0, uint256 fee1) - { - uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000; - uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000; - fee0 = rawFee0 - deduct0; - fee1 = rawFee1 - deduct1; - } - - function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne) - private - view - { - uint32[] memory secondsAgo = new uint32[](2); - secondsAgo[0] = gelatoSlippageInterval; - secondsAgo[1] = 0; - - (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo); - - require(tickCumulatives.length == 2, "array len"); - uint160 avgSqrtRatioX96; - unchecked { - int24 avgTick = - int24( - (tickCumulatives[1] - tickCumulatives[0]) / - int56(uint56(gelatoSlippageInterval)) - ); - avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick(); - } - - uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000; - if (zeroForOne) { - require( - swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage, - "high slippage" - ); - } else { - require( - swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage, - "high slippage" - ); - } - } -} diff --git a/lib/g-uni-v1-core/contracts/__mocks__/MockERC20.sol b/lib/g-uni-v1-core/contracts/__mocks__/MockERC20.sol deleted file mode 100644 index 0ab02a26e..000000000 --- a/lib/g-uni-v1-core/contracts/__mocks__/MockERC20.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -import { - ERC20Upgradeable -} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; - -contract MockERC20 is ERC20Upgradeable { - constructor() { - __ERC20_init("", "TOKEN"); - _mint(msg.sender, 100000e18); - } -} diff --git a/lib/g-uni-v1-core/contracts/__mocks__/SwapTest.sol b/lib/g-uni-v1-core/contracts/__mocks__/SwapTest.sol deleted file mode 100644 index fe2f6b326..000000000 --- a/lib/g-uni-v1-core/contracts/__mocks__/SwapTest.sol +++ /dev/null @@ -1,92 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import { - IUniswapV3SwapCallback -} from "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol"; -import { - IUniswapV3Pool -} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; - -contract SwapTest is IUniswapV3SwapCallback { - function swap( - address pool, - bool zeroForOne, - int256 amountSpecified - ) external { - (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0(); - IUniswapV3Pool(pool).swap( - address(msg.sender), - zeroForOne, - amountSpecified, - zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000, - abi.encode(msg.sender) - ); - } - - function washTrade( - address pool, - int256 amountSpecified, - uint256 numTrades, - uint256 ratio - ) external { - for (uint256 i = 0; i < numTrades; i++) { - bool zeroForOne = i % ratio > 0; - (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0(); - IUniswapV3Pool(pool).swap( - address(msg.sender), - zeroForOne, - amountSpecified, - zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000, - abi.encode(msg.sender) - ); - } - } - - function getSwapResult( - address pool, - bool zeroForOne, - int256 amountSpecified, - uint160 sqrtPriceLimitX96 - ) - external - returns ( - int256 amount0Delta, - int256 amount1Delta, - uint160 nextSqrtRatio - ) - { - (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap( - address(msg.sender), - zeroForOne, - amountSpecified, - sqrtPriceLimitX96, - abi.encode(msg.sender) - ); - - (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0(); - } - - function uniswapV3SwapCallback( - int256 amount0Delta, - int256 amount1Delta, - bytes calldata data - ) external override { - address sender = abi.decode(data, (address)); - - if (amount0Delta > 0) { - IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom( - sender, - msg.sender, - uint256(amount0Delta) - ); - } else if (amount1Delta > 0) { - IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom( - sender, - msg.sender, - uint256(amount1Delta) - ); - } - } -} diff --git a/lib/g-uni-v1-core/contracts/abstract/GUniFactoryStorage.sol b/lib/g-uni-v1-core/contracts/abstract/GUniFactoryStorage.sol deleted file mode 100644 index f3c9b2650..000000000 --- a/lib/g-uni-v1-core/contracts/abstract/GUniFactoryStorage.sol +++ /dev/null @@ -1,69 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import {OwnableUninitialized} from "./OwnableUninitialized.sol"; -import { - Initializable -} from "contracts/lib/Initializable.sol"; -import { - EnumerableSet -} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; - -// solhint-disable-next-line max-states-count -contract GUniFactoryStorage is - OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */ - Initializable - // APPEND ADDITIONAL BASE WITH STATE VARS BELOW: - // XXXX DONT MODIFY ORDERING XXXX -{ - // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX - // solhint-disable-next-line const-name-snakecase - string public constant version = "1.0.0"; - address public immutable factory; - address public poolImplementation; - address public gelatoDeployer; - EnumerableSet.AddressSet internal _deployers; - mapping(address => EnumerableSet.AddressSet) internal _pools; - // APPPEND ADDITIONAL STATE VARS BELOW: - // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX - - event UpdatePoolImplementation( - address previousImplementation, - address newImplementation - ); - - event UpdateGelatoDeployer( - address previosGelatoDeployer, - address newGelatoDeployer - ); - - constructor(address _uniswapV3Factory) { - factory = _uniswapV3Factory; - } - - function initialize( - address _implementation, - address _gelatoDeployer, - address _manager_ - ) external initializer { - poolImplementation = _implementation; - gelatoDeployer = _gelatoDeployer; - _manager = _manager_; - } - - function setPoolImplementation(address nextImplementation) - external - onlyManager - { - emit UpdatePoolImplementation(poolImplementation, nextImplementation); - poolImplementation = nextImplementation; - } - - function setGelatoDeployer(address nextGelatoDeployer) - external - onlyManager - { - emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer); - gelatoDeployer = nextGelatoDeployer; - } -} diff --git a/lib/g-uni-v1-core/contracts/abstract/GUniPoolStorage.sol b/lib/g-uni-v1-core/contracts/abstract/GUniPoolStorage.sol deleted file mode 100644 index b1f7318ed..000000000 --- a/lib/g-uni-v1-core/contracts/abstract/GUniPoolStorage.sol +++ /dev/null @@ -1,179 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -import {Gelatofied} from "./Gelatofied.sol"; -import {OwnableUninitialized} from "./OwnableUninitialized.sol"; -import { - IUniswapV3Pool -} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import { - ReentrancyGuardUpgradeable -} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; -import { - ERC20Upgradeable -} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; - -/// @dev Single Global upgradeable state var storage base: APPEND ONLY -/// @dev Add all inherited contracts with state vars here: APPEND ONLY -/// @dev ERC20Upgradable Includes Initialize -// solhint-disable-next-line max-states-count -/// @dev Modified to support 0.8.19 -/// @dev Modified to set the gelatoFeeBPS to 0 -abstract contract GUniPoolStorage is - ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */ - ReentrancyGuardUpgradeable, - OwnableUninitialized, - Gelatofied - // APPEND ADDITIONAL BASE WITH STATE VARS BELOW: - // XXXX DONT MODIFY ORDERING XXXX -{ - // solhint-disable-next-line const-name-snakecase - string public constant version = "1.0.0"; - // solhint-disable-next-line const-name-snakecase - uint16 public constant gelatoFeeBPS = 0; - - // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX - int24 public lowerTick; - int24 public upperTick; - - uint16 public gelatoRebalanceBPS; - uint16 public gelatoWithdrawBPS; - uint16 public gelatoSlippageBPS; - uint32 public gelatoSlippageInterval; - - uint16 public managerFeeBPS; - address public managerTreasury; - - uint256 public managerBalance0; - uint256 public managerBalance1; - uint256 public gelatoBalance0; - uint256 public gelatoBalance1; - - IUniswapV3Pool public pool; - IERC20 public token0; - IERC20 public token1; - // APPPEND ADDITIONAL STATE VARS BELOW: - // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX - - event UpdateAdminTreasury( - address oldAdminTreasury, - address newAdminTreasury - ); - - event UpdateGelatoParams( - uint16 gelatoRebalanceBPS, - uint16 gelatoWithdrawBPS, - uint16 gelatoSlippageBPS, - uint32 gelatoSlippageInterval - ); - - event SetManagerFee(uint16 managerFee); - - // solhint-disable-next-line max-line-length - constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks - - /// @notice initialize storage variables on a new G-UNI pool, only called once - /// @param _name name of G-UNI token - /// @param _symbol symbol of G-UNI token - /// @param _pool address of Uniswap V3 pool - /// @param _managerFeeBPS proportion of fees earned that go to manager treasury - /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION - /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance) - /// @param _lowerTick initial upperTick (only changeable with executiveRebalance) - /// @param _manager_ address of manager (ownership can be transferred) - function initialize( - string memory _name, - string memory _symbol, - address _pool, - uint16 _managerFeeBPS, - int24 _lowerTick, - int24 _upperTick, - address _manager_ - ) external initializer { - require(_managerFeeBPS <= 10000 - gelatoFeeBPS, "mBPS"); - - // these variables are immutable after initialization - pool = IUniswapV3Pool(_pool); - token0 = IERC20(pool.token0()); - token1 = IERC20(pool.token1()); - managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later - - // these variables can be udpated by the manager - gelatoSlippageInterval = 5 minutes; // default: last five minutes; - gelatoSlippageBPS = 500; // default: 5% slippage - gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn - gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested - managerTreasury = _manager_; // default: treasury is admin - lowerTick = _lowerTick; - upperTick = _upperTick; - _manager = _manager_; - - // e.g. "Gelato Uniswap V3 USDC/DAI LP" and "G-UNI" - __ERC20_init(_name, _symbol); - __ReentrancyGuard_init(); - } - - /// @notice change configurable parameters, only manager can call - /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute - /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance - /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute - /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw - /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance - /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps - /// @param newTreasury address where managerFee withdrawals are sent - // solhint-disable-next-line code-complexity - function updateGelatoParams( - uint16 newRebalanceBPS, - uint16 newWithdrawBPS, - uint16 newSlippageBPS, - uint32 newSlippageInterval, - address newTreasury - ) external onlyManager { - require(newWithdrawBPS <= 10000, "BPS"); - require(newRebalanceBPS <= 10000, "BPS"); - require(newSlippageBPS <= 10000, "BPS"); - emit UpdateGelatoParams( - newRebalanceBPS, - newWithdrawBPS, - newSlippageBPS, - newSlippageInterval - ); - if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS; - if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS; - if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS; - if (newSlippageInterval != 0) - gelatoSlippageInterval = newSlippageInterval; - if (newTreasury != address(0)) managerTreasury = newTreasury; - } - - /// @notice initializeManagerFee sets a managerFee, only manager can call. - /// If a manager fee was not set in the initialize function it can be set here - /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again. - /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points - function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager { - require(managerFeeBPS == 0, "fee"); - require( - _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS, - "mBPS" - ); - emit SetManagerFee(_managerFeeBPS); - managerFeeBPS = _managerFeeBPS; - } - - function renounceOwnership() public virtual override onlyManager { - managerTreasury = address(0); - managerFeeBPS = 0; - managerBalance0 = 0; - managerBalance1 = 0; - super.renounceOwnership(); - } - - function getPositionID() external view returns (bytes32 positionID) { - return _getPositionID(); - } - - function _getPositionID() internal view returns (bytes32 positionID) { - return keccak256(abi.encodePacked(address(this), lowerTick, upperTick)); - } -} diff --git a/lib/g-uni-v1-core/contracts/abstract/Gelatofied.sol b/lib/g-uni-v1-core/contracts/abstract/Gelatofied.sol deleted file mode 100644 index 067f42461..000000000 --- a/lib/g-uni-v1-core/contracts/abstract/Gelatofied.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -import {Address} from "@openzeppelin/contracts/utils/Address.sol"; -import { - IERC20, - SafeERC20 -} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; - -/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage -/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage -abstract contract Gelatofied { - using Address for address payable; - using SafeERC20 for IERC20; - - // solhint-disable-next-line var-name-mixedcase - address payable public immutable GELATO; - - address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; - - constructor(address payable _gelato) { - GELATO = _gelato; - } - - modifier gelatofy(uint256 _amount, address _paymentToken) { - require(msg.sender == GELATO, "Gelatofied: Only gelato"); - _; - if (_paymentToken == _ETH) GELATO.sendValue(_amount); - else IERC20(_paymentToken).safeTransfer(GELATO, _amount); - } -} diff --git a/lib/g-uni-v1-core/contracts/abstract/OwnableUninitialized.sol b/lib/g-uni-v1-core/contracts/abstract/OwnableUninitialized.sol deleted file mode 100644 index bfdfc48dd..000000000 --- a/lib/g-uni-v1-core/contracts/abstract/OwnableUninitialized.sol +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -/** - * @dev Contract module which provides a basic access control mechanism, where - * there is an account (an manager) that can be granted exclusive access to - * specific functions. - * - * By default, the manager account will be the one that deploys the contract. This - * can later be changed with {transferOwnership}. - * - * This module is used through inheritance. It will make available the modifier - * `onlyManager`, which can be applied to your functions to restrict their use to - * the manager. - */ -/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage -/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage -abstract contract OwnableUninitialized { - address internal _manager; - - event OwnershipTransferred( - address indexed previousManager, - address indexed newManager - ); - - /// @dev Initializes the contract setting the deployer as the initial manager. - /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD - // solhint-disable-next-line no-empty-blocks - constructor() {} - - /** - * @dev Returns the address of the current manager. - */ - function manager() public view virtual returns (address) { - return _manager; - } - - /** - * @dev Throws if called by any account other than the manager. - */ - modifier onlyManager() { - require(manager() == msg.sender, "Ownable: caller is not the manager"); - _; - } - - /** - * @dev Leaves the contract without manager. It will not be possible to call - * `onlyManager` functions anymore. Can only be called by the current manager. - * - * NOTE: Renouncing ownership will leave the contract without an manager, - * thereby removing any functionality that is only available to the manager. - */ - function renounceOwnership() public virtual onlyManager { - emit OwnershipTransferred(_manager, address(0)); - _manager = address(0); - } - - /** - * @dev Transfers ownership of the contract to a new account (`newOwner`). - * Can only be called by the current manager. - */ - function transferOwnership(address newOwner) public virtual onlyManager { - require( - newOwner != address(0), - "Ownable: new manager is the zero address" - ); - emit OwnershipTransferred(_manager, newOwner); - _manager = newOwner; - } -} diff --git a/lib/g-uni-v1-core/contracts/interfaces/IEIP173Proxy.sol b/lib/g-uni-v1-core/contracts/interfaces/IEIP173Proxy.sol deleted file mode 100644 index 94e10a8ed..000000000 --- a/lib/g-uni-v1-core/contracts/interfaces/IEIP173Proxy.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -interface IEIP173Proxy { - function proxyAdmin() external view returns (address); - - function transferProxyAdmin(address newAdmin) external; - - function upgradeTo(address newImplementation) external; - - function upgradeToAndCall(address newImplementation, bytes calldata data) - external - payable; -} diff --git a/lib/g-uni-v1-core/contracts/interfaces/IGUniFactory.sol b/lib/g-uni-v1-core/contracts/interfaces/IGUniFactory.sol deleted file mode 100644 index 16e97d52e..000000000 --- a/lib/g-uni-v1-core/contracts/interfaces/IGUniFactory.sol +++ /dev/null @@ -1,27 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -interface IGUniFactory { - event PoolCreated( - address indexed uniPool, - address indexed manager, - address indexed pool - ); - - function createPool( - address tokenA, - address tokenB, - uint24 uniFee, - int24 lowerTick, - int24 upperTick - ) external returns (address pool); - - function createManagedPool( - address tokenA, - address tokenB, - uint24 uniFee, - uint16 managerFee, - int24 lowerTick, - int24 upperTick - ) external returns (address pool); -} diff --git a/lib/g-uni-v1-core/contracts/interfaces/IGUniPoolStorage.sol b/lib/g-uni-v1-core/contracts/interfaces/IGUniPoolStorage.sol deleted file mode 100644 index bcac30881..000000000 --- a/lib/g-uni-v1-core/contracts/interfaces/IGUniPoolStorage.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -interface IGUniPoolStorage { - function initialize( - string memory _name, - string memory _symbol, - address _pool, - uint16 _managerFeeBPS, - int24 _lowerTick, - int24 _upperTick, - address _manager_ - ) external; -} diff --git a/lib/g-uni-v1-core/contracts/interfaces/IUniswapV3TickSpacing.sol b/lib/g-uni-v1-core/contracts/interfaces/IUniswapV3TickSpacing.sol deleted file mode 100644 index a9d58601a..000000000 --- a/lib/g-uni-v1-core/contracts/interfaces/IUniswapV3TickSpacing.sol +++ /dev/null @@ -1,6 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -interface IUniswapV3TickSpacing { - function tickSpacing() external view returns (int24); -} diff --git a/lib/g-uni-v1-core/contracts/lib/Initializable.sol b/lib/g-uni-v1-core/contracts/lib/Initializable.sol deleted file mode 100644 index a6a57c3c8..000000000 --- a/lib/g-uni-v1-core/contracts/lib/Initializable.sol +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: MIT - -// solhint-disable-next-line compiler-version -pragma solidity ^0.8.0; - -/** - * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed - * behind a proxy. Since a proxied contract can't have 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. - * - * 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. - * - * @dev Copied into repo from OpenZeppelin Contracts v4.1.0 - */ -abstract contract Initializable { - - /** - * @dev Indicates that the contract has been initialized. - */ - bool private _initialized; - - /** - * @dev Indicates that the contract is in the process of being initialized. - */ - bool private _initializing; - - /** - * @dev Modifier to protect an initializer function from being invoked twice. - */ - modifier initializer() { - require(_initializing || !_initialized, "Initializable: contract is already initialized"); - - bool isTopLevelCall = !_initializing; - if (isTopLevelCall) { - _initializing = true; - _initialized = true; - } - - _; - - if (isTopLevelCall) { - _initializing = false; - } - } -} diff --git a/lib/g-uni-v1-core/contracts/vendor/proxy/EIP173Proxy.sol b/lib/g-uni-v1-core/contracts/vendor/proxy/EIP173Proxy.sol deleted file mode 100644 index 3f11f6aec..000000000 --- a/lib/g-uni-v1-core/contracts/vendor/proxy/EIP173Proxy.sol +++ /dev/null @@ -1,107 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -import "./Proxy.sol"; - -interface ERC165 { - function supportsInterface(bytes4 id) external view returns (bool); -} - -///@notice Proxy implementing EIP173 for ownership management -contract EIP173Proxy is Proxy { - // ////////////////////////// EVENTS /////////////////////////////////////////////////////////////////////// - - event ProxyAdminTransferred( - address indexed previousAdmin, - address indexed newAdmin - ); - - // /////////////////////// CONSTRUCTOR ////////////////////////////////////////////////////////////////////// - - constructor( - address implementationAddress, - address adminAddress, - bytes memory data - ) payable { - _setImplementation(implementationAddress, data); - _setProxyAdmin(adminAddress); - } - - // ///////////////////// EXTERNAL /////////////////////////////////////////////////////////////////////////// - - function proxyAdmin() external view returns (address) { - return _proxyAdmin(); - } - - function supportsInterface(bytes4 id) external view returns (bool) { - if (id == 0x01ffc9a7 || id == 0x7f5828d0) { - return true; - } - if (id == 0xFFFFFFFF) { - return false; - } - - ERC165 implementation; - // solhint-disable-next-line security/no-inline-assembly - assembly { - implementation := sload( - 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc - ) - } - - // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure - // because it is itself inside `supportsInterface` that might only get 30,000 gas. - // In practise this is unlikely to be an issue. - try implementation.supportsInterface(id) returns (bool support) { - return support; - } catch { - return false; - } - } - - function transferProxyAdmin(address newAdmin) external onlyProxyAdmin { - _setProxyAdmin(newAdmin); - } - - function upgradeTo(address newImplementation) external onlyProxyAdmin { - _setImplementation(newImplementation, ""); - } - - function upgradeToAndCall(address newImplementation, bytes calldata data) - external - payable - onlyProxyAdmin - { - _setImplementation(newImplementation, data); - } - - // /////////////////////// MODIFIERS //////////////////////////////////////////////////////////////////////// - - modifier onlyProxyAdmin() { - require(msg.sender == _proxyAdmin(), "NOT_AUTHORIZED"); - _; - } - - // ///////////////////////// INTERNAL ////////////////////////////////////////////////////////////////////// - - function _proxyAdmin() internal view returns (address adminAddress) { - // solhint-disable-next-line security/no-inline-assembly - assembly { - adminAddress := sload( - 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103 - ) - } - } - - function _setProxyAdmin(address newAdmin) internal { - address previousAdmin = _proxyAdmin(); - // solhint-disable-next-line security/no-inline-assembly - assembly { - sstore( - 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103, - newAdmin - ) - } - emit ProxyAdminTransferred(previousAdmin, newAdmin); - } -} diff --git a/lib/g-uni-v1-core/contracts/vendor/proxy/EIP173ProxyWithReceive.sol b/lib/g-uni-v1-core/contracts/vendor/proxy/EIP173ProxyWithReceive.sol deleted file mode 100644 index 4aa1a4706..000000000 --- a/lib/g-uni-v1-core/contracts/vendor/proxy/EIP173ProxyWithReceive.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -import "./EIP173Proxy.sol"; - -///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive -contract EIP173ProxyWithReceive is EIP173Proxy { - constructor( - address implementationAddress, - address ownerAddress, - bytes memory data - ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {} - - receive() external payable override {} -} diff --git a/lib/g-uni-v1-core/contracts/vendor/proxy/Proxied.sol b/lib/g-uni-v1-core/contracts/vendor/proxy/Proxied.sol deleted file mode 100644 index 05ed2236c..000000000 --- a/lib/g-uni-v1-core/contracts/vendor/proxy/Proxied.sol +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -abstract contract Proxied { - /// @notice to be used by initialisation / postUpgrade function so that only the proxy's admin can execute them - /// It also allows these functions to be called inside a contructor - /// even if the contract is meant to be used without proxy - modifier proxied() { - address proxyAdminAddress = _proxyAdmin(); - // With hardhat-deploy proxies - // the proxyAdminAddress is zero only for the implementation contract - // if the implementation contract want to be used as a standalone/immutable contract - // it simply has to execute the `proxied` function - // This ensure the proxyAdminAddress is never zero post deployment - // And allow you to keep the same code for both proxied contract and immutable contract - if (proxyAdminAddress == address(0)) { - // ensure can not be called twice when used outside of proxy : no admin - // solhint-disable-next-line security/no-inline-assembly - assembly { - sstore( - 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103, - 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF - ) - } - } else { - require(msg.sender == proxyAdminAddress); - } - _; - } - - modifier onlyProxyAdmin() { - require(msg.sender == _proxyAdmin(), "NOT_AUTHORIZED"); - _; - } - - function _proxyAdmin() internal view returns (address adminAddress) { - // solhint-disable-next-line security/no-inline-assembly - assembly { - adminAddress := sload( - 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103 - ) - } - } -} diff --git a/lib/g-uni-v1-core/contracts/vendor/proxy/Proxy.sol b/lib/g-uni-v1-core/contracts/vendor/proxy/Proxy.sol deleted file mode 100644 index 934b8b79c..000000000 --- a/lib/g-uni-v1-core/contracts/vendor/proxy/Proxy.sol +++ /dev/null @@ -1,89 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -// EIP-1967 -abstract contract Proxy { - // /////////////////////// EVENTS /////////////////////////////////////////////////////////////////////////// - - event ProxyImplementationUpdated( - address indexed previousImplementation, - address indexed newImplementation - ); - - // ///////////////////// EXTERNAL /////////////////////////////////////////////////////////////////////////// - - // prettier-ignore - receive() external payable virtual { - revert("ETHER_REJECTED"); // explicit reject by default - } - - fallback() external payable { - _fallback(); - } - - // ///////////////////////// INTERNAL ////////////////////////////////////////////////////////////////////// - - function _fallback() internal { - // solhint-disable-next-line security/no-inline-assembly - assembly { - let implementationAddress := sload( - 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc - ) - calldatacopy(0x0, 0x0, calldatasize()) - let success := delegatecall( - gas(), - implementationAddress, - 0x0, - calldatasize(), - 0, - 0 - ) - let retSz := returndatasize() - returndatacopy(0, 0, retSz) - switch success - case 0 { - revert(0, retSz) - } - default { - return(0, retSz) - } - } - } - - function _setImplementation(address newImplementation, bytes memory data) - internal - { - address previousImplementation; - // solhint-disable-next-line security/no-inline-assembly - assembly { - previousImplementation := sload( - 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc - ) - } - - // solhint-disable-next-line security/no-inline-assembly - assembly { - sstore( - 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc, - newImplementation - ) - } - - emit ProxyImplementationUpdated( - previousImplementation, - newImplementation - ); - - if (data.length > 0) { - (bool success, ) = newImplementation.delegatecall(data); - if (!success) { - assembly { - // This assembly ensure the revert contains the exact string data - let returnDataSize := returndatasize() - returndatacopy(0, 0, returnDataSize) - revert(0, returnDataSize) - } - } - } - } -} diff --git a/lib/g-uni-v1-core/contracts/vendor/uniswap/FullMath.sol b/lib/g-uni-v1-core/contracts/vendor/uniswap/FullMath.sol deleted file mode 100644 index 35b1fb683..000000000 --- a/lib/g-uni-v1-core/contracts/vendor/uniswap/FullMath.sol +++ /dev/null @@ -1,129 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.4; - -/// @title Contains 512-bit math functions -/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision -/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits -library FullMath { - /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 - /// @param a The multiplicand - /// @param b The multiplier - /// @param denominator The divisor - /// @return result The 256-bit result - /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv - function mulDiv( - uint256 a, - uint256 b, - uint256 denominator - ) internal pure returns (uint256 result) { - unchecked { - // 512-bit multiply [prod1 prod0] = a * b - // Compute the product mod 2**256 and mod 2**256 - 1 - // then use the Chinese Remainder Theorem to reconstruct - // the 512 bit result. The result is stored in two 256 - // variables such that product = prod1 * 2**256 + prod0 - uint256 prod0; // Least significant 256 bits of the product - uint256 prod1; // Most significant 256 bits of the product - assembly { - let mm := mulmod(a, b, not(0)) - prod0 := mul(a, b) - prod1 := sub(sub(mm, prod0), lt(mm, prod0)) - } - - // Handle non-overflow cases, 256 by 256 division - if (prod1 == 0) { - require(denominator > 0); - assembly { - result := div(prod0, denominator) - } - return result; - } - - // Make sure the result is less than 2**256. - // Also prevents denominator == 0 - require(denominator > prod1); - - /////////////////////////////////////////////// - // 512 by 256 division. - /////////////////////////////////////////////// - - // Make division exact by subtracting the remainder from [prod1 prod0] - // Compute remainder using mulmod - uint256 remainder; - assembly { - remainder := mulmod(a, b, denominator) - } - // Subtract 256 bit number from 512 bit number - assembly { - prod1 := sub(prod1, gt(remainder, prod0)) - prod0 := sub(prod0, remainder) - } - - // Factor powers of two out of denominator - // Compute largest power of two divisor of denominator. - // Always >= 1. - // EDIT for 0.8 compatibility: - // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256 - uint256 twos = denominator & (~denominator + 1); - - // Divide denominator by power of two - assembly { - denominator := div(denominator, twos) - } - - // Divide [prod1 prod0] by the factors of two - assembly { - prod0 := div(prod0, twos) - } - // Shift in bits from prod1 into prod0. For this we need - // to flip `twos` such that it is 2**256 / twos. - // If twos is zero, then it becomes one - assembly { - twos := add(div(sub(0, twos), twos), 1) - } - prod0 |= prod1 * twos; - - // Invert denominator mod 2**256 - // Now that denominator is an odd number, it has an inverse - // modulo 2**256 such that denominator * inv = 1 mod 2**256. - // Compute the inverse by starting with a seed that is correct - // correct for four bits. That is, denominator * inv = 1 mod 2**4 - uint256 inv = (3 * denominator) ^ 2; - // Now use Newton-Raphson iteration to improve the precision. - // Thanks to Hensel's lifting lemma, this also works in modular - // arithmetic, doubling the correct bits in each step. - inv *= 2 - denominator * inv; // inverse mod 2**8 - inv *= 2 - denominator * inv; // inverse mod 2**16 - inv *= 2 - denominator * inv; // inverse mod 2**32 - inv *= 2 - denominator * inv; // inverse mod 2**64 - inv *= 2 - denominator * inv; // inverse mod 2**128 - inv *= 2 - denominator * inv; // inverse mod 2**256 - - // Because the division is now exact we can divide by multiplying - // with the modular inverse of denominator. This will give us the - // correct result modulo 2**256. Since the precoditions guarantee - // that the outcome is less than 2**256, this is the final result. - // We don't need to compute the high bits of the result and prod1 - // is no longer required. - result = prod0 * inv; - return result; - } - } - - /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 - /// @param a The multiplicand - /// @param b The multiplier - /// @param denominator The divisor - /// @return result The 256-bit result - function mulDivRoundingUp( - uint256 a, - uint256 b, - uint256 denominator - ) internal pure returns (uint256 result) { - result = mulDiv(a, b, denominator); - if (mulmod(a, b, denominator) > 0) { - require(result < type(uint256).max); - result++; - } - } -} diff --git a/lib/g-uni-v1-core/contracts/vendor/uniswap/LiquidityAmounts.sol b/lib/g-uni-v1-core/contracts/vendor/uniswap/LiquidityAmounts.sol deleted file mode 100644 index 56cf3bc70..000000000 --- a/lib/g-uni-v1-core/contracts/vendor/uniswap/LiquidityAmounts.sol +++ /dev/null @@ -1,174 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity >=0.5.0; - -import {FullMath} from "./FullMath.sol"; -import "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol"; - -/// @title Liquidity amount functions -/// @notice Provides functions for computing liquidity amounts from token amounts and prices -library LiquidityAmounts { - function toUint128(uint256 x) private pure returns (uint128 y) { - require((y = uint128(x)) == x); - } - - /// @notice Computes the amount of liquidity received for a given amount of token0 and price range - /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)). - /// @param sqrtRatioAX96 A sqrt price - /// @param sqrtRatioBX96 Another sqrt price - /// @param amount0 The amount0 being sent in - /// @return liquidity The amount of returned liquidity - function getLiquidityForAmount0( - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - uint256 amount0 - ) internal pure returns (uint128 liquidity) { - if (sqrtRatioAX96 > sqrtRatioBX96) - (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); - uint256 intermediate = - FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96); - return - toUint128( - FullMath.mulDiv( - amount0, - intermediate, - sqrtRatioBX96 - sqrtRatioAX96 - ) - ); - } - - /// @notice Computes the amount of liquidity received for a given amount of token1 and price range - /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)). - /// @param sqrtRatioAX96 A sqrt price - /// @param sqrtRatioBX96 Another sqrt price - /// @param amount1 The amount1 being sent in - /// @return liquidity The amount of returned liquidity - function getLiquidityForAmount1( - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - uint256 amount1 - ) internal pure returns (uint128 liquidity) { - if (sqrtRatioAX96 > sqrtRatioBX96) - (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); - return - toUint128( - FullMath.mulDiv( - amount1, - FixedPoint96.Q96, - sqrtRatioBX96 - sqrtRatioAX96 - ) - ); - } - - /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current - /// pool prices and the prices at the tick boundaries - function getLiquidityForAmounts( - uint160 sqrtRatioX96, - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - uint256 amount0, - uint256 amount1 - ) internal pure returns (uint128 liquidity) { - if (sqrtRatioAX96 > sqrtRatioBX96) - (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); - - if (sqrtRatioX96 <= sqrtRatioAX96) { - liquidity = getLiquidityForAmount0( - sqrtRatioAX96, - sqrtRatioBX96, - amount0 - ); - } else if (sqrtRatioX96 < sqrtRatioBX96) { - uint128 liquidity0 = - getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0); - uint128 liquidity1 = - getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1); - - liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1; - } else { - liquidity = getLiquidityForAmount1( - sqrtRatioAX96, - sqrtRatioBX96, - amount1 - ); - } - } - - /// @notice Computes the amount of token0 for a given amount of liquidity and a price range - /// @param sqrtRatioAX96 A sqrt price - /// @param sqrtRatioBX96 Another sqrt price - /// @param liquidity The liquidity being valued - /// @return amount0 The amount0 - function getAmount0ForLiquidity( - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - uint128 liquidity - ) internal pure returns (uint256 amount0) { - if (sqrtRatioAX96 > sqrtRatioBX96) - (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); - - return - FullMath.mulDiv( - uint256(liquidity) << FixedPoint96.RESOLUTION, - sqrtRatioBX96 - sqrtRatioAX96, - sqrtRatioBX96 - ) / sqrtRatioAX96; - } - - /// @notice Computes the amount of token1 for a given amount of liquidity and a price range - /// @param sqrtRatioAX96 A sqrt price - /// @param sqrtRatioBX96 Another sqrt price - /// @param liquidity The liquidity being valued - /// @return amount1 The amount1 - function getAmount1ForLiquidity( - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - uint128 liquidity - ) internal pure returns (uint256 amount1) { - if (sqrtRatioAX96 > sqrtRatioBX96) - (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); - - return - FullMath.mulDiv( - liquidity, - sqrtRatioBX96 - sqrtRatioAX96, - FixedPoint96.Q96 - ); - } - - /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current - /// pool prices and the prices at the tick boundaries - function getAmountsForLiquidity( - uint160 sqrtRatioX96, - uint160 sqrtRatioAX96, - uint160 sqrtRatioBX96, - uint128 liquidity - ) internal pure returns (uint256 amount0, uint256 amount1) { - if (sqrtRatioAX96 > sqrtRatioBX96) - (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); - - if (sqrtRatioX96 <= sqrtRatioAX96) { - amount0 = getAmount0ForLiquidity( - sqrtRatioAX96, - sqrtRatioBX96, - liquidity - ); - } else if (sqrtRatioX96 < sqrtRatioBX96) { - amount0 = getAmount0ForLiquidity( - sqrtRatioX96, - sqrtRatioBX96, - liquidity - ); - amount1 = getAmount1ForLiquidity( - sqrtRatioAX96, - sqrtRatioX96, - liquidity - ); - } else { - amount1 = getAmount1ForLiquidity( - sqrtRatioAX96, - sqrtRatioBX96, - liquidity - ); - } - } -} diff --git a/lib/g-uni-v1-core/contracts/vendor/uniswap/TickMath.sol b/lib/g-uni-v1-core/contracts/vendor/uniswap/TickMath.sol deleted file mode 100644 index cbd87c364..000000000 --- a/lib/g-uni-v1-core/contracts/vendor/uniswap/TickMath.sol +++ /dev/null @@ -1,254 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.19; - -/// @title Math library for computing sqrt prices from ticks and vice versa -/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports -/// prices between 2**-128 and 2**128 -library TickMath { - /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128 - int24 internal constant MIN_TICK = -887272; - /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128 - int24 internal constant MAX_TICK = -MIN_TICK; - - /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) - uint160 internal constant MIN_SQRT_RATIO = 4295128739; - /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) - uint160 internal constant MAX_SQRT_RATIO = - 1461446703485210103287273052203988822378723970342; - - /// @notice Calculates sqrt(1.0001^tick) * 2^96 - /// @dev Throws if |tick| > max tick - /// @param tick The input tick for the above formula - /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0) - /// at the given tick - function getSqrtRatioAtTick(int24 tick) - internal - pure - returns (uint160 sqrtPriceX96) - { - uint256 absTick = - tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick)); - - // EDIT: 0.8 compatibility - require(absTick <= uint256(int256(MAX_TICK)), "T"); - - uint256 ratio = - absTick & 0x1 != 0 - ? 0xfffcb933bd6fad37aa2d162d1a594001 - : 0x100000000000000000000000000000000; - if (absTick & 0x2 != 0) - ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128; - if (absTick & 0x4 != 0) - ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128; - if (absTick & 0x8 != 0) - ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128; - if (absTick & 0x10 != 0) - ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128; - if (absTick & 0x20 != 0) - ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128; - if (absTick & 0x40 != 0) - ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128; - if (absTick & 0x80 != 0) - ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128; - if (absTick & 0x100 != 0) - ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128; - if (absTick & 0x200 != 0) - ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128; - if (absTick & 0x400 != 0) - ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128; - if (absTick & 0x800 != 0) - ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128; - if (absTick & 0x1000 != 0) - ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128; - if (absTick & 0x2000 != 0) - ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128; - if (absTick & 0x4000 != 0) - ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128; - if (absTick & 0x8000 != 0) - ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128; - if (absTick & 0x10000 != 0) - ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128; - if (absTick & 0x20000 != 0) - ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128; - if (absTick & 0x40000 != 0) - ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128; - if (absTick & 0x80000 != 0) - ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128; - - if (tick > 0) ratio = type(uint256).max / ratio; - - // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96. - // we then downcast because we know the result always fits within 160 bits due to our tick input constraint - // we round up in the division so getTickAtSqrtRatio of the output price is always consistent - sqrtPriceX96 = uint160( - (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1) - ); - } - - /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio - /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may - /// ever return. - /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96 - /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio - function getTickAtSqrtRatio(uint160 sqrtPriceX96) - internal - pure - returns (int24 tick) - { - // second inequality must be < because the price can never reach the price at the max tick - require( - sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, - "R" - ); - uint256 ratio = uint256(sqrtPriceX96) << 32; - - uint256 r = ratio; - uint256 msb = 0; - - assembly { - let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := shl(5, gt(r, 0xFFFFFFFF)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := shl(4, gt(r, 0xFFFF)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := shl(3, gt(r, 0xFF)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := shl(2, gt(r, 0xF)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := shl(1, gt(r, 0x3)) - msb := or(msb, f) - r := shr(f, r) - } - assembly { - let f := gt(r, 0x1) - msb := or(msb, f) - } - - if (msb >= 128) r = ratio >> (msb - 127); - else r = ratio << (127 - msb); - - int256 log_2 = (int256(msb) - 128) << 64; - - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(63, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(62, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(61, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(60, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(59, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(58, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(57, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(56, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(55, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(54, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(53, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(52, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(51, f)) - r := shr(f, r) - } - assembly { - r := shr(127, mul(r, r)) - let f := shr(128, r) - log_2 := or(log_2, shl(50, f)) - } - - int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number - - int24 tickLow = - int24( - (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128 - ); - int24 tickHi = - int24( - (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128 - ); - - tick = tickLow == tickHi - ? tickLow - : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 - ? tickHi - : tickLow; - } -} diff --git a/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts b/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts deleted file mode 100644 index 127be8711..000000000 --- a/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { deployments, getNamedAccounts } from "hardhat"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { DeployFunction } from "hardhat-deploy/types"; -import { getAddresses } from "../src/addresses"; -import { isZeroAddress } from "./address"; - -const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { - if ( - hre.network.name === "mainnet" || - hre.network.name === "optimism" || - hre.network.name === "polygon" - ) { - console.log( - `!! Deploying GUniFactory to ${hre.network.name}. Hit ctrl + c to abort` - ); - await new Promise((r) => setTimeout(r, 20000)); - } - - const { deploy } = deployments; - const { deployer } = await getNamedAccounts(); - const addresses = getAddresses(hre.network.name); - - // Validate input addresses - if (isZeroAddress(addresses.UniswapV3Factory)) { - throw new Error("UniswapV3Factory address not set"); - } - if (isZeroAddress(addresses.GelatoDevMultiSig)) { - throw new Error("GelatoDevMultiSig address not set"); - } - if (isZeroAddress(addresses.GUniImplementation)) { - throw new Error("GUniImplementation (pool implementation) address not set"); - } - - const result = await deploy("GUniFactory", { - from: deployer, - proxy: { - proxyContract: "EIP173Proxy", - owner: addresses.GelatoDevMultiSig, - execute: { - init: { - methodName: "initialize", - args: [ - addresses.GUniImplementation, - addresses.GelatoDevMultiSig, - addresses.GelatoDevMultiSig, - ], - }, - }, - }, - args: [addresses.UniswapV3Factory], - }); - - console.log("GUniFactory deployed to:", result.address); -}; - -func.skip = async (hre: HardhatRuntimeEnvironment) => { - const shouldSkip = - hre.network.name === "mainnet" || - hre.network.name === "polygon" || - hre.network.name === "optimism" || - hre.network.name === "goerli"; - return shouldSkip ? true : false; -}; - -func.tags = ["GUniFactory"]; - -export default func; diff --git a/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts b/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts deleted file mode 100644 index 8026aee52..000000000 --- a/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { deployments, getNamedAccounts } from "hardhat"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { DeployFunction } from "hardhat-deploy/types"; -import { getAddresses } from "../src/addresses"; -import { isZeroAddress } from "./address"; - -const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { - if ( - hre.network.name === "mainnet" || - hre.network.name === "optimism" || - hre.network.name === "polygon" - ) { - console.log( - `!! Deploying GUniPool to ${hre.network.name}. Hit ctrl + c to abort` - ); - await new Promise((r) => setTimeout(r, 20000)); - } - - const { deploy } = deployments; - const { deployer } = await getNamedAccounts(); - const addresses = getAddresses(hre.network.name); - - // Validate input addresses - if (isZeroAddress(addresses.Gelato)) { - throw new Error("Gelato address not set"); - } - if (isZeroAddress(deployer)) { - throw new Error("Deployer address not set"); - } - - const result = await deploy("GUniPool", { - from: deployer, - args: [addresses.Gelato], - }); - - console.log("GUniPool deployed to:", result.address); -}; - -func.skip = async (hre: HardhatRuntimeEnvironment) => { - const shouldSkip = - hre.network.name === "mainnet" || - hre.network.name === "polygon" || - hre.network.name === "optimism" || - hre.network.name === "goerli"; - return shouldSkip ? true : false; -}; - -func.tags = ["GUniPool"]; - -export default func; \ No newline at end of file diff --git a/lib/g-uni-v1-core/deploy/address.ts b/lib/g-uni-v1-core/deploy/address.ts deleted file mode 100644 index a9020e5e3..000000000 --- a/lib/g-uni-v1-core/deploy/address.ts +++ /dev/null @@ -1,2 +0,0 @@ - -export const isZeroAddress = (address: string): boolean => !address || address === "" || address === "0x0000000000000000000000000000000000000000"; diff --git a/lib/g-uni-v1-core/deployments/arbitrumSepolia/.chainId b/lib/g-uni-v1-core/deployments/arbitrumSepolia/.chainId deleted file mode 100644 index 71ba4d632..000000000 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/.chainId +++ /dev/null @@ -1 +0,0 @@ -421614 \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory.json b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory.json deleted file mode 100644 index 3602a4afe..000000000 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory.json +++ /dev/null @@ -1,721 +0,0 @@ -{ - "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - } - ], - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x39AC4439e6CB9427C073259e5742529cE46DD663", - "transactionIndex": 4, - "gasUsed": "1375415", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000020000000400000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000400000200000000000000020010000000000000000800000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000200000000000000080000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000080400000000000000000000000000000000000000000000", - "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b", - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", - "logs": [ - { - "transactionIndex": 4, - "blockNumber": 53304410, - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", - "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000090608f57161ac771b28fb0adcd2434cfa1463201" - ], - "data": "0x", - "logIndex": 4, - "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b" - }, - { - "transactionIndex": 4, - "blockNumber": 53304410, - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", - "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "data": "0x", - "logIndex": 5, - "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b" - } - ], - "blockNumber": 53304410, - "cumulativeGasUsed": "2551868", - "status": 1, - "byzantium": true - }, - "args": [ - "0x90608F57161aC771b28fb0adCd2434cfa1463201", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b00000000000000000000000090608f57161ac771b28fb0adcd2434cfa1463201000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033", - "execute": { - "methodName": "initialize", - "args": [ - "0x90608F57161aC771b28fb0adCd2434cfa1463201", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - ] - }, - "implementation": "0x90608F57161aC771b28fb0adCd2434cfa1463201", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Implementation.json b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Implementation.json deleted file mode 100644 index f6e4f9aef..000000000 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Implementation.json +++ /dev/null @@ -1,802 +0,0 @@ -{ - "address": "0x90608F57161aC771b28fb0adCd2434cfa1463201", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_uniswapV3Factory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x0ddae94495bea4ad45f3cf0bd0c7f3df1517ed5e13c1ed7135738305f91e92dc", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x90608F57161aC771b28fb0adCd2434cfa1463201", - "transactionIndex": 3, - "gasUsed": "4839221", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8bf57b4c77eff10abe629c05e512a69be9f81ce267bdda90c3cd31220ea59624", - "transactionHash": "0x0ddae94495bea4ad45f3cf0bd0c7f3df1517ed5e13c1ed7135738305f91e92dc", - "logs": [], - "blockNumber": 53304307, - "cumulativeGasUsed": "5320219", - "status": 1, - "byzantium": true - }, - "args": [ - "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_uniswapV3Factory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"uniPool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previosGelatoDeployer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newGelatoDeployer\",\"type\":\"address\"}],\"name\":\"UpdateGelatoDeployer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"UpdatePoolImplementation\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createManagedPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDeployers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGelatoPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"getTokenName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gelatoDeployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isPoolImmutable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"makePoolsImmutable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numDeployers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextGelatoDeployer\",\"type\":\"address\"}],\"name\":\"setGelatoDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextImplementation\",\"type\":\"address\"}],\"name\":\"setPoolImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"upgradePools\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"bytes[]\",\"name\":\"datas\",\"type\":\"bytes[]\"}],\"name\":\"upgradePoolsAndCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"managerFee\":\"proportion of earned fees that go to pool manager in Basis Points\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"createPool(address,address,uint24,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"getDeployers()\":{\"returns\":{\"_0\":\"deployers the list of deployer addresses\"}},\"getGelatoPools()\":{\"returns\":{\"_0\":\"list of Gelato managed G-UNI pool addresses\"}},\"getPools(address)\":{\"params\":{\"deployer\":\"address that has potentially deployed G-UNI pools (can return empty array)\"},\"returns\":{\"_0\":\"pools the list of G-UNI pool addresses deployed by `deployer`\"}},\"getProxyAdmin(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"address that controls the G-UNI implementation (has power to upgrade it)\"}},\"isPoolImmutable(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"bool signaling if pool is immutable (true) or not (false)\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"numDeployers()\":{\"returns\":{\"_0\":\"total number of G-UNI pool deployer addresses\"}},\"numPools()\":{\"returns\":{\"result\":\"total number of G-UNI pools deployed\"}},\"numPools(address)\":{\"params\":{\"deployer\":\"deployer address\"},\"returns\":{\"_0\":\"total number of G-UNI pools deployed by `deployer`\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"notice\":\"createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`\"},\"createPool(address,address,uint24,int24,int24)\":{\"notice\":\"createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`\"},\"getDeployers()\":{\"notice\":\"getDeployers fetches all addresses that have deployed a G-UNI pool\"},\"getGelatoPools()\":{\"notice\":\"getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)\"},\"getPools(address)\":{\"notice\":\"getPools fetches all the G-UNI pool addresses deployed by `deployer`\"},\"getProxyAdmin(address)\":{\"notice\":\"getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address).\"},\"isPoolImmutable(address)\":{\"notice\":\"isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\"},\"numDeployers()\":{\"notice\":\"numDeployers counts the total number of G-UNI pool deployer addresses\"},\"numPools()\":{\"notice\":\"numPools counts the total number of G-UNI pools in existence\"},\"numPools(address)\":{\"notice\":\"numPools counts the total number of G-UNI pools deployed by `deployer`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniFactory.sol\":\"GUniFactory\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\\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\":\"0x4878ef6c288f4cef3c2a288d32cc548c648831cc55503ad3d9a581ed3b93aad9\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title The interface for the Uniswap V3 Factory\\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\\ninterface IUniswapV3Factory {\\n /// @notice Emitted when the owner of the factory is changed\\n /// @param oldOwner The owner before the owner was changed\\n /// @param newOwner The owner after the owner was changed\\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\\n\\n /// @notice Emitted when a pool is created\\n /// @param token0 The first token of the pool by address sort order\\n /// @param token1 The second token of the pool by address sort order\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks\\n /// @param pool The address of the created pool\\n event PoolCreated(\\n address indexed token0,\\n address indexed token1,\\n uint24 indexed fee,\\n int24 tickSpacing,\\n address pool\\n );\\n\\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\\n /// @param fee The enabled fee, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\\n\\n /// @notice Returns the current owner of the factory\\n /// @dev Can be changed by the current owner via setOwner\\n /// @return The address of the factory owner\\n function owner() external view returns (address);\\n\\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\\n /// @return The tick spacing\\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\\n\\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\\n /// @param tokenA The contract address of either token0 or token1\\n /// @param tokenB The contract address of the other token\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @return pool The pool address\\n function getPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external view returns (address pool);\\n\\n /// @notice Creates a pool for the given two tokens and fee\\n /// @param tokenA One of the two tokens in the desired pool\\n /// @param tokenB The other of the two tokens in the desired pool\\n /// @param fee The desired fee for the pool\\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\\n /// are invalid.\\n /// @return pool The address of the newly created pool\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external returns (address pool);\\n\\n /// @notice Updates the owner of the factory\\n /// @dev Must be called by the current owner\\n /// @param _owner The new owner of the factory\\n function setOwner(address _owner) external;\\n\\n /// @notice Enables a fee amount with the given tickSpacing\\n /// @dev Fee amounts may never be removed once enabled\\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\\n}\\n\",\"keccak256\":\"0xcc3d0c93fc9ac0febbe09f941b465b57f750bcf3b48432da0b97dc289cfdc489\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {\\n IUniswapV3Factory\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\\\";\\nimport {IUniswapV3TickSpacing} from \\\"./interfaces/IUniswapV3TickSpacing.sol\\\";\\nimport {IGUniFactory} from \\\"./interfaces/IGUniFactory.sol\\\";\\nimport {IGUniPoolStorage} from \\\"./interfaces/IGUniPoolStorage.sol\\\";\\nimport {GUniFactoryStorage} from \\\"./abstract/GUniFactoryStorage.sol\\\";\\nimport {EIP173Proxy} from \\\"./vendor/proxy/EIP173Proxy.sol\\\";\\nimport {IEIP173Proxy} from \\\"./interfaces/IEIP173Proxy.sol\\\";\\nimport {\\n IERC20Metadata\\n} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n constructor(address _uniswapV3Factory)\\n GUniFactoryStorage(_uniswapV3Factory)\\n {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n managerFee,\\n lowerTick,\\n upperTick,\\n msg.sender\\n );\\n }\\n\\n /// @notice createPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n 0,\\n lowerTick,\\n upperTick,\\n address(0)\\n );\\n }\\n\\n function _createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick,\\n address manager\\n ) internal returns (address pool) {\\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\\n\\n pool = address(new EIP173Proxy(poolImplementation, address(this), \\\"\\\"));\\n\\n string memory name = \\\"Gelato Uniswap LP\\\";\\n try this.getTokenName(token0, token1) returns (string memory result) {\\n name = result;\\n } catch {} // solhint-disable-line no-empty-blocks\\n\\n address uniPool =\\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\\n require(uniPool != address(0), \\\"uniswap pool does not exist\\\");\\n require(\\n _validateTickSpacing(uniPool, lowerTick, upperTick),\\n \\\"tickSpacing mismatch\\\"\\n );\\n\\n IGUniPoolStorage(pool).initialize(\\n name,\\n \\\"G-UNI\\\",\\n uniPool,\\n managerFee,\\n lowerTick,\\n upperTick,\\n manager\\n );\\n _deployers.add(msg.sender);\\n _pools[msg.sender].add(pool);\\n emit PoolCreated(uniPool, manager, pool);\\n }\\n\\n function _validateTickSpacing(\\n address uniPool,\\n int24 lowerTick,\\n int24 upperTick\\n ) internal view returns (bool) {\\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\\n return\\n lowerTick < upperTick &&\\n lowerTick % spacing == 0 &&\\n upperTick % spacing == 0;\\n }\\n\\n function getTokenName(address token0, address token1)\\n external\\n view\\n returns (string memory)\\n {\\n string memory symbol0 = IERC20Metadata(token0).symbol();\\n string memory symbol1 = IERC20Metadata(token1).symbol();\\n\\n return _append(\\\"Gelato Uniswap \\\", symbol0, \\\"/\\\", symbol1, \\\" LP\\\");\\n }\\n\\n function upgradePools(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\\n }\\n }\\n\\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\\n external\\n onlyManager\\n {\\n require(pools.length == datas.length, \\\"mismatching array length\\\");\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeToAndCall(\\n poolImplementation,\\n datas[i]\\n );\\n }\\n }\\n\\n function makePoolsImmutable(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\\n }\\n }\\n\\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the\\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\\n /// @param pool address of the G-UNI pool\\n /// @return bool signaling if pool is immutable (true) or not (false)\\n function isPoolImmutable(address pool) external view returns (bool) {\\n return address(0) == getProxyAdmin(pool);\\n }\\n\\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\\n /// @return list of Gelato managed G-UNI pool addresses\\n function getGelatoPools() external view returns (address[] memory) {\\n return getPools(gelatoDeployer);\\n }\\n\\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\\n /// @return deployers the list of deployer addresses\\n function getDeployers() public view returns (address[] memory) {\\n uint256 length = numDeployers();\\n address[] memory deployers = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n deployers[i] = _getDeployer(i);\\n }\\n\\n return deployers;\\n }\\n\\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\\n function getPools(address deployer) public view returns (address[] memory) {\\n uint256 length = numPools(deployer);\\n address[] memory pools = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n pools[i] = _getPool(deployer, i);\\n }\\n\\n return pools;\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools in existence\\n /// @return result total number of G-UNI pools deployed\\n function numPools() public view returns (uint256 result) {\\n address[] memory deployers = getDeployers();\\n for (uint256 i = 0; i < deployers.length; i++) {\\n result += numPools(deployers[i]);\\n }\\n }\\n\\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\\n /// @return total number of G-UNI pool deployer addresses\\n function numDeployers() public view returns (uint256) {\\n return _deployers.length();\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\\n /// @param deployer deployer address\\n /// @return total number of G-UNI pools deployed by `deployer`\\n function numPools(address deployer) public view returns (uint256) {\\n return _pools[deployer].length();\\n }\\n\\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\\n /// no longer upgradable (no one owns the zero address).\\n /// @param pool address of the G-UNI pool\\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\\n function getProxyAdmin(address pool) public view returns (address) {\\n return IEIP173Proxy(pool).proxyAdmin();\\n }\\n\\n function _getDeployer(uint256 index) internal view returns (address) {\\n return _deployers.at(index);\\n }\\n\\n function _getPool(address deployer, uint256 index)\\n internal\\n view\\n returns (address)\\n {\\n return _pools[deployer].at(index);\\n }\\n\\n function _getTokenOrder(address tokenA, address tokenB)\\n internal\\n pure\\n returns (address token0, address token1)\\n {\\n require(tokenA != tokenB, \\\"same token\\\");\\n (token0, token1) = tokenA < tokenB\\n ? (tokenA, tokenB)\\n : (tokenB, tokenA);\\n require(token0 != address(0), \\\"no address zero\\\");\\n }\\n\\n function _append(\\n string memory a,\\n string memory b,\\n string memory c,\\n string memory d,\\n string memory e\\n ) internal pure returns (string memory) {\\n return string(abi.encodePacked(a, b, c, d, e));\\n }\\n}\\n\",\"keccak256\":\"0x41d2d6a42321eed641468824c4d0ba4fbe40040895304388315ece96132011d6\",\"license\":\"MIT\"},\"contracts/abstract/GUniFactoryStorage.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n Initializable\\n} from \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\n// solhint-disable-next-line max-states-count\\ncontract GUniFactoryStorage is\\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\\n Initializable\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n address public immutable factory;\\n address public poolImplementation;\\n address public gelatoDeployer;\\n EnumerableSet.AddressSet internal _deployers;\\n mapping(address => EnumerableSet.AddressSet) internal _pools;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdatePoolImplementation(\\n address previousImplementation,\\n address newImplementation\\n );\\n\\n event UpdateGelatoDeployer(\\n address previosGelatoDeployer,\\n address newGelatoDeployer\\n );\\n\\n constructor(address _uniswapV3Factory) {\\n factory = _uniswapV3Factory;\\n }\\n\\n function initialize(\\n address _implementation,\\n address _gelatoDeployer,\\n address _manager_\\n ) external initializer {\\n poolImplementation = _implementation;\\n gelatoDeployer = _gelatoDeployer;\\n _manager = _manager_;\\n }\\n\\n function setPoolImplementation(address nextImplementation)\\n external\\n onlyManager\\n {\\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\\n poolImplementation = nextImplementation;\\n }\\n\\n function setGelatoDeployer(address nextGelatoDeployer)\\n external\\n onlyManager\\n {\\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\\n gelatoDeployer = nextGelatoDeployer;\\n }\\n}\\n\",\"keccak256\":\"0xb0e3a7e77ab8aecf8997593526451e64dd8e8aa07882c210c9aa38d4f7168755\",\"license\":\"MIT\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xb6016d5611f38fbd516a84ea2e56794cb76a8d61c40f6716d5f0133f195759bd\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IEIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IEIP173Proxy {\\n function proxyAdmin() external view returns (address);\\n\\n function transferProxyAdmin(address newAdmin) external;\\n\\n function upgradeTo(address newImplementation) external;\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable;\\n}\\n\",\"keccak256\":\"0xae9996ea370d97cb5fd1934394aca615bee0e46c9a0c161d728490264e83eda5\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IGUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\ninterface IGUniFactory {\\n event PoolCreated(\\n address indexed uniPool,\\n address indexed manager,\\n address indexed pool\\n );\\n\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n}\\n\",\"keccak256\":\"0xe06f79e9b1e6351fc4f40c9f25630f0fbfabae9d2ae2bb642ef1f03d4c2195c1\",\"license\":\"MIT\"},\"contracts/interfaces/IGUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IGUniPoolStorage {\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external;\\n}\\n\",\"keccak256\":\"0x52a3f83a23917772f1eb242cecdfa8b45d7b357a615383628c1ac1f26259dd3f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IUniswapV3TickSpacing.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IUniswapV3TickSpacing {\\n function tickSpacing() external view returns (int24);\\n}\\n\",\"keccak256\":\"0xa6f22651f7e49c6eecf584d8e829d31336de7c43eec3c4c4df3b309db27bd355\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b5060405161273838038061273883398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516126a661009260003960008181610312015261103101526126a66000f3fe60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e620001583660046200151e565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e3660046200160f565b62000448565b6200015e620001a5366004620016b0565b620005b0565b6200016a6200068a565b6200015e620001c6366004620016b0565b620006f5565b6200016a620001dd3660046200151e565b620007d3565b620001ed620007fc565b604051620001749190620016f0565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001758565b6200023a6200080b565b6040516200017491906200176d565b6200023a6200025a3660046200151e565b62000820565b6200023a620008dd565b6200015e62000997565b620001ed62000285366004620017e5565b62000a04565b600254620001ed906001600160a01b031681565b620002b6620002b03660046200151e565b62000a22565b604051901515815260200162000174565b620001ed620002d836600462001878565b62000a3f565b62000221620002ef366004620018f2565b62000a5e565b6200015e6200030636600462001930565b62000bad565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e620003593660046200151e565b62000cb7565b6200015e620003703660046200151e565b62000d56565b620001ed620003873660046200151e565b62000e3d565b3362000398620007fc565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001982565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b03909116908490620019c4565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000ea4565b905090565b3362000453620007fc565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001982565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005aa57838181518110620004eb57620004eb620019de565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052c576200052c620019de565b9050602002810190620005409190620019f4565b6040518463ffffffff1660e01b8152600401620005609392919062001a3d565b600060405180830381600087803b1580156200057b57600080fd5b505af115801562000590573d6000803e3d6000fd5b505050508080620005a19062001a93565b915050620004cc565b50505050565b33620005bb620007fc565b6001600160a01b031614620005e45760405162461bcd60e51b8152600401620003c19062001982565b60005b81518110156200068657818181518110620006065762000606620019de565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063c9190620016f0565b600060405180830381600087803b1580156200065757600080fd5b505af11580156200066c573d6000803e3d6000fd5b5050505080806200067d9062001a93565b915050620005e7565b5050565b60008062000697620008dd565b905060005b8151811015620006f057620006cd828281518110620006bf57620006bf620019de565b6020026020010151620007d3565b620006d9908462001aaf565b925080620006e78162001a93565b9150506200069c565b505090565b3362000700620007fc565b6001600160a01b031614620007295760405162461bcd60e51b8152600401620003c19062001982565b60005b815181101562000686578181815181106200074b576200074b620019de565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200078992911690600401620016f0565b600060405180830381600087803b158015620007a457600080fd5b505af1158015620007b9573d6000803e3d6000fd5b505050508080620007ca9062001a93565b9150506200072c565b6001600160a01b0381166000908152600560205260408120620007f69062000ea4565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200082f83620007d3565b90506000816001600160401b038111156200084e576200084e6200153e565b60405190808252806020026020018201604052801562000878578160200160208202803683370190505b50905060005b82811015620008d55762000893858262000eaf565b828281518110620008a857620008a8620019de565b6001600160a01b039092166020928302919091019091015280620008cc8162001a93565b9150506200087e565b509392505050565b60606000620008eb62000435565b90506000816001600160401b038111156200090a576200090a6200153e565b60405190808252806020026020018201604052801562000934578160200160208202803683370190505b50905060005b8281101562000990576200094e8162000eda565b828281518110620009635762000963620019de565b6001600160a01b039092166020928302919091019091015280620009878162001a93565b9150506200093a565b5092915050565b33620009a2620007fc565b6001600160a01b031614620009cb5760405162461bcd60e51b8152600401620003c19062001982565b600080546040516001600160a01b039091169060008051602062002651833981519152908390a3600080546001600160a01b0319169055565b600062000a178787878787873362000ee9565b979650505050505050565b600062000a2f8262000e3d565b6001600160a01b03161592915050565b600062000a5486868660008787600062000ee9565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000aa1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000acb919081019062001ac5565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000b0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b38919081019062001ac5565b905062000ba46040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001243565b95945050505050565b600054600160a81b900460ff168062000bd05750600054600160a01b900460ff16155b62000c355760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000c60576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005aa576000805460ff60a81b1916905550505050565b3362000cc2620007fc565b6001600160a01b03161462000ceb5760405162461bcd60e51b8152600401620003c19062001982565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000d2c916001600160a01b03909116908490620019c4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000d61620007fc565b6001600160a01b03161462000d8a5760405162461bcd60e51b8152600401620003c19062001982565b6001600160a01b03811662000df35760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200265183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007f6919062001b63565b6000620007f6825490565b6001600160a01b038216600090815260056020526040812062000ed390836200127a565b9392505050565b6000620007f66003836200127a565b600080600062000efa8a8a62001288565b6001546040519294509092506001600160a01b031690309062000f1d90620014f7565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000f60573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb99062000fb29086908690600401620019c4565b600060405180830381865afa92505050801562000ff357506040513d6000823e601f3d908101601f1916820160405262000ff0919081019062001ac5565b60015b1562000ffc5790505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee8290606401602060405180830381865afa1580156200107b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010a1919062001b63565b90506001600160a01b038116620010f95760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b6200110681898962001356565b6200114b5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200118390859085908e908e908e908e9060040162001b83565b600060405180830381600087803b1580156200119e57600080fd5b505af1158015620011b3573d6000803e3d6000fd5b50505050620011cd3360036200140390919063ffffffff16565b50336000908152600560205260409020620011e9908662001403565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200126095949392919062001bf8565b604051602081830303815290604052905095945050505050565b600062000ed383836200141a565b600080826001600160a01b0316846001600160a01b031603620012db5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620012fd57828462001300565b83835b90925090506001600160a01b0382166200134f5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001398573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013be919062001c6d565b90508260020b8460020b128015620013e25750620013dd818562001c8d565b60020b155b801562000ba45750620013f6818462001c8d565b60020b1595945050505050565b600062000ed3836001600160a01b038416620014a5565b815460009082106200147a5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b826000018281548110620014925762001492620019de565b9060005260206000200154905092915050565b6000818152600183016020526040812054620014ee57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007f6565b506000620007f6565b6109928062001cbf83390190565b6001600160a01b03811681146200151b57600080fd5b50565b6000602082840312156200153157600080fd5b813562000ed38162001505565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200157f576200157f6200153e565b604052919050565b600082601f8301126200159957600080fd5b813560206001600160401b03821115620015b757620015b76200153e565b8160051b620015c882820162001554565b9283528481018201928281019087851115620015e357600080fd5b83870192505b8483101562000a17578235620015ff8162001505565b82529183019190830190620015e9565b6000806000604084860312156200162557600080fd5b83356001600160401b03808211156200163d57600080fd5b6200164b8783880162001587565b945060208601359150808211156200166257600080fd5b818601915086601f8301126200167757600080fd5b8135818111156200168757600080fd5b8760208260051b85010111156200169d57600080fd5b6020830194508093505050509250925092565b600060208284031215620016c357600080fd5b81356001600160401b03811115620016da57600080fd5b620016e88482850162001587565b949350505050565b6001600160a01b0391909116815260200190565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b60208152600062000ed360208301846200172a565b6020808252825182820181905260009190848201906040850190845b81811015620017b05783516001600160a01b03168352928401929184019160010162001789565b50909695505050505050565b803562ffffff81168114620017d057600080fd5b919050565b8060020b81146200151b57600080fd5b60008060008060008060c08789031215620017ff57600080fd5b86356200180c8162001505565b955060208701356200181e8162001505565b94506200182e60408801620017bc565b9350606087013561ffff811681146200184657600080fd5b925060808701356200185881620017d5565b915060a08701356200186a81620017d5565b809150509295509295509295565b600080600080600060a086880312156200189157600080fd5b85356200189e8162001505565b94506020860135620018b08162001505565b9350620018c060408701620017bc565b92506060860135620018d281620017d5565b91506080860135620018e481620017d5565b809150509295509295909350565b600080604083850312156200190657600080fd5b8235620019138162001505565b91506020830135620019258162001505565b809150509250929050565b6000806000606084860312156200194657600080fd5b8335620019538162001505565b92506020840135620019658162001505565b91506040840135620019778162001505565b809150509250925092565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811262001a0c57600080fd5b8301803591506001600160401b0382111562001a2757600080fd5b6020019150368190038213156200134f57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001aa85762001aa862001a7d565b5060010190565b80820180821115620007f657620007f662001a7d565b60006020828403121562001ad857600080fd5b81516001600160401b038082111562001af057600080fd5b818401915084601f83011262001b0557600080fd5b81518181111562001b1a5762001b1a6200153e565b62001b2f601f8201601f191660200162001554565b915080825285602082850101111562001b4757600080fd5b62001b5a81602084016020860162001704565b50949350505050565b60006020828403121562001b7657600080fd5b815162000ed38162001505565b60e08152600062001b9860e08301896200172a565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001c0c818460208b0162001704565b86519083019062001c22818360208b0162001704565b865191019062001c37818360208a0162001704565b855191019062001c4c81836020890162001704565b845191019062001c6181836020880162001704565b01979650505050505050565b60006020828403121562001c8057600080fd5b815162000ed381620017d5565b60008260020b8062001caf57634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220bab4dc364f42f8e82ed2983d450c7f7b787f86ecc2b056c62a10271dfd59e29364736f6c63430008130033", - "deployedBytecode": "0x60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e620001583660046200151e565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e3660046200160f565b62000448565b6200015e620001a5366004620016b0565b620005b0565b6200016a6200068a565b6200015e620001c6366004620016b0565b620006f5565b6200016a620001dd3660046200151e565b620007d3565b620001ed620007fc565b604051620001749190620016f0565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001758565b6200023a6200080b565b6040516200017491906200176d565b6200023a6200025a3660046200151e565b62000820565b6200023a620008dd565b6200015e62000997565b620001ed62000285366004620017e5565b62000a04565b600254620001ed906001600160a01b031681565b620002b6620002b03660046200151e565b62000a22565b604051901515815260200162000174565b620001ed620002d836600462001878565b62000a3f565b62000221620002ef366004620018f2565b62000a5e565b6200015e6200030636600462001930565b62000bad565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e620003593660046200151e565b62000cb7565b6200015e620003703660046200151e565b62000d56565b620001ed620003873660046200151e565b62000e3d565b3362000398620007fc565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001982565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b03909116908490620019c4565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000ea4565b905090565b3362000453620007fc565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001982565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005aa57838181518110620004eb57620004eb620019de565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052c576200052c620019de565b9050602002810190620005409190620019f4565b6040518463ffffffff1660e01b8152600401620005609392919062001a3d565b600060405180830381600087803b1580156200057b57600080fd5b505af115801562000590573d6000803e3d6000fd5b505050508080620005a19062001a93565b915050620004cc565b50505050565b33620005bb620007fc565b6001600160a01b031614620005e45760405162461bcd60e51b8152600401620003c19062001982565b60005b81518110156200068657818181518110620006065762000606620019de565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063c9190620016f0565b600060405180830381600087803b1580156200065757600080fd5b505af11580156200066c573d6000803e3d6000fd5b5050505080806200067d9062001a93565b915050620005e7565b5050565b60008062000697620008dd565b905060005b8151811015620006f057620006cd828281518110620006bf57620006bf620019de565b6020026020010151620007d3565b620006d9908462001aaf565b925080620006e78162001a93565b9150506200069c565b505090565b3362000700620007fc565b6001600160a01b031614620007295760405162461bcd60e51b8152600401620003c19062001982565b60005b815181101562000686578181815181106200074b576200074b620019de565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200078992911690600401620016f0565b600060405180830381600087803b158015620007a457600080fd5b505af1158015620007b9573d6000803e3d6000fd5b505050508080620007ca9062001a93565b9150506200072c565b6001600160a01b0381166000908152600560205260408120620007f69062000ea4565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200082f83620007d3565b90506000816001600160401b038111156200084e576200084e6200153e565b60405190808252806020026020018201604052801562000878578160200160208202803683370190505b50905060005b82811015620008d55762000893858262000eaf565b828281518110620008a857620008a8620019de565b6001600160a01b039092166020928302919091019091015280620008cc8162001a93565b9150506200087e565b509392505050565b60606000620008eb62000435565b90506000816001600160401b038111156200090a576200090a6200153e565b60405190808252806020026020018201604052801562000934578160200160208202803683370190505b50905060005b8281101562000990576200094e8162000eda565b828281518110620009635762000963620019de565b6001600160a01b039092166020928302919091019091015280620009878162001a93565b9150506200093a565b5092915050565b33620009a2620007fc565b6001600160a01b031614620009cb5760405162461bcd60e51b8152600401620003c19062001982565b600080546040516001600160a01b039091169060008051602062002651833981519152908390a3600080546001600160a01b0319169055565b600062000a178787878787873362000ee9565b979650505050505050565b600062000a2f8262000e3d565b6001600160a01b03161592915050565b600062000a5486868660008787600062000ee9565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000aa1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000acb919081019062001ac5565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000b0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b38919081019062001ac5565b905062000ba46040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001243565b95945050505050565b600054600160a81b900460ff168062000bd05750600054600160a01b900460ff16155b62000c355760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000c60576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005aa576000805460ff60a81b1916905550505050565b3362000cc2620007fc565b6001600160a01b03161462000ceb5760405162461bcd60e51b8152600401620003c19062001982565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000d2c916001600160a01b03909116908490620019c4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000d61620007fc565b6001600160a01b03161462000d8a5760405162461bcd60e51b8152600401620003c19062001982565b6001600160a01b03811662000df35760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200265183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007f6919062001b63565b6000620007f6825490565b6001600160a01b038216600090815260056020526040812062000ed390836200127a565b9392505050565b6000620007f66003836200127a565b600080600062000efa8a8a62001288565b6001546040519294509092506001600160a01b031690309062000f1d90620014f7565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000f60573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb99062000fb29086908690600401620019c4565b600060405180830381865afa92505050801562000ff357506040513d6000823e601f3d908101601f1916820160405262000ff0919081019062001ac5565b60015b1562000ffc5790505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee8290606401602060405180830381865afa1580156200107b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010a1919062001b63565b90506001600160a01b038116620010f95760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b6200110681898962001356565b6200114b5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200118390859085908e908e908e908e9060040162001b83565b600060405180830381600087803b1580156200119e57600080fd5b505af1158015620011b3573d6000803e3d6000fd5b50505050620011cd3360036200140390919063ffffffff16565b50336000908152600560205260409020620011e9908662001403565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200126095949392919062001bf8565b604051602081830303815290604052905095945050505050565b600062000ed383836200141a565b600080826001600160a01b0316846001600160a01b031603620012db5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620012fd57828462001300565b83835b90925090506001600160a01b0382166200134f5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001398573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013be919062001c6d565b90508260020b8460020b128015620013e25750620013dd818562001c8d565b60020b155b801562000ba45750620013f6818462001c8d565b60020b1595945050505050565b600062000ed3836001600160a01b038416620014a5565b815460009082106200147a5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b826000018281548110620014925762001492620019de565b9060005260206000200154905092915050565b6000818152600183016020526040812054620014ee57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007f6565b506000620007f6565b6109928062001cbf83390190565b6001600160a01b03811681146200151b57600080fd5b50565b6000602082840312156200153157600080fd5b813562000ed38162001505565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200157f576200157f6200153e565b604052919050565b600082601f8301126200159957600080fd5b813560206001600160401b03821115620015b757620015b76200153e565b8160051b620015c882820162001554565b9283528481018201928281019087851115620015e357600080fd5b83870192505b8483101562000a17578235620015ff8162001505565b82529183019190830190620015e9565b6000806000604084860312156200162557600080fd5b83356001600160401b03808211156200163d57600080fd5b6200164b8783880162001587565b945060208601359150808211156200166257600080fd5b818601915086601f8301126200167757600080fd5b8135818111156200168757600080fd5b8760208260051b85010111156200169d57600080fd5b6020830194508093505050509250925092565b600060208284031215620016c357600080fd5b81356001600160401b03811115620016da57600080fd5b620016e88482850162001587565b949350505050565b6001600160a01b0391909116815260200190565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b60208152600062000ed360208301846200172a565b6020808252825182820181905260009190848201906040850190845b81811015620017b05783516001600160a01b03168352928401929184019160010162001789565b50909695505050505050565b803562ffffff81168114620017d057600080fd5b919050565b8060020b81146200151b57600080fd5b60008060008060008060c08789031215620017ff57600080fd5b86356200180c8162001505565b955060208701356200181e8162001505565b94506200182e60408801620017bc565b9350606087013561ffff811681146200184657600080fd5b925060808701356200185881620017d5565b915060a08701356200186a81620017d5565b809150509295509295509295565b600080600080600060a086880312156200189157600080fd5b85356200189e8162001505565b94506020860135620018b08162001505565b9350620018c060408701620017bc565b92506060860135620018d281620017d5565b91506080860135620018e481620017d5565b809150509295509295909350565b600080604083850312156200190657600080fd5b8235620019138162001505565b91506020830135620019258162001505565b809150509250929050565b6000806000606084860312156200194657600080fd5b8335620019538162001505565b92506020840135620019658162001505565b91506040840135620019778162001505565b809150509250925092565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811262001a0c57600080fd5b8301803591506001600160401b0382111562001a2757600080fd5b6020019150368190038213156200134f57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001aa85762001aa862001a7d565b5060010190565b80820180821115620007f657620007f662001a7d565b60006020828403121562001ad857600080fd5b81516001600160401b038082111562001af057600080fd5b818401915084601f83011262001b0557600080fd5b81518181111562001b1a5762001b1a6200153e565b62001b2f601f8201601f191660200162001554565b915080825285602082850101111562001b4757600080fd5b62001b5a81602084016020860162001704565b50949350505050565b60006020828403121562001b7657600080fd5b815162000ed38162001505565b60e08152600062001b9860e08301896200172a565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001c0c818460208b0162001704565b86519083019062001c22818360208b0162001704565b865191019062001c37818360208a0162001704565b855191019062001c4c81836020890162001704565b845191019062001c6181836020880162001704565b01979650505050505050565b60006020828403121562001c8057600080fd5b815162000ed381620017d5565b60008260020b8062001caf57634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220bab4dc364f42f8e82ed2983d450c7f7b787f86ecc2b056c62a10271dfd59e29364736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "managerFee": "proportion of earned fees that go to pool manager in Basis Points", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "createPool(address,address,uint24,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "getDeployers()": { - "returns": { - "_0": "deployers the list of deployer addresses" - } - }, - "getGelatoPools()": { - "returns": { - "_0": "list of Gelato managed G-UNI pool addresses" - } - }, - "getPools(address)": { - "params": { - "deployer": "address that has potentially deployed G-UNI pools (can return empty array)" - }, - "returns": { - "_0": "pools the list of G-UNI pool addresses deployed by `deployer`" - } - }, - "getProxyAdmin(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "address that controls the G-UNI implementation (has power to upgrade it)" - } - }, - "isPoolImmutable(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "bool signaling if pool is immutable (true) or not (false)" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "numDeployers()": { - "returns": { - "_0": "total number of G-UNI pool deployer addresses" - } - }, - "numPools()": { - "returns": { - "result": "total number of G-UNI pools deployed" - } - }, - "numPools(address)": { - "params": { - "deployer": "deployer address" - }, - "returns": { - "_0": "total number of G-UNI pools deployed by `deployer`" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "notice": "createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`" - }, - "createPool(address,address,uint24,int24,int24)": { - "notice": "createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`" - }, - "getDeployers()": { - "notice": "getDeployers fetches all addresses that have deployed a G-UNI pool" - }, - "getGelatoPools()": { - "notice": "getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)" - }, - "getPools(address)": { - "notice": "getPools fetches all the G-UNI pool addresses deployed by `deployer`" - }, - "getProxyAdmin(address)": { - "notice": "getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address)." - }, - "isPoolImmutable(address)": { - "notice": "isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded" - }, - "numDeployers()": { - "notice": "numDeployers counts the total number of G-UNI pool deployer addresses" - }, - "numPools()": { - "notice": "numPools counts the total number of G-UNI pools in existence" - }, - "numPools(address)": { - "notice": "numPools counts the total number of G-UNI pools deployed by `deployer`" - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6441, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_manager", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 5, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initialized", - "offset": 20, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initializing", - "offset": 21, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 5909, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "poolImplementation", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 5911, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "gelatoDeployer", - "offset": 0, - "slot": "2", - "type": "t_address" - }, - { - "astId": 5914, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_deployers", - "offset": 0, - "slot": "3", - "type": "t_struct(AddressSet)2007_storage" - }, - { - "astId": 5919, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_pools", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_struct(AddressSet)2007_storage)" - } - ], - "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_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(AddressSet)2007_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.AddressSet)", - "numberOfBytes": "32", - "value": "t_struct(AddressSet)2007_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(AddressSet)2007_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.AddressSet", - "members": [ - { - "astId": 2006, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1732_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Set)1732_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 1727, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 1731, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "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/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Proxy.json b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Proxy.json deleted file mode 100644 index 7ac4f1028..000000000 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Proxy.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x39AC4439e6CB9427C073259e5742529cE46DD663", - "transactionIndex": 4, - "gasUsed": "1375415", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000020000000400000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000400000200000000000000020010000000000000000800000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000200000000000000080000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000080400000000000000000000000000000000000000000000", - "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b", - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", - "logs": [ - { - "transactionIndex": 4, - "blockNumber": 53304410, - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", - "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000090608f57161ac771b28fb0adcd2434cfa1463201" - ], - "data": "0x", - "logIndex": 4, - "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b" - }, - { - "transactionIndex": 4, - "blockNumber": 53304410, - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", - "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "data": "0x", - "logIndex": 5, - "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b" - } - ], - "blockNumber": 53304410, - "cumulativeGasUsed": "2551868", - "status": 1, - "byzantium": true - }, - "args": [ - "0x90608F57161aC771b28fb0adCd2434cfa1463201", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b00000000000000000000000090608f57161ac771b28fb0adcd2434cfa1463201000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniPool.json b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniPool.json deleted file mode 100644 index be35676c8..000000000 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniPool.json +++ /dev/null @@ -1,1649 +0,0 @@ -{ - "address": "0xF3e2578C66071a637F06cc02b1c11DeC0784C1A6", - "abi": [ - { - "inputs": [ - { - "internalType": "address payable", - "name": "_gelato", - "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": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned0", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned1", - "type": "uint256" - } - ], - "name": "FeesEarned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int24", - "name": "lowerTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "int24", - "name": "upperTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBefore", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityAfter", - "type": "uint128" - } - ], - "name": "Rebalance", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - } - ], - "name": "SetManagerFee", - "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" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldAdminTreasury", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdminTreasury", - "type": "address" - } - ], - "name": "UpdateAdminTreasury", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoRebalanceBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoWithdrawBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoSlippageBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "gelatoSlippageInterval", - "type": "uint32" - } - ], - "name": "UpdateGelatoParams", - "type": "event" - }, - { - "inputs": [], - "name": "GELATO", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "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": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "burn", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "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": [ - { - "internalType": "int24", - "name": "newLowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "newUpperTick", - "type": "int24" - }, - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - } - ], - "name": "executiveRebalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoRebalanceBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageInterval", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoWithdrawBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Max", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Max", - "type": "uint256" - } - ], - "name": "getMintAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPositionID", - "outputs": [ - { - "internalType": "bytes32", - "name": "positionID", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUnderlyingBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "sqrtRatioX96", - "type": "uint160" - } - ], - "name": "getUnderlyingBalancesAtPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "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": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "address", - "name": "_pool", - "type": "address" - }, - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "_lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "_upperTick", - "type": "int24" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - } - ], - "name": "initializeManagerFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "lowerTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerTreasury", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pool", - "outputs": [ - { - "internalType": "contract IUniswapV3Pool", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "paymentToken", - "type": "address" - } - ], - "name": "rebalance", - "outputs": [], - "stateMutability": "nonpayable", - "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": "token0", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token1", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Owed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Owed", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3MintCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amount0Delta", - "type": "int256" - }, - { - "internalType": "int256", - "name": "amount1Delta", - "type": "int256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3SwapCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "newRebalanceBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newWithdrawBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newSlippageBPS", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "newSlippageInterval", - "type": "uint32" - }, - { - "internalType": "address", - "name": "newTreasury", - "type": "address" - } - ], - "name": "updateGelatoParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "upperTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawGelatoBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawManagerBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x8ca1d397f287c7ac87d7677c74656480c141f7242e78f3b9ad4612cf77a39fbe", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0xF3e2578C66071a637F06cc02b1c11DeC0784C1A6", - "transactionIndex": 4, - "gasUsed": "5709523", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xde2678056ddc18fe88264d249865e9cc47de73569a4988671c34dc0cf897d472", - "transactionHash": "0x8ca1d397f287c7ac87d7677c74656480c141f7242e78f3b9ad4612cf77a39fbe", - "logs": [], - "blockNumber": 54644356, - "cumulativeGasUsed": "6328188", - "status": 1, - "byzantium": true - }, - "args": [ - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_gelato\",\"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\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned1\",\"type\":\"uint256\"}],\"name\":\"FeesEarned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"lowerTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"upperTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBefore\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityAfter\",\"type\":\"uint128\"}],\"name\":\"Rebalance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"}],\"name\":\"SetManagerFee\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAdminTreasury\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdminTreasury\",\"type\":\"address\"}],\"name\":\"UpdateAdminTreasury\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoRebalanceBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoWithdrawBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoSlippageBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gelatoSlippageInterval\",\"type\":\"uint32\"}],\"name\":\"UpdateGelatoParams\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GELATO\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"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\":[{\"internalType\":\"int24\",\"name\":\"newLowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"newUpperTick\",\"type\":\"int24\"},{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"}],\"name\":\"executiveRebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoRebalanceBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageInterval\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoWithdrawBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Max\",\"type\":\"uint256\"}],\"name\":\"getMintAmounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPositionID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"positionID\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUnderlyingBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtRatioX96\",\"type\":\"uint160\"}],\"name\":\"getUnderlyingBalancesAtPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"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\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_pool\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"_lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"_upperTick\",\"type\":\"int24\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"}],\"name\":\"initializeManagerFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lowerTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pool\",\"outputs\":[{\"internalType\":\"contract IUniswapV3Pool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"}],\"name\":\"rebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"token0\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newRebalanceBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newWithdrawBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newSlippageBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"newSlippageInterval\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateGelatoParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upperTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawGelatoBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawManagerBalance\",\"outputs\":[],\"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\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"burn(uint256,address)\":{\"params\":{\"burnAmount\":\"The number of G-UNI tokens to burn\",\"receiver\":\"The account to receive the underlying amounts of token0 and token1\"},\"returns\":{\"amount0\":\"amount of token0 transferred to receiver for burning `burnAmount`\",\"amount1\":\"amount of token1 transferred to receiver for burning `burnAmount`\",\"liquidityBurned\":\"amount of liquidity removed from the underlying Uniswap V3 position\"}},\"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 this function is overridden; 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`.\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"details\":\"When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.\",\"params\":{\"newLowerTick\":\"The new lower bound of the position's range\",\"newUpperTick\":\"The new upper bound of the position's range\",\"swapAmountBPS\":\"amount of token to swap as proportion of total. Pass 0 to ignore swap.\",\"swapThresholdPrice\":\"slippage parameter on the swap as a max or min sqrtPriceX96\",\"zeroForOne\":\"Which token to input into the swap (true = token0, false = token1)\"}},\"getMintAmounts(uint256,uint256)\":{\"params\":{\"amount0Max\":\"The maximum amount of token1 to forward on mint\"},\"returns\":{\"amount0\":\"actual amount of token0 to forward when minting `mintAmount`\",\"amount1\":\"actual amount of token1 to forward when minting `mintAmount`\",\"mintAmount\":\"maximum number of G-UNI tokens to mint\"}},\"getUnderlyingBalances()\":{\"returns\":{\"amount0Current\":\"current total underlying balance of token0\",\"amount1Current\":\"current total underlying balance of token1\"}},\"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.\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"params\":{\"_lowerTick\":\"initial upperTick (only changeable with executiveRebalance)\",\"_managerFeeBPS\":\"proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\",\"_manager_\":\"address of manager (ownership can be transferred)\",\"_name\":\"name of G-UNI token\",\"_pool\":\"address of Uniswap V3 pool\",\"_symbol\":\"symbol of G-UNI token\"}},\"initializeManagerFee(uint16)\":{\"params\":{\"_managerFeeBPS\":\"proportion of fees earned that are credited to manager in Basis Points\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"mint(uint256,address)\":{\"details\":\"to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\",\"params\":{\"mintAmount\":\"The number of G-UNI tokens to mint\",\"receiver\":\"The account to receive the minted tokens\"},\"returns\":{\"amount0\":\"amount of token0 transferred from msg.sender to mint `mintAmount`\",\"amount1\":\"amount of token1 transferred from msg.sender to mint `mintAmount`\",\"liquidityMinted\":\"amount of liquidity added to the underlying Uniswap V3 position\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"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 manager.\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"params\":{\"newRebalanceBPS\":\"controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\",\"newSlippageBPS\":\"maximum slippage on swaps during gelato rebalance\",\"newSlippageInterval\":\"length of time for TWAP used in computing slippage on swaps\",\"newTreasury\":\"address where managerFee withdrawals are sent\",\"newWithdrawBPS\":\"controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(uint256,address)\":{\"notice\":\"burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"notice\":\"Change the range of underlying UniswapV3 position, only manager can call\"},\"getMintAmounts(uint256,uint256)\":{\"notice\":\"compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\"},\"getUnderlyingBalances()\":{\"notice\":\"compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"notice\":\"initialize storage variables on a new G-UNI pool, only called once\"},\"initializeManagerFee(uint16)\":{\"notice\":\"initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\"},\"mint(uint256,address)\":{\"notice\":\"mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\"},\"rebalance(uint160,uint256,bool,uint256,address)\":{\"notice\":\"Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\"},\"uniswapV3MintCallback(uint256,uint256,bytes)\":{\"notice\":\"Uniswap V3 callback fn, called back on pool.mint\"},\"uniswapV3SwapCallback(int256,int256,bytes)\":{\"notice\":\"Uniswap v3 callback fn, called back on pool.swap\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"notice\":\"change configurable parameters, only manager can call\"},\"withdrawGelatoBalance(uint256,address)\":{\"notice\":\"withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"},\"withdrawManagerBalance(uint256,address)\":{\"notice\":\"withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniPool.sol\":\"GUniPool\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal initializer {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal initializer {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and make it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x89fa60d14355f7ae06af11e28fce2bb90c5c6186645d681a30e1b36234a4c210\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\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\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The defaut value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\\n __Context_init_unchained();\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override 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 override 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 this function is\\n * overridden;\\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 override returns (uint8) {\\n return 18;\\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\\n uint256 currentAllowance = _allowances[sender][_msgSender()];\\n require(currentAllowance >= amount, \\\"ERC20: transfer amount exceeds allowance\\\");\\n _approve(sender, _msgSender(), currentAllowance - amount);\\n\\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\\n\\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 uint256 senderBalance = _balances[sender];\\n require(senderBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n _balances[sender] = senderBalance - amount;\\n _balances[recipient] += amount;\\n\\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 += amount;\\n _balances[account] += 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 uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n _balances[account] = accountBalance - amount;\\n _totalSupply -= amount;\\n\\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 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 uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0x9c2d7425f3343ea340d6ea67e9d90109d4d846bb013c2572096ec88c9e74946b\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\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\":\"0x8d4a0f2b5b760b5e2c19ed3c108d83897a4dfd5bfed97a93867918df19191e5e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x6795c369a4eefa78468e38966f7851fbc2dda5e5b9ccd3fa2b45970e2e4d3abd\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../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 initializer {\\n __Context_init_unchained();\\n }\\n\\n function __Context_init_unchained() internal initializer {\\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x8e9eb503de1189f50c5f16fef327da310b11898d6b9ab3ca937df07c35233b9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.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 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) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\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\":\"0x99f5c21018d796db7833a2100bb0e7411999e248a3c950fb526eee5d2bf47cb7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0x069b2631bb5b5193a58ccf7a06266c7361bd2c20095667af4402817605627f45\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCast {\\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 require(value < 2**128, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return uint128(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 require(value < 2**64, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return uint64(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 require(value < 2**32, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return uint32(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 require(value < 2**16, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\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 require(value < 2**8, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\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 require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n return uint256(value);\\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 * _Available since v3.1._\\n */\\n function toInt128(int256 value) internal pure returns (int128) {\\n require(value >= -2**127 && value < 2**127, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return int128(value);\\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 * _Available since v3.1._\\n */\\n function toInt64(int256 value) internal pure returns (int64) {\\n require(value >= -2**63 && value < 2**63, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return int64(value);\\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 * _Available since v3.1._\\n */\\n function toInt32(int256 value) internal pure returns (int32) {\\n require(value >= -2**31 && value < 2**31, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return int32(value);\\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 * _Available since v3.1._\\n */\\n function toInt16(int256 value) internal pure returns (int16) {\\n require(value >= -2**15 && value < 2**15, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\n return int16(value);\\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 * _Available since v3.1._\\n */\\n function toInt8(int256 value) internal pure returns (int8) {\\n require(value >= -2**7 && value < 2**7, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\n return int8(value);\\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 require(value < 2**255, \\\"SafeCast: value doesn't fit in an int256\\\");\\n return int256(value);\\n }\\n}\\n\",\"keccak256\":\"0xc37d85b96c2a8d7bc09f25958e0a81394bf5780286444147ddf875fa628d53ce\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\nimport './pool/IUniswapV3PoolImmutables.sol';\\nimport './pool/IUniswapV3PoolState.sol';\\nimport './pool/IUniswapV3PoolDerivedState.sol';\\nimport './pool/IUniswapV3PoolActions.sol';\\nimport './pool/IUniswapV3PoolOwnerActions.sol';\\nimport './pool/IUniswapV3PoolEvents.sol';\\n\\n/// @title The interface for a Uniswap V3 Pool\\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\\n/// to the ERC20 specification\\n/// @dev The pool interface is broken up into many smaller pieces\\ninterface IUniswapV3Pool is\\n IUniswapV3PoolImmutables,\\n IUniswapV3PoolState,\\n IUniswapV3PoolDerivedState,\\n IUniswapV3PoolActions,\\n IUniswapV3PoolOwnerActions,\\n IUniswapV3PoolEvents\\n{\\n\\n}\\n\",\"keccak256\":\"0xfe6113d518466cd6652c85b111e01f33eb62157f49ae5ed7d5a3947a2044adb1\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#mint\\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\\ninterface IUniswapV3MintCallback {\\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x27a9725b8f831a92d16380860c3d348a0b926a7f01b34a54ea6eea78cbdbcd6a\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#swap\\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\\ninterface IUniswapV3SwapCallback {\\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x3f485fb1a44e8fbeadefb5da07d66edab3cfe809f0ac4074b1e54e3eb3c4cf69\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissionless pool actions\\n/// @notice Contains pool methods that can be called by anyone\\ninterface IUniswapV3PoolActions {\\n /// @notice Sets the initial price for the pool\\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\\n function initialize(uint160 sqrtPriceX96) external;\\n\\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\\n /// @param recipient The address for which the liquidity will be created\\n /// @param tickLower The lower tick of the position in which to add liquidity\\n /// @param tickUpper The upper tick of the position in which to add liquidity\\n /// @param amount The amount of liquidity to mint\\n /// @param data Any data that should be passed through to the callback\\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n function mint(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount,\\n bytes calldata data\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Collects tokens owed to a position\\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\\n /// @param recipient The address which should receive the fees collected\\n /// @param tickLower The lower tick of the position for which to collect fees\\n /// @param tickUpper The upper tick of the position for which to collect fees\\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\\n /// @return amount0 The amount of fees collected in token0\\n /// @return amount1 The amount of fees collected in token1\\n function collect(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n\\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\\n /// @dev Fees must be collected separately via a call to #collect\\n /// @param tickLower The lower tick of the position for which to burn liquidity\\n /// @param tickUpper The upper tick of the position for which to burn liquidity\\n /// @param amount How much liquidity to burn\\n /// @return amount0 The amount of token0 sent to the recipient\\n /// @return amount1 The amount of token1 sent to the recipient\\n function burn(\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Swap token0 for token1, or token1 for token0\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\\n /// @param recipient The address to receive the output of the swap\\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\\n /// @param data Any data to be passed through to the callback\\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\\n function swap(\\n address recipient,\\n bool zeroForOne,\\n int256 amountSpecified,\\n uint160 sqrtPriceLimitX96,\\n bytes calldata data\\n ) external returns (int256 amount0, int256 amount1);\\n\\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\\n /// @param recipient The address which will receive the token0 and token1 amounts\\n /// @param amount0 The amount of token0 to send\\n /// @param amount1 The amount of token1 to send\\n /// @param data Any data to be passed through to the callback\\n function flash(\\n address recipient,\\n uint256 amount0,\\n uint256 amount1,\\n bytes calldata data\\n ) external;\\n\\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\\n /// the input observationCardinalityNext.\\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0x9453dd0e7442188667d01d9b65de3f1e14e9511ff3e303179a15f6fc267f7634\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that is not stored\\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\\n/// blockchain. The functions here may have variable gas costs.\\ninterface IUniswapV3PoolDerivedState {\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\\n /// you must call it with secondsAgos = [3600, 0].\\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\\n /// timestamp\\n function observe(uint32[] calldata secondsAgos)\\n external\\n view\\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\\n\\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\\n /// snapshot is taken and the second snapshot is taken.\\n /// @param tickLower The lower tick of the range\\n /// @param tickUpper The upper tick of the range\\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\\n /// @return secondsInside The snapshot of seconds per liquidity for the range\\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\\n external\\n view\\n returns (\\n int56 tickCumulativeInside,\\n uint160 secondsPerLiquidityInsideX128,\\n uint32 secondsInside\\n );\\n}\\n\",\"keccak256\":\"0xe603ac5b17ecdee73ba2b27efdf386c257a19c14206e87eee77e2017b742d9e5\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Events emitted by a pool\\n/// @notice Contains all events emitted by the pool\\ninterface IUniswapV3PoolEvents {\\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\\n event Initialize(uint160 sqrtPriceX96, int24 tick);\\n\\n /// @notice Emitted when liquidity is minted for a given position\\n /// @param sender The address that minted the liquidity\\n /// @param owner The owner of the position and recipient of any minted liquidity\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity minted to the position range\\n /// @param amount0 How much token0 was required for the minted liquidity\\n /// @param amount1 How much token1 was required for the minted liquidity\\n event Mint(\\n address sender,\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted when fees are collected by the owner of a position\\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\\n /// @param owner The owner of the position for which fees are collected\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount0 The amount of token0 fees collected\\n /// @param amount1 The amount of token1 fees collected\\n event Collect(\\n address indexed owner,\\n address recipient,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount0,\\n uint128 amount1\\n );\\n\\n /// @notice Emitted when a position's liquidity is removed\\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\\n /// @param owner The owner of the position for which liquidity is removed\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity to remove\\n /// @param amount0 The amount of token0 withdrawn\\n /// @param amount1 The amount of token1 withdrawn\\n event Burn(\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted by the pool for any swaps between token0 and token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the output of the swap\\n /// @param amount0 The delta of the token0 balance of the pool\\n /// @param amount1 The delta of the token1 balance of the pool\\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param liquidity The liquidity of the pool after the swap\\n /// @param tick The log base 1.0001 of price of the pool after the swap\\n event Swap(\\n address indexed sender,\\n address indexed recipient,\\n int256 amount0,\\n int256 amount1,\\n uint160 sqrtPriceX96,\\n uint128 liquidity,\\n int24 tick\\n );\\n\\n /// @notice Emitted by the pool for any flashes of token0/token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the tokens from flash\\n /// @param amount0 The amount of token0 that was flashed\\n /// @param amount1 The amount of token1 that was flashed\\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\\n event Flash(\\n address indexed sender,\\n address indexed recipient,\\n uint256 amount0,\\n uint256 amount1,\\n uint256 paid0,\\n uint256 paid1\\n );\\n\\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\\n /// just before a mint/swap/burn.\\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(\\n uint16 observationCardinalityNextOld,\\n uint16 observationCardinalityNextNew\\n );\\n\\n /// @notice Emitted when the protocol fee is changed by the pool\\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\\n /// @param feeProtocol0New The updated value of the token0 protocol fee\\n /// @param feeProtocol1New The updated value of the token1 protocol fee\\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\\n\\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\\n /// @param sender The address that collects the protocol fees\\n /// @param recipient The address that receives the collected protocol fees\\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x8071514d0fe5d17d6fbd31c191cdfb703031c24e0ece3621d88ab10e871375cd\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that never changes\\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\\ninterface IUniswapV3PoolImmutables {\\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\\n /// @return The contract address\\n function factory() external view returns (address);\\n\\n /// @notice The first of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token0() external view returns (address);\\n\\n /// @notice The second of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token1() external view returns (address);\\n\\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\\n /// @return The fee\\n function fee() external view returns (uint24);\\n\\n /// @notice The pool tick spacing\\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\\n /// This value is an int24 to avoid casting even though it is always positive.\\n /// @return The tick spacing\\n function tickSpacing() external view returns (int24);\\n\\n /// @notice The maximum amount of position liquidity that can use any tick in the range\\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\\n /// @return The max amount of liquidity per tick\\n function maxLiquidityPerTick() external view returns (uint128);\\n}\\n\",\"keccak256\":\"0xf6e5d2cd1139c4c276bdbc8e1d2b256e456c866a91f1b868da265c6d2685c3f7\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissioned pool actions\\n/// @notice Contains pool methods that may only be called by the factory owner\\ninterface IUniswapV3PoolOwnerActions {\\n /// @notice Set the denominator of the protocol's % share of the fees\\n /// @param feeProtocol0 new protocol fee for token0 of the pool\\n /// @param feeProtocol1 new protocol fee for token1 of the pool\\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\\n\\n /// @notice Collect the protocol fee accrued to the pool\\n /// @param recipient The address to which collected protocol fees should be sent\\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\\n /// @return amount0 The protocol fee collected in token0\\n /// @return amount1 The protocol fee collected in token1\\n function collectProtocol(\\n address recipient,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x759b78a2918af9e99e246dc3af084f654e48ef32bb4e4cb8a966aa3dcaece235\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that can change\\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\\n/// per transaction\\ninterface IUniswapV3PoolState {\\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\\n /// when accessed externally.\\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\\n /// boundary.\\n /// observationIndex The index of the last oracle observation that was written,\\n /// observationCardinality The current maximum number of observations stored in the pool,\\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// feeProtocol The protocol fee for both tokens of the pool.\\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\\n /// unlocked Whether the pool is currently locked to reentrancy\\n function slot0()\\n external\\n view\\n returns (\\n uint160 sqrtPriceX96,\\n int24 tick,\\n uint16 observationIndex,\\n uint16 observationCardinality,\\n uint16 observationCardinalityNext,\\n uint8 feeProtocol,\\n bool unlocked\\n );\\n\\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal0X128() external view returns (uint256);\\n\\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal1X128() external view returns (uint256);\\n\\n /// @notice The amounts of token0 and token1 that are owed to the protocol\\n /// @dev Protocol fees will never exceed uint128 max in either token\\n function protocolFees() external view returns (uint128 token0, uint128 token1);\\n\\n /// @notice The currently in range liquidity available to the pool\\n /// @dev This value has no relationship to the total liquidity across all ticks\\n function liquidity() external view returns (uint128);\\n\\n /// @notice Look up information about a specific tick in the pool\\n /// @param tick The tick to look up\\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\\n /// tick upper,\\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\\n /// a specific position.\\n function ticks(int24 tick)\\n external\\n view\\n returns (\\n uint128 liquidityGross,\\n int128 liquidityNet,\\n uint256 feeGrowthOutside0X128,\\n uint256 feeGrowthOutside1X128,\\n int56 tickCumulativeOutside,\\n uint160 secondsPerLiquidityOutsideX128,\\n uint32 secondsOutside,\\n bool initialized\\n );\\n\\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\\n function tickBitmap(int16 wordPosition) external view returns (uint256);\\n\\n /// @notice Returns the information about a position by the position's key\\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\\n /// @return _liquidity The amount of liquidity in the position,\\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\\n function positions(bytes32 key)\\n external\\n view\\n returns (\\n uint128 _liquidity,\\n uint256 feeGrowthInside0LastX128,\\n uint256 feeGrowthInside1LastX128,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param index The element of the observations array to fetch\\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\\n /// ago, rather than at a specific index in the array.\\n /// @return blockTimestamp The timestamp of the observation,\\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// Returns initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 index)\\n external\\n view\\n returns (\\n uint32 blockTimestamp,\\n int56 tickCumulative,\\n uint160 secondsPerLiquidityCumulativeX128,\\n bool initialized\\n );\\n}\\n\",\"keccak256\":\"0x852dc1f5df7dcf7f11e7bb3eed79f0cea72ad4b25f6a9d2c35aafb48925fd49f\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.4.0;\\n\\n/// @title FixedPoint96\\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\\n/// @dev Used in SqrtPriceMath.sol\\nlibrary FixedPoint96 {\\n uint8 internal constant RESOLUTION = 96;\\n uint256 internal constant Q96 = 0x1000000000000000000000000;\\n}\\n\",\"keccak256\":\"0x0ba8a9b95a956a4050749c0158e928398c447c91469682ca8a7cc7e77a7fe032\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {\\n IUniswapV3MintCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\\\";\\nimport {\\n IUniswapV3SwapCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\\\";\\nimport {GUniPoolStorage} from \\\"./abstract/GUniPoolStorage.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {TickMath} from \\\"./vendor/uniswap/TickMath.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {SafeCast} from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport {\\n FullMath,\\n LiquidityAmounts\\n} from \\\"./vendor/uniswap/LiquidityAmounts.sol\\\";\\n\\ncontract GUniPool is\\n IUniswapV3MintCallback,\\n IUniswapV3SwapCallback,\\n GUniPoolStorage\\n{\\n using SafeERC20 for IERC20;\\n using TickMath for int24;\\n\\n event Minted(\\n address receiver,\\n uint256 mintAmount,\\n uint256 amount0In,\\n uint256 amount1In,\\n uint128 liquidityMinted\\n );\\n\\n event Burned(\\n address receiver,\\n uint256 burnAmount,\\n uint256 amount0Out,\\n uint256 amount1Out,\\n uint128 liquidityBurned\\n );\\n\\n event Rebalance(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidityBefore,\\n uint128 liquidityAfter\\n );\\n\\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice Uniswap V3 callback fn, called back on pool.mint\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata /*_data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\\n }\\n\\n /// @notice Uniswap v3 callback fn, called back on pool.swap\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata /*data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Delta > 0)\\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\\n else if (amount1Delta > 0)\\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\\n }\\n\\n // User functions => Should be called via a Router\\n\\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\\n /// @param mintAmount The number of G-UNI tokens to mint\\n /// @param receiver The account to receive the minted tokens\\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function mint(uint256 mintAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityMinted\\n )\\n {\\n require(mintAmount > 0, \\\"mint 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n\\n if (totalSupply > 0) {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n amount0 = FullMath.mulDivRoundingUp(\\n amount0Current,\\n mintAmount,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n amount1Current,\\n mintAmount,\\n totalSupply\\n );\\n } else {\\n // if supply is 0 mintAmount == liquidity to deposit\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n SafeCast.toUint128(mintAmount)\\n );\\n }\\n\\n // transfer amounts owed to contract\\n if (amount0 > 0) {\\n token0.safeTransferFrom(msg.sender, address(this), amount0);\\n }\\n if (amount1 > 0) {\\n token1.safeTransferFrom(msg.sender, address(this), amount1);\\n }\\n\\n // deposit as much new liquidity as possible\\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n\\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \\\"\\\");\\n\\n _mint(receiver, mintAmount);\\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\\n }\\n\\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\\n /// @param burnAmount The number of G-UNI tokens to burn\\n /// @param receiver The account to receive the underlying amounts of token0 and token1\\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines\\n function burn(uint256 burnAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityBurned\\n )\\n {\\n require(burnAmount > 0, \\\"burn 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n\\n _burn(msg.sender, burnAmount);\\n\\n uint256 liquidityBurned_ =\\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidityBurned);\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n\\n amount0 =\\n burn0 +\\n FullMath.mulDiv(\\n token0.balanceOf(address(this)) -\\n burn0 -\\n managerBalance0 -\\n gelatoBalance0,\\n burnAmount,\\n totalSupply\\n );\\n amount1 =\\n burn1 +\\n FullMath.mulDiv(\\n token1.balanceOf(address(this)) -\\n burn1 -\\n managerBalance1 -\\n gelatoBalance1,\\n burnAmount,\\n totalSupply\\n );\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(receiver, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(receiver, amount1);\\n }\\n\\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\\n }\\n\\n // Manager Functions => Called by Pool Manager\\n\\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\\n /// any leftover will be unused and sit idle until the next rebalance.\\n /// @param newLowerTick The new lower bound of the position's range\\n /// @param newUpperTick The new upper bound of the position's range\\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\\n // solhint-disable-next-line function-max-lines\\n function executiveRebalance(\\n int24 newLowerTick,\\n int24 newUpperTick,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) external onlyManager {\\n uint128 liquidity;\\n uint128 newLiquidity;\\n if (totalSupply() > 0) {\\n (liquidity, , , , ) = pool.positions(_getPositionID());\\n if (liquidity > 0) {\\n (, , uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n }\\n\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n\\n uint256 reinvest0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n uint256 reinvest1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n\\n _deposit(\\n newLowerTick,\\n newUpperTick,\\n reinvest0,\\n reinvest1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n\\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > 0, \\\"new position 0\\\");\\n } else {\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n }\\n\\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\\n }\\n\\n // Gelatofied functions => Automatically called by Gelato\\n\\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\\n function rebalance(\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) external gelatofy(feeAmount, paymentToken) {\\n if (swapAmountBPS > 0) {\\n _checkSlippage(swapThresholdPrice, zeroForOne);\\n }\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n _rebalance(\\n liquidity,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne,\\n feeAmount,\\n paymentToken\\n );\\n\\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > liquidity, \\\"liquidity must increase\\\");\\n\\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\\n }\\n\\n /// @notice withdraw manager fees accrued, only gelato executors can call.\\n /// Target account to receive fees is managerTreasury, alterable by manager.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n managerBalance0,\\n managerBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(managerTreasury, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(managerTreasury, amount1);\\n }\\n }\\n\\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n gelatoBalance0,\\n gelatoBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n gelatoBalance0 = 0;\\n gelatoBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(GELATO, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(GELATO, amount1);\\n }\\n }\\n\\n function _balancesToWithdraw(\\n uint256 balance0,\\n uint256 balance1,\\n uint256 feeAmount,\\n address feeToken\\n ) internal view returns (uint256 amount0, uint256 amount1) {\\n if (feeToken == address(token0)) {\\n require(\\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount0 = balance0 - feeAmount;\\n amount1 = balance1;\\n } else if (feeToken == address(token1)) {\\n require(\\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount1 = balance1 - feeAmount;\\n amount0 = balance0;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n }\\n\\n // View functions\\n\\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\\n /// @param amount0Max The maximum amount of token0 to forward on mint\\n /// @param amount0Max The maximum amount of token1 to forward on mint\\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\\n /// @return mintAmount maximum number of G-UNI tokens to mint\\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\\n external\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n uint256 totalSupply = totalSupply();\\n if (totalSupply > 0) {\\n (amount0, amount1, mintAmount) = _computeMintAmounts(\\n totalSupply,\\n amount0Max,\\n amount1Max\\n );\\n } else {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 newLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0Max,\\n amount1Max\\n );\\n mintAmount = uint256(newLiquidity);\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n newLiquidity\\n );\\n }\\n }\\n\\n /// @notice compute total underlying holdings of the G-UNI token supply\\n /// includes current liquidity invested in uniswap position, current fees earned\\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\\n /// @return amount0Current current total underlying balance of token0\\n /// @return amount1Current current total underlying balance of token1\\n function getUnderlyingBalances()\\n public\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\\n external\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\\n internal\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (\\n uint128 liquidity,\\n uint256 feeGrowthInside0Last,\\n uint256 feeGrowthInside1Last,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n ) = pool.positions(_getPositionID());\\n\\n // compute current holdings from liquidity\\n (amount0Current, amount1Current) = LiquidityAmounts\\n .getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n liquidity\\n );\\n\\n // compute current fees earned\\n uint256 fee0 =\\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\\n uint256(tokensOwed0);\\n uint256 fee1 =\\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\\n uint256(tokensOwed1);\\n\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n\\n // add any leftover in contract to current holdings\\n amount0Current +=\\n fee0 +\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n amount1Current +=\\n fee1 +\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n }\\n\\n // Private functions\\n\\n // solhint-disable-next-line function-max-lines\\n function _rebalance(\\n uint128 liquidity,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) private {\\n uint256 leftover0 =\\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\\n uint256 leftover1 =\\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\\n\\n (, , uint256 feesEarned0, uint256 feesEarned1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n _applyFees(feesEarned0, feesEarned1);\\n (feesEarned0, feesEarned1) = _subtractAdminFees(\\n feesEarned0,\\n feesEarned1\\n );\\n emit FeesEarned(feesEarned0, feesEarned1);\\n feesEarned0 += leftover0;\\n feesEarned1 += leftover1;\\n\\n if (paymentToken == address(token0)) {\\n require(\\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0 -\\n feeAmount;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n } else if (paymentToken == address(token1)) {\\n require(\\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1 -\\n feeAmount;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n\\n _deposit(\\n lowerTick,\\n upperTick,\\n leftover0,\\n leftover1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _withdraw(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidity\\n )\\n private\\n returns (\\n uint256 burn0,\\n uint256 burn1,\\n uint256 fee0,\\n uint256 fee1\\n )\\n {\\n uint256 preBalance0 = token0.balanceOf(address(this));\\n uint256 preBalance1 = token1.balanceOf(address(this));\\n\\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\\n\\n pool.collect(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n type(uint128).max,\\n type(uint128).max\\n );\\n\\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _deposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) private {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n // First, deposit as much as we can\\n uint128 baseLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n if (baseLiquidity > 0) {\\n (uint256 amountDeposited0, uint256 amountDeposited1) =\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n baseLiquidity,\\n \\\"\\\"\\n );\\n\\n amount0 -= amountDeposited0;\\n amount1 -= amountDeposited1;\\n }\\n int256 swapAmount =\\n SafeCast.toInt256(\\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\\n );\\n if (swapAmount > 0) {\\n _swapAndDeposit(\\n lowerTick_,\\n upperTick_,\\n amount0,\\n amount1,\\n swapAmount,\\n swapThresholdPrice,\\n zeroForOne\\n );\\n }\\n }\\n\\n function _swapAndDeposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n int256 swapAmount,\\n uint160 swapThresholdPrice,\\n bool zeroForOne\\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\\n (int256 amount0Delta, int256 amount1Delta) =\\n pool.swap(\\n address(this),\\n zeroForOne,\\n swapAmount,\\n swapThresholdPrice,\\n \\\"\\\"\\n );\\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\\n\\n // Add liquidity a second time\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 liquidityAfterSwap =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n finalAmount0,\\n finalAmount1\\n );\\n if (liquidityAfterSwap > 0) {\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n liquidityAfterSwap,\\n \\\"\\\"\\n );\\n }\\n }\\n\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function _computeMintAmounts(\\n uint256 totalSupply,\\n uint256 amount0Max,\\n uint256 amount1Max\\n )\\n private\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n // compute proportional amount of tokens to mint\\n if (amount0Current == 0 && amount1Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount1Max,\\n totalSupply,\\n amount1Current\\n );\\n } else if (amount1Current == 0 && amount0Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount0Max,\\n totalSupply,\\n amount0Current\\n );\\n } else if (amount0Current == 0 && amount1Current == 0) {\\n revert(\\\"\\\");\\n } else {\\n // only if both are non-zero\\n uint256 amount0Mint =\\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\\n uint256 amount1Mint =\\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\\n require(amount0Mint > 0 && amount1Mint > 0, \\\"mint 0\\\");\\n\\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\\n }\\n\\n // compute amounts owed to contract\\n amount0 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount0Current,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount1Current,\\n totalSupply\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _computeFeesEarned(\\n bool isZero,\\n uint256 feeGrowthInsideLast,\\n int24 tick,\\n uint128 liquidity\\n ) private view returns (uint256 fee) {\\n uint256 feeGrowthOutsideLower;\\n uint256 feeGrowthOutsideUpper;\\n uint256 feeGrowthGlobal;\\n if (isZero) {\\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\\n } else {\\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\\n }\\n\\n unchecked {\\n // calculate fee growth below\\n uint256 feeGrowthBelow;\\n if (tick >= lowerTick) {\\n feeGrowthBelow = feeGrowthOutsideLower;\\n } else {\\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\\n }\\n\\n // calculate fee growth above\\n uint256 feeGrowthAbove;\\n if (tick < upperTick) {\\n feeGrowthAbove = feeGrowthOutsideUpper;\\n } else {\\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\\n }\\n\\n uint256 feeGrowthInside =\\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\\n fee = FullMath.mulDiv(\\n liquidity,\\n feeGrowthInside - feeGrowthInsideLast,\\n 0x100000000000000000000000000000000\\n );\\n }\\n }\\n\\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\\n }\\n\\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\\n private\\n view\\n returns (uint256 fee0, uint256 fee1)\\n {\\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n fee0 = rawFee0 - deduct0;\\n fee1 = rawFee1 - deduct1;\\n }\\n\\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\\n private\\n view\\n {\\n uint32[] memory secondsAgo = new uint32[](2);\\n secondsAgo[0] = gelatoSlippageInterval;\\n secondsAgo[1] = 0;\\n\\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\\n\\n require(tickCumulatives.length == 2, \\\"array len\\\");\\n uint160 avgSqrtRatioX96;\\n unchecked {\\n int24 avgTick =\\n int24(\\n (tickCumulatives[1] - tickCumulatives[0]) /\\n int56(uint56(gelatoSlippageInterval))\\n );\\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\\n }\\n\\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\\n if (zeroForOne) {\\n require(\\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\\n \\\"high slippage\\\"\\n );\\n } else {\\n require(\\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\\n \\\"high slippage\\\"\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdd382818c81f34c434bb3d4235ac9ff39034cb68e1b87244837d9250878d9fa0\",\"license\":\"GPL-3.0\"},\"contracts/abstract/GUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {Gelatofied} from \\\"./Gelatofied.sol\\\";\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {\\n ReentrancyGuardUpgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport {\\n ERC20Upgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\n\\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\\n/// @dev ERC20Upgradable Includes Initialize\\n// solhint-disable-next-line max-states-count\\n/// @dev Modified to support 0.8.19\\n/// @dev Modified to set the gelatoFeeBPS to 0\\nabstract contract GUniPoolStorage is\\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\\n ReentrancyGuardUpgradeable,\\n OwnableUninitialized,\\n Gelatofied\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n // solhint-disable-next-line const-name-snakecase\\n uint16 public constant gelatoFeeBPS = 0;\\n\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n int24 public lowerTick;\\n int24 public upperTick;\\n\\n uint16 public gelatoRebalanceBPS;\\n uint16 public gelatoWithdrawBPS;\\n uint16 public gelatoSlippageBPS;\\n uint32 public gelatoSlippageInterval;\\n\\n uint16 public managerFeeBPS;\\n address public managerTreasury;\\n\\n uint256 public managerBalance0;\\n uint256 public managerBalance1;\\n uint256 public gelatoBalance0;\\n uint256 public gelatoBalance1;\\n\\n IUniswapV3Pool public pool;\\n IERC20 public token0;\\n IERC20 public token1;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdateAdminTreasury(\\n address oldAdminTreasury,\\n address newAdminTreasury\\n );\\n\\n event UpdateGelatoParams(\\n uint16 gelatoRebalanceBPS,\\n uint16 gelatoWithdrawBPS,\\n uint16 gelatoSlippageBPS,\\n uint32 gelatoSlippageInterval\\n );\\n\\n event SetManagerFee(uint16 managerFee);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice initialize storage variables on a new G-UNI pool, only called once\\n /// @param _name name of G-UNI token\\n /// @param _symbol symbol of G-UNI token\\n /// @param _pool address of Uniswap V3 pool\\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\\n /// @param _manager_ address of manager (ownership can be transferred)\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external initializer {\\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \\\"mBPS\\\");\\n\\n // these variables are immutable after initialization\\n pool = IUniswapV3Pool(_pool);\\n token0 = IERC20(pool.token0());\\n token1 = IERC20(pool.token1());\\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\\n\\n // these variables can be udpated by the manager\\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\\n gelatoSlippageBPS = 500; // default: 5% slippage\\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\\n managerTreasury = _manager_; // default: treasury is admin\\n lowerTick = _lowerTick;\\n upperTick = _upperTick;\\n _manager = _manager_;\\n\\n // e.g. \\\"Gelato Uniswap V3 USDC/DAI LP\\\" and \\\"G-UNI\\\"\\n __ERC20_init(_name, _symbol);\\n __ReentrancyGuard_init();\\n }\\n\\n /// @notice change configurable parameters, only manager can call\\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\\n /// @param newTreasury address where managerFee withdrawals are sent\\n // solhint-disable-next-line code-complexity\\n function updateGelatoParams(\\n uint16 newRebalanceBPS,\\n uint16 newWithdrawBPS,\\n uint16 newSlippageBPS,\\n uint32 newSlippageInterval,\\n address newTreasury\\n ) external onlyManager {\\n require(newWithdrawBPS <= 10000, \\\"BPS\\\");\\n require(newRebalanceBPS <= 10000, \\\"BPS\\\");\\n require(newSlippageBPS <= 10000, \\\"BPS\\\");\\n emit UpdateGelatoParams(\\n newRebalanceBPS,\\n newWithdrawBPS,\\n newSlippageBPS,\\n newSlippageInterval\\n );\\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\\n if (newSlippageInterval != 0)\\n gelatoSlippageInterval = newSlippageInterval;\\n if (newTreasury != address(0)) managerTreasury = newTreasury;\\n }\\n\\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\\n /// If a manager fee was not set in the initialize function it can be set here\\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\\n require(managerFeeBPS == 0, \\\"fee\\\");\\n require(\\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\\n \\\"mBPS\\\"\\n );\\n emit SetManagerFee(_managerFeeBPS);\\n managerFeeBPS = _managerFeeBPS;\\n }\\n\\n function renounceOwnership() public virtual override onlyManager {\\n managerTreasury = address(0);\\n managerFeeBPS = 0;\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n super.renounceOwnership();\\n }\\n\\n function getPositionID() external view returns (bytes32 positionID) {\\n return _getPositionID();\\n }\\n\\n function _getPositionID() internal view returns (bytes32 positionID) {\\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\\n }\\n}\\n\",\"keccak256\":\"0xd1ad805a13c7cd73554b1e3cc3735f3f369d759f8e0b9188977b85295456d033\",\"license\":\"GPL-3.0\"},\"contracts/abstract/Gelatofied.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract Gelatofied {\\n using Address for address payable;\\n using SafeERC20 for IERC20;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n address payable public immutable GELATO;\\n\\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n constructor(address payable _gelato) {\\n GELATO = _gelato;\\n }\\n\\n modifier gelatofy(uint256 _amount, address _paymentToken) {\\n require(msg.sender == GELATO, \\\"Gelatofied: Only gelato\\\");\\n _;\\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x264bc07e6e1b80c454c311ecf4b56afe245ddde31151ed9bcc4cb9ad25bec46a\",\"license\":\"GPL-3.0\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xb6016d5611f38fbd516a84ea2e56794cb76a8d61c40f6716d5f0133f195759bd\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/FullMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.4;\\n\\n/// @title Contains 512-bit math functions\\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\\n/// @dev Handles \\\"phantom overflow\\\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\\nlibrary FullMath {\\n /// @notice Calculates floor(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\\n function mulDiv(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = a * b\\n // Compute the product mod 2**256 and mod 2**256 - 1\\n // then use the Chinese Remainder Theorem to reconstruct\\n // the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2**256 + prod0\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(a, b, not(0))\\n prod0 := mul(a, b)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division\\n if (prod1 == 0) {\\n require(denominator > 0);\\n assembly {\\n result := div(prod0, denominator)\\n }\\n return result;\\n }\\n\\n // Make sure the result is less than 2**256.\\n // Also prevents denominator == 0\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0]\\n // Compute remainder using mulmod\\n uint256 remainder;\\n assembly {\\n remainder := mulmod(a, b, denominator)\\n }\\n // Subtract 256 bit number from 512 bit number\\n assembly {\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator\\n // Compute largest power of two divisor of denominator.\\n // Always >= 1.\\n // EDIT for 0.8 compatibility:\\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\\n uint256 twos = denominator & (~denominator + 1);\\n\\n // Divide denominator by power of two\\n assembly {\\n denominator := div(denominator, twos)\\n }\\n\\n // Divide [prod1 prod0] by the factors of two\\n assembly {\\n prod0 := div(prod0, twos)\\n }\\n // Shift in bits from prod1 into prod0. For this we need\\n // to flip `twos` such that it is 2**256 / twos.\\n // If twos is zero, then it becomes one\\n assembly {\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2**256\\n // Now that denominator is an odd number, it has an inverse\\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\\n // Compute the inverse by starting with a seed that is correct\\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\\n uint256 inv = (3 * denominator) ^ 2;\\n // Now use Newton-Raphson iteration to improve the precision.\\n // Thanks to Hensel's lifting lemma, this also works in modular\\n // arithmetic, doubling the correct bits in each step.\\n inv *= 2 - denominator * inv; // inverse mod 2**8\\n inv *= 2 - denominator * inv; // inverse mod 2**16\\n inv *= 2 - denominator * inv; // inverse mod 2**32\\n inv *= 2 - denominator * inv; // inverse mod 2**64\\n inv *= 2 - denominator * inv; // inverse mod 2**128\\n inv *= 2 - denominator * inv; // inverse mod 2**256\\n\\n // Because the division is now exact we can divide by multiplying\\n // with the modular inverse of denominator. This will give us the\\n // correct result modulo 2**256. Since the precoditions guarantee\\n // that the outcome is less than 2**256, this is the final result.\\n // We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inv;\\n return result;\\n }\\n }\\n\\n /// @notice Calculates ceil(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n function mulDivRoundingUp(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n result = mulDiv(a, b, denominator);\\n if (mulmod(a, b, denominator) > 0) {\\n require(result < type(uint256).max);\\n result++;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3fa0efa3eea2a84bd6ab7e55badd61f97069a6c50780059b036c810427a9740c\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/LiquidityAmounts.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.5.0;\\n\\nimport {FullMath} from \\\"./FullMath.sol\\\";\\nimport \\\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\\\";\\n\\n/// @title Liquidity amount functions\\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\\nlibrary LiquidityAmounts {\\n function toUint128(uint256 x) private pure returns (uint128 y) {\\n require((y = uint128(x)) == x);\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount0 The amount0 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount0(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n uint256 intermediate =\\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount0,\\n intermediate,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount1 The amount1 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount1(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount1,\\n FixedPoint96.Q96,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\\n /// pool prices and the prices at the tick boundaries\\n function getLiquidityForAmounts(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n liquidity = getLiquidityForAmount0(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount0\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n uint128 liquidity0 =\\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\\n uint128 liquidity1 =\\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\\n\\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\\n } else {\\n liquidity = getLiquidityForAmount1(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount1\\n );\\n }\\n }\\n\\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount0 The amount0\\n function getAmount0ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n uint256(liquidity) << FixedPoint96.RESOLUTION,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n sqrtRatioBX96\\n ) / sqrtRatioAX96;\\n }\\n\\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount1 The amount1\\n function getAmount1ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n liquidity,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n FixedPoint96.Q96\\n );\\n }\\n\\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\\n /// pool prices and the prices at the tick boundaries\\n function getAmountsForLiquidity(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0, uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioX96,\\n liquidity\\n );\\n } else {\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x6205f6409d42fc9565530d2a69819bf8c4e4c66b7a4c61d0827e81c084df6832\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/TickMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\n/// prices between 2**-128 and 2**128\\nlibrary TickMath {\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\n int24 internal constant MIN_TICK = -887272;\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\n int24 internal constant MAX_TICK = -MIN_TICK;\\n\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\n uint160 internal constant MAX_SQRT_RATIO =\\n 1461446703485210103287273052203988822378723970342;\\n\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\n /// @dev Throws if |tick| > max tick\\n /// @param tick The input tick for the above formula\\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\n /// at the given tick\\n function getSqrtRatioAtTick(int24 tick)\\n internal\\n pure\\n returns (uint160 sqrtPriceX96)\\n {\\n uint256 absTick =\\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\\n\\n // EDIT: 0.8 compatibility\\n require(absTick <= uint256(int256(MAX_TICK)), \\\"T\\\");\\n\\n uint256 ratio =\\n absTick & 0x1 != 0\\n ? 0xfffcb933bd6fad37aa2d162d1a594001\\n : 0x100000000000000000000000000000000;\\n if (absTick & 0x2 != 0)\\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\\n if (absTick & 0x4 != 0)\\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\\n if (absTick & 0x8 != 0)\\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\\n if (absTick & 0x10 != 0)\\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\\n if (absTick & 0x20 != 0)\\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\\n if (absTick & 0x40 != 0)\\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\\n if (absTick & 0x80 != 0)\\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\\n if (absTick & 0x100 != 0)\\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\\n if (absTick & 0x200 != 0)\\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\\n if (absTick & 0x400 != 0)\\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\\n if (absTick & 0x800 != 0)\\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\\n if (absTick & 0x1000 != 0)\\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\\n if (absTick & 0x2000 != 0)\\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\\n if (absTick & 0x4000 != 0)\\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\\n if (absTick & 0x8000 != 0)\\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\\n if (absTick & 0x10000 != 0)\\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\\n if (absTick & 0x20000 != 0)\\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\\n if (absTick & 0x40000 != 0)\\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\\n if (absTick & 0x80000 != 0)\\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\\n\\n if (tick > 0) ratio = type(uint256).max / ratio;\\n\\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\n sqrtPriceX96 = uint160(\\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\\n );\\n }\\n\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\n /// ever return.\\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\\n internal\\n pure\\n returns (int24 tick)\\n {\\n // second inequality must be < because the price can never reach the price at the max tick\\n require(\\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\\n \\\"R\\\"\\n );\\n uint256 ratio = uint256(sqrtPriceX96) << 32;\\n\\n uint256 r = ratio;\\n uint256 msb = 0;\\n\\n assembly {\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(4, gt(r, 0xFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(3, gt(r, 0xFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(2, gt(r, 0xF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(1, gt(r, 0x3))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := gt(r, 0x1)\\n msb := or(msb, f)\\n }\\n\\n if (msb >= 128) r = ratio >> (msb - 127);\\n else r = ratio << (127 - msb);\\n\\n int256 log_2 = (int256(msb) - 128) << 64;\\n\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(63, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(62, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(61, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(60, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(59, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(58, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(57, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(56, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(55, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(54, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(53, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(52, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(51, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(50, f))\\n }\\n\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\n\\n int24 tickLow =\\n int24(\\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\\n );\\n int24 tickHi =\\n int24(\\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\\n );\\n\\n tick = tickLow == tickHi\\n ? tickLow\\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\\n ? tickHi\\n : tickLow;\\n }\\n}\\n\",\"keccak256\":\"0x589b6104fd07d2e56e5b52edcfa53e6e47e2c38cace38025c16278ca73413f2d\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b5060405162005e0e38038062005e0e833981016040819052620000349162000046565b6001600160a01b031660805262000078565b6000602082840312156200005957600080fd5b81516001600160a01b03811681146200007157600080fd5b9392505050565b608051615d3b620000d3600039600081816105f801528181610ce301528181610dcc01528181610e06015281816114a7015281816116d50152818161170f015281816117e20152818161185901526118960152615d3b6000f3fe608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190614dc5565b61026e610269366004614e0d565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d9190614e39565b6102a66106fc565b60405161023d929190614e4d565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004614e5b565b610796565b6102f56102f0366004614eb9565b61084e565b005b6102ff600081565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004614e0d565b610c3a565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610c71565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b1366004614f21565b6001600160a01b031660009081526033602052604090205490565b6102f5610c80565b6097546103e890600160b81b900460020b81565b60405161023d9190614f3e565b6102f5610403366004614f4c565b610cd6565b61041b610416366004614f4c565b610e31565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e6110ea565b61045a610455366004614f7c565b6110f9565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004614fc0565b611232565b6097546103e890600160a01b900460020b81565b61026e6104aa366004614e0d565b6113f2565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004614e0d565b61148d565b6102f56104e5366004615023565b61149a565b610233609b5481565b6102a6610501366004614f21565b61173d565b6102f5610514366004614f4c565b6117d5565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046150bc565b6118bb565b6097546102ff90600160f01b900461ffff1681565b61023361059a36600461510e565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b61023361191f565b6102f56105db3660046151f1565b61192e565b6102f56105ee3660046152b3565b611ba3565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f5610628366004614f21565b611cb0565b6102f561063b3660046150bc565b611d90565b61041b61064e366004614f4c565b611dfa565b606060368054610662906152d0565b80601f016020809104026020016040519081016040528092919081815260200182805461068e906152d0565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f2338484612114565b5060015b92915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610779919061530a565b50505050509150915061078c8282612239565b9350935050509091565b60006107a38484846124b9565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561082d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610841853361083c86856153b2565b612114565b60019150505b9392505050565b33610857610c71565b6001600160a01b03161461087d5760405162461bcd60e51b8152600401610824906153c5565b600080600061088b60355490565b1115610bca57609d546001600160a01b031663514ea4bf6108aa61267f565b6040518263ffffffff1660e01b81526004016108c891815260200190565b60a060405180830381865afa1580156108e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610909919061541e565b5092945050506001600160801b03831615905061099257609754600090819061094890600160a01b8104600290810b91600160b81b9004900b866126da565b9350935050506109588282612a0d565b6109628282612ae6565b6040519193509150600080516020615ce6833981519152906109879084908490614e4d565b60405180910390a150505b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a06903090600401614e39565b602060405180830381865afa158015610a23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a479190615475565b610a5191906153b2565b610a5b91906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610a97903090600401614e39565b602060405180830381865afa158015610ab4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad89190615475565b610ae291906153b2565b610aec91906153b2565b9050610afd898984848b8b8b612b80565b609d546001600160a01b031663514ea4bf610b1661267f565b6040518263ffffffff1660e01b8152600401610b3491815260200190565b60a060405180830381865afa158015610b51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b75919061541e565b509295505050506001600160801b038316610bc35760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610824565b5050610c06565b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615c8683398151915287878484604051610c29949392919061548e565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061083c9086906154bc565b6097546001600160a01b031690565b33610c89610c71565b6001600160a01b031614610caf5760405162461bcd60e51b8152600401610824906153c5565b60988054600160201b600160d01b031916905560006099819055609a55610cd4612d21565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d205760405162461bcd60e51b8152600401610824906154cf565b600080610d33609954609a548888612d88565b60006099819055609a5590925090508115610d6d57609854609e54610d6d916001600160a01b0391821691600160301b9091041684612eac565b8015610d9857609854609f54610d98916001600160a01b0391821691600160301b9091041683612eac565b505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601610df757610df26001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b610e2b565b610e2b6001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050565b6000806000600260655403610e585760405162461bcd60e51b815260040161082490615500565b600260655584610e7a5760405162461bcd60e51b815260040161082490615537565b6000610e8560355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610edc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f00919061530a565b50505050505090506000821115610f4157600080610f1c6106fc565b91509150610f2b828a8661302a565b9650610f38818a8661302a565b95505050610f87565b609754610f81908290610f5d90600160a01b900460020b613073565b609754610f7390600160b81b900460020b613073565b610f7c8b613488565b6134f1565b90955093505b8415610fa557609e54610fa5906001600160a01b031633308861358c565b8315610fc357609f54610fc3906001600160a01b031633308761358c565b609754610ffc908290610fdf90600160a01b900460020b613073565b609754610ff590600160b81b900460020b613073565b88886135c4565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d9161104c913091600160a01b8104600290810b92600160b81b909204900b908990600401615557565b60408051808303816000875af115801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190615599565b505061109a8688613686565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e786888787876040516110d19594939291906155bd565b60405180910390a1505060016065819055509250925092565b606060378054610662906152d0565b60008060008061110860355490565b905080156111275761111b818787613753565b9195509350915061122a565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611195919061530a565b505050505050905060006111db826111be609760149054906101000a900460020b60020b613073565b6097546111d490600160b81b900460020b613073565b8b8b6135c4565b6097546001600160801b038216955090915061122290839061120690600160a01b900460020b613073565b60975461121c90600160b81b900460020b613073565b846134f1565b909650945050505b509250925092565b3361123b610c71565b6001600160a01b0316146112615760405162461bcd60e51b8152600401610824906153c5565b6127108461ffff1611156112875760405162461bcd60e51b8152600401610824906155f4565b6127108561ffff1611156112ad5760405162461bcd60e51b8152600401610824906155f4565b6127108361ffff1611156112d35760405162461bcd60e51b8152600401610824906155f4565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff85161561134a576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff84161561136f576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561139557609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff8216156113b7576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156113eb5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156114745760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610824565b611483338561083c86856153b2565b5060019392505050565b60006106f23384846124b9565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114e45760405162461bcd60e51b8152600401610824906154cf565b85156114f4576114f48786613862565b609d546000906001600160a01b031663514ea4bf61151061267f565b6040518263ffffffff1660e01b815260040161152e91815260200190565b60a060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f919061541e565b505050509050611583818989898989613abb565b609d546000906001600160a01b031663514ea4bf61159f61267f565b6040518263ffffffff1660e01b81526004016115bd91815260200190565b60a060405180830381865afa1580156115da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fe919061541e565b505050509050816001600160801b0316816001600160801b03161161165f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610824565b609754604051600080516020615c868339815191529161169991600160a01b8204600290810b92600160b81b9004900b908690869061548e565b60405180910390a1505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601611700576116fb6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b611734565b6117346001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b9919061530a565b50505050509150506117cb8482612239565b9250925050915091565b8181336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461181f5760405162461bcd60e51b8152600401610824906154cf565b600080611832609b54609c548888612d88565b6000609b819055609c559092509050811561187e57609e5461187e906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084612eac565b8015610d9857609f54610d98906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083612eac565b609d546001600160a01b031633146118e55760405162461bcd60e51b815260040161082490615611565b831561190257609e54611902906001600160a01b03163386612eac565b8215610e2b57609f54610e2b906001600160a01b03163385612eac565b600061192961267f565b905090565b600054610100900460ff1680611947575060005460ff16155b6119635760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015611985576000805461ffff19166101011790555b6119926000612710615688565b61ffff168561ffff1611156119b95760405162461bcd60e51b8152600401610824906156aa565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe1681916004808201926020929091908290030181865afa158015611a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3691906156c8565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a79160048083019260209291908290030181865afa158015611a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab891906156c8565b609f80546001600160a01b039283166001600160a01b0319918216179091556098805460978054948716600160301b8102600160301b600160d01b031963ffffffff1961ffff8e16600160201b021665ffffffffffff199095169490941761012c17939093169290921790925562ffffff878116600160b81b02909316600165ffffff00000160a01b0319938916600160a01b02600165ffffff00000160a01b0390951694909417643e800c801960d31b179290921692909217179055611b7f8888613f83565b611b87614002565b8015611b99576000805461ff00191690555b5050505050505050565b33611bac610c71565b6001600160a01b031614611bd25760405162461bcd60e51b8152600401610824906153c5565b609854600160201b900461ffff1615611c135760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610824565b60008161ffff16118015611c3b5750611c2f6000612710615688565b61ffff168161ffff1611155b611c575760405162461bcd60e51b8152600401610824906156aa565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611cb9610c71565b6001600160a01b031614611cdf5760405162461bcd60e51b8152600401610824906153c5565b6001600160a01b038116611d465760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610824565b6097546040516001600160a01b03808416921690600080516020615ca683398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611dba5760405162461bcd60e51b815260040161082490615611565b6000841315611dda57609e54610df2906001600160a01b03163386612eac565b6000831315610e2b57609f54610e2b906001600160a01b03163385612eac565b6000806000600260655403611e215760405162461bcd60e51b815260040161082490615500565b600260655584611e5c5760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610824565b6000611e6760355490565b609d549091506000906001600160a01b031663514ea4bf611e8661267f565b6040518263ffffffff1660e01b8152600401611ea491815260200190565b60a060405180830381865afa158015611ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee5919061541e565b505050509050611ef53388614076565b6000611f0b88836001600160801b0316856141b3565b9050611f1681613488565b609754909450600090819081908190611f4590600160a01b8104600290810b91600160b81b9004900b8a6126da565b9350935093509350611f578282612a0d565b611f618282612ae6565b6040519193509150600080516020615ce683398151915290611f869084908490614e4d565b60405180910390a1609b54609954609e546040516370a0823160e01b815261203293929188916001600160a01b03909116906370a0823190611fcc903090600401614e39565b602060405180830381865afa158015611fe9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200d9190615475565b61201791906153b2565b61202191906153b2565b61202b91906153b2565b8d896141b3565b61203c90856154bc565b609c54609a54609f546040516370a0823160e01b8152939d506120799387916001600160a01b0316906370a0823190611fcc903090600401614e39565b61208390846154bc565b985089156120a257609e546120a2906001600160a01b03168c8c612eac565b88156120bf57609f546120bf906001600160a01b03168c8b612eac565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516120f69594939291906155bd565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166121765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610824565b6001600160a01b0382166121d75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610824565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61226161267f565b6040518263ffffffff1660e01b815260040161227f91815260200190565b60a060405180830381865afa15801561229c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c0919061541e565b94509450945094509450612305896122e9609760149054906101000a900460020b60020b613073565b6097546122ff90600160b81b900460020b613073565b886134f1565b909750955060006001600160801b0383166123236001878c8a614261565b61232d91906154bc565b90506000826001600160801b03166123486000878d8b614261565b61235291906154bc565b905061235e8282612ae6565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a082319061239c903090600401614e39565b602060405180830381865afa1580156123b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dd9190615475565b6123e790856154bc565b6123f191906153b2565b6123fb91906153b2565b612405908a6154bc565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a0823190612440903090600401614e39565b602060405180830381865afa15801561245d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124819190615475565b61248b90846154bc565b61249591906153b2565b61249f91906153b2565b6124a990896154bc565b9750505050505050509250929050565b6001600160a01b03831661251d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610824565b6001600160a01b03821661257f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610824565b6001600160a01b038316600090815260336020526040902054818110156125f75760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610824565b61260182826153b2565b6001600160a01b0380861660009081526033602052604080822093909355908516815290812080548492906126379084906154bc565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615cc68339815191528460405161267191815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b820460e890811b6034830152600160b81b90920490911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a0823190612713903090600401614e39565b602060405180830381865afa158015612730573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127549190615475565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061278a903090600401614e39565b602060405180830381865afa1580156127a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cb9190615475565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a79060640160408051808303816000875af1158015612830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128549190615599565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a40160408051808303816000875af11580156128c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128eb91906156e5565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612921903090600401614e39565b602060405180830381865afa15801561293e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129629190615475565b61296c91906153b2565b61297691906153b2565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a08231906129ab903090600401614e39565b602060405180830381865afa1580156129c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ec9190615475565b6129f691906153b2565b612a0091906153b2565b9250505093509350935093565b612710612a1b600084615718565b612a259190615745565b609b6000828254612a3691906154bc565b909155506127109050612a4a600083615718565b612a549190615745565b609c6000828254612a6591906154bc565b909155505060985461271090612a8690600160201b900461ffff1684615718565b612a909190615745565b60996000828254612aa191906154bc565b909155505060985461271090612ac290600160201b900461ffff1683615718565b612acc9190615745565b609a6000828254612add91906154bc565b90915550505050565b6000806000612710609860049054906101000a900461ffff166000612b0b9190615759565b612b199061ffff1687615718565b612b239190615745565b60985490915060009061271090612b4590600160201b900461ffff1683615759565b612b539061ffff1687615718565b612b5d9190615745565b9050612b6982876153b2565b9350612b7581866153b2565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015612bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bee919061530a565b50505050505090506000612c1b82612c088b60020b613073565b612c148b60020b613073565b8a8a6135c4565b90506001600160801b03811615612cc957609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612c679030908f908f908990600401615557565b60408051808303816000875af1158015612c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ca99190615599565b9092509050612cb8828a6153b2565b9850612cc481896153b2565b975050505b6000612cf86127108686612cdd5789612cdf565b8a5b612ce99190615718565b612cf39190615745565b61460d565b90506000811315612d1557612d128a8a8a8a858b8a614673565b50505b50505050505050505050565b33612d2a610c71565b6001600160a01b031614612d505760405162461bcd60e51b8152600401610824906153c5565b6097546040516000916001600160a01b031690600080516020615ca6833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0390811690841603612dfd57609754849061271090612dc190600160e01b900461ffff1689615718565b612dcb9190615745565b1015612de95760405162461bcd60e51b815260040161082490615774565b612df384876153b2565b9150849050612ea3565b609f546001600160a01b0390811690841603612e6d57609754849061271090612e3190600160e01b900461ffff1688615718565b612e3b9190615745565b1015612e595760405162461bcd60e51b815260040161082490615774565b612e6384866153b2565b9050859150612ea3565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610824565b94509492505050565b6040516001600160a01b038316602482015260448101829052612f0f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261488f565b505050565b80471015612f645760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610824565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612fb1576040519150601f19603f3d011682016040523d82523d6000602084013e612fb6565b606091505b5050905080612f0f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610824565b60006130378484846141b3565b9050600082806130495761304961572f565b848609111561084757600019811061306057600080fd5b8061306a81615796565b95945050505050565b60008060008360020b1261308a578260020b613097565b8260020b613097906157af565b90506130a6620d89e7196157cb565b60020b8111156130dc5760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610824565b6000816001166000036130f357600160801b613105565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561313a576080613135826ffff97272373d413259a46990580e213a615718565b901c90505b600482161561316457608061315f826ffff2e50f5f656932ef12357cf3c7fdcc615718565b901c90505b600882161561318e576080613189826fffe5caca7e10e4e61c3624eaa0941cd0615718565b901c90505b60108216156131b85760806131b3826fffcb9843d60f6159c9db58835c926644615718565b901c90505b60208216156131e25760806131dd826fff973b41fa98c081472e6896dfb254c0615718565b901c90505b604082161561320c576080613207826fff2ea16466c96a3843ec78b326b52861615718565b901c90505b6080821615613236576080613231826ffe5dee046a99a2a811c461f1969c3053615718565b901c90505b61010082161561326157608061325c826ffcbe86c7900a88aedcffc83b479aa3a4615718565b901c90505b61020082161561328c576080613287826ff987a7253ac413176f2b074cf7815e54615718565b901c90505b6104008216156132b75760806132b2826ff3392b0822b70005940c7a398e4b70f3615718565b901c90505b6108008216156132e25760806132dd826fe7159475a2c29b7443b29c7fa6e889d9615718565b901c90505b61100082161561330d576080613308826fd097f3bdfd2022b8845ad8f792aa5825615718565b901c90505b612000821615613338576080613333826fa9f746462d870fdf8a65dc1f90e061e5615718565b901c90505b61400082161561336357608061335e826f70d869a156d2a1b890bb3df62baf32f7615718565b901c90505b61800082161561338e576080613389826f31be135f97d08fd981231505542fcfa6615718565b901c90505b620100008216156133ba5760806133b5826f09aa508b5b7a84e1c677de54f3e99bc9615718565b901c90505b620200008216156133e55760806133e0826e5d6af8dedb81196699c329225ee604615718565b901c90505b6204000082161561340f57608061340a826d2216e584f5fa1ea926041bedfe98615718565b901c90505b62080000821615613437576080613432826b048a170391f7dc42444e8fa2615718565b901c90505b60008460020b13156134525761344f81600019615745565b90505b613460600160201b826157ed565b1561346c57600161346f565b60005b6134809060ff16602083901c6154bc565b949350505050565b6000600160801b82106134ed5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610824565b5090565b600080836001600160a01b0316856001600160a01b03161115613512579293925b846001600160a01b0316866001600160a01b03161161353d57613536858585614961565b9150612ea3565b836001600160a01b0316866001600160a01b0316101561357657613562868585614961565b915061356f8587856149cb565b9050612ea3565b6135818585856149cb565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e2b9085906323b872dd60e01b90608401612ed8565b6000836001600160a01b0316856001600160a01b031611156135e4579293925b846001600160a01b0316866001600160a01b03161161360f57613608858585614a15565b905061306a565b836001600160a01b0316866001600160a01b03161015613671576000613636878686614a15565b90506000613645878986614a7f565b9050806001600160801b0316826001600160801b0316106136665780613668565b815b9250505061306a565b61367c858584614a7f565b9695505050505050565b6001600160a01b0382166136dc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610824565b80603560008282546136ee91906154bc565b90915550506001600160a01b0382166000908152603360205260408120805483929061371b9084906154bc565b90915550506040518181526001600160a01b03831690600090600080516020615cc68339815191529060200160405180910390a35050565b60008060008060006137636106fc565b915091508160001480156137775750600081115b1561378e576137878689836141b3565b925061383d565b8015801561379c5750600082115b156137ac576137878789846141b3565b811580156137b8575080155b156137df5760405162461bcd60e51b81526020600482015260006024820152604401610824565b60006137ec888a856141b3565b905060006137fb888b856141b3565b905060008211801561380d5750600081115b6138295760405162461bcd60e51b815260040161082490615537565b8082106138365780613838565b815b945050505b61384883838a61302a565b945061385583828a61302a565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff16918391506000906138a0576138a0615801565b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106138cf576138cf615801565b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613915908590600401615817565b600060405180830381865afa158015613932573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261395a919081019061590a565b509050805160021461399a5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610824565b6098548151600091829163ffffffff90911660060b90849083906139c0576139c0615801565b6020026020010151846001815181106139db576139db615801565b60200260200101510360060b816139f4576139f461572f565b059050613a038160020b613073565b6097549092506000915061271090613a2690600160f01b900461ffff16846159cc565b613a3091906159fe565b90508415613a7857613a428183615a24565b6001600160a01b0316866001600160a01b03161015613a735760405162461bcd60e51b815260040161082490615a44565b613ab3565b613a828183615a6b565b6001600160a01b0316866001600160a01b03161115613ab35760405162461bcd60e51b815260040161082490615a44565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613af4903090600401614e39565b602060405180830381865afa158015613b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b359190615475565b613b3f91906153b2565b613b4991906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613b85903090600401614e39565b602060405180830381865afa158015613ba2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bc69190615475565b613bd091906153b2565b613bda91906153b2565b6097549091506000908190613c0590600160a01b8104600290810b91600160b81b9004900b8c6126da565b935093505050613c158282612a0d565b613c1f8282612ae6565b6040519193509150600080516020615ce683398151915290613c449084908490614e4d565b60405180910390a1613c5684836154bc565b9150613c6283826154bc565b609e549091506001600160a01b0390811690861603613def57609754869061271090613c9990600160d01b900461ffff1685615718565b613ca39190615745565b1015613cc15760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613cf9903090600401614e39565b602060405180830381865afa158015613d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d3a9190615475565b613d4491906153b2565b613d4e91906153b2565b613d5891906153b2565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613d93903090600401614e39565b602060405180830381865afa158015613db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dd49190615475565b613dde91906153b2565b613de891906153b2565b9250613f5c565b609f546001600160a01b0390811690861603612e6d57609754869061271090613e2390600160d01b900461ffff1684615718565b613e2d9190615745565b1015613e4b5760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a0823190613e81903090600401614e39565b602060405180830381865afa158015613e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ec29190615475565b613ecc91906153b2565b613ed691906153b2565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a0823190613f11903090600401614e39565b602060405180830381865afa158015613f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f529190615475565b613dd491906153b2565b609754612d1590600160a01b8104600290810b91600160b81b9004900b86868d8d8d612b80565b600054610100900460ff1680613f9c575060005460ff16155b613fb85760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015613fda576000805461ffff19166101011790555b613fe2614ab5565b613fec8383614b1f565b8015612f0f576000805461ff0019169055505050565b600054610100900460ff168061401b575060005460ff16155b6140375760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614059576000805461ffff19166101011790555b614061614ba6565b8015614073576000805461ff00191690555b50565b6001600160a01b0382166140d65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610824565b6001600160a01b0382166000908152603360205260409020548181101561414a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610824565b61415482826153b2565b6001600160a01b038416600090815260336020526040812091909155603580548492906141829084906153b2565b90915550506040518281526000906001600160a01b03851690600080516020615cc68339815191529060200161222c565b60008080600019858709858702925082811083820303915050806000036141ec57600084116141e157600080fd5b508290049050610847565b8084116141f857600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600080871561440157609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b8152600401602060405180830381865afa1580156142c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142e49190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161432491600160a01b90910460020b90600401614f3e565b61010060405180830381865afa158015614342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143669190615a8b565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba9395506143af94600160b81b90910460020b93506004019150614f3e9050565b61010060405180830381865afa1580156143cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143f19190615a8b565b5093975061458f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b8152600401602060405180830381865afa158015614454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144789190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916144b891600160a01b90910460020b90600401614f3e565b61010060405180830381865afa1580156144d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144fa9190615a8b565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506145429450600160b81b900460020b926004019150614f3e9050565b61010060405180830381865afa158015614560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145849190615a8b565b509297505050505050505b609754600090600160a01b9004600290810b9088900b126145b15750826145b6565b508281035b609754600090600160b81b9004600290810b9089900b12156145d95750826145de565b508282035b8183038190036145fe6001600160801b0389168b8303600160801b6141b3565b9b9a5050505050505050505050565b6000600160ff1b82106134ed5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610824565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c40160408051808303816000875af11580156146e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061470c9190615599565b915091508161471a8a61460d565b6147249190615b27565b9350806147308961460d565b61473a9190615b27565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015614791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b5919061530a565b505050505050905060006147e2826147cf8f60020b613073565b6147db8f60020b613073565b89896135c4565b90506001600160801b0381161561487f57609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b815260040161483a9493929190615557565b60408051808303816000875af1158015614858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061487c9190615599565b50505b5050505097509795505050505050565b60006148e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c169092919063ffffffff16565b805190915015612f0f57808060200190518101906149029190615b47565b612f0f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610824565b6000826001600160a01b0316846001600160a01b03161115614981579192915b6001600160a01b0384166149c1600160601b600160e01b03606085901b166149a98787615a24565b6001600160a01b0316866001600160a01b03166141b3565b6134809190615745565b6000826001600160a01b0316846001600160a01b031611156149eb579192915b6134806001600160801b038316614a028686615a24565b6001600160a01b0316600160601b6141b3565b6000826001600160a01b0316846001600160a01b03161115614a35579192915b6000614a58856001600160a01b0316856001600160a01b0316600160601b6141b3565b905061306a614a7a8483614a6c8989615a24565b6001600160a01b03166141b3565b614c25565b6000826001600160a01b0316846001600160a01b03161115614a9f579192915b613480614a7a83600160601b614a6c8888615a24565b600054610100900460ff1680614ace575060005460ff16155b614aea5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614061576000805461ffff19166101011790558015614073576000805461ff001916905550565b600054610100900460ff1680614b38575060005460ff16155b614b545760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614b76576000805461ffff19166101011790555b6036614b828482615baa565b506037614b8f8382615baa565b508015612f0f576000805461ff0019169055505050565b600054610100900460ff1680614bbf575060005460ff16155b614bdb5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614bfd576000805461ffff19166101011790555b60016065558015614073576000805461ff001916905550565b60606134808484600085614c40565b806001600160801b0381168114614c3b57600080fd5b919050565b606082471015614ca15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610824565b843b614cef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610824565b600080866001600160a01b03168587604051614d0b9190615c69565b60006040518083038185875af1925050503d8060008114614d48576040519150601f19603f3d011682016040523d82523d6000602084013e614d4d565b606091505b5091509150614d5d828286614d68565b979650505050505050565b60608315614d77575081610847565b825115614d875782518084602001fd5b8160405162461bcd60e51b81526004016108249190614dc5565b60005b83811015614dbc578181015183820152602001614da4565b50506000910152565b6020815260008251806020840152614de4816040850160208701614da1565b601f01601f19169190910160400192915050565b6001600160a01b038116811461407357600080fd5b60008060408385031215614e2057600080fd5b8235614e2b81614df8565b946020939093013593505050565b6001600160a01b0391909116815260200190565b918252602082015260400190565b600080600060608486031215614e7057600080fd5b8335614e7b81614df8565b92506020840135614e8b81614df8565b929592945050506040919091013590565b8060020b811461407357600080fd5b801515811461407357600080fd5b600080600080600060a08688031215614ed157600080fd5b8535614edc81614e9c565b94506020860135614eec81614e9c565b93506040860135614efc81614df8565b9250606086013591506080860135614f1381614eab565b809150509295509295909350565b600060208284031215614f3357600080fd5b813561084781614df8565b60029190910b815260200190565b60008060408385031215614f5f57600080fd5b823591506020830135614f7181614df8565b809150509250929050565b60008060408385031215614f8f57600080fd5b50508035926020909101359150565b61ffff8116811461407357600080fd5b63ffffffff8116811461407357600080fd5b600080600080600060a08688031215614fd857600080fd5b8535614fe381614f9e565b94506020860135614ff381614f9e565b9350604086013561500381614f9e565b9250606086013561501381614fae565b91506080860135614f1381614df8565b600080600080600060a0868803121561503b57600080fd5b853561504681614df8565b945060208601359350604086013561505d81614eab565b9250606086013591506080860135614f1381614df8565b60008083601f84011261508657600080fd5b5081356001600160401b0381111561509d57600080fd5b6020830191508360208285010111156150b557600080fd5b9250929050565b600080600080606085870312156150d257600080fd5b843593506020850135925060408501356001600160401b038111156150f657600080fd5b61510287828801615074565b95989497509550505050565b6000806040838503121561512157600080fd5b823561512c81614df8565b91506020830135614f7181614df8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561517a5761517a61513c565b604052919050565b600082601f83011261519357600080fd5b81356001600160401b038111156151ac576151ac61513c565b6151bf601f8201601f1916602001615152565b8181528460208386010111156151d457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060e0888a03121561520c57600080fd5b87356001600160401b038082111561522357600080fd5b61522f8b838c01615182565b985060208a013591508082111561524557600080fd5b506152528a828b01615182565b965050604088013561526381614df8565b9450606088013561527381614f9e565b9350608088013561528381614e9c565b925060a088013561529381614e9c565b915060c08801356152a381614df8565b8091505092959891949750929550565b6000602082840312156152c557600080fd5b813561084781614f9e565b600181811c908216806152e457607f821691505b60208210810361530457634e487b7160e01b600052602260045260246000fd5b50919050565b600080600080600080600060e0888a03121561532557600080fd5b875161533081614df8565b602089015190975061534181614e9c565b604089015190965061535281614f9e565b606089015190955061536381614f9e565b608089015190945061537481614f9e565b60a089015190935060ff8116811461538b57600080fd5b60c08901519092506152a381614eab565b634e487b7160e01b600052601160045260246000fd5b818103818111156106f6576106f661539c565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b80516001600160801b0381168114614c3b57600080fd5b600080600080600060a0868803121561543657600080fd5b61543f86615407565b9450602086015193506040860151925061545b60608701615407565b915061546960808701615407565b90509295509295909350565b60006020828403121561548757600080fd5b5051919050565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b808201808211156106f6576106f661539c565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b600080604083850312156155ac57600080fd5b505080516020909101519092909150565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b60208082526003908201526242505360e81b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b61ffff8281168282160390808211156156a3576156a361539c565b5092915050565b6020808252600490820152636d42505360e01b604082015260600190565b6000602082840312156156da57600080fd5b815161084781614df8565b600080604083850312156156f857600080fd5b61570183615407565b915061570f60208401615407565b90509250929050565b80820281158282048414176106f6576106f661539c565b634e487b7160e01b600052601260045260246000fd5b6000826157545761575461572f565b500490565b61ffff8181168382160190808211156156a3576156a361539c565b602080825260089082015267686967682066656560c01b604082015260600190565b6000600182016157a8576157a861539c565b5060010190565b6000600160ff1b82016157c4576157c461539c565b5060000390565b60008160020b627fffff1981036157e4576157e461539c565b60000392915050565b6000826157fc576157fc61572f565b500690565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561585557835163ffffffff1683529284019291840191600101615833565b50909695505050505050565b60006001600160401b0382111561587a5761587a61513c565b5060051b60200190565b8051600681900b8114614c3b57600080fd5b600082601f8301126158a757600080fd5b815160206158bc6158b783615861565b615152565b82815260059290921b840181019181810190868411156158db57600080fd5b8286015b848110156158ff5780516158f281614df8565b83529183019183016158df565b509695505050505050565b6000806040838503121561591d57600080fd5b82516001600160401b038082111561593457600080fd5b818501915085601f83011261594857600080fd5b815160206159586158b783615861565b82815260059290921b8401810191818101908984111561597757600080fd5b948201945b8386101561599c5761598d86615884565b8252948201949082019061597c565b918801519196509093505050808211156159b557600080fd5b506159c285828601615896565b9150509250929050565b6001600160a01b038281168282168181028316929181158285048214176159f5576159f561539c565b50505092915050565b60006001600160a01b0383811680615a1857615a1861572f565b92169190910492915050565b6001600160a01b038281168282160390808211156156a3576156a361539c565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b6001600160a01b038181168382160190808211156156a3576156a361539c565b600080600080600080600080610100898b031215615aa857600080fd5b615ab189615407565b9750602089015180600f0b8114615ac757600080fd5b60408a015160608b015191985096509450615ae460808a01615884565b935060a0890151615af481614df8565b60c08a0151909350615b0581614fae565b60e08a0151909250615b1681614eab565b809150509295985092959890939650565b81810360008312801583831316838312821617156156a3576156a361539c565b600060208284031215615b5957600080fd5b815161084781614eab565b601f821115612f0f57600081815260208120601f850160051c81016020861015615b8b5750805b601f850160051c820191505b81811015613ab357828155600101615b97565b81516001600160401b03811115615bc357615bc361513c565b615bd781615bd184546152d0565b84615b64565b602080601f831160018114615c0c5760008415615bf45750858301515b600019600386901b1c1916600185901b178555613ab3565b600085815260208120601f198616915b82811015615c3b57888601518255948401946001909101908401615c1c565b5085821015615c595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251615c7b818460208701614da1565b919091019291505056fec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a2646970667358221220a11bde499516b0a2e8e737821292815fcefc66549a9729f24ea128d34ed6027364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190614dc5565b61026e610269366004614e0d565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d9190614e39565b6102a66106fc565b60405161023d929190614e4d565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004614e5b565b610796565b6102f56102f0366004614eb9565b61084e565b005b6102ff600081565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004614e0d565b610c3a565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610c71565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b1366004614f21565b6001600160a01b031660009081526033602052604090205490565b6102f5610c80565b6097546103e890600160b81b900460020b81565b60405161023d9190614f3e565b6102f5610403366004614f4c565b610cd6565b61041b610416366004614f4c565b610e31565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e6110ea565b61045a610455366004614f7c565b6110f9565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004614fc0565b611232565b6097546103e890600160a01b900460020b81565b61026e6104aa366004614e0d565b6113f2565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004614e0d565b61148d565b6102f56104e5366004615023565b61149a565b610233609b5481565b6102a6610501366004614f21565b61173d565b6102f5610514366004614f4c565b6117d5565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046150bc565b6118bb565b6097546102ff90600160f01b900461ffff1681565b61023361059a36600461510e565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b61023361191f565b6102f56105db3660046151f1565b61192e565b6102f56105ee3660046152b3565b611ba3565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f5610628366004614f21565b611cb0565b6102f561063b3660046150bc565b611d90565b61041b61064e366004614f4c565b611dfa565b606060368054610662906152d0565b80601f016020809104026020016040519081016040528092919081815260200182805461068e906152d0565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f2338484612114565b5060015b92915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610779919061530a565b50505050509150915061078c8282612239565b9350935050509091565b60006107a38484846124b9565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561082d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610841853361083c86856153b2565b612114565b60019150505b9392505050565b33610857610c71565b6001600160a01b03161461087d5760405162461bcd60e51b8152600401610824906153c5565b600080600061088b60355490565b1115610bca57609d546001600160a01b031663514ea4bf6108aa61267f565b6040518263ffffffff1660e01b81526004016108c891815260200190565b60a060405180830381865afa1580156108e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610909919061541e565b5092945050506001600160801b03831615905061099257609754600090819061094890600160a01b8104600290810b91600160b81b9004900b866126da565b9350935050506109588282612a0d565b6109628282612ae6565b6040519193509150600080516020615ce6833981519152906109879084908490614e4d565b60405180910390a150505b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a06903090600401614e39565b602060405180830381865afa158015610a23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a479190615475565b610a5191906153b2565b610a5b91906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610a97903090600401614e39565b602060405180830381865afa158015610ab4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad89190615475565b610ae291906153b2565b610aec91906153b2565b9050610afd898984848b8b8b612b80565b609d546001600160a01b031663514ea4bf610b1661267f565b6040518263ffffffff1660e01b8152600401610b3491815260200190565b60a060405180830381865afa158015610b51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b75919061541e565b509295505050506001600160801b038316610bc35760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610824565b5050610c06565b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615c8683398151915287878484604051610c29949392919061548e565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061083c9086906154bc565b6097546001600160a01b031690565b33610c89610c71565b6001600160a01b031614610caf5760405162461bcd60e51b8152600401610824906153c5565b60988054600160201b600160d01b031916905560006099819055609a55610cd4612d21565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d205760405162461bcd60e51b8152600401610824906154cf565b600080610d33609954609a548888612d88565b60006099819055609a5590925090508115610d6d57609854609e54610d6d916001600160a01b0391821691600160301b9091041684612eac565b8015610d9857609854609f54610d98916001600160a01b0391821691600160301b9091041683612eac565b505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601610df757610df26001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b610e2b565b610e2b6001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050565b6000806000600260655403610e585760405162461bcd60e51b815260040161082490615500565b600260655584610e7a5760405162461bcd60e51b815260040161082490615537565b6000610e8560355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610edc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f00919061530a565b50505050505090506000821115610f4157600080610f1c6106fc565b91509150610f2b828a8661302a565b9650610f38818a8661302a565b95505050610f87565b609754610f81908290610f5d90600160a01b900460020b613073565b609754610f7390600160b81b900460020b613073565b610f7c8b613488565b6134f1565b90955093505b8415610fa557609e54610fa5906001600160a01b031633308861358c565b8315610fc357609f54610fc3906001600160a01b031633308761358c565b609754610ffc908290610fdf90600160a01b900460020b613073565b609754610ff590600160b81b900460020b613073565b88886135c4565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d9161104c913091600160a01b8104600290810b92600160b81b909204900b908990600401615557565b60408051808303816000875af115801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190615599565b505061109a8688613686565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e786888787876040516110d19594939291906155bd565b60405180910390a1505060016065819055509250925092565b606060378054610662906152d0565b60008060008061110860355490565b905080156111275761111b818787613753565b9195509350915061122a565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611195919061530a565b505050505050905060006111db826111be609760149054906101000a900460020b60020b613073565b6097546111d490600160b81b900460020b613073565b8b8b6135c4565b6097546001600160801b038216955090915061122290839061120690600160a01b900460020b613073565b60975461121c90600160b81b900460020b613073565b846134f1565b909650945050505b509250925092565b3361123b610c71565b6001600160a01b0316146112615760405162461bcd60e51b8152600401610824906153c5565b6127108461ffff1611156112875760405162461bcd60e51b8152600401610824906155f4565b6127108561ffff1611156112ad5760405162461bcd60e51b8152600401610824906155f4565b6127108361ffff1611156112d35760405162461bcd60e51b8152600401610824906155f4565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff85161561134a576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff84161561136f576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561139557609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff8216156113b7576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156113eb5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156114745760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610824565b611483338561083c86856153b2565b5060019392505050565b60006106f23384846124b9565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114e45760405162461bcd60e51b8152600401610824906154cf565b85156114f4576114f48786613862565b609d546000906001600160a01b031663514ea4bf61151061267f565b6040518263ffffffff1660e01b815260040161152e91815260200190565b60a060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f919061541e565b505050509050611583818989898989613abb565b609d546000906001600160a01b031663514ea4bf61159f61267f565b6040518263ffffffff1660e01b81526004016115bd91815260200190565b60a060405180830381865afa1580156115da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fe919061541e565b505050509050816001600160801b0316816001600160801b03161161165f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610824565b609754604051600080516020615c868339815191529161169991600160a01b8204600290810b92600160b81b9004900b908690869061548e565b60405180910390a1505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601611700576116fb6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b611734565b6117346001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b9919061530a565b50505050509150506117cb8482612239565b9250925050915091565b8181336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461181f5760405162461bcd60e51b8152600401610824906154cf565b600080611832609b54609c548888612d88565b6000609b819055609c559092509050811561187e57609e5461187e906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084612eac565b8015610d9857609f54610d98906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083612eac565b609d546001600160a01b031633146118e55760405162461bcd60e51b815260040161082490615611565b831561190257609e54611902906001600160a01b03163386612eac565b8215610e2b57609f54610e2b906001600160a01b03163385612eac565b600061192961267f565b905090565b600054610100900460ff1680611947575060005460ff16155b6119635760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015611985576000805461ffff19166101011790555b6119926000612710615688565b61ffff168561ffff1611156119b95760405162461bcd60e51b8152600401610824906156aa565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe1681916004808201926020929091908290030181865afa158015611a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3691906156c8565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a79160048083019260209291908290030181865afa158015611a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab891906156c8565b609f80546001600160a01b039283166001600160a01b0319918216179091556098805460978054948716600160301b8102600160301b600160d01b031963ffffffff1961ffff8e16600160201b021665ffffffffffff199095169490941761012c17939093169290921790925562ffffff878116600160b81b02909316600165ffffff00000160a01b0319938916600160a01b02600165ffffff00000160a01b0390951694909417643e800c801960d31b179290921692909217179055611b7f8888613f83565b611b87614002565b8015611b99576000805461ff00191690555b5050505050505050565b33611bac610c71565b6001600160a01b031614611bd25760405162461bcd60e51b8152600401610824906153c5565b609854600160201b900461ffff1615611c135760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610824565b60008161ffff16118015611c3b5750611c2f6000612710615688565b61ffff168161ffff1611155b611c575760405162461bcd60e51b8152600401610824906156aa565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611cb9610c71565b6001600160a01b031614611cdf5760405162461bcd60e51b8152600401610824906153c5565b6001600160a01b038116611d465760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610824565b6097546040516001600160a01b03808416921690600080516020615ca683398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611dba5760405162461bcd60e51b815260040161082490615611565b6000841315611dda57609e54610df2906001600160a01b03163386612eac565b6000831315610e2b57609f54610e2b906001600160a01b03163385612eac565b6000806000600260655403611e215760405162461bcd60e51b815260040161082490615500565b600260655584611e5c5760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610824565b6000611e6760355490565b609d549091506000906001600160a01b031663514ea4bf611e8661267f565b6040518263ffffffff1660e01b8152600401611ea491815260200190565b60a060405180830381865afa158015611ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee5919061541e565b505050509050611ef53388614076565b6000611f0b88836001600160801b0316856141b3565b9050611f1681613488565b609754909450600090819081908190611f4590600160a01b8104600290810b91600160b81b9004900b8a6126da565b9350935093509350611f578282612a0d565b611f618282612ae6565b6040519193509150600080516020615ce683398151915290611f869084908490614e4d565b60405180910390a1609b54609954609e546040516370a0823160e01b815261203293929188916001600160a01b03909116906370a0823190611fcc903090600401614e39565b602060405180830381865afa158015611fe9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200d9190615475565b61201791906153b2565b61202191906153b2565b61202b91906153b2565b8d896141b3565b61203c90856154bc565b609c54609a54609f546040516370a0823160e01b8152939d506120799387916001600160a01b0316906370a0823190611fcc903090600401614e39565b61208390846154bc565b985089156120a257609e546120a2906001600160a01b03168c8c612eac565b88156120bf57609f546120bf906001600160a01b03168c8b612eac565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516120f69594939291906155bd565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166121765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610824565b6001600160a01b0382166121d75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610824565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61226161267f565b6040518263ffffffff1660e01b815260040161227f91815260200190565b60a060405180830381865afa15801561229c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c0919061541e565b94509450945094509450612305896122e9609760149054906101000a900460020b60020b613073565b6097546122ff90600160b81b900460020b613073565b886134f1565b909750955060006001600160801b0383166123236001878c8a614261565b61232d91906154bc565b90506000826001600160801b03166123486000878d8b614261565b61235291906154bc565b905061235e8282612ae6565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a082319061239c903090600401614e39565b602060405180830381865afa1580156123b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dd9190615475565b6123e790856154bc565b6123f191906153b2565b6123fb91906153b2565b612405908a6154bc565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a0823190612440903090600401614e39565b602060405180830381865afa15801561245d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124819190615475565b61248b90846154bc565b61249591906153b2565b61249f91906153b2565b6124a990896154bc565b9750505050505050509250929050565b6001600160a01b03831661251d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610824565b6001600160a01b03821661257f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610824565b6001600160a01b038316600090815260336020526040902054818110156125f75760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610824565b61260182826153b2565b6001600160a01b0380861660009081526033602052604080822093909355908516815290812080548492906126379084906154bc565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615cc68339815191528460405161267191815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b820460e890811b6034830152600160b81b90920490911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a0823190612713903090600401614e39565b602060405180830381865afa158015612730573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127549190615475565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061278a903090600401614e39565b602060405180830381865afa1580156127a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cb9190615475565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a79060640160408051808303816000875af1158015612830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128549190615599565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a40160408051808303816000875af11580156128c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128eb91906156e5565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612921903090600401614e39565b602060405180830381865afa15801561293e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129629190615475565b61296c91906153b2565b61297691906153b2565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a08231906129ab903090600401614e39565b602060405180830381865afa1580156129c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ec9190615475565b6129f691906153b2565b612a0091906153b2565b9250505093509350935093565b612710612a1b600084615718565b612a259190615745565b609b6000828254612a3691906154bc565b909155506127109050612a4a600083615718565b612a549190615745565b609c6000828254612a6591906154bc565b909155505060985461271090612a8690600160201b900461ffff1684615718565b612a909190615745565b60996000828254612aa191906154bc565b909155505060985461271090612ac290600160201b900461ffff1683615718565b612acc9190615745565b609a6000828254612add91906154bc565b90915550505050565b6000806000612710609860049054906101000a900461ffff166000612b0b9190615759565b612b199061ffff1687615718565b612b239190615745565b60985490915060009061271090612b4590600160201b900461ffff1683615759565b612b539061ffff1687615718565b612b5d9190615745565b9050612b6982876153b2565b9350612b7581866153b2565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015612bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bee919061530a565b50505050505090506000612c1b82612c088b60020b613073565b612c148b60020b613073565b8a8a6135c4565b90506001600160801b03811615612cc957609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612c679030908f908f908990600401615557565b60408051808303816000875af1158015612c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ca99190615599565b9092509050612cb8828a6153b2565b9850612cc481896153b2565b975050505b6000612cf86127108686612cdd5789612cdf565b8a5b612ce99190615718565b612cf39190615745565b61460d565b90506000811315612d1557612d128a8a8a8a858b8a614673565b50505b50505050505050505050565b33612d2a610c71565b6001600160a01b031614612d505760405162461bcd60e51b8152600401610824906153c5565b6097546040516000916001600160a01b031690600080516020615ca6833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0390811690841603612dfd57609754849061271090612dc190600160e01b900461ffff1689615718565b612dcb9190615745565b1015612de95760405162461bcd60e51b815260040161082490615774565b612df384876153b2565b9150849050612ea3565b609f546001600160a01b0390811690841603612e6d57609754849061271090612e3190600160e01b900461ffff1688615718565b612e3b9190615745565b1015612e595760405162461bcd60e51b815260040161082490615774565b612e6384866153b2565b9050859150612ea3565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610824565b94509492505050565b6040516001600160a01b038316602482015260448101829052612f0f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261488f565b505050565b80471015612f645760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610824565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612fb1576040519150601f19603f3d011682016040523d82523d6000602084013e612fb6565b606091505b5050905080612f0f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610824565b60006130378484846141b3565b9050600082806130495761304961572f565b848609111561084757600019811061306057600080fd5b8061306a81615796565b95945050505050565b60008060008360020b1261308a578260020b613097565b8260020b613097906157af565b90506130a6620d89e7196157cb565b60020b8111156130dc5760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610824565b6000816001166000036130f357600160801b613105565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561313a576080613135826ffff97272373d413259a46990580e213a615718565b901c90505b600482161561316457608061315f826ffff2e50f5f656932ef12357cf3c7fdcc615718565b901c90505b600882161561318e576080613189826fffe5caca7e10e4e61c3624eaa0941cd0615718565b901c90505b60108216156131b85760806131b3826fffcb9843d60f6159c9db58835c926644615718565b901c90505b60208216156131e25760806131dd826fff973b41fa98c081472e6896dfb254c0615718565b901c90505b604082161561320c576080613207826fff2ea16466c96a3843ec78b326b52861615718565b901c90505b6080821615613236576080613231826ffe5dee046a99a2a811c461f1969c3053615718565b901c90505b61010082161561326157608061325c826ffcbe86c7900a88aedcffc83b479aa3a4615718565b901c90505b61020082161561328c576080613287826ff987a7253ac413176f2b074cf7815e54615718565b901c90505b6104008216156132b75760806132b2826ff3392b0822b70005940c7a398e4b70f3615718565b901c90505b6108008216156132e25760806132dd826fe7159475a2c29b7443b29c7fa6e889d9615718565b901c90505b61100082161561330d576080613308826fd097f3bdfd2022b8845ad8f792aa5825615718565b901c90505b612000821615613338576080613333826fa9f746462d870fdf8a65dc1f90e061e5615718565b901c90505b61400082161561336357608061335e826f70d869a156d2a1b890bb3df62baf32f7615718565b901c90505b61800082161561338e576080613389826f31be135f97d08fd981231505542fcfa6615718565b901c90505b620100008216156133ba5760806133b5826f09aa508b5b7a84e1c677de54f3e99bc9615718565b901c90505b620200008216156133e55760806133e0826e5d6af8dedb81196699c329225ee604615718565b901c90505b6204000082161561340f57608061340a826d2216e584f5fa1ea926041bedfe98615718565b901c90505b62080000821615613437576080613432826b048a170391f7dc42444e8fa2615718565b901c90505b60008460020b13156134525761344f81600019615745565b90505b613460600160201b826157ed565b1561346c57600161346f565b60005b6134809060ff16602083901c6154bc565b949350505050565b6000600160801b82106134ed5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610824565b5090565b600080836001600160a01b0316856001600160a01b03161115613512579293925b846001600160a01b0316866001600160a01b03161161353d57613536858585614961565b9150612ea3565b836001600160a01b0316866001600160a01b0316101561357657613562868585614961565b915061356f8587856149cb565b9050612ea3565b6135818585856149cb565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e2b9085906323b872dd60e01b90608401612ed8565b6000836001600160a01b0316856001600160a01b031611156135e4579293925b846001600160a01b0316866001600160a01b03161161360f57613608858585614a15565b905061306a565b836001600160a01b0316866001600160a01b03161015613671576000613636878686614a15565b90506000613645878986614a7f565b9050806001600160801b0316826001600160801b0316106136665780613668565b815b9250505061306a565b61367c858584614a7f565b9695505050505050565b6001600160a01b0382166136dc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610824565b80603560008282546136ee91906154bc565b90915550506001600160a01b0382166000908152603360205260408120805483929061371b9084906154bc565b90915550506040518181526001600160a01b03831690600090600080516020615cc68339815191529060200160405180910390a35050565b60008060008060006137636106fc565b915091508160001480156137775750600081115b1561378e576137878689836141b3565b925061383d565b8015801561379c5750600082115b156137ac576137878789846141b3565b811580156137b8575080155b156137df5760405162461bcd60e51b81526020600482015260006024820152604401610824565b60006137ec888a856141b3565b905060006137fb888b856141b3565b905060008211801561380d5750600081115b6138295760405162461bcd60e51b815260040161082490615537565b8082106138365780613838565b815b945050505b61384883838a61302a565b945061385583828a61302a565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff16918391506000906138a0576138a0615801565b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106138cf576138cf615801565b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613915908590600401615817565b600060405180830381865afa158015613932573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261395a919081019061590a565b509050805160021461399a5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610824565b6098548151600091829163ffffffff90911660060b90849083906139c0576139c0615801565b6020026020010151846001815181106139db576139db615801565b60200260200101510360060b816139f4576139f461572f565b059050613a038160020b613073565b6097549092506000915061271090613a2690600160f01b900461ffff16846159cc565b613a3091906159fe565b90508415613a7857613a428183615a24565b6001600160a01b0316866001600160a01b03161015613a735760405162461bcd60e51b815260040161082490615a44565b613ab3565b613a828183615a6b565b6001600160a01b0316866001600160a01b03161115613ab35760405162461bcd60e51b815260040161082490615a44565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613af4903090600401614e39565b602060405180830381865afa158015613b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b359190615475565b613b3f91906153b2565b613b4991906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613b85903090600401614e39565b602060405180830381865afa158015613ba2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bc69190615475565b613bd091906153b2565b613bda91906153b2565b6097549091506000908190613c0590600160a01b8104600290810b91600160b81b9004900b8c6126da565b935093505050613c158282612a0d565b613c1f8282612ae6565b6040519193509150600080516020615ce683398151915290613c449084908490614e4d565b60405180910390a1613c5684836154bc565b9150613c6283826154bc565b609e549091506001600160a01b0390811690861603613def57609754869061271090613c9990600160d01b900461ffff1685615718565b613ca39190615745565b1015613cc15760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613cf9903090600401614e39565b602060405180830381865afa158015613d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d3a9190615475565b613d4491906153b2565b613d4e91906153b2565b613d5891906153b2565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613d93903090600401614e39565b602060405180830381865afa158015613db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dd49190615475565b613dde91906153b2565b613de891906153b2565b9250613f5c565b609f546001600160a01b0390811690861603612e6d57609754869061271090613e2390600160d01b900461ffff1684615718565b613e2d9190615745565b1015613e4b5760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a0823190613e81903090600401614e39565b602060405180830381865afa158015613e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ec29190615475565b613ecc91906153b2565b613ed691906153b2565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a0823190613f11903090600401614e39565b602060405180830381865afa158015613f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f529190615475565b613dd491906153b2565b609754612d1590600160a01b8104600290810b91600160b81b9004900b86868d8d8d612b80565b600054610100900460ff1680613f9c575060005460ff16155b613fb85760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015613fda576000805461ffff19166101011790555b613fe2614ab5565b613fec8383614b1f565b8015612f0f576000805461ff0019169055505050565b600054610100900460ff168061401b575060005460ff16155b6140375760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614059576000805461ffff19166101011790555b614061614ba6565b8015614073576000805461ff00191690555b50565b6001600160a01b0382166140d65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610824565b6001600160a01b0382166000908152603360205260409020548181101561414a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610824565b61415482826153b2565b6001600160a01b038416600090815260336020526040812091909155603580548492906141829084906153b2565b90915550506040518281526000906001600160a01b03851690600080516020615cc68339815191529060200161222c565b60008080600019858709858702925082811083820303915050806000036141ec57600084116141e157600080fd5b508290049050610847565b8084116141f857600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600080871561440157609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b8152600401602060405180830381865afa1580156142c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142e49190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161432491600160a01b90910460020b90600401614f3e565b61010060405180830381865afa158015614342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143669190615a8b565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba9395506143af94600160b81b90910460020b93506004019150614f3e9050565b61010060405180830381865afa1580156143cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143f19190615a8b565b5093975061458f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b8152600401602060405180830381865afa158015614454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144789190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916144b891600160a01b90910460020b90600401614f3e565b61010060405180830381865afa1580156144d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144fa9190615a8b565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506145429450600160b81b900460020b926004019150614f3e9050565b61010060405180830381865afa158015614560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145849190615a8b565b509297505050505050505b609754600090600160a01b9004600290810b9088900b126145b15750826145b6565b508281035b609754600090600160b81b9004600290810b9089900b12156145d95750826145de565b508282035b8183038190036145fe6001600160801b0389168b8303600160801b6141b3565b9b9a5050505050505050505050565b6000600160ff1b82106134ed5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610824565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c40160408051808303816000875af11580156146e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061470c9190615599565b915091508161471a8a61460d565b6147249190615b27565b9350806147308961460d565b61473a9190615b27565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015614791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b5919061530a565b505050505050905060006147e2826147cf8f60020b613073565b6147db8f60020b613073565b89896135c4565b90506001600160801b0381161561487f57609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b815260040161483a9493929190615557565b60408051808303816000875af1158015614858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061487c9190615599565b50505b5050505097509795505050505050565b60006148e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c169092919063ffffffff16565b805190915015612f0f57808060200190518101906149029190615b47565b612f0f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610824565b6000826001600160a01b0316846001600160a01b03161115614981579192915b6001600160a01b0384166149c1600160601b600160e01b03606085901b166149a98787615a24565b6001600160a01b0316866001600160a01b03166141b3565b6134809190615745565b6000826001600160a01b0316846001600160a01b031611156149eb579192915b6134806001600160801b038316614a028686615a24565b6001600160a01b0316600160601b6141b3565b6000826001600160a01b0316846001600160a01b03161115614a35579192915b6000614a58856001600160a01b0316856001600160a01b0316600160601b6141b3565b905061306a614a7a8483614a6c8989615a24565b6001600160a01b03166141b3565b614c25565b6000826001600160a01b0316846001600160a01b03161115614a9f579192915b613480614a7a83600160601b614a6c8888615a24565b600054610100900460ff1680614ace575060005460ff16155b614aea5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614061576000805461ffff19166101011790558015614073576000805461ff001916905550565b600054610100900460ff1680614b38575060005460ff16155b614b545760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614b76576000805461ffff19166101011790555b6036614b828482615baa565b506037614b8f8382615baa565b508015612f0f576000805461ff0019169055505050565b600054610100900460ff1680614bbf575060005460ff16155b614bdb5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614bfd576000805461ffff19166101011790555b60016065558015614073576000805461ff001916905550565b60606134808484600085614c40565b806001600160801b0381168114614c3b57600080fd5b919050565b606082471015614ca15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610824565b843b614cef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610824565b600080866001600160a01b03168587604051614d0b9190615c69565b60006040518083038185875af1925050503d8060008114614d48576040519150601f19603f3d011682016040523d82523d6000602084013e614d4d565b606091505b5091509150614d5d828286614d68565b979650505050505050565b60608315614d77575081610847565b825115614d875782518084602001fd5b8160405162461bcd60e51b81526004016108249190614dc5565b60005b83811015614dbc578181015183820152602001614da4565b50506000910152565b6020815260008251806020840152614de4816040850160208701614da1565b601f01601f19169190910160400192915050565b6001600160a01b038116811461407357600080fd5b60008060408385031215614e2057600080fd5b8235614e2b81614df8565b946020939093013593505050565b6001600160a01b0391909116815260200190565b918252602082015260400190565b600080600060608486031215614e7057600080fd5b8335614e7b81614df8565b92506020840135614e8b81614df8565b929592945050506040919091013590565b8060020b811461407357600080fd5b801515811461407357600080fd5b600080600080600060a08688031215614ed157600080fd5b8535614edc81614e9c565b94506020860135614eec81614e9c565b93506040860135614efc81614df8565b9250606086013591506080860135614f1381614eab565b809150509295509295909350565b600060208284031215614f3357600080fd5b813561084781614df8565b60029190910b815260200190565b60008060408385031215614f5f57600080fd5b823591506020830135614f7181614df8565b809150509250929050565b60008060408385031215614f8f57600080fd5b50508035926020909101359150565b61ffff8116811461407357600080fd5b63ffffffff8116811461407357600080fd5b600080600080600060a08688031215614fd857600080fd5b8535614fe381614f9e565b94506020860135614ff381614f9e565b9350604086013561500381614f9e565b9250606086013561501381614fae565b91506080860135614f1381614df8565b600080600080600060a0868803121561503b57600080fd5b853561504681614df8565b945060208601359350604086013561505d81614eab565b9250606086013591506080860135614f1381614df8565b60008083601f84011261508657600080fd5b5081356001600160401b0381111561509d57600080fd5b6020830191508360208285010111156150b557600080fd5b9250929050565b600080600080606085870312156150d257600080fd5b843593506020850135925060408501356001600160401b038111156150f657600080fd5b61510287828801615074565b95989497509550505050565b6000806040838503121561512157600080fd5b823561512c81614df8565b91506020830135614f7181614df8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561517a5761517a61513c565b604052919050565b600082601f83011261519357600080fd5b81356001600160401b038111156151ac576151ac61513c565b6151bf601f8201601f1916602001615152565b8181528460208386010111156151d457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060e0888a03121561520c57600080fd5b87356001600160401b038082111561522357600080fd5b61522f8b838c01615182565b985060208a013591508082111561524557600080fd5b506152528a828b01615182565b965050604088013561526381614df8565b9450606088013561527381614f9e565b9350608088013561528381614e9c565b925060a088013561529381614e9c565b915060c08801356152a381614df8565b8091505092959891949750929550565b6000602082840312156152c557600080fd5b813561084781614f9e565b600181811c908216806152e457607f821691505b60208210810361530457634e487b7160e01b600052602260045260246000fd5b50919050565b600080600080600080600060e0888a03121561532557600080fd5b875161533081614df8565b602089015190975061534181614e9c565b604089015190965061535281614f9e565b606089015190955061536381614f9e565b608089015190945061537481614f9e565b60a089015190935060ff8116811461538b57600080fd5b60c08901519092506152a381614eab565b634e487b7160e01b600052601160045260246000fd5b818103818111156106f6576106f661539c565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b80516001600160801b0381168114614c3b57600080fd5b600080600080600060a0868803121561543657600080fd5b61543f86615407565b9450602086015193506040860151925061545b60608701615407565b915061546960808701615407565b90509295509295909350565b60006020828403121561548757600080fd5b5051919050565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b808201808211156106f6576106f661539c565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b600080604083850312156155ac57600080fd5b505080516020909101519092909150565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b60208082526003908201526242505360e81b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b61ffff8281168282160390808211156156a3576156a361539c565b5092915050565b6020808252600490820152636d42505360e01b604082015260600190565b6000602082840312156156da57600080fd5b815161084781614df8565b600080604083850312156156f857600080fd5b61570183615407565b915061570f60208401615407565b90509250929050565b80820281158282048414176106f6576106f661539c565b634e487b7160e01b600052601260045260246000fd5b6000826157545761575461572f565b500490565b61ffff8181168382160190808211156156a3576156a361539c565b602080825260089082015267686967682066656560c01b604082015260600190565b6000600182016157a8576157a861539c565b5060010190565b6000600160ff1b82016157c4576157c461539c565b5060000390565b60008160020b627fffff1981036157e4576157e461539c565b60000392915050565b6000826157fc576157fc61572f565b500690565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561585557835163ffffffff1683529284019291840191600101615833565b50909695505050505050565b60006001600160401b0382111561587a5761587a61513c565b5060051b60200190565b8051600681900b8114614c3b57600080fd5b600082601f8301126158a757600080fd5b815160206158bc6158b783615861565b615152565b82815260059290921b840181019181810190868411156158db57600080fd5b8286015b848110156158ff5780516158f281614df8565b83529183019183016158df565b509695505050505050565b6000806040838503121561591d57600080fd5b82516001600160401b038082111561593457600080fd5b818501915085601f83011261594857600080fd5b815160206159586158b783615861565b82815260059290921b8401810191818101908984111561597757600080fd5b948201945b8386101561599c5761598d86615884565b8252948201949082019061597c565b918801519196509093505050808211156159b557600080fd5b506159c285828601615896565b9150509250929050565b6001600160a01b038281168282168181028316929181158285048214176159f5576159f561539c565b50505092915050565b60006001600160a01b0383811680615a1857615a1861572f565b92169190910492915050565b6001600160a01b038281168282160390808211156156a3576156a361539c565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b6001600160a01b038181168382160190808211156156a3576156a361539c565b600080600080600080600080610100898b031215615aa857600080fd5b615ab189615407565b9750602089015180600f0b8114615ac757600080fd5b60408a015160608b015191985096509450615ae460808a01615884565b935060a0890151615af481614df8565b60c08a0151909350615b0581614fae565b60e08a0151909250615b1681614eab565b809150509295985092959890939650565b81810360008312801583831316838312821617156156a3576156a361539c565b600060208284031215615b5957600080fd5b815161084781614eab565b601f821115612f0f57600081815260208120601f850160051c81016020861015615b8b5750805b601f850160051c820191505b81811015613ab357828155600101615b97565b81516001600160401b03811115615bc357615bc361513c565b615bd781615bd184546152d0565b84615b64565b602080601f831160018114615c0c5760008415615bf45750858301515b600019600386901b1c1916600185901b178555613ab3565b600085815260208120601f198616915b82811015615c3b57888601518255948401946001909101908401615c1c565b5085821015615c595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251615c7b818460208701614da1565b919091019291505056fec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a2646970667358221220a11bde499516b0a2e8e737821292815fcefc66549a9729f24ea128d34ed6027364736f6c63430008130033", - "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": "See {IERC20-allowance}." - }, - "approve(address,uint256)": { - "details": "See {IERC20-approve}. Requirements: - `spender` cannot be the zero address." - }, - "balanceOf(address)": { - "details": "See {IERC20-balanceOf}." - }, - "burn(uint256,address)": { - "params": { - "burnAmount": "The number of G-UNI tokens to burn", - "receiver": "The account to receive the underlying amounts of token0 and token1" - }, - "returns": { - "amount0": "amount of token0 transferred to receiver for burning `burnAmount`", - "amount1": "amount of token1 transferred to receiver for burning `burnAmount`", - "liquidityBurned": "amount of liquidity removed from the underlying Uniswap V3 position" - } - }, - "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 this function is overridden; 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`." - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "details": "When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.", - "params": { - "newLowerTick": "The new lower bound of the position's range", - "newUpperTick": "The new upper bound of the position's range", - "swapAmountBPS": "amount of token to swap as proportion of total. Pass 0 to ignore swap.", - "swapThresholdPrice": "slippage parameter on the swap as a max or min sqrtPriceX96", - "zeroForOne": "Which token to input into the swap (true = token0, false = token1)" - } - }, - "getMintAmounts(uint256,uint256)": { - "params": { - "amount0Max": "The maximum amount of token1 to forward on mint" - }, - "returns": { - "amount0": "actual amount of token0 to forward when minting `mintAmount`", - "amount1": "actual amount of token1 to forward when minting `mintAmount`", - "mintAmount": "maximum number of G-UNI tokens to mint" - } - }, - "getUnderlyingBalances()": { - "returns": { - "amount0Current": "current total underlying balance of token0", - "amount1Current": "current total underlying balance of token1" - } - }, - "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." - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "params": { - "_lowerTick": "initial upperTick (only changeable with executiveRebalance)", - "_managerFeeBPS": "proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION", - "_manager_": "address of manager (ownership can be transferred)", - "_name": "name of G-UNI token", - "_pool": "address of Uniswap V3 pool", - "_symbol": "symbol of G-UNI token" - } - }, - "initializeManagerFee(uint16)": { - "params": { - "_managerFeeBPS": "proportion of fees earned that are credited to manager in Basis Points" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "mint(uint256,address)": { - "details": "to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts", - "params": { - "mintAmount": "The number of G-UNI tokens to mint", - "receiver": "The account to receive the minted tokens" - }, - "returns": { - "amount0": "amount of token0 transferred from msg.sender to mint `mintAmount`", - "amount1": "amount of token1 transferred from msg.sender to mint `mintAmount`", - "liquidityMinted": "amount of liquidity added to the underlying Uniswap V3 position" - } - }, - "name()": { - "details": "Returns the name of the token." - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "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 manager." - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "params": { - "newRebalanceBPS": "controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance", - "newSlippageBPS": "maximum slippage on swaps during gelato rebalance", - "newSlippageInterval": "length of time for TWAP used in computing slippage on swaps", - "newTreasury": "address where managerFee withdrawals are sent", - "newWithdrawBPS": "controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "burn(uint256,address)": { - "notice": "burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens" - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "notice": "Change the range of underlying UniswapV3 position, only manager can call" - }, - "getMintAmounts(uint256,uint256)": { - "notice": "compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`" - }, - "getUnderlyingBalances()": { - "notice": "compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)" - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "notice": "initialize storage variables on a new G-UNI pool, only called once" - }, - "initializeManagerFee(uint16)": { - "notice": "initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again." - }, - "mint(uint256,address)": { - "notice": "mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position" - }, - "rebalance(uint160,uint256,bool,uint256,address)": { - "notice": "Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager." - }, - "uniswapV3MintCallback(uint256,uint256,bytes)": { - "notice": "Uniswap V3 callback fn, called back on pool.mint" - }, - "uniswapV3SwapCallback(int256,int256,bytes)": { - "notice": "Uniswap v3 callback fn, called back on pool.swap" - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "notice": "change configurable parameters, only manager can call" - }, - "withdrawGelatoBalance(uint256,address)": { - "notice": "withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - }, - "withdrawManagerBalance(uint256,address)": { - "notice": "withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 5, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 784, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage" - }, - { - "astId": 122, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_balances", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 128, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_allowances", - "offset": 0, - "slot": "52", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 130, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_totalSupply", - "offset": 0, - "slot": "53", - "type": "t_uint256" - }, - { - "astId": 132, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_name", - "offset": 0, - "slot": "54", - "type": "t_string_storage" - }, - { - "astId": 134, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_symbol", - "offset": 0, - "slot": "55", - "type": "t_string_storage" - }, - { - "astId": 636, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "56", - "type": "t_array(t_uint256)45_storage" - }, - { - "astId": 59, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_status", - "offset": 0, - "slot": "101", - "type": "t_uint256" - }, - { - "astId": 102, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "102", - "type": "t_array(t_uint256)49_storage" - }, - { - "astId": 6441, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_manager", - "offset": 0, - "slot": "151", - "type": "t_address" - }, - { - "astId": 6031, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "lowerTick", - "offset": 20, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6033, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "upperTick", - "offset": 23, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6035, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoRebalanceBPS", - "offset": 26, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6037, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoWithdrawBPS", - "offset": 28, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6039, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageBPS", - "offset": 30, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6041, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageInterval", - "offset": 0, - "slot": "152", - "type": "t_uint32" - }, - { - "astId": 6043, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerFeeBPS", - "offset": 4, - "slot": "152", - "type": "t_uint16" - }, - { - "astId": 6045, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerTreasury", - "offset": 6, - "slot": "152", - "type": "t_address" - }, - { - "astId": 6047, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance0", - "offset": 0, - "slot": "153", - "type": "t_uint256" - }, - { - "astId": 6049, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance1", - "offset": 0, - "slot": "154", - "type": "t_uint256" - }, - { - "astId": 6051, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance0", - "offset": 0, - "slot": "155", - "type": "t_uint256" - }, - { - "astId": 6053, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance1", - "offset": 0, - "slot": "156", - "type": "t_uint256" - }, - { - "astId": 6056, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "pool", - "offset": 0, - "slot": "157", - "type": "t_contract(IUniswapV3Pool)2339" - }, - { - "astId": 6059, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token0", - "offset": 0, - "slot": "158", - "type": "t_contract(IERC20)863" - }, - { - "astId": 6062, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token1", - "offset": 0, - "slot": "159", - "type": "t_contract(IERC20)863" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)45_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)49_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "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)863": { - "encoding": "inplace", - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_contract(IUniswapV3Pool)2339": { - "encoding": "inplace", - "label": "contract IUniswapV3Pool", - "numberOfBytes": "20" - }, - "t_int24": { - "encoding": "inplace", - "label": "int24", - "numberOfBytes": "3" - }, - "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_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/arbitrumSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json b/lib/g-uni-v1-core/deployments/arbitrumSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json deleted file mode 100644 index 371127af2..000000000 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\n/// @dev Modified to support 0.8.19\n/// @dev Modified to set the gelatoFeeBPS to 0\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 0;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n event SetManagerFee(uint16 managerFee);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n emit SetManagerFee(_managerFeeBPS);\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidityBefore,\n uint128 liquidityAfter\n );\n\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n SafeCast.toUint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidityBurned);\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n\n amount0 =\n burn0 +\n FullMath.mulDiv(\n token0.balanceOf(address(this)) -\n burn0 -\n managerBalance0 -\n gelatoBalance0,\n burnAmount,\n totalSupply\n );\n amount1 =\n burn1 +\n FullMath.mulDiv(\n token1.balanceOf(address(this)) -\n burn1 -\n managerBalance1 -\n gelatoBalance1,\n burnAmount,\n totalSupply\n );\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n // solhint-disable-next-line function-max-lines\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n uint128 liquidity;\n uint128 newLiquidity;\n if (totalSupply() > 0) {\n (liquidity, , , , ) = pool.positions(_getPositionID());\n if (liquidity > 0) {\n (, , uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n }\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > 0, \"new position 0\");\n } else {\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n }\n\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n _rebalance(\n liquidity,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > liquidity, \"liquidity must increase\");\n\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\n external\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n // solhint-disable-next-line function-max-lines\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\n internal\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint128 liquidity,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n uint256 leftover0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 leftover1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n (, , uint256 feesEarned0, uint256 feesEarned1) =\n _withdraw(lowerTick, upperTick, liquidity);\n _applyFees(feesEarned0, feesEarned1);\n (feesEarned0, feesEarned1) = _subtractAdminFees(\n feesEarned0,\n feesEarned1\n );\n emit FeesEarned(feesEarned0, feesEarned1);\n feesEarned0 += leftover0;\n feesEarned1 += leftover1;\n\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n leftover0,\n leftover1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdraw(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n )\n private\n returns (\n uint256 burn0,\n uint256 burn1,\n uint256 fee0,\n uint256 fee1\n )\n {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n SafeCast.toInt256(\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\n );\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array len\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"high slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"high slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\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 require(value < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return uint128(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 require(value < 2**64, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return uint64(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 require(value < 2**32, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return uint32(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 require(value < 2**16, \"SafeCast: value doesn\\'t fit in 16 bits\");\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 require(value < 2**8, \"SafeCast: value doesn\\'t fit in 8 bits\");\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 require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= -2**127 && value < 2**127, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return int128(value);\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= -2**63 && value < 2**63, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return int64(value);\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= -2**31 && value < 2**31, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return int32(value);\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= -2**15 && value < 2**15, \"SafeCast: value doesn\\'t fit in 16 bits\");\n return int16(value);\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= -2**7 && value < 2**7, \"SafeCast: value doesn\\'t fit in 8 bits\");\n return int8(value);\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 require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IUniswapV3TickSpacing} from \"./interfaces/IUniswapV3TickSpacing.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n }\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n 0,\n lowerTick,\n upperTick,\n address(0)\n );\n }\n\n function _createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n address manager\n ) internal returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory name = \"Gelato Uniswap LP\";\n try this.getTokenName(token0, token1) returns (string memory result) {\n name = result;\n } catch {} // solhint-disable-line no-empty-blocks\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n require(uniPool != address(0), \"uniswap pool does not exist\");\n require(\n _validateTickSpacing(uniPool, lowerTick, upperTick),\n \"tickSpacing mismatch\"\n );\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n manager\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, manager, pool);\n }\n\n function _validateTickSpacing(\n address uniPool,\n int24 lowerTick,\n int24 upperTick\n ) internal view returns (bool) {\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\n return\n lowerTick < upperTick &&\n lowerTick % spacing == 0 &&\n upperTick % spacing == 0;\n }\n\n function getTokenName(address token0, address token1)\n external\n view\n returns (string memory)\n {\n string memory symbol0 = IERC20Metadata(token0).symbol();\n string memory symbol1 = IERC20Metadata(token1).symbol();\n\n return _append(\"Gelato Uniswap \", symbol0, \"/\", symbol1, \" LP\");\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IUniswapV3TickSpacing.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IUniswapV3TickSpacing {\n function tickSpacing() external view returns (int24);\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "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/lib/g-uni-v1-core/deployments/axisBlast/.chainId b/lib/g-uni-v1-core/deployments/axisBlast/.chainId deleted file mode 100644 index 69e80cbf7..000000000 --- a/lib/g-uni-v1-core/deployments/axisBlast/.chainId +++ /dev/null @@ -1 +0,0 @@ -6226 \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/axisBlast/GUniFactory.json b/lib/g-uni-v1-core/deployments/axisBlast/GUniFactory.json deleted file mode 100644 index 78b633725..000000000 --- a/lib/g-uni-v1-core/deployments/axisBlast/GUniFactory.json +++ /dev/null @@ -1,721 +0,0 @@ -{ - "address": "0xCa5eb015d7A527337109798524470e215346A617", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - } - ], - "transactionHash": "0x579b4f96c1e08a2feb76b2d54f68b1f43e370ab29a8ad9ac3fc2489830798bfb", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0xCa5eb015d7A527337109798524470e215346A617", - "transactionIndex": 0, - "gasUsed": "551340", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000000000000400000000000000020200000000000000000000000000000000000000000000000000000008000000000000000000000000000200000000000000020000000000000000000800000000002000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000010000000008000000000000000000020001000000000000000000400000000000000000000000000000008000000000000", - "blockHash": "0x158e2e6ae0ac1282d2fa33246b657ab0d2c6503b04c36abc0e40334ee35aa4d5", - "transactionHash": "0x579b4f96c1e08a2feb76b2d54f68b1f43e370ab29a8ad9ac3fc2489830798bfb", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 4490173, - "transactionHash": "0x579b4f96c1e08a2feb76b2d54f68b1f43e370ab29a8ad9ac3fc2489830798bfb", - "address": "0xCa5eb015d7A527337109798524470e215346A617", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000008b87749b379f5bca1d74a7b3d4e9f3ded41c706" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0x158e2e6ae0ac1282d2fa33246b657ab0d2c6503b04c36abc0e40334ee35aa4d5" - }, - { - "transactionIndex": 0, - "blockNumber": 4490173, - "transactionHash": "0x579b4f96c1e08a2feb76b2d54f68b1f43e370ab29a8ad9ac3fc2489830798bfb", - "address": "0xCa5eb015d7A527337109798524470e215346A617", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0x158e2e6ae0ac1282d2fa33246b657ab0d2c6503b04c36abc0e40334ee35aa4d5" - } - ], - "blockNumber": 4490173, - "cumulativeGasUsed": "551340", - "status": 1, - "byzantium": true - }, - "args": [ - "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b00000000000000000000000008b87749b379f5bca1d74a7b3d4e9f3ded41c706000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033", - "execute": { - "methodName": "initialize", - "args": [ - "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - ] - }, - "implementation": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/axisBlast/GUniFactory_Implementation.json b/lib/g-uni-v1-core/deployments/axisBlast/GUniFactory_Implementation.json deleted file mode 100644 index 3f7fa4480..000000000 --- a/lib/g-uni-v1-core/deployments/axisBlast/GUniFactory_Implementation.json +++ /dev/null @@ -1,802 +0,0 @@ -{ - "address": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_uniswapV3Factory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x6781c4397e848adc94917c88c7e33d5355795ed4d5c88dcd21bb1ab746790f07", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "transactionIndex": 0, - "gasUsed": "2185771", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x5f38594edc3c5d83aadec7d0194cfa9c55d197cc0d7a961ae524686f77ab4bd2", - "transactionHash": "0x6781c4397e848adc94917c88c7e33d5355795ed4d5c88dcd21bb1ab746790f07", - "logs": [], - "blockNumber": 4490172, - "cumulativeGasUsed": "2185771", - "status": 1, - "byzantium": true - }, - "args": [ - "0x792edAdE80af5fC680d96a2eD80A44247D2Cf6Fd" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_uniswapV3Factory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"uniPool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previosGelatoDeployer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newGelatoDeployer\",\"type\":\"address\"}],\"name\":\"UpdateGelatoDeployer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"UpdatePoolImplementation\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createManagedPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDeployers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGelatoPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"getTokenName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gelatoDeployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isPoolImmutable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"makePoolsImmutable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numDeployers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextGelatoDeployer\",\"type\":\"address\"}],\"name\":\"setGelatoDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextImplementation\",\"type\":\"address\"}],\"name\":\"setPoolImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"upgradePools\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"bytes[]\",\"name\":\"datas\",\"type\":\"bytes[]\"}],\"name\":\"upgradePoolsAndCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"managerFee\":\"proportion of earned fees that go to pool manager in Basis Points\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"createPool(address,address,uint24,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"getDeployers()\":{\"returns\":{\"_0\":\"deployers the list of deployer addresses\"}},\"getGelatoPools()\":{\"returns\":{\"_0\":\"list of Gelato managed G-UNI pool addresses\"}},\"getPools(address)\":{\"params\":{\"deployer\":\"address that has potentially deployed G-UNI pools (can return empty array)\"},\"returns\":{\"_0\":\"pools the list of G-UNI pool addresses deployed by `deployer`\"}},\"getProxyAdmin(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"address that controls the G-UNI implementation (has power to upgrade it)\"}},\"isPoolImmutable(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"bool signaling if pool is immutable (true) or not (false)\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"numDeployers()\":{\"returns\":{\"_0\":\"total number of G-UNI pool deployer addresses\"}},\"numPools()\":{\"returns\":{\"result\":\"total number of G-UNI pools deployed\"}},\"numPools(address)\":{\"params\":{\"deployer\":\"deployer address\"},\"returns\":{\"_0\":\"total number of G-UNI pools deployed by `deployer`\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"notice\":\"createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`\"},\"createPool(address,address,uint24,int24,int24)\":{\"notice\":\"createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`\"},\"getDeployers()\":{\"notice\":\"getDeployers fetches all addresses that have deployed a G-UNI pool\"},\"getGelatoPools()\":{\"notice\":\"getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)\"},\"getPools(address)\":{\"notice\":\"getPools fetches all the G-UNI pool addresses deployed by `deployer`\"},\"getProxyAdmin(address)\":{\"notice\":\"getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address).\"},\"isPoolImmutable(address)\":{\"notice\":\"isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\"},\"numDeployers()\":{\"notice\":\"numDeployers counts the total number of G-UNI pool deployer addresses\"},\"numPools()\":{\"notice\":\"numPools counts the total number of G-UNI pools in existence\"},\"numPools(address)\":{\"notice\":\"numPools counts the total number of G-UNI pools deployed by `deployer`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniFactory.sol\":\"GUniFactory\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\\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\":\"0x4878ef6c288f4cef3c2a288d32cc548c648831cc55503ad3d9a581ed3b93aad9\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title The interface for the Uniswap V3 Factory\\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\\ninterface IUniswapV3Factory {\\n /// @notice Emitted when the owner of the factory is changed\\n /// @param oldOwner The owner before the owner was changed\\n /// @param newOwner The owner after the owner was changed\\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\\n\\n /// @notice Emitted when a pool is created\\n /// @param token0 The first token of the pool by address sort order\\n /// @param token1 The second token of the pool by address sort order\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks\\n /// @param pool The address of the created pool\\n event PoolCreated(\\n address indexed token0,\\n address indexed token1,\\n uint24 indexed fee,\\n int24 tickSpacing,\\n address pool\\n );\\n\\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\\n /// @param fee The enabled fee, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\\n\\n /// @notice Returns the current owner of the factory\\n /// @dev Can be changed by the current owner via setOwner\\n /// @return The address of the factory owner\\n function owner() external view returns (address);\\n\\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\\n /// @return The tick spacing\\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\\n\\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\\n /// @param tokenA The contract address of either token0 or token1\\n /// @param tokenB The contract address of the other token\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @return pool The pool address\\n function getPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external view returns (address pool);\\n\\n /// @notice Creates a pool for the given two tokens and fee\\n /// @param tokenA One of the two tokens in the desired pool\\n /// @param tokenB The other of the two tokens in the desired pool\\n /// @param fee The desired fee for the pool\\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\\n /// are invalid.\\n /// @return pool The address of the newly created pool\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external returns (address pool);\\n\\n /// @notice Updates the owner of the factory\\n /// @dev Must be called by the current owner\\n /// @param _owner The new owner of the factory\\n function setOwner(address _owner) external;\\n\\n /// @notice Enables a fee amount with the given tickSpacing\\n /// @dev Fee amounts may never be removed once enabled\\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\\n}\\n\",\"keccak256\":\"0xcc3d0c93fc9ac0febbe09f941b465b57f750bcf3b48432da0b97dc289cfdc489\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {\\n IUniswapV3Factory\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\\\";\\nimport {IUniswapV3TickSpacing} from \\\"./interfaces/IUniswapV3TickSpacing.sol\\\";\\nimport {IGUniFactory} from \\\"./interfaces/IGUniFactory.sol\\\";\\nimport {IGUniPoolStorage} from \\\"./interfaces/IGUniPoolStorage.sol\\\";\\nimport {GUniFactoryStorage} from \\\"./abstract/GUniFactoryStorage.sol\\\";\\nimport {EIP173Proxy} from \\\"./vendor/proxy/EIP173Proxy.sol\\\";\\nimport {IEIP173Proxy} from \\\"./interfaces/IEIP173Proxy.sol\\\";\\nimport {\\n IERC20Metadata\\n} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n constructor(address _uniswapV3Factory)\\n GUniFactoryStorage(_uniswapV3Factory)\\n {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n managerFee,\\n lowerTick,\\n upperTick,\\n msg.sender\\n );\\n }\\n\\n /// @notice createPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n 0,\\n lowerTick,\\n upperTick,\\n address(0)\\n );\\n }\\n\\n function _createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick,\\n address manager\\n ) internal returns (address pool) {\\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\\n\\n pool = address(new EIP173Proxy(poolImplementation, address(this), \\\"\\\"));\\n\\n string memory name = \\\"Gelato Uniswap LP\\\";\\n try this.getTokenName(token0, token1) returns (string memory result) {\\n name = result;\\n } catch {} // solhint-disable-line no-empty-blocks\\n\\n address uniPool =\\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\\n require(uniPool != address(0), \\\"uniswap pool does not exist\\\");\\n require(\\n _validateTickSpacing(uniPool, lowerTick, upperTick),\\n \\\"tickSpacing mismatch\\\"\\n );\\n\\n IGUniPoolStorage(pool).initialize(\\n name,\\n \\\"G-UNI\\\",\\n uniPool,\\n managerFee,\\n lowerTick,\\n upperTick,\\n manager\\n );\\n _deployers.add(msg.sender);\\n _pools[msg.sender].add(pool);\\n emit PoolCreated(uniPool, manager, pool);\\n }\\n\\n function _validateTickSpacing(\\n address uniPool,\\n int24 lowerTick,\\n int24 upperTick\\n ) internal view returns (bool) {\\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\\n return\\n lowerTick < upperTick &&\\n lowerTick % spacing == 0 &&\\n upperTick % spacing == 0;\\n }\\n\\n function getTokenName(address token0, address token1)\\n external\\n view\\n returns (string memory)\\n {\\n string memory symbol0 = IERC20Metadata(token0).symbol();\\n string memory symbol1 = IERC20Metadata(token1).symbol();\\n\\n return _append(\\\"Gelato Uniswap \\\", symbol0, \\\"/\\\", symbol1, \\\" LP\\\");\\n }\\n\\n function upgradePools(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\\n }\\n }\\n\\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\\n external\\n onlyManager\\n {\\n require(pools.length == datas.length, \\\"mismatching array length\\\");\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeToAndCall(\\n poolImplementation,\\n datas[i]\\n );\\n }\\n }\\n\\n function makePoolsImmutable(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\\n }\\n }\\n\\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the\\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\\n /// @param pool address of the G-UNI pool\\n /// @return bool signaling if pool is immutable (true) or not (false)\\n function isPoolImmutable(address pool) external view returns (bool) {\\n return address(0) == getProxyAdmin(pool);\\n }\\n\\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\\n /// @return list of Gelato managed G-UNI pool addresses\\n function getGelatoPools() external view returns (address[] memory) {\\n return getPools(gelatoDeployer);\\n }\\n\\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\\n /// @return deployers the list of deployer addresses\\n function getDeployers() public view returns (address[] memory) {\\n uint256 length = numDeployers();\\n address[] memory deployers = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n deployers[i] = _getDeployer(i);\\n }\\n\\n return deployers;\\n }\\n\\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\\n function getPools(address deployer) public view returns (address[] memory) {\\n uint256 length = numPools(deployer);\\n address[] memory pools = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n pools[i] = _getPool(deployer, i);\\n }\\n\\n return pools;\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools in existence\\n /// @return result total number of G-UNI pools deployed\\n function numPools() public view returns (uint256 result) {\\n address[] memory deployers = getDeployers();\\n for (uint256 i = 0; i < deployers.length; i++) {\\n result += numPools(deployers[i]);\\n }\\n }\\n\\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\\n /// @return total number of G-UNI pool deployer addresses\\n function numDeployers() public view returns (uint256) {\\n return _deployers.length();\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\\n /// @param deployer deployer address\\n /// @return total number of G-UNI pools deployed by `deployer`\\n function numPools(address deployer) public view returns (uint256) {\\n return _pools[deployer].length();\\n }\\n\\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\\n /// no longer upgradable (no one owns the zero address).\\n /// @param pool address of the G-UNI pool\\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\\n function getProxyAdmin(address pool) public view returns (address) {\\n return IEIP173Proxy(pool).proxyAdmin();\\n }\\n\\n function _getDeployer(uint256 index) internal view returns (address) {\\n return _deployers.at(index);\\n }\\n\\n function _getPool(address deployer, uint256 index)\\n internal\\n view\\n returns (address)\\n {\\n return _pools[deployer].at(index);\\n }\\n\\n function _getTokenOrder(address tokenA, address tokenB)\\n internal\\n pure\\n returns (address token0, address token1)\\n {\\n require(tokenA != tokenB, \\\"same token\\\");\\n (token0, token1) = tokenA < tokenB\\n ? (tokenA, tokenB)\\n : (tokenB, tokenA);\\n require(token0 != address(0), \\\"no address zero\\\");\\n }\\n\\n function _append(\\n string memory a,\\n string memory b,\\n string memory c,\\n string memory d,\\n string memory e\\n ) internal pure returns (string memory) {\\n return string(abi.encodePacked(a, b, c, d, e));\\n }\\n}\\n\",\"keccak256\":\"0x41d2d6a42321eed641468824c4d0ba4fbe40040895304388315ece96132011d6\",\"license\":\"MIT\"},\"contracts/abstract/GUniFactoryStorage.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n Initializable\\n} from \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\n// solhint-disable-next-line max-states-count\\ncontract GUniFactoryStorage is\\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\\n Initializable\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n address public immutable factory;\\n address public poolImplementation;\\n address public gelatoDeployer;\\n EnumerableSet.AddressSet internal _deployers;\\n mapping(address => EnumerableSet.AddressSet) internal _pools;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdatePoolImplementation(\\n address previousImplementation,\\n address newImplementation\\n );\\n\\n event UpdateGelatoDeployer(\\n address previosGelatoDeployer,\\n address newGelatoDeployer\\n );\\n\\n constructor(address _uniswapV3Factory) {\\n factory = _uniswapV3Factory;\\n }\\n\\n function initialize(\\n address _implementation,\\n address _gelatoDeployer,\\n address _manager_\\n ) external initializer {\\n poolImplementation = _implementation;\\n gelatoDeployer = _gelatoDeployer;\\n _manager = _manager_;\\n }\\n\\n function setPoolImplementation(address nextImplementation)\\n external\\n onlyManager\\n {\\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\\n poolImplementation = nextImplementation;\\n }\\n\\n function setGelatoDeployer(address nextGelatoDeployer)\\n external\\n onlyManager\\n {\\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\\n gelatoDeployer = nextGelatoDeployer;\\n }\\n}\\n\",\"keccak256\":\"0xb0e3a7e77ab8aecf8997593526451e64dd8e8aa07882c210c9aa38d4f7168755\",\"license\":\"MIT\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xb6016d5611f38fbd516a84ea2e56794cb76a8d61c40f6716d5f0133f195759bd\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IEIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IEIP173Proxy {\\n function proxyAdmin() external view returns (address);\\n\\n function transferProxyAdmin(address newAdmin) external;\\n\\n function upgradeTo(address newImplementation) external;\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable;\\n}\\n\",\"keccak256\":\"0xae9996ea370d97cb5fd1934394aca615bee0e46c9a0c161d728490264e83eda5\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IGUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\ninterface IGUniFactory {\\n event PoolCreated(\\n address indexed uniPool,\\n address indexed manager,\\n address indexed pool\\n );\\n\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n}\\n\",\"keccak256\":\"0xe06f79e9b1e6351fc4f40c9f25630f0fbfabae9d2ae2bb642ef1f03d4c2195c1\",\"license\":\"MIT\"},\"contracts/interfaces/IGUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IGUniPoolStorage {\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external;\\n}\\n\",\"keccak256\":\"0x52a3f83a23917772f1eb242cecdfa8b45d7b357a615383628c1ac1f26259dd3f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IUniswapV3TickSpacing.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IUniswapV3TickSpacing {\\n function tickSpacing() external view returns (int24);\\n}\\n\",\"keccak256\":\"0xa6f22651f7e49c6eecf584d8e829d31336de7c43eec3c4c4df3b309db27bd355\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b5060405161273838038061273883398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516126a661009260003960008181610312015261103101526126a66000f3fe60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e620001583660046200151e565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e3660046200160f565b62000448565b6200015e620001a5366004620016b0565b620005b0565b6200016a6200068a565b6200015e620001c6366004620016b0565b620006f5565b6200016a620001dd3660046200151e565b620007d3565b620001ed620007fc565b604051620001749190620016f0565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001758565b6200023a6200080b565b6040516200017491906200176d565b6200023a6200025a3660046200151e565b62000820565b6200023a620008dd565b6200015e62000997565b620001ed62000285366004620017e5565b62000a04565b600254620001ed906001600160a01b031681565b620002b6620002b03660046200151e565b62000a22565b604051901515815260200162000174565b620001ed620002d836600462001878565b62000a3f565b62000221620002ef366004620018f2565b62000a5e565b6200015e6200030636600462001930565b62000bad565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e620003593660046200151e565b62000cb7565b6200015e620003703660046200151e565b62000d56565b620001ed620003873660046200151e565b62000e3d565b3362000398620007fc565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001982565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b03909116908490620019c4565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000ea4565b905090565b3362000453620007fc565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001982565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005aa57838181518110620004eb57620004eb620019de565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052c576200052c620019de565b9050602002810190620005409190620019f4565b6040518463ffffffff1660e01b8152600401620005609392919062001a3d565b600060405180830381600087803b1580156200057b57600080fd5b505af115801562000590573d6000803e3d6000fd5b505050508080620005a19062001a93565b915050620004cc565b50505050565b33620005bb620007fc565b6001600160a01b031614620005e45760405162461bcd60e51b8152600401620003c19062001982565b60005b81518110156200068657818181518110620006065762000606620019de565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063c9190620016f0565b600060405180830381600087803b1580156200065757600080fd5b505af11580156200066c573d6000803e3d6000fd5b5050505080806200067d9062001a93565b915050620005e7565b5050565b60008062000697620008dd565b905060005b8151811015620006f057620006cd828281518110620006bf57620006bf620019de565b6020026020010151620007d3565b620006d9908462001aaf565b925080620006e78162001a93565b9150506200069c565b505090565b3362000700620007fc565b6001600160a01b031614620007295760405162461bcd60e51b8152600401620003c19062001982565b60005b815181101562000686578181815181106200074b576200074b620019de565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200078992911690600401620016f0565b600060405180830381600087803b158015620007a457600080fd5b505af1158015620007b9573d6000803e3d6000fd5b505050508080620007ca9062001a93565b9150506200072c565b6001600160a01b0381166000908152600560205260408120620007f69062000ea4565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200082f83620007d3565b90506000816001600160401b038111156200084e576200084e6200153e565b60405190808252806020026020018201604052801562000878578160200160208202803683370190505b50905060005b82811015620008d55762000893858262000eaf565b828281518110620008a857620008a8620019de565b6001600160a01b039092166020928302919091019091015280620008cc8162001a93565b9150506200087e565b509392505050565b60606000620008eb62000435565b90506000816001600160401b038111156200090a576200090a6200153e565b60405190808252806020026020018201604052801562000934578160200160208202803683370190505b50905060005b8281101562000990576200094e8162000eda565b828281518110620009635762000963620019de565b6001600160a01b039092166020928302919091019091015280620009878162001a93565b9150506200093a565b5092915050565b33620009a2620007fc565b6001600160a01b031614620009cb5760405162461bcd60e51b8152600401620003c19062001982565b600080546040516001600160a01b039091169060008051602062002651833981519152908390a3600080546001600160a01b0319169055565b600062000a178787878787873362000ee9565b979650505050505050565b600062000a2f8262000e3d565b6001600160a01b03161592915050565b600062000a5486868660008787600062000ee9565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000aa1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000acb919081019062001ac5565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000b0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b38919081019062001ac5565b905062000ba46040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001243565b95945050505050565b600054600160a81b900460ff168062000bd05750600054600160a01b900460ff16155b62000c355760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000c60576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005aa576000805460ff60a81b1916905550505050565b3362000cc2620007fc565b6001600160a01b03161462000ceb5760405162461bcd60e51b8152600401620003c19062001982565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000d2c916001600160a01b03909116908490620019c4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000d61620007fc565b6001600160a01b03161462000d8a5760405162461bcd60e51b8152600401620003c19062001982565b6001600160a01b03811662000df35760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200265183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007f6919062001b63565b6000620007f6825490565b6001600160a01b038216600090815260056020526040812062000ed390836200127a565b9392505050565b6000620007f66003836200127a565b600080600062000efa8a8a62001288565b6001546040519294509092506001600160a01b031690309062000f1d90620014f7565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000f60573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb99062000fb29086908690600401620019c4565b600060405180830381865afa92505050801562000ff357506040513d6000823e601f3d908101601f1916820160405262000ff0919081019062001ac5565b60015b1562000ffc5790505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee8290606401602060405180830381865afa1580156200107b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010a1919062001b63565b90506001600160a01b038116620010f95760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b6200110681898962001356565b6200114b5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200118390859085908e908e908e908e9060040162001b83565b600060405180830381600087803b1580156200119e57600080fd5b505af1158015620011b3573d6000803e3d6000fd5b50505050620011cd3360036200140390919063ffffffff16565b50336000908152600560205260409020620011e9908662001403565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200126095949392919062001bf8565b604051602081830303815290604052905095945050505050565b600062000ed383836200141a565b600080826001600160a01b0316846001600160a01b031603620012db5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620012fd57828462001300565b83835b90925090506001600160a01b0382166200134f5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001398573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013be919062001c6d565b90508260020b8460020b128015620013e25750620013dd818562001c8d565b60020b155b801562000ba45750620013f6818462001c8d565b60020b1595945050505050565b600062000ed3836001600160a01b038416620014a5565b815460009082106200147a5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b826000018281548110620014925762001492620019de565b9060005260206000200154905092915050565b6000818152600183016020526040812054620014ee57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007f6565b506000620007f6565b6109928062001cbf83390190565b6001600160a01b03811681146200151b57600080fd5b50565b6000602082840312156200153157600080fd5b813562000ed38162001505565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200157f576200157f6200153e565b604052919050565b600082601f8301126200159957600080fd5b813560206001600160401b03821115620015b757620015b76200153e565b8160051b620015c882820162001554565b9283528481018201928281019087851115620015e357600080fd5b83870192505b8483101562000a17578235620015ff8162001505565b82529183019190830190620015e9565b6000806000604084860312156200162557600080fd5b83356001600160401b03808211156200163d57600080fd5b6200164b8783880162001587565b945060208601359150808211156200166257600080fd5b818601915086601f8301126200167757600080fd5b8135818111156200168757600080fd5b8760208260051b85010111156200169d57600080fd5b6020830194508093505050509250925092565b600060208284031215620016c357600080fd5b81356001600160401b03811115620016da57600080fd5b620016e88482850162001587565b949350505050565b6001600160a01b0391909116815260200190565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b60208152600062000ed360208301846200172a565b6020808252825182820181905260009190848201906040850190845b81811015620017b05783516001600160a01b03168352928401929184019160010162001789565b50909695505050505050565b803562ffffff81168114620017d057600080fd5b919050565b8060020b81146200151b57600080fd5b60008060008060008060c08789031215620017ff57600080fd5b86356200180c8162001505565b955060208701356200181e8162001505565b94506200182e60408801620017bc565b9350606087013561ffff811681146200184657600080fd5b925060808701356200185881620017d5565b915060a08701356200186a81620017d5565b809150509295509295509295565b600080600080600060a086880312156200189157600080fd5b85356200189e8162001505565b94506020860135620018b08162001505565b9350620018c060408701620017bc565b92506060860135620018d281620017d5565b91506080860135620018e481620017d5565b809150509295509295909350565b600080604083850312156200190657600080fd5b8235620019138162001505565b91506020830135620019258162001505565b809150509250929050565b6000806000606084860312156200194657600080fd5b8335620019538162001505565b92506020840135620019658162001505565b91506040840135620019778162001505565b809150509250925092565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811262001a0c57600080fd5b8301803591506001600160401b0382111562001a2757600080fd5b6020019150368190038213156200134f57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001aa85762001aa862001a7d565b5060010190565b80820180821115620007f657620007f662001a7d565b60006020828403121562001ad857600080fd5b81516001600160401b038082111562001af057600080fd5b818401915084601f83011262001b0557600080fd5b81518181111562001b1a5762001b1a6200153e565b62001b2f601f8201601f191660200162001554565b915080825285602082850101111562001b4757600080fd5b62001b5a81602084016020860162001704565b50949350505050565b60006020828403121562001b7657600080fd5b815162000ed38162001505565b60e08152600062001b9860e08301896200172a565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001c0c818460208b0162001704565b86519083019062001c22818360208b0162001704565b865191019062001c37818360208a0162001704565b855191019062001c4c81836020890162001704565b845191019062001c6181836020880162001704565b01979650505050505050565b60006020828403121562001c8057600080fd5b815162000ed381620017d5565b60008260020b8062001caf57634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220bab4dc364f42f8e82ed2983d450c7f7b787f86ecc2b056c62a10271dfd59e29364736f6c63430008130033", - "deployedBytecode": "0x60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e620001583660046200151e565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e3660046200160f565b62000448565b6200015e620001a5366004620016b0565b620005b0565b6200016a6200068a565b6200015e620001c6366004620016b0565b620006f5565b6200016a620001dd3660046200151e565b620007d3565b620001ed620007fc565b604051620001749190620016f0565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001758565b6200023a6200080b565b6040516200017491906200176d565b6200023a6200025a3660046200151e565b62000820565b6200023a620008dd565b6200015e62000997565b620001ed62000285366004620017e5565b62000a04565b600254620001ed906001600160a01b031681565b620002b6620002b03660046200151e565b62000a22565b604051901515815260200162000174565b620001ed620002d836600462001878565b62000a3f565b62000221620002ef366004620018f2565b62000a5e565b6200015e6200030636600462001930565b62000bad565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e620003593660046200151e565b62000cb7565b6200015e620003703660046200151e565b62000d56565b620001ed620003873660046200151e565b62000e3d565b3362000398620007fc565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001982565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b03909116908490620019c4565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000ea4565b905090565b3362000453620007fc565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001982565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005aa57838181518110620004eb57620004eb620019de565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052c576200052c620019de565b9050602002810190620005409190620019f4565b6040518463ffffffff1660e01b8152600401620005609392919062001a3d565b600060405180830381600087803b1580156200057b57600080fd5b505af115801562000590573d6000803e3d6000fd5b505050508080620005a19062001a93565b915050620004cc565b50505050565b33620005bb620007fc565b6001600160a01b031614620005e45760405162461bcd60e51b8152600401620003c19062001982565b60005b81518110156200068657818181518110620006065762000606620019de565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063c9190620016f0565b600060405180830381600087803b1580156200065757600080fd5b505af11580156200066c573d6000803e3d6000fd5b5050505080806200067d9062001a93565b915050620005e7565b5050565b60008062000697620008dd565b905060005b8151811015620006f057620006cd828281518110620006bf57620006bf620019de565b6020026020010151620007d3565b620006d9908462001aaf565b925080620006e78162001a93565b9150506200069c565b505090565b3362000700620007fc565b6001600160a01b031614620007295760405162461bcd60e51b8152600401620003c19062001982565b60005b815181101562000686578181815181106200074b576200074b620019de565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200078992911690600401620016f0565b600060405180830381600087803b158015620007a457600080fd5b505af1158015620007b9573d6000803e3d6000fd5b505050508080620007ca9062001a93565b9150506200072c565b6001600160a01b0381166000908152600560205260408120620007f69062000ea4565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200082f83620007d3565b90506000816001600160401b038111156200084e576200084e6200153e565b60405190808252806020026020018201604052801562000878578160200160208202803683370190505b50905060005b82811015620008d55762000893858262000eaf565b828281518110620008a857620008a8620019de565b6001600160a01b039092166020928302919091019091015280620008cc8162001a93565b9150506200087e565b509392505050565b60606000620008eb62000435565b90506000816001600160401b038111156200090a576200090a6200153e565b60405190808252806020026020018201604052801562000934578160200160208202803683370190505b50905060005b8281101562000990576200094e8162000eda565b828281518110620009635762000963620019de565b6001600160a01b039092166020928302919091019091015280620009878162001a93565b9150506200093a565b5092915050565b33620009a2620007fc565b6001600160a01b031614620009cb5760405162461bcd60e51b8152600401620003c19062001982565b600080546040516001600160a01b039091169060008051602062002651833981519152908390a3600080546001600160a01b0319169055565b600062000a178787878787873362000ee9565b979650505050505050565b600062000a2f8262000e3d565b6001600160a01b03161592915050565b600062000a5486868660008787600062000ee9565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000aa1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000acb919081019062001ac5565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000b0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b38919081019062001ac5565b905062000ba46040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001243565b95945050505050565b600054600160a81b900460ff168062000bd05750600054600160a01b900460ff16155b62000c355760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000c60576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005aa576000805460ff60a81b1916905550505050565b3362000cc2620007fc565b6001600160a01b03161462000ceb5760405162461bcd60e51b8152600401620003c19062001982565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000d2c916001600160a01b03909116908490620019c4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000d61620007fc565b6001600160a01b03161462000d8a5760405162461bcd60e51b8152600401620003c19062001982565b6001600160a01b03811662000df35760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200265183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007f6919062001b63565b6000620007f6825490565b6001600160a01b038216600090815260056020526040812062000ed390836200127a565b9392505050565b6000620007f66003836200127a565b600080600062000efa8a8a62001288565b6001546040519294509092506001600160a01b031690309062000f1d90620014f7565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000f60573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb99062000fb29086908690600401620019c4565b600060405180830381865afa92505050801562000ff357506040513d6000823e601f3d908101601f1916820160405262000ff0919081019062001ac5565b60015b1562000ffc5790505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee8290606401602060405180830381865afa1580156200107b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010a1919062001b63565b90506001600160a01b038116620010f95760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b6200110681898962001356565b6200114b5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200118390859085908e908e908e908e9060040162001b83565b600060405180830381600087803b1580156200119e57600080fd5b505af1158015620011b3573d6000803e3d6000fd5b50505050620011cd3360036200140390919063ffffffff16565b50336000908152600560205260409020620011e9908662001403565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200126095949392919062001bf8565b604051602081830303815290604052905095945050505050565b600062000ed383836200141a565b600080826001600160a01b0316846001600160a01b031603620012db5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620012fd57828462001300565b83835b90925090506001600160a01b0382166200134f5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001398573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013be919062001c6d565b90508260020b8460020b128015620013e25750620013dd818562001c8d565b60020b155b801562000ba45750620013f6818462001c8d565b60020b1595945050505050565b600062000ed3836001600160a01b038416620014a5565b815460009082106200147a5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b826000018281548110620014925762001492620019de565b9060005260206000200154905092915050565b6000818152600183016020526040812054620014ee57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007f6565b506000620007f6565b6109928062001cbf83390190565b6001600160a01b03811681146200151b57600080fd5b50565b6000602082840312156200153157600080fd5b813562000ed38162001505565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200157f576200157f6200153e565b604052919050565b600082601f8301126200159957600080fd5b813560206001600160401b03821115620015b757620015b76200153e565b8160051b620015c882820162001554565b9283528481018201928281019087851115620015e357600080fd5b83870192505b8483101562000a17578235620015ff8162001505565b82529183019190830190620015e9565b6000806000604084860312156200162557600080fd5b83356001600160401b03808211156200163d57600080fd5b6200164b8783880162001587565b945060208601359150808211156200166257600080fd5b818601915086601f8301126200167757600080fd5b8135818111156200168757600080fd5b8760208260051b85010111156200169d57600080fd5b6020830194508093505050509250925092565b600060208284031215620016c357600080fd5b81356001600160401b03811115620016da57600080fd5b620016e88482850162001587565b949350505050565b6001600160a01b0391909116815260200190565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b60208152600062000ed360208301846200172a565b6020808252825182820181905260009190848201906040850190845b81811015620017b05783516001600160a01b03168352928401929184019160010162001789565b50909695505050505050565b803562ffffff81168114620017d057600080fd5b919050565b8060020b81146200151b57600080fd5b60008060008060008060c08789031215620017ff57600080fd5b86356200180c8162001505565b955060208701356200181e8162001505565b94506200182e60408801620017bc565b9350606087013561ffff811681146200184657600080fd5b925060808701356200185881620017d5565b915060a08701356200186a81620017d5565b809150509295509295509295565b600080600080600060a086880312156200189157600080fd5b85356200189e8162001505565b94506020860135620018b08162001505565b9350620018c060408701620017bc565b92506060860135620018d281620017d5565b91506080860135620018e481620017d5565b809150509295509295909350565b600080604083850312156200190657600080fd5b8235620019138162001505565b91506020830135620019258162001505565b809150509250929050565b6000806000606084860312156200194657600080fd5b8335620019538162001505565b92506020840135620019658162001505565b91506040840135620019778162001505565b809150509250925092565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811262001a0c57600080fd5b8301803591506001600160401b0382111562001a2757600080fd5b6020019150368190038213156200134f57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001aa85762001aa862001a7d565b5060010190565b80820180821115620007f657620007f662001a7d565b60006020828403121562001ad857600080fd5b81516001600160401b038082111562001af057600080fd5b818401915084601f83011262001b0557600080fd5b81518181111562001b1a5762001b1a6200153e565b62001b2f601f8201601f191660200162001554565b915080825285602082850101111562001b4757600080fd5b62001b5a81602084016020860162001704565b50949350505050565b60006020828403121562001b7657600080fd5b815162000ed38162001505565b60e08152600062001b9860e08301896200172a565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001c0c818460208b0162001704565b86519083019062001c22818360208b0162001704565b865191019062001c37818360208a0162001704565b855191019062001c4c81836020890162001704565b845191019062001c6181836020880162001704565b01979650505050505050565b60006020828403121562001c8057600080fd5b815162000ed381620017d5565b60008260020b8062001caf57634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220bab4dc364f42f8e82ed2983d450c7f7b787f86ecc2b056c62a10271dfd59e29364736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "managerFee": "proportion of earned fees that go to pool manager in Basis Points", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "createPool(address,address,uint24,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "getDeployers()": { - "returns": { - "_0": "deployers the list of deployer addresses" - } - }, - "getGelatoPools()": { - "returns": { - "_0": "list of Gelato managed G-UNI pool addresses" - } - }, - "getPools(address)": { - "params": { - "deployer": "address that has potentially deployed G-UNI pools (can return empty array)" - }, - "returns": { - "_0": "pools the list of G-UNI pool addresses deployed by `deployer`" - } - }, - "getProxyAdmin(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "address that controls the G-UNI implementation (has power to upgrade it)" - } - }, - "isPoolImmutable(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "bool signaling if pool is immutable (true) or not (false)" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "numDeployers()": { - "returns": { - "_0": "total number of G-UNI pool deployer addresses" - } - }, - "numPools()": { - "returns": { - "result": "total number of G-UNI pools deployed" - } - }, - "numPools(address)": { - "params": { - "deployer": "deployer address" - }, - "returns": { - "_0": "total number of G-UNI pools deployed by `deployer`" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "notice": "createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`" - }, - "createPool(address,address,uint24,int24,int24)": { - "notice": "createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`" - }, - "getDeployers()": { - "notice": "getDeployers fetches all addresses that have deployed a G-UNI pool" - }, - "getGelatoPools()": { - "notice": "getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)" - }, - "getPools(address)": { - "notice": "getPools fetches all the G-UNI pool addresses deployed by `deployer`" - }, - "getProxyAdmin(address)": { - "notice": "getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address)." - }, - "isPoolImmutable(address)": { - "notice": "isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded" - }, - "numDeployers()": { - "notice": "numDeployers counts the total number of G-UNI pool deployer addresses" - }, - "numPools()": { - "notice": "numPools counts the total number of G-UNI pools in existence" - }, - "numPools(address)": { - "notice": "numPools counts the total number of G-UNI pools deployed by `deployer`" - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6441, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_manager", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 5, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initialized", - "offset": 20, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initializing", - "offset": 21, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 5909, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "poolImplementation", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 5911, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "gelatoDeployer", - "offset": 0, - "slot": "2", - "type": "t_address" - }, - { - "astId": 5914, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_deployers", - "offset": 0, - "slot": "3", - "type": "t_struct(AddressSet)2007_storage" - }, - { - "astId": 5919, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_pools", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_struct(AddressSet)2007_storage)" - } - ], - "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_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(AddressSet)2007_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.AddressSet)", - "numberOfBytes": "32", - "value": "t_struct(AddressSet)2007_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(AddressSet)2007_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.AddressSet", - "members": [ - { - "astId": 2006, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1732_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Set)1732_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 1727, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 1731, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "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/lib/g-uni-v1-core/deployments/axisBlast/GUniFactory_Proxy.json b/lib/g-uni-v1-core/deployments/axisBlast/GUniFactory_Proxy.json deleted file mode 100644 index 98c016ee1..000000000 --- a/lib/g-uni-v1-core/deployments/axisBlast/GUniFactory_Proxy.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "address": "0xCa5eb015d7A527337109798524470e215346A617", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x579b4f96c1e08a2feb76b2d54f68b1f43e370ab29a8ad9ac3fc2489830798bfb", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0xCa5eb015d7A527337109798524470e215346A617", - "transactionIndex": 0, - "gasUsed": "551340", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000000000000400000000000000020200000000000000000000000000000000000000000000000000000008000000000000000000000000000200000000000000020000000000000000000800000000002000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000010000000008000000000000000000020001000000000000000000400000000000000000000000000000008000000000000", - "blockHash": "0x158e2e6ae0ac1282d2fa33246b657ab0d2c6503b04c36abc0e40334ee35aa4d5", - "transactionHash": "0x579b4f96c1e08a2feb76b2d54f68b1f43e370ab29a8ad9ac3fc2489830798bfb", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 4490173, - "transactionHash": "0x579b4f96c1e08a2feb76b2d54f68b1f43e370ab29a8ad9ac3fc2489830798bfb", - "address": "0xCa5eb015d7A527337109798524470e215346A617", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000008b87749b379f5bca1d74a7b3d4e9f3ded41c706" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0x158e2e6ae0ac1282d2fa33246b657ab0d2c6503b04c36abc0e40334ee35aa4d5" - }, - { - "transactionIndex": 0, - "blockNumber": 4490173, - "transactionHash": "0x579b4f96c1e08a2feb76b2d54f68b1f43e370ab29a8ad9ac3fc2489830798bfb", - "address": "0xCa5eb015d7A527337109798524470e215346A617", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0x158e2e6ae0ac1282d2fa33246b657ab0d2c6503b04c36abc0e40334ee35aa4d5" - } - ], - "blockNumber": 4490173, - "cumulativeGasUsed": "551340", - "status": 1, - "byzantium": true - }, - "args": [ - "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b00000000000000000000000008b87749b379f5bca1d74a7b3d4e9f3ded41c706000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/axisBlast/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json b/lib/g-uni-v1-core/deployments/axisBlast/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json deleted file mode 100644 index 371127af2..000000000 --- a/lib/g-uni-v1-core/deployments/axisBlast/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\n/// @dev Modified to support 0.8.19\n/// @dev Modified to set the gelatoFeeBPS to 0\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 0;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n event SetManagerFee(uint16 managerFee);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n emit SetManagerFee(_managerFeeBPS);\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidityBefore,\n uint128 liquidityAfter\n );\n\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n SafeCast.toUint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidityBurned);\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n\n amount0 =\n burn0 +\n FullMath.mulDiv(\n token0.balanceOf(address(this)) -\n burn0 -\n managerBalance0 -\n gelatoBalance0,\n burnAmount,\n totalSupply\n );\n amount1 =\n burn1 +\n FullMath.mulDiv(\n token1.balanceOf(address(this)) -\n burn1 -\n managerBalance1 -\n gelatoBalance1,\n burnAmount,\n totalSupply\n );\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n // solhint-disable-next-line function-max-lines\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n uint128 liquidity;\n uint128 newLiquidity;\n if (totalSupply() > 0) {\n (liquidity, , , , ) = pool.positions(_getPositionID());\n if (liquidity > 0) {\n (, , uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n }\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > 0, \"new position 0\");\n } else {\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n }\n\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n _rebalance(\n liquidity,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > liquidity, \"liquidity must increase\");\n\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\n external\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n // solhint-disable-next-line function-max-lines\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\n internal\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint128 liquidity,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n uint256 leftover0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 leftover1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n (, , uint256 feesEarned0, uint256 feesEarned1) =\n _withdraw(lowerTick, upperTick, liquidity);\n _applyFees(feesEarned0, feesEarned1);\n (feesEarned0, feesEarned1) = _subtractAdminFees(\n feesEarned0,\n feesEarned1\n );\n emit FeesEarned(feesEarned0, feesEarned1);\n feesEarned0 += leftover0;\n feesEarned1 += leftover1;\n\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n leftover0,\n leftover1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdraw(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n )\n private\n returns (\n uint256 burn0,\n uint256 burn1,\n uint256 fee0,\n uint256 fee1\n )\n {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n SafeCast.toInt256(\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\n );\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array len\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"high slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"high slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\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 require(value < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return uint128(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 require(value < 2**64, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return uint64(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 require(value < 2**32, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return uint32(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 require(value < 2**16, \"SafeCast: value doesn\\'t fit in 16 bits\");\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 require(value < 2**8, \"SafeCast: value doesn\\'t fit in 8 bits\");\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 require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= -2**127 && value < 2**127, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return int128(value);\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= -2**63 && value < 2**63, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return int64(value);\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= -2**31 && value < 2**31, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return int32(value);\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= -2**15 && value < 2**15, \"SafeCast: value doesn\\'t fit in 16 bits\");\n return int16(value);\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= -2**7 && value < 2**7, \"SafeCast: value doesn\\'t fit in 8 bits\");\n return int8(value);\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 require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IUniswapV3TickSpacing} from \"./interfaces/IUniswapV3TickSpacing.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n }\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n 0,\n lowerTick,\n upperTick,\n address(0)\n );\n }\n\n function _createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n address manager\n ) internal returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory name = \"Gelato Uniswap LP\";\n try this.getTokenName(token0, token1) returns (string memory result) {\n name = result;\n } catch {} // solhint-disable-line no-empty-blocks\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n require(uniPool != address(0), \"uniswap pool does not exist\");\n require(\n _validateTickSpacing(uniPool, lowerTick, upperTick),\n \"tickSpacing mismatch\"\n );\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n manager\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, manager, pool);\n }\n\n function _validateTickSpacing(\n address uniPool,\n int24 lowerTick,\n int24 upperTick\n ) internal view returns (bool) {\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\n return\n lowerTick < upperTick &&\n lowerTick % spacing == 0 &&\n upperTick % spacing == 0;\n }\n\n function getTokenName(address token0, address token1)\n external\n view\n returns (string memory)\n {\n string memory symbol0 = IERC20Metadata(token0).symbol();\n string memory symbol1 = IERC20Metadata(token1).symbol();\n\n return _append(\"Gelato Uniswap \", symbol0, \"/\", symbol1, \" LP\");\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IUniswapV3TickSpacing.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IUniswapV3TickSpacing {\n function tickSpacing() external view returns (int24);\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "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/lib/g-uni-v1-core/deployments/baseSepolia/.chainId b/lib/g-uni-v1-core/deployments/baseSepolia/.chainId deleted file mode 100644 index 667f99daf..000000000 --- a/lib/g-uni-v1-core/deployments/baseSepolia/.chainId +++ /dev/null @@ -1 +0,0 @@ -84532 \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/baseSepolia/GUniFactory.json b/lib/g-uni-v1-core/deployments/baseSepolia/GUniFactory.json deleted file mode 100644 index 7b3c50b5d..000000000 --- a/lib/g-uni-v1-core/deployments/baseSepolia/GUniFactory.json +++ /dev/null @@ -1,721 +0,0 @@ -{ - "address": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - } - ], - "transactionHash": "0x29025b7246215a4b4c5da6f6dbc324c3bc1f03b3e5f28228c07755e3baaf131c", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b", - "transactionIndex": 6, - "gasUsed": "551510", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000000000200400000000000000000000000100000000000000000000000000000000000000000000000008000000000000000008000000000200000000000000020000000000000000000800000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000020010000000000000000000400008000000000000001000000000000000000000000", - "blockHash": "0x1ab87b9371d9cea1d2ff5b61e96d7bf33f9a806f3eb8ffb09b9103bf905be9dc", - "transactionHash": "0x29025b7246215a4b4c5da6f6dbc324c3bc1f03b3e5f28228c07755e3baaf131c", - "logs": [ - { - "transactionIndex": 6, - "blockNumber": 11136393, - "transactionHash": "0x29025b7246215a4b4c5da6f6dbc324c3bc1f03b3e5f28228c07755e3baaf131c", - "address": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b1e9e16a40321fe06cfd797619c345c143d11aa7" - ], - "data": "0x", - "logIndex": 8, - "blockHash": "0x1ab87b9371d9cea1d2ff5b61e96d7bf33f9a806f3eb8ffb09b9103bf905be9dc" - }, - { - "transactionIndex": 6, - "blockNumber": 11136393, - "transactionHash": "0x29025b7246215a4b4c5da6f6dbc324c3bc1f03b3e5f28228c07755e3baaf131c", - "address": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "data": "0x", - "logIndex": 9, - "blockHash": "0x1ab87b9371d9cea1d2ff5b61e96d7bf33f9a806f3eb8ffb09b9103bf905be9dc" - } - ], - "blockNumber": 11136393, - "cumulativeGasUsed": "1167576", - "status": 1, - "byzantium": true - }, - "args": [ - "0xB1e9E16a40321Fe06Cfd797619C345c143D11Aa7", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b000000000000000000000000b1e9e16a40321fe06cfd797619c345c143d11aa7000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033", - "execute": { - "methodName": "initialize", - "args": [ - "0xB1e9E16a40321Fe06Cfd797619C345c143D11Aa7", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - ] - }, - "implementation": "0xB1e9E16a40321Fe06Cfd797619C345c143D11Aa7", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/baseSepolia/GUniFactory_Implementation.json b/lib/g-uni-v1-core/deployments/baseSepolia/GUniFactory_Implementation.json deleted file mode 100644 index e3867ea21..000000000 --- a/lib/g-uni-v1-core/deployments/baseSepolia/GUniFactory_Implementation.json +++ /dev/null @@ -1,802 +0,0 @@ -{ - "address": "0xB1e9E16a40321Fe06Cfd797619C345c143D11Aa7", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_uniswapV3Factory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xdfe8e3f97ab751a7eb3d9a4fcb983a440c6d6f0aee5c79ee7c14b95364444aa8", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0xB1e9E16a40321Fe06Cfd797619C345c143D11Aa7", - "transactionIndex": 3, - "gasUsed": "2186401", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x87b534111cb0efa719c884232cb455f071a518a545c7ed40700f5bfca25a8429", - "transactionHash": "0xdfe8e3f97ab751a7eb3d9a4fcb983a440c6d6f0aee5c79ee7c14b95364444aa8", - "logs": [], - "blockNumber": 11136382, - "cumulativeGasUsed": "2534455", - "status": 1, - "byzantium": true - }, - "args": [ - "0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_uniswapV3Factory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"uniPool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previosGelatoDeployer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newGelatoDeployer\",\"type\":\"address\"}],\"name\":\"UpdateGelatoDeployer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"UpdatePoolImplementation\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createManagedPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDeployers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGelatoPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"getTokenName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gelatoDeployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isPoolImmutable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"makePoolsImmutable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numDeployers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextGelatoDeployer\",\"type\":\"address\"}],\"name\":\"setGelatoDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextImplementation\",\"type\":\"address\"}],\"name\":\"setPoolImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"upgradePools\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"bytes[]\",\"name\":\"datas\",\"type\":\"bytes[]\"}],\"name\":\"upgradePoolsAndCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"managerFee\":\"proportion of earned fees that go to pool manager in Basis Points\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"createPool(address,address,uint24,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"getDeployers()\":{\"returns\":{\"_0\":\"deployers the list of deployer addresses\"}},\"getGelatoPools()\":{\"returns\":{\"_0\":\"list of Gelato managed G-UNI pool addresses\"}},\"getPools(address)\":{\"params\":{\"deployer\":\"address that has potentially deployed G-UNI pools (can return empty array)\"},\"returns\":{\"_0\":\"pools the list of G-UNI pool addresses deployed by `deployer`\"}},\"getProxyAdmin(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"address that controls the G-UNI implementation (has power to upgrade it)\"}},\"isPoolImmutable(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"bool signaling if pool is immutable (true) or not (false)\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"numDeployers()\":{\"returns\":{\"_0\":\"total number of G-UNI pool deployer addresses\"}},\"numPools()\":{\"returns\":{\"result\":\"total number of G-UNI pools deployed\"}},\"numPools(address)\":{\"params\":{\"deployer\":\"deployer address\"},\"returns\":{\"_0\":\"total number of G-UNI pools deployed by `deployer`\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"notice\":\"createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`\"},\"createPool(address,address,uint24,int24,int24)\":{\"notice\":\"createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`\"},\"getDeployers()\":{\"notice\":\"getDeployers fetches all addresses that have deployed a G-UNI pool\"},\"getGelatoPools()\":{\"notice\":\"getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)\"},\"getPools(address)\":{\"notice\":\"getPools fetches all the G-UNI pool addresses deployed by `deployer`\"},\"getProxyAdmin(address)\":{\"notice\":\"getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address).\"},\"isPoolImmutable(address)\":{\"notice\":\"isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\"},\"numDeployers()\":{\"notice\":\"numDeployers counts the total number of G-UNI pool deployer addresses\"},\"numPools()\":{\"notice\":\"numPools counts the total number of G-UNI pools in existence\"},\"numPools(address)\":{\"notice\":\"numPools counts the total number of G-UNI pools deployed by `deployer`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniFactory.sol\":\"GUniFactory\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\\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\":\"0x4878ef6c288f4cef3c2a288d32cc548c648831cc55503ad3d9a581ed3b93aad9\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title The interface for the Uniswap V3 Factory\\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\\ninterface IUniswapV3Factory {\\n /// @notice Emitted when the owner of the factory is changed\\n /// @param oldOwner The owner before the owner was changed\\n /// @param newOwner The owner after the owner was changed\\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\\n\\n /// @notice Emitted when a pool is created\\n /// @param token0 The first token of the pool by address sort order\\n /// @param token1 The second token of the pool by address sort order\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks\\n /// @param pool The address of the created pool\\n event PoolCreated(\\n address indexed token0,\\n address indexed token1,\\n uint24 indexed fee,\\n int24 tickSpacing,\\n address pool\\n );\\n\\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\\n /// @param fee The enabled fee, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\\n\\n /// @notice Returns the current owner of the factory\\n /// @dev Can be changed by the current owner via setOwner\\n /// @return The address of the factory owner\\n function owner() external view returns (address);\\n\\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\\n /// @return The tick spacing\\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\\n\\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\\n /// @param tokenA The contract address of either token0 or token1\\n /// @param tokenB The contract address of the other token\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @return pool The pool address\\n function getPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external view returns (address pool);\\n\\n /// @notice Creates a pool for the given two tokens and fee\\n /// @param tokenA One of the two tokens in the desired pool\\n /// @param tokenB The other of the two tokens in the desired pool\\n /// @param fee The desired fee for the pool\\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\\n /// are invalid.\\n /// @return pool The address of the newly created pool\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external returns (address pool);\\n\\n /// @notice Updates the owner of the factory\\n /// @dev Must be called by the current owner\\n /// @param _owner The new owner of the factory\\n function setOwner(address _owner) external;\\n\\n /// @notice Enables a fee amount with the given tickSpacing\\n /// @dev Fee amounts may never be removed once enabled\\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\\n}\\n\",\"keccak256\":\"0xcc3d0c93fc9ac0febbe09f941b465b57f750bcf3b48432da0b97dc289cfdc489\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {\\n IUniswapV3Factory\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\\\";\\nimport {IUniswapV3TickSpacing} from \\\"./interfaces/IUniswapV3TickSpacing.sol\\\";\\nimport {IGUniFactory} from \\\"./interfaces/IGUniFactory.sol\\\";\\nimport {IGUniPoolStorage} from \\\"./interfaces/IGUniPoolStorage.sol\\\";\\nimport {GUniFactoryStorage} from \\\"./abstract/GUniFactoryStorage.sol\\\";\\nimport {EIP173Proxy} from \\\"./vendor/proxy/EIP173Proxy.sol\\\";\\nimport {IEIP173Proxy} from \\\"./interfaces/IEIP173Proxy.sol\\\";\\nimport {\\n IERC20Metadata\\n} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n constructor(address _uniswapV3Factory)\\n GUniFactoryStorage(_uniswapV3Factory)\\n {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n managerFee,\\n lowerTick,\\n upperTick,\\n msg.sender\\n );\\n }\\n\\n /// @notice createPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n 0,\\n lowerTick,\\n upperTick,\\n address(0)\\n );\\n }\\n\\n function _createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick,\\n address manager\\n ) internal returns (address pool) {\\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\\n\\n pool = address(new EIP173Proxy(poolImplementation, address(this), \\\"\\\"));\\n\\n string memory name = \\\"Gelato Uniswap LP\\\";\\n try this.getTokenName(token0, token1) returns (string memory result) {\\n name = result;\\n } catch {} // solhint-disable-line no-empty-blocks\\n\\n address uniPool =\\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\\n require(uniPool != address(0), \\\"uniswap pool does not exist\\\");\\n require(\\n _validateTickSpacing(uniPool, lowerTick, upperTick),\\n \\\"tickSpacing mismatch\\\"\\n );\\n\\n IGUniPoolStorage(pool).initialize(\\n name,\\n \\\"G-UNI\\\",\\n uniPool,\\n managerFee,\\n lowerTick,\\n upperTick,\\n manager\\n );\\n _deployers.add(msg.sender);\\n _pools[msg.sender].add(pool);\\n emit PoolCreated(uniPool, manager, pool);\\n }\\n\\n function _validateTickSpacing(\\n address uniPool,\\n int24 lowerTick,\\n int24 upperTick\\n ) internal view returns (bool) {\\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\\n return\\n lowerTick < upperTick &&\\n lowerTick % spacing == 0 &&\\n upperTick % spacing == 0;\\n }\\n\\n function getTokenName(address token0, address token1)\\n external\\n view\\n returns (string memory)\\n {\\n string memory symbol0 = IERC20Metadata(token0).symbol();\\n string memory symbol1 = IERC20Metadata(token1).symbol();\\n\\n return _append(\\\"Gelato Uniswap \\\", symbol0, \\\"/\\\", symbol1, \\\" LP\\\");\\n }\\n\\n function upgradePools(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\\n }\\n }\\n\\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\\n external\\n onlyManager\\n {\\n require(pools.length == datas.length, \\\"mismatching array length\\\");\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeToAndCall(\\n poolImplementation,\\n datas[i]\\n );\\n }\\n }\\n\\n function makePoolsImmutable(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\\n }\\n }\\n\\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the\\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\\n /// @param pool address of the G-UNI pool\\n /// @return bool signaling if pool is immutable (true) or not (false)\\n function isPoolImmutable(address pool) external view returns (bool) {\\n return address(0) == getProxyAdmin(pool);\\n }\\n\\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\\n /// @return list of Gelato managed G-UNI pool addresses\\n function getGelatoPools() external view returns (address[] memory) {\\n return getPools(gelatoDeployer);\\n }\\n\\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\\n /// @return deployers the list of deployer addresses\\n function getDeployers() public view returns (address[] memory) {\\n uint256 length = numDeployers();\\n address[] memory deployers = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n deployers[i] = _getDeployer(i);\\n }\\n\\n return deployers;\\n }\\n\\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\\n function getPools(address deployer) public view returns (address[] memory) {\\n uint256 length = numPools(deployer);\\n address[] memory pools = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n pools[i] = _getPool(deployer, i);\\n }\\n\\n return pools;\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools in existence\\n /// @return result total number of G-UNI pools deployed\\n function numPools() public view returns (uint256 result) {\\n address[] memory deployers = getDeployers();\\n for (uint256 i = 0; i < deployers.length; i++) {\\n result += numPools(deployers[i]);\\n }\\n }\\n\\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\\n /// @return total number of G-UNI pool deployer addresses\\n function numDeployers() public view returns (uint256) {\\n return _deployers.length();\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\\n /// @param deployer deployer address\\n /// @return total number of G-UNI pools deployed by `deployer`\\n function numPools(address deployer) public view returns (uint256) {\\n return _pools[deployer].length();\\n }\\n\\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\\n /// no longer upgradable (no one owns the zero address).\\n /// @param pool address of the G-UNI pool\\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\\n function getProxyAdmin(address pool) public view returns (address) {\\n return IEIP173Proxy(pool).proxyAdmin();\\n }\\n\\n function _getDeployer(uint256 index) internal view returns (address) {\\n return _deployers.at(index);\\n }\\n\\n function _getPool(address deployer, uint256 index)\\n internal\\n view\\n returns (address)\\n {\\n return _pools[deployer].at(index);\\n }\\n\\n function _getTokenOrder(address tokenA, address tokenB)\\n internal\\n pure\\n returns (address token0, address token1)\\n {\\n require(tokenA != tokenB, \\\"same token\\\");\\n (token0, token1) = tokenA < tokenB\\n ? (tokenA, tokenB)\\n : (tokenB, tokenA);\\n require(token0 != address(0), \\\"no address zero\\\");\\n }\\n\\n function _append(\\n string memory a,\\n string memory b,\\n string memory c,\\n string memory d,\\n string memory e\\n ) internal pure returns (string memory) {\\n return string(abi.encodePacked(a, b, c, d, e));\\n }\\n}\\n\",\"keccak256\":\"0x41d2d6a42321eed641468824c4d0ba4fbe40040895304388315ece96132011d6\",\"license\":\"MIT\"},\"contracts/abstract/GUniFactoryStorage.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n Initializable\\n} from \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\n// solhint-disable-next-line max-states-count\\ncontract GUniFactoryStorage is\\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\\n Initializable\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n address public immutable factory;\\n address public poolImplementation;\\n address public gelatoDeployer;\\n EnumerableSet.AddressSet internal _deployers;\\n mapping(address => EnumerableSet.AddressSet) internal _pools;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdatePoolImplementation(\\n address previousImplementation,\\n address newImplementation\\n );\\n\\n event UpdateGelatoDeployer(\\n address previosGelatoDeployer,\\n address newGelatoDeployer\\n );\\n\\n constructor(address _uniswapV3Factory) {\\n factory = _uniswapV3Factory;\\n }\\n\\n function initialize(\\n address _implementation,\\n address _gelatoDeployer,\\n address _manager_\\n ) external initializer {\\n poolImplementation = _implementation;\\n gelatoDeployer = _gelatoDeployer;\\n _manager = _manager_;\\n }\\n\\n function setPoolImplementation(address nextImplementation)\\n external\\n onlyManager\\n {\\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\\n poolImplementation = nextImplementation;\\n }\\n\\n function setGelatoDeployer(address nextGelatoDeployer)\\n external\\n onlyManager\\n {\\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\\n gelatoDeployer = nextGelatoDeployer;\\n }\\n}\\n\",\"keccak256\":\"0xb0e3a7e77ab8aecf8997593526451e64dd8e8aa07882c210c9aa38d4f7168755\",\"license\":\"MIT\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xb6016d5611f38fbd516a84ea2e56794cb76a8d61c40f6716d5f0133f195759bd\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IEIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IEIP173Proxy {\\n function proxyAdmin() external view returns (address);\\n\\n function transferProxyAdmin(address newAdmin) external;\\n\\n function upgradeTo(address newImplementation) external;\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable;\\n}\\n\",\"keccak256\":\"0xae9996ea370d97cb5fd1934394aca615bee0e46c9a0c161d728490264e83eda5\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IGUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\ninterface IGUniFactory {\\n event PoolCreated(\\n address indexed uniPool,\\n address indexed manager,\\n address indexed pool\\n );\\n\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n}\\n\",\"keccak256\":\"0xe06f79e9b1e6351fc4f40c9f25630f0fbfabae9d2ae2bb642ef1f03d4c2195c1\",\"license\":\"MIT\"},\"contracts/interfaces/IGUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IGUniPoolStorage {\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external;\\n}\\n\",\"keccak256\":\"0x52a3f83a23917772f1eb242cecdfa8b45d7b357a615383628c1ac1f26259dd3f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IUniswapV3TickSpacing.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IUniswapV3TickSpacing {\\n function tickSpacing() external view returns (int24);\\n}\\n\",\"keccak256\":\"0xa6f22651f7e49c6eecf584d8e829d31336de7c43eec3c4c4df3b309db27bd355\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b5060405161273838038061273883398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516126a661009260003960008181610312015261103101526126a66000f3fe60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e620001583660046200151e565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e3660046200160f565b62000448565b6200015e620001a5366004620016b0565b620005b0565b6200016a6200068a565b6200015e620001c6366004620016b0565b620006f5565b6200016a620001dd3660046200151e565b620007d3565b620001ed620007fc565b604051620001749190620016f0565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001758565b6200023a6200080b565b6040516200017491906200176d565b6200023a6200025a3660046200151e565b62000820565b6200023a620008dd565b6200015e62000997565b620001ed62000285366004620017e5565b62000a04565b600254620001ed906001600160a01b031681565b620002b6620002b03660046200151e565b62000a22565b604051901515815260200162000174565b620001ed620002d836600462001878565b62000a3f565b62000221620002ef366004620018f2565b62000a5e565b6200015e6200030636600462001930565b62000bad565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e620003593660046200151e565b62000cb7565b6200015e620003703660046200151e565b62000d56565b620001ed620003873660046200151e565b62000e3d565b3362000398620007fc565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001982565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b03909116908490620019c4565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000ea4565b905090565b3362000453620007fc565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001982565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005aa57838181518110620004eb57620004eb620019de565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052c576200052c620019de565b9050602002810190620005409190620019f4565b6040518463ffffffff1660e01b8152600401620005609392919062001a3d565b600060405180830381600087803b1580156200057b57600080fd5b505af115801562000590573d6000803e3d6000fd5b505050508080620005a19062001a93565b915050620004cc565b50505050565b33620005bb620007fc565b6001600160a01b031614620005e45760405162461bcd60e51b8152600401620003c19062001982565b60005b81518110156200068657818181518110620006065762000606620019de565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063c9190620016f0565b600060405180830381600087803b1580156200065757600080fd5b505af11580156200066c573d6000803e3d6000fd5b5050505080806200067d9062001a93565b915050620005e7565b5050565b60008062000697620008dd565b905060005b8151811015620006f057620006cd828281518110620006bf57620006bf620019de565b6020026020010151620007d3565b620006d9908462001aaf565b925080620006e78162001a93565b9150506200069c565b505090565b3362000700620007fc565b6001600160a01b031614620007295760405162461bcd60e51b8152600401620003c19062001982565b60005b815181101562000686578181815181106200074b576200074b620019de565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200078992911690600401620016f0565b600060405180830381600087803b158015620007a457600080fd5b505af1158015620007b9573d6000803e3d6000fd5b505050508080620007ca9062001a93565b9150506200072c565b6001600160a01b0381166000908152600560205260408120620007f69062000ea4565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200082f83620007d3565b90506000816001600160401b038111156200084e576200084e6200153e565b60405190808252806020026020018201604052801562000878578160200160208202803683370190505b50905060005b82811015620008d55762000893858262000eaf565b828281518110620008a857620008a8620019de565b6001600160a01b039092166020928302919091019091015280620008cc8162001a93565b9150506200087e565b509392505050565b60606000620008eb62000435565b90506000816001600160401b038111156200090a576200090a6200153e565b60405190808252806020026020018201604052801562000934578160200160208202803683370190505b50905060005b8281101562000990576200094e8162000eda565b828281518110620009635762000963620019de565b6001600160a01b039092166020928302919091019091015280620009878162001a93565b9150506200093a565b5092915050565b33620009a2620007fc565b6001600160a01b031614620009cb5760405162461bcd60e51b8152600401620003c19062001982565b600080546040516001600160a01b039091169060008051602062002651833981519152908390a3600080546001600160a01b0319169055565b600062000a178787878787873362000ee9565b979650505050505050565b600062000a2f8262000e3d565b6001600160a01b03161592915050565b600062000a5486868660008787600062000ee9565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000aa1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000acb919081019062001ac5565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000b0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b38919081019062001ac5565b905062000ba46040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001243565b95945050505050565b600054600160a81b900460ff168062000bd05750600054600160a01b900460ff16155b62000c355760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000c60576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005aa576000805460ff60a81b1916905550505050565b3362000cc2620007fc565b6001600160a01b03161462000ceb5760405162461bcd60e51b8152600401620003c19062001982565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000d2c916001600160a01b03909116908490620019c4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000d61620007fc565b6001600160a01b03161462000d8a5760405162461bcd60e51b8152600401620003c19062001982565b6001600160a01b03811662000df35760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200265183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007f6919062001b63565b6000620007f6825490565b6001600160a01b038216600090815260056020526040812062000ed390836200127a565b9392505050565b6000620007f66003836200127a565b600080600062000efa8a8a62001288565b6001546040519294509092506001600160a01b031690309062000f1d90620014f7565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000f60573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb99062000fb29086908690600401620019c4565b600060405180830381865afa92505050801562000ff357506040513d6000823e601f3d908101601f1916820160405262000ff0919081019062001ac5565b60015b1562000ffc5790505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee8290606401602060405180830381865afa1580156200107b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010a1919062001b63565b90506001600160a01b038116620010f95760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b6200110681898962001356565b6200114b5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200118390859085908e908e908e908e9060040162001b83565b600060405180830381600087803b1580156200119e57600080fd5b505af1158015620011b3573d6000803e3d6000fd5b50505050620011cd3360036200140390919063ffffffff16565b50336000908152600560205260409020620011e9908662001403565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200126095949392919062001bf8565b604051602081830303815290604052905095945050505050565b600062000ed383836200141a565b600080826001600160a01b0316846001600160a01b031603620012db5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620012fd57828462001300565b83835b90925090506001600160a01b0382166200134f5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001398573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013be919062001c6d565b90508260020b8460020b128015620013e25750620013dd818562001c8d565b60020b155b801562000ba45750620013f6818462001c8d565b60020b1595945050505050565b600062000ed3836001600160a01b038416620014a5565b815460009082106200147a5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b826000018281548110620014925762001492620019de565b9060005260206000200154905092915050565b6000818152600183016020526040812054620014ee57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007f6565b506000620007f6565b6109928062001cbf83390190565b6001600160a01b03811681146200151b57600080fd5b50565b6000602082840312156200153157600080fd5b813562000ed38162001505565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200157f576200157f6200153e565b604052919050565b600082601f8301126200159957600080fd5b813560206001600160401b03821115620015b757620015b76200153e565b8160051b620015c882820162001554565b9283528481018201928281019087851115620015e357600080fd5b83870192505b8483101562000a17578235620015ff8162001505565b82529183019190830190620015e9565b6000806000604084860312156200162557600080fd5b83356001600160401b03808211156200163d57600080fd5b6200164b8783880162001587565b945060208601359150808211156200166257600080fd5b818601915086601f8301126200167757600080fd5b8135818111156200168757600080fd5b8760208260051b85010111156200169d57600080fd5b6020830194508093505050509250925092565b600060208284031215620016c357600080fd5b81356001600160401b03811115620016da57600080fd5b620016e88482850162001587565b949350505050565b6001600160a01b0391909116815260200190565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b60208152600062000ed360208301846200172a565b6020808252825182820181905260009190848201906040850190845b81811015620017b05783516001600160a01b03168352928401929184019160010162001789565b50909695505050505050565b803562ffffff81168114620017d057600080fd5b919050565b8060020b81146200151b57600080fd5b60008060008060008060c08789031215620017ff57600080fd5b86356200180c8162001505565b955060208701356200181e8162001505565b94506200182e60408801620017bc565b9350606087013561ffff811681146200184657600080fd5b925060808701356200185881620017d5565b915060a08701356200186a81620017d5565b809150509295509295509295565b600080600080600060a086880312156200189157600080fd5b85356200189e8162001505565b94506020860135620018b08162001505565b9350620018c060408701620017bc565b92506060860135620018d281620017d5565b91506080860135620018e481620017d5565b809150509295509295909350565b600080604083850312156200190657600080fd5b8235620019138162001505565b91506020830135620019258162001505565b809150509250929050565b6000806000606084860312156200194657600080fd5b8335620019538162001505565b92506020840135620019658162001505565b91506040840135620019778162001505565b809150509250925092565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811262001a0c57600080fd5b8301803591506001600160401b0382111562001a2757600080fd5b6020019150368190038213156200134f57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001aa85762001aa862001a7d565b5060010190565b80820180821115620007f657620007f662001a7d565b60006020828403121562001ad857600080fd5b81516001600160401b038082111562001af057600080fd5b818401915084601f83011262001b0557600080fd5b81518181111562001b1a5762001b1a6200153e565b62001b2f601f8201601f191660200162001554565b915080825285602082850101111562001b4757600080fd5b62001b5a81602084016020860162001704565b50949350505050565b60006020828403121562001b7657600080fd5b815162000ed38162001505565b60e08152600062001b9860e08301896200172a565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001c0c818460208b0162001704565b86519083019062001c22818360208b0162001704565b865191019062001c37818360208a0162001704565b855191019062001c4c81836020890162001704565b845191019062001c6181836020880162001704565b01979650505050505050565b60006020828403121562001c8057600080fd5b815162000ed381620017d5565b60008260020b8062001caf57634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220bab4dc364f42f8e82ed2983d450c7f7b787f86ecc2b056c62a10271dfd59e29364736f6c63430008130033", - "deployedBytecode": "0x60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e620001583660046200151e565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e3660046200160f565b62000448565b6200015e620001a5366004620016b0565b620005b0565b6200016a6200068a565b6200015e620001c6366004620016b0565b620006f5565b6200016a620001dd3660046200151e565b620007d3565b620001ed620007fc565b604051620001749190620016f0565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001758565b6200023a6200080b565b6040516200017491906200176d565b6200023a6200025a3660046200151e565b62000820565b6200023a620008dd565b6200015e62000997565b620001ed62000285366004620017e5565b62000a04565b600254620001ed906001600160a01b031681565b620002b6620002b03660046200151e565b62000a22565b604051901515815260200162000174565b620001ed620002d836600462001878565b62000a3f565b62000221620002ef366004620018f2565b62000a5e565b6200015e6200030636600462001930565b62000bad565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e620003593660046200151e565b62000cb7565b6200015e620003703660046200151e565b62000d56565b620001ed620003873660046200151e565b62000e3d565b3362000398620007fc565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001982565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b03909116908490620019c4565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000ea4565b905090565b3362000453620007fc565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001982565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005aa57838181518110620004eb57620004eb620019de565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052c576200052c620019de565b9050602002810190620005409190620019f4565b6040518463ffffffff1660e01b8152600401620005609392919062001a3d565b600060405180830381600087803b1580156200057b57600080fd5b505af115801562000590573d6000803e3d6000fd5b505050508080620005a19062001a93565b915050620004cc565b50505050565b33620005bb620007fc565b6001600160a01b031614620005e45760405162461bcd60e51b8152600401620003c19062001982565b60005b81518110156200068657818181518110620006065762000606620019de565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063c9190620016f0565b600060405180830381600087803b1580156200065757600080fd5b505af11580156200066c573d6000803e3d6000fd5b5050505080806200067d9062001a93565b915050620005e7565b5050565b60008062000697620008dd565b905060005b8151811015620006f057620006cd828281518110620006bf57620006bf620019de565b6020026020010151620007d3565b620006d9908462001aaf565b925080620006e78162001a93565b9150506200069c565b505090565b3362000700620007fc565b6001600160a01b031614620007295760405162461bcd60e51b8152600401620003c19062001982565b60005b815181101562000686578181815181106200074b576200074b620019de565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200078992911690600401620016f0565b600060405180830381600087803b158015620007a457600080fd5b505af1158015620007b9573d6000803e3d6000fd5b505050508080620007ca9062001a93565b9150506200072c565b6001600160a01b0381166000908152600560205260408120620007f69062000ea4565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200082f83620007d3565b90506000816001600160401b038111156200084e576200084e6200153e565b60405190808252806020026020018201604052801562000878578160200160208202803683370190505b50905060005b82811015620008d55762000893858262000eaf565b828281518110620008a857620008a8620019de565b6001600160a01b039092166020928302919091019091015280620008cc8162001a93565b9150506200087e565b509392505050565b60606000620008eb62000435565b90506000816001600160401b038111156200090a576200090a6200153e565b60405190808252806020026020018201604052801562000934578160200160208202803683370190505b50905060005b8281101562000990576200094e8162000eda565b828281518110620009635762000963620019de565b6001600160a01b039092166020928302919091019091015280620009878162001a93565b9150506200093a565b5092915050565b33620009a2620007fc565b6001600160a01b031614620009cb5760405162461bcd60e51b8152600401620003c19062001982565b600080546040516001600160a01b039091169060008051602062002651833981519152908390a3600080546001600160a01b0319169055565b600062000a178787878787873362000ee9565b979650505050505050565b600062000a2f8262000e3d565b6001600160a01b03161592915050565b600062000a5486868660008787600062000ee9565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000aa1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000acb919081019062001ac5565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000b0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b38919081019062001ac5565b905062000ba46040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001243565b95945050505050565b600054600160a81b900460ff168062000bd05750600054600160a01b900460ff16155b62000c355760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000c60576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005aa576000805460ff60a81b1916905550505050565b3362000cc2620007fc565b6001600160a01b03161462000ceb5760405162461bcd60e51b8152600401620003c19062001982565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000d2c916001600160a01b03909116908490620019c4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000d61620007fc565b6001600160a01b03161462000d8a5760405162461bcd60e51b8152600401620003c19062001982565b6001600160a01b03811662000df35760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200265183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007f6919062001b63565b6000620007f6825490565b6001600160a01b038216600090815260056020526040812062000ed390836200127a565b9392505050565b6000620007f66003836200127a565b600080600062000efa8a8a62001288565b6001546040519294509092506001600160a01b031690309062000f1d90620014f7565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000f60573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb99062000fb29086908690600401620019c4565b600060405180830381865afa92505050801562000ff357506040513d6000823e601f3d908101601f1916820160405262000ff0919081019062001ac5565b60015b1562000ffc5790505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee8290606401602060405180830381865afa1580156200107b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010a1919062001b63565b90506001600160a01b038116620010f95760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b6200110681898962001356565b6200114b5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200118390859085908e908e908e908e9060040162001b83565b600060405180830381600087803b1580156200119e57600080fd5b505af1158015620011b3573d6000803e3d6000fd5b50505050620011cd3360036200140390919063ffffffff16565b50336000908152600560205260409020620011e9908662001403565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200126095949392919062001bf8565b604051602081830303815290604052905095945050505050565b600062000ed383836200141a565b600080826001600160a01b0316846001600160a01b031603620012db5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620012fd57828462001300565b83835b90925090506001600160a01b0382166200134f5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001398573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013be919062001c6d565b90508260020b8460020b128015620013e25750620013dd818562001c8d565b60020b155b801562000ba45750620013f6818462001c8d565b60020b1595945050505050565b600062000ed3836001600160a01b038416620014a5565b815460009082106200147a5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b826000018281548110620014925762001492620019de565b9060005260206000200154905092915050565b6000818152600183016020526040812054620014ee57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007f6565b506000620007f6565b6109928062001cbf83390190565b6001600160a01b03811681146200151b57600080fd5b50565b6000602082840312156200153157600080fd5b813562000ed38162001505565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200157f576200157f6200153e565b604052919050565b600082601f8301126200159957600080fd5b813560206001600160401b03821115620015b757620015b76200153e565b8160051b620015c882820162001554565b9283528481018201928281019087851115620015e357600080fd5b83870192505b8483101562000a17578235620015ff8162001505565b82529183019190830190620015e9565b6000806000604084860312156200162557600080fd5b83356001600160401b03808211156200163d57600080fd5b6200164b8783880162001587565b945060208601359150808211156200166257600080fd5b818601915086601f8301126200167757600080fd5b8135818111156200168757600080fd5b8760208260051b85010111156200169d57600080fd5b6020830194508093505050509250925092565b600060208284031215620016c357600080fd5b81356001600160401b03811115620016da57600080fd5b620016e88482850162001587565b949350505050565b6001600160a01b0391909116815260200190565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b60208152600062000ed360208301846200172a565b6020808252825182820181905260009190848201906040850190845b81811015620017b05783516001600160a01b03168352928401929184019160010162001789565b50909695505050505050565b803562ffffff81168114620017d057600080fd5b919050565b8060020b81146200151b57600080fd5b60008060008060008060c08789031215620017ff57600080fd5b86356200180c8162001505565b955060208701356200181e8162001505565b94506200182e60408801620017bc565b9350606087013561ffff811681146200184657600080fd5b925060808701356200185881620017d5565b915060a08701356200186a81620017d5565b809150509295509295509295565b600080600080600060a086880312156200189157600080fd5b85356200189e8162001505565b94506020860135620018b08162001505565b9350620018c060408701620017bc565b92506060860135620018d281620017d5565b91506080860135620018e481620017d5565b809150509295509295909350565b600080604083850312156200190657600080fd5b8235620019138162001505565b91506020830135620019258162001505565b809150509250929050565b6000806000606084860312156200194657600080fd5b8335620019538162001505565b92506020840135620019658162001505565b91506040840135620019778162001505565b809150509250925092565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811262001a0c57600080fd5b8301803591506001600160401b0382111562001a2757600080fd5b6020019150368190038213156200134f57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001aa85762001aa862001a7d565b5060010190565b80820180821115620007f657620007f662001a7d565b60006020828403121562001ad857600080fd5b81516001600160401b038082111562001af057600080fd5b818401915084601f83011262001b0557600080fd5b81518181111562001b1a5762001b1a6200153e565b62001b2f601f8201601f191660200162001554565b915080825285602082850101111562001b4757600080fd5b62001b5a81602084016020860162001704565b50949350505050565b60006020828403121562001b7657600080fd5b815162000ed38162001505565b60e08152600062001b9860e08301896200172a565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001c0c818460208b0162001704565b86519083019062001c22818360208b0162001704565b865191019062001c37818360208a0162001704565b855191019062001c4c81836020890162001704565b845191019062001c6181836020880162001704565b01979650505050505050565b60006020828403121562001c8057600080fd5b815162000ed381620017d5565b60008260020b8062001caf57634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220bab4dc364f42f8e82ed2983d450c7f7b787f86ecc2b056c62a10271dfd59e29364736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "managerFee": "proportion of earned fees that go to pool manager in Basis Points", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "createPool(address,address,uint24,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "getDeployers()": { - "returns": { - "_0": "deployers the list of deployer addresses" - } - }, - "getGelatoPools()": { - "returns": { - "_0": "list of Gelato managed G-UNI pool addresses" - } - }, - "getPools(address)": { - "params": { - "deployer": "address that has potentially deployed G-UNI pools (can return empty array)" - }, - "returns": { - "_0": "pools the list of G-UNI pool addresses deployed by `deployer`" - } - }, - "getProxyAdmin(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "address that controls the G-UNI implementation (has power to upgrade it)" - } - }, - "isPoolImmutable(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "bool signaling if pool is immutable (true) or not (false)" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "numDeployers()": { - "returns": { - "_0": "total number of G-UNI pool deployer addresses" - } - }, - "numPools()": { - "returns": { - "result": "total number of G-UNI pools deployed" - } - }, - "numPools(address)": { - "params": { - "deployer": "deployer address" - }, - "returns": { - "_0": "total number of G-UNI pools deployed by `deployer`" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "notice": "createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`" - }, - "createPool(address,address,uint24,int24,int24)": { - "notice": "createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`" - }, - "getDeployers()": { - "notice": "getDeployers fetches all addresses that have deployed a G-UNI pool" - }, - "getGelatoPools()": { - "notice": "getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)" - }, - "getPools(address)": { - "notice": "getPools fetches all the G-UNI pool addresses deployed by `deployer`" - }, - "getProxyAdmin(address)": { - "notice": "getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address)." - }, - "isPoolImmutable(address)": { - "notice": "isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded" - }, - "numDeployers()": { - "notice": "numDeployers counts the total number of G-UNI pool deployer addresses" - }, - "numPools()": { - "notice": "numPools counts the total number of G-UNI pools in existence" - }, - "numPools(address)": { - "notice": "numPools counts the total number of G-UNI pools deployed by `deployer`" - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6441, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_manager", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 5, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initialized", - "offset": 20, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initializing", - "offset": 21, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 5909, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "poolImplementation", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 5911, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "gelatoDeployer", - "offset": 0, - "slot": "2", - "type": "t_address" - }, - { - "astId": 5914, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_deployers", - "offset": 0, - "slot": "3", - "type": "t_struct(AddressSet)2007_storage" - }, - { - "astId": 5919, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_pools", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_struct(AddressSet)2007_storage)" - } - ], - "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_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(AddressSet)2007_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.AddressSet)", - "numberOfBytes": "32", - "value": "t_struct(AddressSet)2007_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(AddressSet)2007_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.AddressSet", - "members": [ - { - "astId": 2006, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1732_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Set)1732_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 1727, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 1731, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "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/lib/g-uni-v1-core/deployments/baseSepolia/GUniFactory_Proxy.json b/lib/g-uni-v1-core/deployments/baseSepolia/GUniFactory_Proxy.json deleted file mode 100644 index 3afb061f5..000000000 --- a/lib/g-uni-v1-core/deployments/baseSepolia/GUniFactory_Proxy.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "address": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x29025b7246215a4b4c5da6f6dbc324c3bc1f03b3e5f28228c07755e3baaf131c", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b", - "transactionIndex": 6, - "gasUsed": "551510", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000000000200400000000000000000000000100000000000000000000000000000000000000000000000008000000000000000008000000000200000000000000020000000000000000000800000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000020010000000000000000000400008000000000000001000000000000000000000000", - "blockHash": "0x1ab87b9371d9cea1d2ff5b61e96d7bf33f9a806f3eb8ffb09b9103bf905be9dc", - "transactionHash": "0x29025b7246215a4b4c5da6f6dbc324c3bc1f03b3e5f28228c07755e3baaf131c", - "logs": [ - { - "transactionIndex": 6, - "blockNumber": 11136393, - "transactionHash": "0x29025b7246215a4b4c5da6f6dbc324c3bc1f03b3e5f28228c07755e3baaf131c", - "address": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b1e9e16a40321fe06cfd797619c345c143d11aa7" - ], - "data": "0x", - "logIndex": 8, - "blockHash": "0x1ab87b9371d9cea1d2ff5b61e96d7bf33f9a806f3eb8ffb09b9103bf905be9dc" - }, - { - "transactionIndex": 6, - "blockNumber": 11136393, - "transactionHash": "0x29025b7246215a4b4c5da6f6dbc324c3bc1f03b3e5f28228c07755e3baaf131c", - "address": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "data": "0x", - "logIndex": 9, - "blockHash": "0x1ab87b9371d9cea1d2ff5b61e96d7bf33f9a806f3eb8ffb09b9103bf905be9dc" - } - ], - "blockNumber": 11136393, - "cumulativeGasUsed": "1167576", - "status": 1, - "byzantium": true - }, - "args": [ - "0xB1e9E16a40321Fe06Cfd797619C345c143D11Aa7", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b000000000000000000000000b1e9e16a40321fe06cfd797619c345c143d11aa7000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/baseSepolia/GUniPool.json b/lib/g-uni-v1-core/deployments/baseSepolia/GUniPool.json deleted file mode 100644 index b656c1830..000000000 --- a/lib/g-uni-v1-core/deployments/baseSepolia/GUniPool.json +++ /dev/null @@ -1,1649 +0,0 @@ -{ - "address": "0xF5c31d08a71c854A9f607A5992456dBC31B11e16", - "abi": [ - { - "inputs": [ - { - "internalType": "address payable", - "name": "_gelato", - "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": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned0", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned1", - "type": "uint256" - } - ], - "name": "FeesEarned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int24", - "name": "lowerTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "int24", - "name": "upperTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBefore", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityAfter", - "type": "uint128" - } - ], - "name": "Rebalance", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - } - ], - "name": "SetManagerFee", - "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" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldAdminTreasury", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdminTreasury", - "type": "address" - } - ], - "name": "UpdateAdminTreasury", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoRebalanceBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoWithdrawBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoSlippageBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "gelatoSlippageInterval", - "type": "uint32" - } - ], - "name": "UpdateGelatoParams", - "type": "event" - }, - { - "inputs": [], - "name": "GELATO", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "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": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "burn", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "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": [ - { - "internalType": "int24", - "name": "newLowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "newUpperTick", - "type": "int24" - }, - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - } - ], - "name": "executiveRebalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoRebalanceBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageInterval", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoWithdrawBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Max", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Max", - "type": "uint256" - } - ], - "name": "getMintAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPositionID", - "outputs": [ - { - "internalType": "bytes32", - "name": "positionID", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUnderlyingBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "sqrtRatioX96", - "type": "uint160" - } - ], - "name": "getUnderlyingBalancesAtPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "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": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "address", - "name": "_pool", - "type": "address" - }, - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "_lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "_upperTick", - "type": "int24" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - } - ], - "name": "initializeManagerFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "lowerTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerTreasury", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pool", - "outputs": [ - { - "internalType": "contract IUniswapV3Pool", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "paymentToken", - "type": "address" - } - ], - "name": "rebalance", - "outputs": [], - "stateMutability": "nonpayable", - "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": "token0", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token1", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Owed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Owed", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3MintCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amount0Delta", - "type": "int256" - }, - { - "internalType": "int256", - "name": "amount1Delta", - "type": "int256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3SwapCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "newRebalanceBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newWithdrawBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newSlippageBPS", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "newSlippageInterval", - "type": "uint32" - }, - { - "internalType": "address", - "name": "newTreasury", - "type": "address" - } - ], - "name": "updateGelatoParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "upperTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawGelatoBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawManagerBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x656dfce1a2831aeceb00af6330961c9e21c1e4c6919accfdcc3b28b11e806ea1", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0xF5c31d08a71c854A9f607A5992456dBC31B11e16", - "transactionIndex": 4, - "gasUsed": "5209546", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xed1232f938bae78807761859963245f84f5f4c75760ccb02e377d6ebbc47dd4a", - "transactionHash": "0x656dfce1a2831aeceb00af6330961c9e21c1e4c6919accfdcc3b28b11e806ea1", - "logs": [], - "blockNumber": 11304746, - "cumulativeGasUsed": "6095128", - "status": 1, - "byzantium": true - }, - "args": [ - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_gelato\",\"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\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned1\",\"type\":\"uint256\"}],\"name\":\"FeesEarned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"lowerTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"upperTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBefore\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityAfter\",\"type\":\"uint128\"}],\"name\":\"Rebalance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"}],\"name\":\"SetManagerFee\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAdminTreasury\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdminTreasury\",\"type\":\"address\"}],\"name\":\"UpdateAdminTreasury\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoRebalanceBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoWithdrawBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoSlippageBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gelatoSlippageInterval\",\"type\":\"uint32\"}],\"name\":\"UpdateGelatoParams\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GELATO\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"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\":[{\"internalType\":\"int24\",\"name\":\"newLowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"newUpperTick\",\"type\":\"int24\"},{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"}],\"name\":\"executiveRebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoRebalanceBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageInterval\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoWithdrawBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Max\",\"type\":\"uint256\"}],\"name\":\"getMintAmounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPositionID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"positionID\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUnderlyingBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtRatioX96\",\"type\":\"uint160\"}],\"name\":\"getUnderlyingBalancesAtPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"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\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_pool\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"_lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"_upperTick\",\"type\":\"int24\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"}],\"name\":\"initializeManagerFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lowerTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pool\",\"outputs\":[{\"internalType\":\"contract IUniswapV3Pool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"}],\"name\":\"rebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"token0\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newRebalanceBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newWithdrawBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newSlippageBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"newSlippageInterval\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateGelatoParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upperTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawGelatoBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawManagerBalance\",\"outputs\":[],\"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\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"burn(uint256,address)\":{\"params\":{\"burnAmount\":\"The number of G-UNI tokens to burn\",\"receiver\":\"The account to receive the underlying amounts of token0 and token1\"},\"returns\":{\"amount0\":\"amount of token0 transferred to receiver for burning `burnAmount`\",\"amount1\":\"amount of token1 transferred to receiver for burning `burnAmount`\",\"liquidityBurned\":\"amount of liquidity removed from the underlying Uniswap V3 position\"}},\"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 this function is overridden; 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`.\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"details\":\"When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.\",\"params\":{\"newLowerTick\":\"The new lower bound of the position's range\",\"newUpperTick\":\"The new upper bound of the position's range\",\"swapAmountBPS\":\"amount of token to swap as proportion of total. Pass 0 to ignore swap.\",\"swapThresholdPrice\":\"slippage parameter on the swap as a max or min sqrtPriceX96\",\"zeroForOne\":\"Which token to input into the swap (true = token0, false = token1)\"}},\"getMintAmounts(uint256,uint256)\":{\"params\":{\"amount0Max\":\"The maximum amount of token1 to forward on mint\"},\"returns\":{\"amount0\":\"actual amount of token0 to forward when minting `mintAmount`\",\"amount1\":\"actual amount of token1 to forward when minting `mintAmount`\",\"mintAmount\":\"maximum number of G-UNI tokens to mint\"}},\"getUnderlyingBalances()\":{\"returns\":{\"amount0Current\":\"current total underlying balance of token0\",\"amount1Current\":\"current total underlying balance of token1\"}},\"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.\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"params\":{\"_lowerTick\":\"initial upperTick (only changeable with executiveRebalance)\",\"_managerFeeBPS\":\"proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\",\"_manager_\":\"address of manager (ownership can be transferred)\",\"_name\":\"name of G-UNI token\",\"_pool\":\"address of Uniswap V3 pool\",\"_symbol\":\"symbol of G-UNI token\"}},\"initializeManagerFee(uint16)\":{\"params\":{\"_managerFeeBPS\":\"proportion of fees earned that are credited to manager in Basis Points\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"mint(uint256,address)\":{\"details\":\"to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\",\"params\":{\"mintAmount\":\"The number of G-UNI tokens to mint\",\"receiver\":\"The account to receive the minted tokens\"},\"returns\":{\"amount0\":\"amount of token0 transferred from msg.sender to mint `mintAmount`\",\"amount1\":\"amount of token1 transferred from msg.sender to mint `mintAmount`\",\"liquidityMinted\":\"amount of liquidity added to the underlying Uniswap V3 position\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"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 manager.\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"params\":{\"newRebalanceBPS\":\"controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\",\"newSlippageBPS\":\"maximum slippage on swaps during gelato rebalance\",\"newSlippageInterval\":\"length of time for TWAP used in computing slippage on swaps\",\"newTreasury\":\"address where managerFee withdrawals are sent\",\"newWithdrawBPS\":\"controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(uint256,address)\":{\"notice\":\"burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"notice\":\"Change the range of underlying UniswapV3 position, only manager can call\"},\"getMintAmounts(uint256,uint256)\":{\"notice\":\"compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\"},\"getUnderlyingBalances()\":{\"notice\":\"compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"notice\":\"initialize storage variables on a new G-UNI pool, only called once\"},\"initializeManagerFee(uint16)\":{\"notice\":\"initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\"},\"mint(uint256,address)\":{\"notice\":\"mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\"},\"rebalance(uint160,uint256,bool,uint256,address)\":{\"notice\":\"Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\"},\"uniswapV3MintCallback(uint256,uint256,bytes)\":{\"notice\":\"Uniswap V3 callback fn, called back on pool.mint\"},\"uniswapV3SwapCallback(int256,int256,bytes)\":{\"notice\":\"Uniswap v3 callback fn, called back on pool.swap\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"notice\":\"change configurable parameters, only manager can call\"},\"withdrawGelatoBalance(uint256,address)\":{\"notice\":\"withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"},\"withdrawManagerBalance(uint256,address)\":{\"notice\":\"withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniPool.sol\":\"GUniPool\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal initializer {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal initializer {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and make it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x89fa60d14355f7ae06af11e28fce2bb90c5c6186645d681a30e1b36234a4c210\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\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\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The defaut value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\\n __Context_init_unchained();\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override 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 override 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 this function is\\n * overridden;\\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 override returns (uint8) {\\n return 18;\\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\\n uint256 currentAllowance = _allowances[sender][_msgSender()];\\n require(currentAllowance >= amount, \\\"ERC20: transfer amount exceeds allowance\\\");\\n _approve(sender, _msgSender(), currentAllowance - amount);\\n\\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\\n\\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 uint256 senderBalance = _balances[sender];\\n require(senderBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n _balances[sender] = senderBalance - amount;\\n _balances[recipient] += amount;\\n\\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 += amount;\\n _balances[account] += 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 uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n _balances[account] = accountBalance - amount;\\n _totalSupply -= amount;\\n\\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 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 uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0x9c2d7425f3343ea340d6ea67e9d90109d4d846bb013c2572096ec88c9e74946b\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\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\":\"0x8d4a0f2b5b760b5e2c19ed3c108d83897a4dfd5bfed97a93867918df19191e5e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x6795c369a4eefa78468e38966f7851fbc2dda5e5b9ccd3fa2b45970e2e4d3abd\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../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 initializer {\\n __Context_init_unchained();\\n }\\n\\n function __Context_init_unchained() internal initializer {\\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x8e9eb503de1189f50c5f16fef327da310b11898d6b9ab3ca937df07c35233b9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.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 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) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\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\":\"0x99f5c21018d796db7833a2100bb0e7411999e248a3c950fb526eee5d2bf47cb7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0x069b2631bb5b5193a58ccf7a06266c7361bd2c20095667af4402817605627f45\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCast {\\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 require(value < 2**128, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return uint128(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 require(value < 2**64, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return uint64(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 require(value < 2**32, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return uint32(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 require(value < 2**16, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\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 require(value < 2**8, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\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 require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n return uint256(value);\\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 * _Available since v3.1._\\n */\\n function toInt128(int256 value) internal pure returns (int128) {\\n require(value >= -2**127 && value < 2**127, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return int128(value);\\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 * _Available since v3.1._\\n */\\n function toInt64(int256 value) internal pure returns (int64) {\\n require(value >= -2**63 && value < 2**63, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return int64(value);\\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 * _Available since v3.1._\\n */\\n function toInt32(int256 value) internal pure returns (int32) {\\n require(value >= -2**31 && value < 2**31, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return int32(value);\\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 * _Available since v3.1._\\n */\\n function toInt16(int256 value) internal pure returns (int16) {\\n require(value >= -2**15 && value < 2**15, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\n return int16(value);\\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 * _Available since v3.1._\\n */\\n function toInt8(int256 value) internal pure returns (int8) {\\n require(value >= -2**7 && value < 2**7, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\n return int8(value);\\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 require(value < 2**255, \\\"SafeCast: value doesn't fit in an int256\\\");\\n return int256(value);\\n }\\n}\\n\",\"keccak256\":\"0xc37d85b96c2a8d7bc09f25958e0a81394bf5780286444147ddf875fa628d53ce\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\nimport './pool/IUniswapV3PoolImmutables.sol';\\nimport './pool/IUniswapV3PoolState.sol';\\nimport './pool/IUniswapV3PoolDerivedState.sol';\\nimport './pool/IUniswapV3PoolActions.sol';\\nimport './pool/IUniswapV3PoolOwnerActions.sol';\\nimport './pool/IUniswapV3PoolEvents.sol';\\n\\n/// @title The interface for a Uniswap V3 Pool\\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\\n/// to the ERC20 specification\\n/// @dev The pool interface is broken up into many smaller pieces\\ninterface IUniswapV3Pool is\\n IUniswapV3PoolImmutables,\\n IUniswapV3PoolState,\\n IUniswapV3PoolDerivedState,\\n IUniswapV3PoolActions,\\n IUniswapV3PoolOwnerActions,\\n IUniswapV3PoolEvents\\n{\\n\\n}\\n\",\"keccak256\":\"0xfe6113d518466cd6652c85b111e01f33eb62157f49ae5ed7d5a3947a2044adb1\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#mint\\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\\ninterface IUniswapV3MintCallback {\\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x27a9725b8f831a92d16380860c3d348a0b926a7f01b34a54ea6eea78cbdbcd6a\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#swap\\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\\ninterface IUniswapV3SwapCallback {\\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x3f485fb1a44e8fbeadefb5da07d66edab3cfe809f0ac4074b1e54e3eb3c4cf69\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissionless pool actions\\n/// @notice Contains pool methods that can be called by anyone\\ninterface IUniswapV3PoolActions {\\n /// @notice Sets the initial price for the pool\\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\\n function initialize(uint160 sqrtPriceX96) external;\\n\\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\\n /// @param recipient The address for which the liquidity will be created\\n /// @param tickLower The lower tick of the position in which to add liquidity\\n /// @param tickUpper The upper tick of the position in which to add liquidity\\n /// @param amount The amount of liquidity to mint\\n /// @param data Any data that should be passed through to the callback\\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n function mint(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount,\\n bytes calldata data\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Collects tokens owed to a position\\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\\n /// @param recipient The address which should receive the fees collected\\n /// @param tickLower The lower tick of the position for which to collect fees\\n /// @param tickUpper The upper tick of the position for which to collect fees\\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\\n /// @return amount0 The amount of fees collected in token0\\n /// @return amount1 The amount of fees collected in token1\\n function collect(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n\\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\\n /// @dev Fees must be collected separately via a call to #collect\\n /// @param tickLower The lower tick of the position for which to burn liquidity\\n /// @param tickUpper The upper tick of the position for which to burn liquidity\\n /// @param amount How much liquidity to burn\\n /// @return amount0 The amount of token0 sent to the recipient\\n /// @return amount1 The amount of token1 sent to the recipient\\n function burn(\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Swap token0 for token1, or token1 for token0\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\\n /// @param recipient The address to receive the output of the swap\\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\\n /// @param data Any data to be passed through to the callback\\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\\n function swap(\\n address recipient,\\n bool zeroForOne,\\n int256 amountSpecified,\\n uint160 sqrtPriceLimitX96,\\n bytes calldata data\\n ) external returns (int256 amount0, int256 amount1);\\n\\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\\n /// @param recipient The address which will receive the token0 and token1 amounts\\n /// @param amount0 The amount of token0 to send\\n /// @param amount1 The amount of token1 to send\\n /// @param data Any data to be passed through to the callback\\n function flash(\\n address recipient,\\n uint256 amount0,\\n uint256 amount1,\\n bytes calldata data\\n ) external;\\n\\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\\n /// the input observationCardinalityNext.\\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0x9453dd0e7442188667d01d9b65de3f1e14e9511ff3e303179a15f6fc267f7634\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that is not stored\\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\\n/// blockchain. The functions here may have variable gas costs.\\ninterface IUniswapV3PoolDerivedState {\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\\n /// you must call it with secondsAgos = [3600, 0].\\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\\n /// timestamp\\n function observe(uint32[] calldata secondsAgos)\\n external\\n view\\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\\n\\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\\n /// snapshot is taken and the second snapshot is taken.\\n /// @param tickLower The lower tick of the range\\n /// @param tickUpper The upper tick of the range\\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\\n /// @return secondsInside The snapshot of seconds per liquidity for the range\\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\\n external\\n view\\n returns (\\n int56 tickCumulativeInside,\\n uint160 secondsPerLiquidityInsideX128,\\n uint32 secondsInside\\n );\\n}\\n\",\"keccak256\":\"0xe603ac5b17ecdee73ba2b27efdf386c257a19c14206e87eee77e2017b742d9e5\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Events emitted by a pool\\n/// @notice Contains all events emitted by the pool\\ninterface IUniswapV3PoolEvents {\\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\\n event Initialize(uint160 sqrtPriceX96, int24 tick);\\n\\n /// @notice Emitted when liquidity is minted for a given position\\n /// @param sender The address that minted the liquidity\\n /// @param owner The owner of the position and recipient of any minted liquidity\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity minted to the position range\\n /// @param amount0 How much token0 was required for the minted liquidity\\n /// @param amount1 How much token1 was required for the minted liquidity\\n event Mint(\\n address sender,\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted when fees are collected by the owner of a position\\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\\n /// @param owner The owner of the position for which fees are collected\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount0 The amount of token0 fees collected\\n /// @param amount1 The amount of token1 fees collected\\n event Collect(\\n address indexed owner,\\n address recipient,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount0,\\n uint128 amount1\\n );\\n\\n /// @notice Emitted when a position's liquidity is removed\\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\\n /// @param owner The owner of the position for which liquidity is removed\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity to remove\\n /// @param amount0 The amount of token0 withdrawn\\n /// @param amount1 The amount of token1 withdrawn\\n event Burn(\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted by the pool for any swaps between token0 and token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the output of the swap\\n /// @param amount0 The delta of the token0 balance of the pool\\n /// @param amount1 The delta of the token1 balance of the pool\\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param liquidity The liquidity of the pool after the swap\\n /// @param tick The log base 1.0001 of price of the pool after the swap\\n event Swap(\\n address indexed sender,\\n address indexed recipient,\\n int256 amount0,\\n int256 amount1,\\n uint160 sqrtPriceX96,\\n uint128 liquidity,\\n int24 tick\\n );\\n\\n /// @notice Emitted by the pool for any flashes of token0/token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the tokens from flash\\n /// @param amount0 The amount of token0 that was flashed\\n /// @param amount1 The amount of token1 that was flashed\\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\\n event Flash(\\n address indexed sender,\\n address indexed recipient,\\n uint256 amount0,\\n uint256 amount1,\\n uint256 paid0,\\n uint256 paid1\\n );\\n\\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\\n /// just before a mint/swap/burn.\\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(\\n uint16 observationCardinalityNextOld,\\n uint16 observationCardinalityNextNew\\n );\\n\\n /// @notice Emitted when the protocol fee is changed by the pool\\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\\n /// @param feeProtocol0New The updated value of the token0 protocol fee\\n /// @param feeProtocol1New The updated value of the token1 protocol fee\\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\\n\\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\\n /// @param sender The address that collects the protocol fees\\n /// @param recipient The address that receives the collected protocol fees\\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x8071514d0fe5d17d6fbd31c191cdfb703031c24e0ece3621d88ab10e871375cd\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that never changes\\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\\ninterface IUniswapV3PoolImmutables {\\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\\n /// @return The contract address\\n function factory() external view returns (address);\\n\\n /// @notice The first of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token0() external view returns (address);\\n\\n /// @notice The second of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token1() external view returns (address);\\n\\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\\n /// @return The fee\\n function fee() external view returns (uint24);\\n\\n /// @notice The pool tick spacing\\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\\n /// This value is an int24 to avoid casting even though it is always positive.\\n /// @return The tick spacing\\n function tickSpacing() external view returns (int24);\\n\\n /// @notice The maximum amount of position liquidity that can use any tick in the range\\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\\n /// @return The max amount of liquidity per tick\\n function maxLiquidityPerTick() external view returns (uint128);\\n}\\n\",\"keccak256\":\"0xf6e5d2cd1139c4c276bdbc8e1d2b256e456c866a91f1b868da265c6d2685c3f7\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissioned pool actions\\n/// @notice Contains pool methods that may only be called by the factory owner\\ninterface IUniswapV3PoolOwnerActions {\\n /// @notice Set the denominator of the protocol's % share of the fees\\n /// @param feeProtocol0 new protocol fee for token0 of the pool\\n /// @param feeProtocol1 new protocol fee for token1 of the pool\\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\\n\\n /// @notice Collect the protocol fee accrued to the pool\\n /// @param recipient The address to which collected protocol fees should be sent\\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\\n /// @return amount0 The protocol fee collected in token0\\n /// @return amount1 The protocol fee collected in token1\\n function collectProtocol(\\n address recipient,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x759b78a2918af9e99e246dc3af084f654e48ef32bb4e4cb8a966aa3dcaece235\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that can change\\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\\n/// per transaction\\ninterface IUniswapV3PoolState {\\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\\n /// when accessed externally.\\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\\n /// boundary.\\n /// observationIndex The index of the last oracle observation that was written,\\n /// observationCardinality The current maximum number of observations stored in the pool,\\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// feeProtocol The protocol fee for both tokens of the pool.\\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\\n /// unlocked Whether the pool is currently locked to reentrancy\\n function slot0()\\n external\\n view\\n returns (\\n uint160 sqrtPriceX96,\\n int24 tick,\\n uint16 observationIndex,\\n uint16 observationCardinality,\\n uint16 observationCardinalityNext,\\n uint8 feeProtocol,\\n bool unlocked\\n );\\n\\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal0X128() external view returns (uint256);\\n\\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal1X128() external view returns (uint256);\\n\\n /// @notice The amounts of token0 and token1 that are owed to the protocol\\n /// @dev Protocol fees will never exceed uint128 max in either token\\n function protocolFees() external view returns (uint128 token0, uint128 token1);\\n\\n /// @notice The currently in range liquidity available to the pool\\n /// @dev This value has no relationship to the total liquidity across all ticks\\n function liquidity() external view returns (uint128);\\n\\n /// @notice Look up information about a specific tick in the pool\\n /// @param tick The tick to look up\\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\\n /// tick upper,\\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\\n /// a specific position.\\n function ticks(int24 tick)\\n external\\n view\\n returns (\\n uint128 liquidityGross,\\n int128 liquidityNet,\\n uint256 feeGrowthOutside0X128,\\n uint256 feeGrowthOutside1X128,\\n int56 tickCumulativeOutside,\\n uint160 secondsPerLiquidityOutsideX128,\\n uint32 secondsOutside,\\n bool initialized\\n );\\n\\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\\n function tickBitmap(int16 wordPosition) external view returns (uint256);\\n\\n /// @notice Returns the information about a position by the position's key\\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\\n /// @return _liquidity The amount of liquidity in the position,\\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\\n function positions(bytes32 key)\\n external\\n view\\n returns (\\n uint128 _liquidity,\\n uint256 feeGrowthInside0LastX128,\\n uint256 feeGrowthInside1LastX128,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param index The element of the observations array to fetch\\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\\n /// ago, rather than at a specific index in the array.\\n /// @return blockTimestamp The timestamp of the observation,\\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// Returns initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 index)\\n external\\n view\\n returns (\\n uint32 blockTimestamp,\\n int56 tickCumulative,\\n uint160 secondsPerLiquidityCumulativeX128,\\n bool initialized\\n );\\n}\\n\",\"keccak256\":\"0x852dc1f5df7dcf7f11e7bb3eed79f0cea72ad4b25f6a9d2c35aafb48925fd49f\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.4.0;\\n\\n/// @title FixedPoint96\\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\\n/// @dev Used in SqrtPriceMath.sol\\nlibrary FixedPoint96 {\\n uint8 internal constant RESOLUTION = 96;\\n uint256 internal constant Q96 = 0x1000000000000000000000000;\\n}\\n\",\"keccak256\":\"0x0ba8a9b95a956a4050749c0158e928398c447c91469682ca8a7cc7e77a7fe032\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {\\n IUniswapV3MintCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\\\";\\nimport {\\n IUniswapV3SwapCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\\\";\\nimport {GUniPoolStorage} from \\\"./abstract/GUniPoolStorage.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {TickMath} from \\\"./vendor/uniswap/TickMath.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {SafeCast} from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport {\\n FullMath,\\n LiquidityAmounts\\n} from \\\"./vendor/uniswap/LiquidityAmounts.sol\\\";\\n\\ncontract GUniPool is\\n IUniswapV3MintCallback,\\n IUniswapV3SwapCallback,\\n GUniPoolStorage\\n{\\n using SafeERC20 for IERC20;\\n using TickMath for int24;\\n\\n event Minted(\\n address receiver,\\n uint256 mintAmount,\\n uint256 amount0In,\\n uint256 amount1In,\\n uint128 liquidityMinted\\n );\\n\\n event Burned(\\n address receiver,\\n uint256 burnAmount,\\n uint256 amount0Out,\\n uint256 amount1Out,\\n uint128 liquidityBurned\\n );\\n\\n event Rebalance(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidityBefore,\\n uint128 liquidityAfter\\n );\\n\\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice Uniswap V3 callback fn, called back on pool.mint\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata /*_data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\\n }\\n\\n /// @notice Uniswap v3 callback fn, called back on pool.swap\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata /*data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Delta > 0)\\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\\n else if (amount1Delta > 0)\\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\\n }\\n\\n // User functions => Should be called via a Router\\n\\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\\n /// @param mintAmount The number of G-UNI tokens to mint\\n /// @param receiver The account to receive the minted tokens\\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function mint(uint256 mintAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityMinted\\n )\\n {\\n require(mintAmount > 0, \\\"mint 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n\\n if (totalSupply > 0) {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n amount0 = FullMath.mulDivRoundingUp(\\n amount0Current,\\n mintAmount,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n amount1Current,\\n mintAmount,\\n totalSupply\\n );\\n } else {\\n // if supply is 0 mintAmount == liquidity to deposit\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n SafeCast.toUint128(mintAmount)\\n );\\n }\\n\\n // transfer amounts owed to contract\\n if (amount0 > 0) {\\n token0.safeTransferFrom(msg.sender, address(this), amount0);\\n }\\n if (amount1 > 0) {\\n token1.safeTransferFrom(msg.sender, address(this), amount1);\\n }\\n\\n // deposit as much new liquidity as possible\\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n\\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \\\"\\\");\\n\\n _mint(receiver, mintAmount);\\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\\n }\\n\\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\\n /// @param burnAmount The number of G-UNI tokens to burn\\n /// @param receiver The account to receive the underlying amounts of token0 and token1\\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines\\n function burn(uint256 burnAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityBurned\\n )\\n {\\n require(burnAmount > 0, \\\"burn 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n\\n _burn(msg.sender, burnAmount);\\n\\n uint256 liquidityBurned_ =\\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidityBurned);\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n\\n amount0 =\\n burn0 +\\n FullMath.mulDiv(\\n token0.balanceOf(address(this)) -\\n burn0 -\\n managerBalance0 -\\n gelatoBalance0,\\n burnAmount,\\n totalSupply\\n );\\n amount1 =\\n burn1 +\\n FullMath.mulDiv(\\n token1.balanceOf(address(this)) -\\n burn1 -\\n managerBalance1 -\\n gelatoBalance1,\\n burnAmount,\\n totalSupply\\n );\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(receiver, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(receiver, amount1);\\n }\\n\\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\\n }\\n\\n // Manager Functions => Called by Pool Manager\\n\\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\\n /// any leftover will be unused and sit idle until the next rebalance.\\n /// @param newLowerTick The new lower bound of the position's range\\n /// @param newUpperTick The new upper bound of the position's range\\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\\n // solhint-disable-next-line function-max-lines\\n function executiveRebalance(\\n int24 newLowerTick,\\n int24 newUpperTick,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) external onlyManager {\\n uint128 liquidity;\\n uint128 newLiquidity;\\n if (totalSupply() > 0) {\\n (liquidity, , , , ) = pool.positions(_getPositionID());\\n if (liquidity > 0) {\\n (, , uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n }\\n\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n\\n uint256 reinvest0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n uint256 reinvest1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n\\n _deposit(\\n newLowerTick,\\n newUpperTick,\\n reinvest0,\\n reinvest1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n\\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > 0, \\\"new position 0\\\");\\n } else {\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n }\\n\\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\\n }\\n\\n // Gelatofied functions => Automatically called by Gelato\\n\\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\\n function rebalance(\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) external gelatofy(feeAmount, paymentToken) {\\n if (swapAmountBPS > 0) {\\n _checkSlippage(swapThresholdPrice, zeroForOne);\\n }\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n _rebalance(\\n liquidity,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne,\\n feeAmount,\\n paymentToken\\n );\\n\\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > liquidity, \\\"liquidity must increase\\\");\\n\\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\\n }\\n\\n /// @notice withdraw manager fees accrued, only gelato executors can call.\\n /// Target account to receive fees is managerTreasury, alterable by manager.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n managerBalance0,\\n managerBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(managerTreasury, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(managerTreasury, amount1);\\n }\\n }\\n\\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n gelatoBalance0,\\n gelatoBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n gelatoBalance0 = 0;\\n gelatoBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(GELATO, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(GELATO, amount1);\\n }\\n }\\n\\n function _balancesToWithdraw(\\n uint256 balance0,\\n uint256 balance1,\\n uint256 feeAmount,\\n address feeToken\\n ) internal view returns (uint256 amount0, uint256 amount1) {\\n if (feeToken == address(token0)) {\\n require(\\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount0 = balance0 - feeAmount;\\n amount1 = balance1;\\n } else if (feeToken == address(token1)) {\\n require(\\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount1 = balance1 - feeAmount;\\n amount0 = balance0;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n }\\n\\n // View functions\\n\\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\\n /// @param amount0Max The maximum amount of token0 to forward on mint\\n /// @param amount0Max The maximum amount of token1 to forward on mint\\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\\n /// @return mintAmount maximum number of G-UNI tokens to mint\\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\\n external\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n uint256 totalSupply = totalSupply();\\n if (totalSupply > 0) {\\n (amount0, amount1, mintAmount) = _computeMintAmounts(\\n totalSupply,\\n amount0Max,\\n amount1Max\\n );\\n } else {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 newLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0Max,\\n amount1Max\\n );\\n mintAmount = uint256(newLiquidity);\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n newLiquidity\\n );\\n }\\n }\\n\\n /// @notice compute total underlying holdings of the G-UNI token supply\\n /// includes current liquidity invested in uniswap position, current fees earned\\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\\n /// @return amount0Current current total underlying balance of token0\\n /// @return amount1Current current total underlying balance of token1\\n function getUnderlyingBalances()\\n public\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\\n external\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\\n internal\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (\\n uint128 liquidity,\\n uint256 feeGrowthInside0Last,\\n uint256 feeGrowthInside1Last,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n ) = pool.positions(_getPositionID());\\n\\n // compute current holdings from liquidity\\n (amount0Current, amount1Current) = LiquidityAmounts\\n .getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n liquidity\\n );\\n\\n // compute current fees earned\\n uint256 fee0 =\\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\\n uint256(tokensOwed0);\\n uint256 fee1 =\\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\\n uint256(tokensOwed1);\\n\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n\\n // add any leftover in contract to current holdings\\n amount0Current +=\\n fee0 +\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n amount1Current +=\\n fee1 +\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n }\\n\\n // Private functions\\n\\n // solhint-disable-next-line function-max-lines\\n function _rebalance(\\n uint128 liquidity,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) private {\\n uint256 leftover0 =\\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\\n uint256 leftover1 =\\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\\n\\n (, , uint256 feesEarned0, uint256 feesEarned1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n _applyFees(feesEarned0, feesEarned1);\\n (feesEarned0, feesEarned1) = _subtractAdminFees(\\n feesEarned0,\\n feesEarned1\\n );\\n emit FeesEarned(feesEarned0, feesEarned1);\\n feesEarned0 += leftover0;\\n feesEarned1 += leftover1;\\n\\n if (paymentToken == address(token0)) {\\n require(\\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0 -\\n feeAmount;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n } else if (paymentToken == address(token1)) {\\n require(\\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1 -\\n feeAmount;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n\\n _deposit(\\n lowerTick,\\n upperTick,\\n leftover0,\\n leftover1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _withdraw(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidity\\n )\\n private\\n returns (\\n uint256 burn0,\\n uint256 burn1,\\n uint256 fee0,\\n uint256 fee1\\n )\\n {\\n uint256 preBalance0 = token0.balanceOf(address(this));\\n uint256 preBalance1 = token1.balanceOf(address(this));\\n\\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\\n\\n pool.collect(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n type(uint128).max,\\n type(uint128).max\\n );\\n\\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _deposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) private {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n // First, deposit as much as we can\\n uint128 baseLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n if (baseLiquidity > 0) {\\n (uint256 amountDeposited0, uint256 amountDeposited1) =\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n baseLiquidity,\\n \\\"\\\"\\n );\\n\\n amount0 -= amountDeposited0;\\n amount1 -= amountDeposited1;\\n }\\n int256 swapAmount =\\n SafeCast.toInt256(\\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\\n );\\n if (swapAmount > 0) {\\n _swapAndDeposit(\\n lowerTick_,\\n upperTick_,\\n amount0,\\n amount1,\\n swapAmount,\\n swapThresholdPrice,\\n zeroForOne\\n );\\n }\\n }\\n\\n function _swapAndDeposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n int256 swapAmount,\\n uint160 swapThresholdPrice,\\n bool zeroForOne\\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\\n (int256 amount0Delta, int256 amount1Delta) =\\n pool.swap(\\n address(this),\\n zeroForOne,\\n swapAmount,\\n swapThresholdPrice,\\n \\\"\\\"\\n );\\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\\n\\n // Add liquidity a second time\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 liquidityAfterSwap =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n finalAmount0,\\n finalAmount1\\n );\\n if (liquidityAfterSwap > 0) {\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n liquidityAfterSwap,\\n \\\"\\\"\\n );\\n }\\n }\\n\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function _computeMintAmounts(\\n uint256 totalSupply,\\n uint256 amount0Max,\\n uint256 amount1Max\\n )\\n private\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n // compute proportional amount of tokens to mint\\n if (amount0Current == 0 && amount1Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount1Max,\\n totalSupply,\\n amount1Current\\n );\\n } else if (amount1Current == 0 && amount0Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount0Max,\\n totalSupply,\\n amount0Current\\n );\\n } else if (amount0Current == 0 && amount1Current == 0) {\\n revert(\\\"\\\");\\n } else {\\n // only if both are non-zero\\n uint256 amount0Mint =\\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\\n uint256 amount1Mint =\\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\\n require(amount0Mint > 0 && amount1Mint > 0, \\\"mint 0\\\");\\n\\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\\n }\\n\\n // compute amounts owed to contract\\n amount0 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount0Current,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount1Current,\\n totalSupply\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _computeFeesEarned(\\n bool isZero,\\n uint256 feeGrowthInsideLast,\\n int24 tick,\\n uint128 liquidity\\n ) private view returns (uint256 fee) {\\n uint256 feeGrowthOutsideLower;\\n uint256 feeGrowthOutsideUpper;\\n uint256 feeGrowthGlobal;\\n if (isZero) {\\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\\n } else {\\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\\n }\\n\\n unchecked {\\n // calculate fee growth below\\n uint256 feeGrowthBelow;\\n if (tick >= lowerTick) {\\n feeGrowthBelow = feeGrowthOutsideLower;\\n } else {\\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\\n }\\n\\n // calculate fee growth above\\n uint256 feeGrowthAbove;\\n if (tick < upperTick) {\\n feeGrowthAbove = feeGrowthOutsideUpper;\\n } else {\\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\\n }\\n\\n uint256 feeGrowthInside =\\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\\n fee = FullMath.mulDiv(\\n liquidity,\\n feeGrowthInside - feeGrowthInsideLast,\\n 0x100000000000000000000000000000000\\n );\\n }\\n }\\n\\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\\n }\\n\\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\\n private\\n view\\n returns (uint256 fee0, uint256 fee1)\\n {\\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n fee0 = rawFee0 - deduct0;\\n fee1 = rawFee1 - deduct1;\\n }\\n\\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\\n private\\n view\\n {\\n uint32[] memory secondsAgo = new uint32[](2);\\n secondsAgo[0] = gelatoSlippageInterval;\\n secondsAgo[1] = 0;\\n\\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\\n\\n require(tickCumulatives.length == 2, \\\"array len\\\");\\n uint160 avgSqrtRatioX96;\\n unchecked {\\n int24 avgTick =\\n int24(\\n (tickCumulatives[1] - tickCumulatives[0]) /\\n int56(uint56(gelatoSlippageInterval))\\n );\\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\\n }\\n\\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\\n if (zeroForOne) {\\n require(\\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\\n \\\"high slippage\\\"\\n );\\n } else {\\n require(\\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\\n \\\"high slippage\\\"\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdd382818c81f34c434bb3d4235ac9ff39034cb68e1b87244837d9250878d9fa0\",\"license\":\"GPL-3.0\"},\"contracts/abstract/GUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {Gelatofied} from \\\"./Gelatofied.sol\\\";\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {\\n ReentrancyGuardUpgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport {\\n ERC20Upgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\n\\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\\n/// @dev ERC20Upgradable Includes Initialize\\n// solhint-disable-next-line max-states-count\\n/// @dev Modified to support 0.8.19\\n/// @dev Modified to set the gelatoFeeBPS to 0\\nabstract contract GUniPoolStorage is\\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\\n ReentrancyGuardUpgradeable,\\n OwnableUninitialized,\\n Gelatofied\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n // solhint-disable-next-line const-name-snakecase\\n uint16 public constant gelatoFeeBPS = 0;\\n\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n int24 public lowerTick;\\n int24 public upperTick;\\n\\n uint16 public gelatoRebalanceBPS;\\n uint16 public gelatoWithdrawBPS;\\n uint16 public gelatoSlippageBPS;\\n uint32 public gelatoSlippageInterval;\\n\\n uint16 public managerFeeBPS;\\n address public managerTreasury;\\n\\n uint256 public managerBalance0;\\n uint256 public managerBalance1;\\n uint256 public gelatoBalance0;\\n uint256 public gelatoBalance1;\\n\\n IUniswapV3Pool public pool;\\n IERC20 public token0;\\n IERC20 public token1;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdateAdminTreasury(\\n address oldAdminTreasury,\\n address newAdminTreasury\\n );\\n\\n event UpdateGelatoParams(\\n uint16 gelatoRebalanceBPS,\\n uint16 gelatoWithdrawBPS,\\n uint16 gelatoSlippageBPS,\\n uint32 gelatoSlippageInterval\\n );\\n\\n event SetManagerFee(uint16 managerFee);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice initialize storage variables on a new G-UNI pool, only called once\\n /// @param _name name of G-UNI token\\n /// @param _symbol symbol of G-UNI token\\n /// @param _pool address of Uniswap V3 pool\\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\\n /// @param _manager_ address of manager (ownership can be transferred)\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external initializer {\\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \\\"mBPS\\\");\\n\\n // these variables are immutable after initialization\\n pool = IUniswapV3Pool(_pool);\\n token0 = IERC20(pool.token0());\\n token1 = IERC20(pool.token1());\\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\\n\\n // these variables can be udpated by the manager\\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\\n gelatoSlippageBPS = 500; // default: 5% slippage\\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\\n managerTreasury = _manager_; // default: treasury is admin\\n lowerTick = _lowerTick;\\n upperTick = _upperTick;\\n _manager = _manager_;\\n\\n // e.g. \\\"Gelato Uniswap V3 USDC/DAI LP\\\" and \\\"G-UNI\\\"\\n __ERC20_init(_name, _symbol);\\n __ReentrancyGuard_init();\\n }\\n\\n /// @notice change configurable parameters, only manager can call\\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\\n /// @param newTreasury address where managerFee withdrawals are sent\\n // solhint-disable-next-line code-complexity\\n function updateGelatoParams(\\n uint16 newRebalanceBPS,\\n uint16 newWithdrawBPS,\\n uint16 newSlippageBPS,\\n uint32 newSlippageInterval,\\n address newTreasury\\n ) external onlyManager {\\n require(newWithdrawBPS <= 10000, \\\"BPS\\\");\\n require(newRebalanceBPS <= 10000, \\\"BPS\\\");\\n require(newSlippageBPS <= 10000, \\\"BPS\\\");\\n emit UpdateGelatoParams(\\n newRebalanceBPS,\\n newWithdrawBPS,\\n newSlippageBPS,\\n newSlippageInterval\\n );\\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\\n if (newSlippageInterval != 0)\\n gelatoSlippageInterval = newSlippageInterval;\\n if (newTreasury != address(0)) managerTreasury = newTreasury;\\n }\\n\\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\\n /// If a manager fee was not set in the initialize function it can be set here\\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\\n require(managerFeeBPS == 0, \\\"fee\\\");\\n require(\\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\\n \\\"mBPS\\\"\\n );\\n emit SetManagerFee(_managerFeeBPS);\\n managerFeeBPS = _managerFeeBPS;\\n }\\n\\n function renounceOwnership() public virtual override onlyManager {\\n managerTreasury = address(0);\\n managerFeeBPS = 0;\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n super.renounceOwnership();\\n }\\n\\n function getPositionID() external view returns (bytes32 positionID) {\\n return _getPositionID();\\n }\\n\\n function _getPositionID() internal view returns (bytes32 positionID) {\\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\\n }\\n}\\n\",\"keccak256\":\"0xd1ad805a13c7cd73554b1e3cc3735f3f369d759f8e0b9188977b85295456d033\",\"license\":\"GPL-3.0\"},\"contracts/abstract/Gelatofied.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract Gelatofied {\\n using Address for address payable;\\n using SafeERC20 for IERC20;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n address payable public immutable GELATO;\\n\\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n constructor(address payable _gelato) {\\n GELATO = _gelato;\\n }\\n\\n modifier gelatofy(uint256 _amount, address _paymentToken) {\\n require(msg.sender == GELATO, \\\"Gelatofied: Only gelato\\\");\\n _;\\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x264bc07e6e1b80c454c311ecf4b56afe245ddde31151ed9bcc4cb9ad25bec46a\",\"license\":\"GPL-3.0\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xb6016d5611f38fbd516a84ea2e56794cb76a8d61c40f6716d5f0133f195759bd\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/FullMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.4;\\n\\n/// @title Contains 512-bit math functions\\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\\n/// @dev Handles \\\"phantom overflow\\\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\\nlibrary FullMath {\\n /// @notice Calculates floor(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\\n function mulDiv(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = a * b\\n // Compute the product mod 2**256 and mod 2**256 - 1\\n // then use the Chinese Remainder Theorem to reconstruct\\n // the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2**256 + prod0\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(a, b, not(0))\\n prod0 := mul(a, b)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division\\n if (prod1 == 0) {\\n require(denominator > 0);\\n assembly {\\n result := div(prod0, denominator)\\n }\\n return result;\\n }\\n\\n // Make sure the result is less than 2**256.\\n // Also prevents denominator == 0\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0]\\n // Compute remainder using mulmod\\n uint256 remainder;\\n assembly {\\n remainder := mulmod(a, b, denominator)\\n }\\n // Subtract 256 bit number from 512 bit number\\n assembly {\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator\\n // Compute largest power of two divisor of denominator.\\n // Always >= 1.\\n // EDIT for 0.8 compatibility:\\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\\n uint256 twos = denominator & (~denominator + 1);\\n\\n // Divide denominator by power of two\\n assembly {\\n denominator := div(denominator, twos)\\n }\\n\\n // Divide [prod1 prod0] by the factors of two\\n assembly {\\n prod0 := div(prod0, twos)\\n }\\n // Shift in bits from prod1 into prod0. For this we need\\n // to flip `twos` such that it is 2**256 / twos.\\n // If twos is zero, then it becomes one\\n assembly {\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2**256\\n // Now that denominator is an odd number, it has an inverse\\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\\n // Compute the inverse by starting with a seed that is correct\\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\\n uint256 inv = (3 * denominator) ^ 2;\\n // Now use Newton-Raphson iteration to improve the precision.\\n // Thanks to Hensel's lifting lemma, this also works in modular\\n // arithmetic, doubling the correct bits in each step.\\n inv *= 2 - denominator * inv; // inverse mod 2**8\\n inv *= 2 - denominator * inv; // inverse mod 2**16\\n inv *= 2 - denominator * inv; // inverse mod 2**32\\n inv *= 2 - denominator * inv; // inverse mod 2**64\\n inv *= 2 - denominator * inv; // inverse mod 2**128\\n inv *= 2 - denominator * inv; // inverse mod 2**256\\n\\n // Because the division is now exact we can divide by multiplying\\n // with the modular inverse of denominator. This will give us the\\n // correct result modulo 2**256. Since the precoditions guarantee\\n // that the outcome is less than 2**256, this is the final result.\\n // We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inv;\\n return result;\\n }\\n }\\n\\n /// @notice Calculates ceil(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n function mulDivRoundingUp(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n result = mulDiv(a, b, denominator);\\n if (mulmod(a, b, denominator) > 0) {\\n require(result < type(uint256).max);\\n result++;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3fa0efa3eea2a84bd6ab7e55badd61f97069a6c50780059b036c810427a9740c\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/LiquidityAmounts.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.5.0;\\n\\nimport {FullMath} from \\\"./FullMath.sol\\\";\\nimport \\\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\\\";\\n\\n/// @title Liquidity amount functions\\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\\nlibrary LiquidityAmounts {\\n function toUint128(uint256 x) private pure returns (uint128 y) {\\n require((y = uint128(x)) == x);\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount0 The amount0 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount0(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n uint256 intermediate =\\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount0,\\n intermediate,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount1 The amount1 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount1(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount1,\\n FixedPoint96.Q96,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\\n /// pool prices and the prices at the tick boundaries\\n function getLiquidityForAmounts(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n liquidity = getLiquidityForAmount0(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount0\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n uint128 liquidity0 =\\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\\n uint128 liquidity1 =\\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\\n\\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\\n } else {\\n liquidity = getLiquidityForAmount1(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount1\\n );\\n }\\n }\\n\\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount0 The amount0\\n function getAmount0ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n uint256(liquidity) << FixedPoint96.RESOLUTION,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n sqrtRatioBX96\\n ) / sqrtRatioAX96;\\n }\\n\\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount1 The amount1\\n function getAmount1ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n liquidity,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n FixedPoint96.Q96\\n );\\n }\\n\\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\\n /// pool prices and the prices at the tick boundaries\\n function getAmountsForLiquidity(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0, uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioX96,\\n liquidity\\n );\\n } else {\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x6205f6409d42fc9565530d2a69819bf8c4e4c66b7a4c61d0827e81c084df6832\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/TickMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\n/// prices between 2**-128 and 2**128\\nlibrary TickMath {\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\n int24 internal constant MIN_TICK = -887272;\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\n int24 internal constant MAX_TICK = -MIN_TICK;\\n\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\n uint160 internal constant MAX_SQRT_RATIO =\\n 1461446703485210103287273052203988822378723970342;\\n\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\n /// @dev Throws if |tick| > max tick\\n /// @param tick The input tick for the above formula\\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\n /// at the given tick\\n function getSqrtRatioAtTick(int24 tick)\\n internal\\n pure\\n returns (uint160 sqrtPriceX96)\\n {\\n uint256 absTick =\\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\\n\\n // EDIT: 0.8 compatibility\\n require(absTick <= uint256(int256(MAX_TICK)), \\\"T\\\");\\n\\n uint256 ratio =\\n absTick & 0x1 != 0\\n ? 0xfffcb933bd6fad37aa2d162d1a594001\\n : 0x100000000000000000000000000000000;\\n if (absTick & 0x2 != 0)\\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\\n if (absTick & 0x4 != 0)\\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\\n if (absTick & 0x8 != 0)\\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\\n if (absTick & 0x10 != 0)\\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\\n if (absTick & 0x20 != 0)\\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\\n if (absTick & 0x40 != 0)\\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\\n if (absTick & 0x80 != 0)\\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\\n if (absTick & 0x100 != 0)\\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\\n if (absTick & 0x200 != 0)\\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\\n if (absTick & 0x400 != 0)\\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\\n if (absTick & 0x800 != 0)\\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\\n if (absTick & 0x1000 != 0)\\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\\n if (absTick & 0x2000 != 0)\\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\\n if (absTick & 0x4000 != 0)\\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\\n if (absTick & 0x8000 != 0)\\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\\n if (absTick & 0x10000 != 0)\\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\\n if (absTick & 0x20000 != 0)\\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\\n if (absTick & 0x40000 != 0)\\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\\n if (absTick & 0x80000 != 0)\\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\\n\\n if (tick > 0) ratio = type(uint256).max / ratio;\\n\\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\n sqrtPriceX96 = uint160(\\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\\n );\\n }\\n\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\n /// ever return.\\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\\n internal\\n pure\\n returns (int24 tick)\\n {\\n // second inequality must be < because the price can never reach the price at the max tick\\n require(\\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\\n \\\"R\\\"\\n );\\n uint256 ratio = uint256(sqrtPriceX96) << 32;\\n\\n uint256 r = ratio;\\n uint256 msb = 0;\\n\\n assembly {\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(4, gt(r, 0xFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(3, gt(r, 0xFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(2, gt(r, 0xF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(1, gt(r, 0x3))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := gt(r, 0x1)\\n msb := or(msb, f)\\n }\\n\\n if (msb >= 128) r = ratio >> (msb - 127);\\n else r = ratio << (127 - msb);\\n\\n int256 log_2 = (int256(msb) - 128) << 64;\\n\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(63, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(62, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(61, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(60, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(59, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(58, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(57, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(56, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(55, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(54, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(53, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(52, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(51, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(50, f))\\n }\\n\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\n\\n int24 tickLow =\\n int24(\\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\\n );\\n int24 tickHi =\\n int24(\\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\\n );\\n\\n tick = tickLow == tickHi\\n ? tickLow\\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\\n ? tickHi\\n : tickLow;\\n }\\n}\\n\",\"keccak256\":\"0x589b6104fd07d2e56e5b52edcfa53e6e47e2c38cace38025c16278ca73413f2d\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b5060405162005e0e38038062005e0e833981016040819052620000349162000046565b6001600160a01b031660805262000078565b6000602082840312156200005957600080fd5b81516001600160a01b03811681146200007157600080fd5b9392505050565b608051615d3b620000d3600039600081816105f801528181610ce301528181610dcc01528181610e06015281816114a7015281816116d50152818161170f015281816117e20152818161185901526118960152615d3b6000f3fe608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190614dc5565b61026e610269366004614e0d565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d9190614e39565b6102a66106fc565b60405161023d929190614e4d565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004614e5b565b610796565b6102f56102f0366004614eb9565b61084e565b005b6102ff600081565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004614e0d565b610c3a565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610c71565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b1366004614f21565b6001600160a01b031660009081526033602052604090205490565b6102f5610c80565b6097546103e890600160b81b900460020b81565b60405161023d9190614f3e565b6102f5610403366004614f4c565b610cd6565b61041b610416366004614f4c565b610e31565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e6110ea565b61045a610455366004614f7c565b6110f9565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004614fc0565b611232565b6097546103e890600160a01b900460020b81565b61026e6104aa366004614e0d565b6113f2565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004614e0d565b61148d565b6102f56104e5366004615023565b61149a565b610233609b5481565b6102a6610501366004614f21565b61173d565b6102f5610514366004614f4c565b6117d5565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046150bc565b6118bb565b6097546102ff90600160f01b900461ffff1681565b61023361059a36600461510e565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b61023361191f565b6102f56105db3660046151f1565b61192e565b6102f56105ee3660046152b3565b611ba3565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f5610628366004614f21565b611cb0565b6102f561063b3660046150bc565b611d90565b61041b61064e366004614f4c565b611dfa565b606060368054610662906152d0565b80601f016020809104026020016040519081016040528092919081815260200182805461068e906152d0565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f2338484612114565b5060015b92915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610779919061530a565b50505050509150915061078c8282612239565b9350935050509091565b60006107a38484846124b9565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561082d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610841853361083c86856153b2565b612114565b60019150505b9392505050565b33610857610c71565b6001600160a01b03161461087d5760405162461bcd60e51b8152600401610824906153c5565b600080600061088b60355490565b1115610bca57609d546001600160a01b031663514ea4bf6108aa61267f565b6040518263ffffffff1660e01b81526004016108c891815260200190565b60a060405180830381865afa1580156108e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610909919061541e565b5092945050506001600160801b03831615905061099257609754600090819061094890600160a01b8104600290810b91600160b81b9004900b866126da565b9350935050506109588282612a0d565b6109628282612ae6565b6040519193509150600080516020615ce6833981519152906109879084908490614e4d565b60405180910390a150505b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a06903090600401614e39565b602060405180830381865afa158015610a23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a479190615475565b610a5191906153b2565b610a5b91906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610a97903090600401614e39565b602060405180830381865afa158015610ab4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad89190615475565b610ae291906153b2565b610aec91906153b2565b9050610afd898984848b8b8b612b80565b609d546001600160a01b031663514ea4bf610b1661267f565b6040518263ffffffff1660e01b8152600401610b3491815260200190565b60a060405180830381865afa158015610b51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b75919061541e565b509295505050506001600160801b038316610bc35760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610824565b5050610c06565b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615c8683398151915287878484604051610c29949392919061548e565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061083c9086906154bc565b6097546001600160a01b031690565b33610c89610c71565b6001600160a01b031614610caf5760405162461bcd60e51b8152600401610824906153c5565b60988054600160201b600160d01b031916905560006099819055609a55610cd4612d21565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d205760405162461bcd60e51b8152600401610824906154cf565b600080610d33609954609a548888612d88565b60006099819055609a5590925090508115610d6d57609854609e54610d6d916001600160a01b0391821691600160301b9091041684612eac565b8015610d9857609854609f54610d98916001600160a01b0391821691600160301b9091041683612eac565b505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601610df757610df26001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b610e2b565b610e2b6001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050565b6000806000600260655403610e585760405162461bcd60e51b815260040161082490615500565b600260655584610e7a5760405162461bcd60e51b815260040161082490615537565b6000610e8560355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610edc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f00919061530a565b50505050505090506000821115610f4157600080610f1c6106fc565b91509150610f2b828a8661302a565b9650610f38818a8661302a565b95505050610f87565b609754610f81908290610f5d90600160a01b900460020b613073565b609754610f7390600160b81b900460020b613073565b610f7c8b613488565b6134f1565b90955093505b8415610fa557609e54610fa5906001600160a01b031633308861358c565b8315610fc357609f54610fc3906001600160a01b031633308761358c565b609754610ffc908290610fdf90600160a01b900460020b613073565b609754610ff590600160b81b900460020b613073565b88886135c4565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d9161104c913091600160a01b8104600290810b92600160b81b909204900b908990600401615557565b60408051808303816000875af115801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190615599565b505061109a8688613686565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e786888787876040516110d19594939291906155bd565b60405180910390a1505060016065819055509250925092565b606060378054610662906152d0565b60008060008061110860355490565b905080156111275761111b818787613753565b9195509350915061122a565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611195919061530a565b505050505050905060006111db826111be609760149054906101000a900460020b60020b613073565b6097546111d490600160b81b900460020b613073565b8b8b6135c4565b6097546001600160801b038216955090915061122290839061120690600160a01b900460020b613073565b60975461121c90600160b81b900460020b613073565b846134f1565b909650945050505b509250925092565b3361123b610c71565b6001600160a01b0316146112615760405162461bcd60e51b8152600401610824906153c5565b6127108461ffff1611156112875760405162461bcd60e51b8152600401610824906155f4565b6127108561ffff1611156112ad5760405162461bcd60e51b8152600401610824906155f4565b6127108361ffff1611156112d35760405162461bcd60e51b8152600401610824906155f4565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff85161561134a576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff84161561136f576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561139557609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff8216156113b7576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156113eb5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156114745760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610824565b611483338561083c86856153b2565b5060019392505050565b60006106f23384846124b9565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114e45760405162461bcd60e51b8152600401610824906154cf565b85156114f4576114f48786613862565b609d546000906001600160a01b031663514ea4bf61151061267f565b6040518263ffffffff1660e01b815260040161152e91815260200190565b60a060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f919061541e565b505050509050611583818989898989613abb565b609d546000906001600160a01b031663514ea4bf61159f61267f565b6040518263ffffffff1660e01b81526004016115bd91815260200190565b60a060405180830381865afa1580156115da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fe919061541e565b505050509050816001600160801b0316816001600160801b03161161165f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610824565b609754604051600080516020615c868339815191529161169991600160a01b8204600290810b92600160b81b9004900b908690869061548e565b60405180910390a1505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601611700576116fb6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b611734565b6117346001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b9919061530a565b50505050509150506117cb8482612239565b9250925050915091565b8181336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461181f5760405162461bcd60e51b8152600401610824906154cf565b600080611832609b54609c548888612d88565b6000609b819055609c559092509050811561187e57609e5461187e906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084612eac565b8015610d9857609f54610d98906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083612eac565b609d546001600160a01b031633146118e55760405162461bcd60e51b815260040161082490615611565b831561190257609e54611902906001600160a01b03163386612eac565b8215610e2b57609f54610e2b906001600160a01b03163385612eac565b600061192961267f565b905090565b600054610100900460ff1680611947575060005460ff16155b6119635760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015611985576000805461ffff19166101011790555b6119926000612710615688565b61ffff168561ffff1611156119b95760405162461bcd60e51b8152600401610824906156aa565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe1681916004808201926020929091908290030181865afa158015611a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3691906156c8565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a79160048083019260209291908290030181865afa158015611a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab891906156c8565b609f80546001600160a01b039283166001600160a01b0319918216179091556098805460978054948716600160301b8102600160301b600160d01b031963ffffffff1961ffff8e16600160201b021665ffffffffffff199095169490941761012c17939093169290921790925562ffffff878116600160b81b02909316600165ffffff00000160a01b0319938916600160a01b02600165ffffff00000160a01b0390951694909417643e800c801960d31b179290921692909217179055611b7f8888613f83565b611b87614002565b8015611b99576000805461ff00191690555b5050505050505050565b33611bac610c71565b6001600160a01b031614611bd25760405162461bcd60e51b8152600401610824906153c5565b609854600160201b900461ffff1615611c135760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610824565b60008161ffff16118015611c3b5750611c2f6000612710615688565b61ffff168161ffff1611155b611c575760405162461bcd60e51b8152600401610824906156aa565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611cb9610c71565b6001600160a01b031614611cdf5760405162461bcd60e51b8152600401610824906153c5565b6001600160a01b038116611d465760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610824565b6097546040516001600160a01b03808416921690600080516020615ca683398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611dba5760405162461bcd60e51b815260040161082490615611565b6000841315611dda57609e54610df2906001600160a01b03163386612eac565b6000831315610e2b57609f54610e2b906001600160a01b03163385612eac565b6000806000600260655403611e215760405162461bcd60e51b815260040161082490615500565b600260655584611e5c5760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610824565b6000611e6760355490565b609d549091506000906001600160a01b031663514ea4bf611e8661267f565b6040518263ffffffff1660e01b8152600401611ea491815260200190565b60a060405180830381865afa158015611ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee5919061541e565b505050509050611ef53388614076565b6000611f0b88836001600160801b0316856141b3565b9050611f1681613488565b609754909450600090819081908190611f4590600160a01b8104600290810b91600160b81b9004900b8a6126da565b9350935093509350611f578282612a0d565b611f618282612ae6565b6040519193509150600080516020615ce683398151915290611f869084908490614e4d565b60405180910390a1609b54609954609e546040516370a0823160e01b815261203293929188916001600160a01b03909116906370a0823190611fcc903090600401614e39565b602060405180830381865afa158015611fe9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200d9190615475565b61201791906153b2565b61202191906153b2565b61202b91906153b2565b8d896141b3565b61203c90856154bc565b609c54609a54609f546040516370a0823160e01b8152939d506120799387916001600160a01b0316906370a0823190611fcc903090600401614e39565b61208390846154bc565b985089156120a257609e546120a2906001600160a01b03168c8c612eac565b88156120bf57609f546120bf906001600160a01b03168c8b612eac565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516120f69594939291906155bd565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166121765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610824565b6001600160a01b0382166121d75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610824565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61226161267f565b6040518263ffffffff1660e01b815260040161227f91815260200190565b60a060405180830381865afa15801561229c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c0919061541e565b94509450945094509450612305896122e9609760149054906101000a900460020b60020b613073565b6097546122ff90600160b81b900460020b613073565b886134f1565b909750955060006001600160801b0383166123236001878c8a614261565b61232d91906154bc565b90506000826001600160801b03166123486000878d8b614261565b61235291906154bc565b905061235e8282612ae6565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a082319061239c903090600401614e39565b602060405180830381865afa1580156123b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dd9190615475565b6123e790856154bc565b6123f191906153b2565b6123fb91906153b2565b612405908a6154bc565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a0823190612440903090600401614e39565b602060405180830381865afa15801561245d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124819190615475565b61248b90846154bc565b61249591906153b2565b61249f91906153b2565b6124a990896154bc565b9750505050505050509250929050565b6001600160a01b03831661251d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610824565b6001600160a01b03821661257f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610824565b6001600160a01b038316600090815260336020526040902054818110156125f75760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610824565b61260182826153b2565b6001600160a01b0380861660009081526033602052604080822093909355908516815290812080548492906126379084906154bc565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615cc68339815191528460405161267191815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b820460e890811b6034830152600160b81b90920490911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a0823190612713903090600401614e39565b602060405180830381865afa158015612730573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127549190615475565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061278a903090600401614e39565b602060405180830381865afa1580156127a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cb9190615475565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a79060640160408051808303816000875af1158015612830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128549190615599565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a40160408051808303816000875af11580156128c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128eb91906156e5565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612921903090600401614e39565b602060405180830381865afa15801561293e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129629190615475565b61296c91906153b2565b61297691906153b2565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a08231906129ab903090600401614e39565b602060405180830381865afa1580156129c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ec9190615475565b6129f691906153b2565b612a0091906153b2565b9250505093509350935093565b612710612a1b600084615718565b612a259190615745565b609b6000828254612a3691906154bc565b909155506127109050612a4a600083615718565b612a549190615745565b609c6000828254612a6591906154bc565b909155505060985461271090612a8690600160201b900461ffff1684615718565b612a909190615745565b60996000828254612aa191906154bc565b909155505060985461271090612ac290600160201b900461ffff1683615718565b612acc9190615745565b609a6000828254612add91906154bc565b90915550505050565b6000806000612710609860049054906101000a900461ffff166000612b0b9190615759565b612b199061ffff1687615718565b612b239190615745565b60985490915060009061271090612b4590600160201b900461ffff1683615759565b612b539061ffff1687615718565b612b5d9190615745565b9050612b6982876153b2565b9350612b7581866153b2565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015612bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bee919061530a565b50505050505090506000612c1b82612c088b60020b613073565b612c148b60020b613073565b8a8a6135c4565b90506001600160801b03811615612cc957609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612c679030908f908f908990600401615557565b60408051808303816000875af1158015612c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ca99190615599565b9092509050612cb8828a6153b2565b9850612cc481896153b2565b975050505b6000612cf86127108686612cdd5789612cdf565b8a5b612ce99190615718565b612cf39190615745565b61460d565b90506000811315612d1557612d128a8a8a8a858b8a614673565b50505b50505050505050505050565b33612d2a610c71565b6001600160a01b031614612d505760405162461bcd60e51b8152600401610824906153c5565b6097546040516000916001600160a01b031690600080516020615ca6833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0390811690841603612dfd57609754849061271090612dc190600160e01b900461ffff1689615718565b612dcb9190615745565b1015612de95760405162461bcd60e51b815260040161082490615774565b612df384876153b2565b9150849050612ea3565b609f546001600160a01b0390811690841603612e6d57609754849061271090612e3190600160e01b900461ffff1688615718565b612e3b9190615745565b1015612e595760405162461bcd60e51b815260040161082490615774565b612e6384866153b2565b9050859150612ea3565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610824565b94509492505050565b6040516001600160a01b038316602482015260448101829052612f0f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261488f565b505050565b80471015612f645760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610824565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612fb1576040519150601f19603f3d011682016040523d82523d6000602084013e612fb6565b606091505b5050905080612f0f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610824565b60006130378484846141b3565b9050600082806130495761304961572f565b848609111561084757600019811061306057600080fd5b8061306a81615796565b95945050505050565b60008060008360020b1261308a578260020b613097565b8260020b613097906157af565b90506130a6620d89e7196157cb565b60020b8111156130dc5760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610824565b6000816001166000036130f357600160801b613105565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561313a576080613135826ffff97272373d413259a46990580e213a615718565b901c90505b600482161561316457608061315f826ffff2e50f5f656932ef12357cf3c7fdcc615718565b901c90505b600882161561318e576080613189826fffe5caca7e10e4e61c3624eaa0941cd0615718565b901c90505b60108216156131b85760806131b3826fffcb9843d60f6159c9db58835c926644615718565b901c90505b60208216156131e25760806131dd826fff973b41fa98c081472e6896dfb254c0615718565b901c90505b604082161561320c576080613207826fff2ea16466c96a3843ec78b326b52861615718565b901c90505b6080821615613236576080613231826ffe5dee046a99a2a811c461f1969c3053615718565b901c90505b61010082161561326157608061325c826ffcbe86c7900a88aedcffc83b479aa3a4615718565b901c90505b61020082161561328c576080613287826ff987a7253ac413176f2b074cf7815e54615718565b901c90505b6104008216156132b75760806132b2826ff3392b0822b70005940c7a398e4b70f3615718565b901c90505b6108008216156132e25760806132dd826fe7159475a2c29b7443b29c7fa6e889d9615718565b901c90505b61100082161561330d576080613308826fd097f3bdfd2022b8845ad8f792aa5825615718565b901c90505b612000821615613338576080613333826fa9f746462d870fdf8a65dc1f90e061e5615718565b901c90505b61400082161561336357608061335e826f70d869a156d2a1b890bb3df62baf32f7615718565b901c90505b61800082161561338e576080613389826f31be135f97d08fd981231505542fcfa6615718565b901c90505b620100008216156133ba5760806133b5826f09aa508b5b7a84e1c677de54f3e99bc9615718565b901c90505b620200008216156133e55760806133e0826e5d6af8dedb81196699c329225ee604615718565b901c90505b6204000082161561340f57608061340a826d2216e584f5fa1ea926041bedfe98615718565b901c90505b62080000821615613437576080613432826b048a170391f7dc42444e8fa2615718565b901c90505b60008460020b13156134525761344f81600019615745565b90505b613460600160201b826157ed565b1561346c57600161346f565b60005b6134809060ff16602083901c6154bc565b949350505050565b6000600160801b82106134ed5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610824565b5090565b600080836001600160a01b0316856001600160a01b03161115613512579293925b846001600160a01b0316866001600160a01b03161161353d57613536858585614961565b9150612ea3565b836001600160a01b0316866001600160a01b0316101561357657613562868585614961565b915061356f8587856149cb565b9050612ea3565b6135818585856149cb565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e2b9085906323b872dd60e01b90608401612ed8565b6000836001600160a01b0316856001600160a01b031611156135e4579293925b846001600160a01b0316866001600160a01b03161161360f57613608858585614a15565b905061306a565b836001600160a01b0316866001600160a01b03161015613671576000613636878686614a15565b90506000613645878986614a7f565b9050806001600160801b0316826001600160801b0316106136665780613668565b815b9250505061306a565b61367c858584614a7f565b9695505050505050565b6001600160a01b0382166136dc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610824565b80603560008282546136ee91906154bc565b90915550506001600160a01b0382166000908152603360205260408120805483929061371b9084906154bc565b90915550506040518181526001600160a01b03831690600090600080516020615cc68339815191529060200160405180910390a35050565b60008060008060006137636106fc565b915091508160001480156137775750600081115b1561378e576137878689836141b3565b925061383d565b8015801561379c5750600082115b156137ac576137878789846141b3565b811580156137b8575080155b156137df5760405162461bcd60e51b81526020600482015260006024820152604401610824565b60006137ec888a856141b3565b905060006137fb888b856141b3565b905060008211801561380d5750600081115b6138295760405162461bcd60e51b815260040161082490615537565b8082106138365780613838565b815b945050505b61384883838a61302a565b945061385583828a61302a565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff16918391506000906138a0576138a0615801565b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106138cf576138cf615801565b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613915908590600401615817565b600060405180830381865afa158015613932573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261395a919081019061590a565b509050805160021461399a5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610824565b6098548151600091829163ffffffff90911660060b90849083906139c0576139c0615801565b6020026020010151846001815181106139db576139db615801565b60200260200101510360060b816139f4576139f461572f565b059050613a038160020b613073565b6097549092506000915061271090613a2690600160f01b900461ffff16846159cc565b613a3091906159fe565b90508415613a7857613a428183615a24565b6001600160a01b0316866001600160a01b03161015613a735760405162461bcd60e51b815260040161082490615a44565b613ab3565b613a828183615a6b565b6001600160a01b0316866001600160a01b03161115613ab35760405162461bcd60e51b815260040161082490615a44565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613af4903090600401614e39565b602060405180830381865afa158015613b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b359190615475565b613b3f91906153b2565b613b4991906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613b85903090600401614e39565b602060405180830381865afa158015613ba2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bc69190615475565b613bd091906153b2565b613bda91906153b2565b6097549091506000908190613c0590600160a01b8104600290810b91600160b81b9004900b8c6126da565b935093505050613c158282612a0d565b613c1f8282612ae6565b6040519193509150600080516020615ce683398151915290613c449084908490614e4d565b60405180910390a1613c5684836154bc565b9150613c6283826154bc565b609e549091506001600160a01b0390811690861603613def57609754869061271090613c9990600160d01b900461ffff1685615718565b613ca39190615745565b1015613cc15760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613cf9903090600401614e39565b602060405180830381865afa158015613d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d3a9190615475565b613d4491906153b2565b613d4e91906153b2565b613d5891906153b2565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613d93903090600401614e39565b602060405180830381865afa158015613db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dd49190615475565b613dde91906153b2565b613de891906153b2565b9250613f5c565b609f546001600160a01b0390811690861603612e6d57609754869061271090613e2390600160d01b900461ffff1684615718565b613e2d9190615745565b1015613e4b5760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a0823190613e81903090600401614e39565b602060405180830381865afa158015613e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ec29190615475565b613ecc91906153b2565b613ed691906153b2565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a0823190613f11903090600401614e39565b602060405180830381865afa158015613f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f529190615475565b613dd491906153b2565b609754612d1590600160a01b8104600290810b91600160b81b9004900b86868d8d8d612b80565b600054610100900460ff1680613f9c575060005460ff16155b613fb85760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015613fda576000805461ffff19166101011790555b613fe2614ab5565b613fec8383614b1f565b8015612f0f576000805461ff0019169055505050565b600054610100900460ff168061401b575060005460ff16155b6140375760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614059576000805461ffff19166101011790555b614061614ba6565b8015614073576000805461ff00191690555b50565b6001600160a01b0382166140d65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610824565b6001600160a01b0382166000908152603360205260409020548181101561414a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610824565b61415482826153b2565b6001600160a01b038416600090815260336020526040812091909155603580548492906141829084906153b2565b90915550506040518281526000906001600160a01b03851690600080516020615cc68339815191529060200161222c565b60008080600019858709858702925082811083820303915050806000036141ec57600084116141e157600080fd5b508290049050610847565b8084116141f857600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600080871561440157609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b8152600401602060405180830381865afa1580156142c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142e49190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161432491600160a01b90910460020b90600401614f3e565b61010060405180830381865afa158015614342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143669190615a8b565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba9395506143af94600160b81b90910460020b93506004019150614f3e9050565b61010060405180830381865afa1580156143cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143f19190615a8b565b5093975061458f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b8152600401602060405180830381865afa158015614454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144789190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916144b891600160a01b90910460020b90600401614f3e565b61010060405180830381865afa1580156144d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144fa9190615a8b565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506145429450600160b81b900460020b926004019150614f3e9050565b61010060405180830381865afa158015614560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145849190615a8b565b509297505050505050505b609754600090600160a01b9004600290810b9088900b126145b15750826145b6565b508281035b609754600090600160b81b9004600290810b9089900b12156145d95750826145de565b508282035b8183038190036145fe6001600160801b0389168b8303600160801b6141b3565b9b9a5050505050505050505050565b6000600160ff1b82106134ed5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610824565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c40160408051808303816000875af11580156146e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061470c9190615599565b915091508161471a8a61460d565b6147249190615b27565b9350806147308961460d565b61473a9190615b27565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015614791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b5919061530a565b505050505050905060006147e2826147cf8f60020b613073565b6147db8f60020b613073565b89896135c4565b90506001600160801b0381161561487f57609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b815260040161483a9493929190615557565b60408051808303816000875af1158015614858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061487c9190615599565b50505b5050505097509795505050505050565b60006148e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c169092919063ffffffff16565b805190915015612f0f57808060200190518101906149029190615b47565b612f0f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610824565b6000826001600160a01b0316846001600160a01b03161115614981579192915b6001600160a01b0384166149c1600160601b600160e01b03606085901b166149a98787615a24565b6001600160a01b0316866001600160a01b03166141b3565b6134809190615745565b6000826001600160a01b0316846001600160a01b031611156149eb579192915b6134806001600160801b038316614a028686615a24565b6001600160a01b0316600160601b6141b3565b6000826001600160a01b0316846001600160a01b03161115614a35579192915b6000614a58856001600160a01b0316856001600160a01b0316600160601b6141b3565b905061306a614a7a8483614a6c8989615a24565b6001600160a01b03166141b3565b614c25565b6000826001600160a01b0316846001600160a01b03161115614a9f579192915b613480614a7a83600160601b614a6c8888615a24565b600054610100900460ff1680614ace575060005460ff16155b614aea5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614061576000805461ffff19166101011790558015614073576000805461ff001916905550565b600054610100900460ff1680614b38575060005460ff16155b614b545760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614b76576000805461ffff19166101011790555b6036614b828482615baa565b506037614b8f8382615baa565b508015612f0f576000805461ff0019169055505050565b600054610100900460ff1680614bbf575060005460ff16155b614bdb5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614bfd576000805461ffff19166101011790555b60016065558015614073576000805461ff001916905550565b60606134808484600085614c40565b806001600160801b0381168114614c3b57600080fd5b919050565b606082471015614ca15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610824565b843b614cef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610824565b600080866001600160a01b03168587604051614d0b9190615c69565b60006040518083038185875af1925050503d8060008114614d48576040519150601f19603f3d011682016040523d82523d6000602084013e614d4d565b606091505b5091509150614d5d828286614d68565b979650505050505050565b60608315614d77575081610847565b825115614d875782518084602001fd5b8160405162461bcd60e51b81526004016108249190614dc5565b60005b83811015614dbc578181015183820152602001614da4565b50506000910152565b6020815260008251806020840152614de4816040850160208701614da1565b601f01601f19169190910160400192915050565b6001600160a01b038116811461407357600080fd5b60008060408385031215614e2057600080fd5b8235614e2b81614df8565b946020939093013593505050565b6001600160a01b0391909116815260200190565b918252602082015260400190565b600080600060608486031215614e7057600080fd5b8335614e7b81614df8565b92506020840135614e8b81614df8565b929592945050506040919091013590565b8060020b811461407357600080fd5b801515811461407357600080fd5b600080600080600060a08688031215614ed157600080fd5b8535614edc81614e9c565b94506020860135614eec81614e9c565b93506040860135614efc81614df8565b9250606086013591506080860135614f1381614eab565b809150509295509295909350565b600060208284031215614f3357600080fd5b813561084781614df8565b60029190910b815260200190565b60008060408385031215614f5f57600080fd5b823591506020830135614f7181614df8565b809150509250929050565b60008060408385031215614f8f57600080fd5b50508035926020909101359150565b61ffff8116811461407357600080fd5b63ffffffff8116811461407357600080fd5b600080600080600060a08688031215614fd857600080fd5b8535614fe381614f9e565b94506020860135614ff381614f9e565b9350604086013561500381614f9e565b9250606086013561501381614fae565b91506080860135614f1381614df8565b600080600080600060a0868803121561503b57600080fd5b853561504681614df8565b945060208601359350604086013561505d81614eab565b9250606086013591506080860135614f1381614df8565b60008083601f84011261508657600080fd5b5081356001600160401b0381111561509d57600080fd5b6020830191508360208285010111156150b557600080fd5b9250929050565b600080600080606085870312156150d257600080fd5b843593506020850135925060408501356001600160401b038111156150f657600080fd5b61510287828801615074565b95989497509550505050565b6000806040838503121561512157600080fd5b823561512c81614df8565b91506020830135614f7181614df8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561517a5761517a61513c565b604052919050565b600082601f83011261519357600080fd5b81356001600160401b038111156151ac576151ac61513c565b6151bf601f8201601f1916602001615152565b8181528460208386010111156151d457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060e0888a03121561520c57600080fd5b87356001600160401b038082111561522357600080fd5b61522f8b838c01615182565b985060208a013591508082111561524557600080fd5b506152528a828b01615182565b965050604088013561526381614df8565b9450606088013561527381614f9e565b9350608088013561528381614e9c565b925060a088013561529381614e9c565b915060c08801356152a381614df8565b8091505092959891949750929550565b6000602082840312156152c557600080fd5b813561084781614f9e565b600181811c908216806152e457607f821691505b60208210810361530457634e487b7160e01b600052602260045260246000fd5b50919050565b600080600080600080600060e0888a03121561532557600080fd5b875161533081614df8565b602089015190975061534181614e9c565b604089015190965061535281614f9e565b606089015190955061536381614f9e565b608089015190945061537481614f9e565b60a089015190935060ff8116811461538b57600080fd5b60c08901519092506152a381614eab565b634e487b7160e01b600052601160045260246000fd5b818103818111156106f6576106f661539c565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b80516001600160801b0381168114614c3b57600080fd5b600080600080600060a0868803121561543657600080fd5b61543f86615407565b9450602086015193506040860151925061545b60608701615407565b915061546960808701615407565b90509295509295909350565b60006020828403121561548757600080fd5b5051919050565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b808201808211156106f6576106f661539c565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b600080604083850312156155ac57600080fd5b505080516020909101519092909150565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b60208082526003908201526242505360e81b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b61ffff8281168282160390808211156156a3576156a361539c565b5092915050565b6020808252600490820152636d42505360e01b604082015260600190565b6000602082840312156156da57600080fd5b815161084781614df8565b600080604083850312156156f857600080fd5b61570183615407565b915061570f60208401615407565b90509250929050565b80820281158282048414176106f6576106f661539c565b634e487b7160e01b600052601260045260246000fd5b6000826157545761575461572f565b500490565b61ffff8181168382160190808211156156a3576156a361539c565b602080825260089082015267686967682066656560c01b604082015260600190565b6000600182016157a8576157a861539c565b5060010190565b6000600160ff1b82016157c4576157c461539c565b5060000390565b60008160020b627fffff1981036157e4576157e461539c565b60000392915050565b6000826157fc576157fc61572f565b500690565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561585557835163ffffffff1683529284019291840191600101615833565b50909695505050505050565b60006001600160401b0382111561587a5761587a61513c565b5060051b60200190565b8051600681900b8114614c3b57600080fd5b600082601f8301126158a757600080fd5b815160206158bc6158b783615861565b615152565b82815260059290921b840181019181810190868411156158db57600080fd5b8286015b848110156158ff5780516158f281614df8565b83529183019183016158df565b509695505050505050565b6000806040838503121561591d57600080fd5b82516001600160401b038082111561593457600080fd5b818501915085601f83011261594857600080fd5b815160206159586158b783615861565b82815260059290921b8401810191818101908984111561597757600080fd5b948201945b8386101561599c5761598d86615884565b8252948201949082019061597c565b918801519196509093505050808211156159b557600080fd5b506159c285828601615896565b9150509250929050565b6001600160a01b038281168282168181028316929181158285048214176159f5576159f561539c565b50505092915050565b60006001600160a01b0383811680615a1857615a1861572f565b92169190910492915050565b6001600160a01b038281168282160390808211156156a3576156a361539c565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b6001600160a01b038181168382160190808211156156a3576156a361539c565b600080600080600080600080610100898b031215615aa857600080fd5b615ab189615407565b9750602089015180600f0b8114615ac757600080fd5b60408a015160608b015191985096509450615ae460808a01615884565b935060a0890151615af481614df8565b60c08a0151909350615b0581614fae565b60e08a0151909250615b1681614eab565b809150509295985092959890939650565b81810360008312801583831316838312821617156156a3576156a361539c565b600060208284031215615b5957600080fd5b815161084781614eab565b601f821115612f0f57600081815260208120601f850160051c81016020861015615b8b5750805b601f850160051c820191505b81811015613ab357828155600101615b97565b81516001600160401b03811115615bc357615bc361513c565b615bd781615bd184546152d0565b84615b64565b602080601f831160018114615c0c5760008415615bf45750858301515b600019600386901b1c1916600185901b178555613ab3565b600085815260208120601f198616915b82811015615c3b57888601518255948401946001909101908401615c1c565b5085821015615c595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251615c7b818460208701614da1565b919091019291505056fec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a2646970667358221220a11bde499516b0a2e8e737821292815fcefc66549a9729f24ea128d34ed6027364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190614dc5565b61026e610269366004614e0d565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d9190614e39565b6102a66106fc565b60405161023d929190614e4d565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004614e5b565b610796565b6102f56102f0366004614eb9565b61084e565b005b6102ff600081565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004614e0d565b610c3a565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610c71565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b1366004614f21565b6001600160a01b031660009081526033602052604090205490565b6102f5610c80565b6097546103e890600160b81b900460020b81565b60405161023d9190614f3e565b6102f5610403366004614f4c565b610cd6565b61041b610416366004614f4c565b610e31565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e6110ea565b61045a610455366004614f7c565b6110f9565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004614fc0565b611232565b6097546103e890600160a01b900460020b81565b61026e6104aa366004614e0d565b6113f2565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004614e0d565b61148d565b6102f56104e5366004615023565b61149a565b610233609b5481565b6102a6610501366004614f21565b61173d565b6102f5610514366004614f4c565b6117d5565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046150bc565b6118bb565b6097546102ff90600160f01b900461ffff1681565b61023361059a36600461510e565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b61023361191f565b6102f56105db3660046151f1565b61192e565b6102f56105ee3660046152b3565b611ba3565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f5610628366004614f21565b611cb0565b6102f561063b3660046150bc565b611d90565b61041b61064e366004614f4c565b611dfa565b606060368054610662906152d0565b80601f016020809104026020016040519081016040528092919081815260200182805461068e906152d0565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f2338484612114565b5060015b92915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610779919061530a565b50505050509150915061078c8282612239565b9350935050509091565b60006107a38484846124b9565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561082d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610841853361083c86856153b2565b612114565b60019150505b9392505050565b33610857610c71565b6001600160a01b03161461087d5760405162461bcd60e51b8152600401610824906153c5565b600080600061088b60355490565b1115610bca57609d546001600160a01b031663514ea4bf6108aa61267f565b6040518263ffffffff1660e01b81526004016108c891815260200190565b60a060405180830381865afa1580156108e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610909919061541e565b5092945050506001600160801b03831615905061099257609754600090819061094890600160a01b8104600290810b91600160b81b9004900b866126da565b9350935050506109588282612a0d565b6109628282612ae6565b6040519193509150600080516020615ce6833981519152906109879084908490614e4d565b60405180910390a150505b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a06903090600401614e39565b602060405180830381865afa158015610a23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a479190615475565b610a5191906153b2565b610a5b91906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610a97903090600401614e39565b602060405180830381865afa158015610ab4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad89190615475565b610ae291906153b2565b610aec91906153b2565b9050610afd898984848b8b8b612b80565b609d546001600160a01b031663514ea4bf610b1661267f565b6040518263ffffffff1660e01b8152600401610b3491815260200190565b60a060405180830381865afa158015610b51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b75919061541e565b509295505050506001600160801b038316610bc35760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610824565b5050610c06565b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615c8683398151915287878484604051610c29949392919061548e565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061083c9086906154bc565b6097546001600160a01b031690565b33610c89610c71565b6001600160a01b031614610caf5760405162461bcd60e51b8152600401610824906153c5565b60988054600160201b600160d01b031916905560006099819055609a55610cd4612d21565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d205760405162461bcd60e51b8152600401610824906154cf565b600080610d33609954609a548888612d88565b60006099819055609a5590925090508115610d6d57609854609e54610d6d916001600160a01b0391821691600160301b9091041684612eac565b8015610d9857609854609f54610d98916001600160a01b0391821691600160301b9091041683612eac565b505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601610df757610df26001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b610e2b565b610e2b6001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050565b6000806000600260655403610e585760405162461bcd60e51b815260040161082490615500565b600260655584610e7a5760405162461bcd60e51b815260040161082490615537565b6000610e8560355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610edc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f00919061530a565b50505050505090506000821115610f4157600080610f1c6106fc565b91509150610f2b828a8661302a565b9650610f38818a8661302a565b95505050610f87565b609754610f81908290610f5d90600160a01b900460020b613073565b609754610f7390600160b81b900460020b613073565b610f7c8b613488565b6134f1565b90955093505b8415610fa557609e54610fa5906001600160a01b031633308861358c565b8315610fc357609f54610fc3906001600160a01b031633308761358c565b609754610ffc908290610fdf90600160a01b900460020b613073565b609754610ff590600160b81b900460020b613073565b88886135c4565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d9161104c913091600160a01b8104600290810b92600160b81b909204900b908990600401615557565b60408051808303816000875af115801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190615599565b505061109a8688613686565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e786888787876040516110d19594939291906155bd565b60405180910390a1505060016065819055509250925092565b606060378054610662906152d0565b60008060008061110860355490565b905080156111275761111b818787613753565b9195509350915061122a565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611195919061530a565b505050505050905060006111db826111be609760149054906101000a900460020b60020b613073565b6097546111d490600160b81b900460020b613073565b8b8b6135c4565b6097546001600160801b038216955090915061122290839061120690600160a01b900460020b613073565b60975461121c90600160b81b900460020b613073565b846134f1565b909650945050505b509250925092565b3361123b610c71565b6001600160a01b0316146112615760405162461bcd60e51b8152600401610824906153c5565b6127108461ffff1611156112875760405162461bcd60e51b8152600401610824906155f4565b6127108561ffff1611156112ad5760405162461bcd60e51b8152600401610824906155f4565b6127108361ffff1611156112d35760405162461bcd60e51b8152600401610824906155f4565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff85161561134a576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff84161561136f576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561139557609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff8216156113b7576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156113eb5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156114745760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610824565b611483338561083c86856153b2565b5060019392505050565b60006106f23384846124b9565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114e45760405162461bcd60e51b8152600401610824906154cf565b85156114f4576114f48786613862565b609d546000906001600160a01b031663514ea4bf61151061267f565b6040518263ffffffff1660e01b815260040161152e91815260200190565b60a060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f919061541e565b505050509050611583818989898989613abb565b609d546000906001600160a01b031663514ea4bf61159f61267f565b6040518263ffffffff1660e01b81526004016115bd91815260200190565b60a060405180830381865afa1580156115da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fe919061541e565b505050509050816001600160801b0316816001600160801b03161161165f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610824565b609754604051600080516020615c868339815191529161169991600160a01b8204600290810b92600160b81b9004900b908690869061548e565b60405180910390a1505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601611700576116fb6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b611734565b6117346001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b9919061530a565b50505050509150506117cb8482612239565b9250925050915091565b8181336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461181f5760405162461bcd60e51b8152600401610824906154cf565b600080611832609b54609c548888612d88565b6000609b819055609c559092509050811561187e57609e5461187e906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084612eac565b8015610d9857609f54610d98906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083612eac565b609d546001600160a01b031633146118e55760405162461bcd60e51b815260040161082490615611565b831561190257609e54611902906001600160a01b03163386612eac565b8215610e2b57609f54610e2b906001600160a01b03163385612eac565b600061192961267f565b905090565b600054610100900460ff1680611947575060005460ff16155b6119635760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015611985576000805461ffff19166101011790555b6119926000612710615688565b61ffff168561ffff1611156119b95760405162461bcd60e51b8152600401610824906156aa565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe1681916004808201926020929091908290030181865afa158015611a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3691906156c8565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a79160048083019260209291908290030181865afa158015611a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab891906156c8565b609f80546001600160a01b039283166001600160a01b0319918216179091556098805460978054948716600160301b8102600160301b600160d01b031963ffffffff1961ffff8e16600160201b021665ffffffffffff199095169490941761012c17939093169290921790925562ffffff878116600160b81b02909316600165ffffff00000160a01b0319938916600160a01b02600165ffffff00000160a01b0390951694909417643e800c801960d31b179290921692909217179055611b7f8888613f83565b611b87614002565b8015611b99576000805461ff00191690555b5050505050505050565b33611bac610c71565b6001600160a01b031614611bd25760405162461bcd60e51b8152600401610824906153c5565b609854600160201b900461ffff1615611c135760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610824565b60008161ffff16118015611c3b5750611c2f6000612710615688565b61ffff168161ffff1611155b611c575760405162461bcd60e51b8152600401610824906156aa565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611cb9610c71565b6001600160a01b031614611cdf5760405162461bcd60e51b8152600401610824906153c5565b6001600160a01b038116611d465760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610824565b6097546040516001600160a01b03808416921690600080516020615ca683398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611dba5760405162461bcd60e51b815260040161082490615611565b6000841315611dda57609e54610df2906001600160a01b03163386612eac565b6000831315610e2b57609f54610e2b906001600160a01b03163385612eac565b6000806000600260655403611e215760405162461bcd60e51b815260040161082490615500565b600260655584611e5c5760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610824565b6000611e6760355490565b609d549091506000906001600160a01b031663514ea4bf611e8661267f565b6040518263ffffffff1660e01b8152600401611ea491815260200190565b60a060405180830381865afa158015611ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee5919061541e565b505050509050611ef53388614076565b6000611f0b88836001600160801b0316856141b3565b9050611f1681613488565b609754909450600090819081908190611f4590600160a01b8104600290810b91600160b81b9004900b8a6126da565b9350935093509350611f578282612a0d565b611f618282612ae6565b6040519193509150600080516020615ce683398151915290611f869084908490614e4d565b60405180910390a1609b54609954609e546040516370a0823160e01b815261203293929188916001600160a01b03909116906370a0823190611fcc903090600401614e39565b602060405180830381865afa158015611fe9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200d9190615475565b61201791906153b2565b61202191906153b2565b61202b91906153b2565b8d896141b3565b61203c90856154bc565b609c54609a54609f546040516370a0823160e01b8152939d506120799387916001600160a01b0316906370a0823190611fcc903090600401614e39565b61208390846154bc565b985089156120a257609e546120a2906001600160a01b03168c8c612eac565b88156120bf57609f546120bf906001600160a01b03168c8b612eac565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516120f69594939291906155bd565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166121765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610824565b6001600160a01b0382166121d75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610824565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61226161267f565b6040518263ffffffff1660e01b815260040161227f91815260200190565b60a060405180830381865afa15801561229c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c0919061541e565b94509450945094509450612305896122e9609760149054906101000a900460020b60020b613073565b6097546122ff90600160b81b900460020b613073565b886134f1565b909750955060006001600160801b0383166123236001878c8a614261565b61232d91906154bc565b90506000826001600160801b03166123486000878d8b614261565b61235291906154bc565b905061235e8282612ae6565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a082319061239c903090600401614e39565b602060405180830381865afa1580156123b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dd9190615475565b6123e790856154bc565b6123f191906153b2565b6123fb91906153b2565b612405908a6154bc565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a0823190612440903090600401614e39565b602060405180830381865afa15801561245d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124819190615475565b61248b90846154bc565b61249591906153b2565b61249f91906153b2565b6124a990896154bc565b9750505050505050509250929050565b6001600160a01b03831661251d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610824565b6001600160a01b03821661257f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610824565b6001600160a01b038316600090815260336020526040902054818110156125f75760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610824565b61260182826153b2565b6001600160a01b0380861660009081526033602052604080822093909355908516815290812080548492906126379084906154bc565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615cc68339815191528460405161267191815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b820460e890811b6034830152600160b81b90920490911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a0823190612713903090600401614e39565b602060405180830381865afa158015612730573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127549190615475565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061278a903090600401614e39565b602060405180830381865afa1580156127a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cb9190615475565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a79060640160408051808303816000875af1158015612830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128549190615599565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a40160408051808303816000875af11580156128c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128eb91906156e5565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612921903090600401614e39565b602060405180830381865afa15801561293e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129629190615475565b61296c91906153b2565b61297691906153b2565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a08231906129ab903090600401614e39565b602060405180830381865afa1580156129c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ec9190615475565b6129f691906153b2565b612a0091906153b2565b9250505093509350935093565b612710612a1b600084615718565b612a259190615745565b609b6000828254612a3691906154bc565b909155506127109050612a4a600083615718565b612a549190615745565b609c6000828254612a6591906154bc565b909155505060985461271090612a8690600160201b900461ffff1684615718565b612a909190615745565b60996000828254612aa191906154bc565b909155505060985461271090612ac290600160201b900461ffff1683615718565b612acc9190615745565b609a6000828254612add91906154bc565b90915550505050565b6000806000612710609860049054906101000a900461ffff166000612b0b9190615759565b612b199061ffff1687615718565b612b239190615745565b60985490915060009061271090612b4590600160201b900461ffff1683615759565b612b539061ffff1687615718565b612b5d9190615745565b9050612b6982876153b2565b9350612b7581866153b2565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015612bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bee919061530a565b50505050505090506000612c1b82612c088b60020b613073565b612c148b60020b613073565b8a8a6135c4565b90506001600160801b03811615612cc957609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612c679030908f908f908990600401615557565b60408051808303816000875af1158015612c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ca99190615599565b9092509050612cb8828a6153b2565b9850612cc481896153b2565b975050505b6000612cf86127108686612cdd5789612cdf565b8a5b612ce99190615718565b612cf39190615745565b61460d565b90506000811315612d1557612d128a8a8a8a858b8a614673565b50505b50505050505050505050565b33612d2a610c71565b6001600160a01b031614612d505760405162461bcd60e51b8152600401610824906153c5565b6097546040516000916001600160a01b031690600080516020615ca6833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0390811690841603612dfd57609754849061271090612dc190600160e01b900461ffff1689615718565b612dcb9190615745565b1015612de95760405162461bcd60e51b815260040161082490615774565b612df384876153b2565b9150849050612ea3565b609f546001600160a01b0390811690841603612e6d57609754849061271090612e3190600160e01b900461ffff1688615718565b612e3b9190615745565b1015612e595760405162461bcd60e51b815260040161082490615774565b612e6384866153b2565b9050859150612ea3565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610824565b94509492505050565b6040516001600160a01b038316602482015260448101829052612f0f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261488f565b505050565b80471015612f645760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610824565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612fb1576040519150601f19603f3d011682016040523d82523d6000602084013e612fb6565b606091505b5050905080612f0f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610824565b60006130378484846141b3565b9050600082806130495761304961572f565b848609111561084757600019811061306057600080fd5b8061306a81615796565b95945050505050565b60008060008360020b1261308a578260020b613097565b8260020b613097906157af565b90506130a6620d89e7196157cb565b60020b8111156130dc5760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610824565b6000816001166000036130f357600160801b613105565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561313a576080613135826ffff97272373d413259a46990580e213a615718565b901c90505b600482161561316457608061315f826ffff2e50f5f656932ef12357cf3c7fdcc615718565b901c90505b600882161561318e576080613189826fffe5caca7e10e4e61c3624eaa0941cd0615718565b901c90505b60108216156131b85760806131b3826fffcb9843d60f6159c9db58835c926644615718565b901c90505b60208216156131e25760806131dd826fff973b41fa98c081472e6896dfb254c0615718565b901c90505b604082161561320c576080613207826fff2ea16466c96a3843ec78b326b52861615718565b901c90505b6080821615613236576080613231826ffe5dee046a99a2a811c461f1969c3053615718565b901c90505b61010082161561326157608061325c826ffcbe86c7900a88aedcffc83b479aa3a4615718565b901c90505b61020082161561328c576080613287826ff987a7253ac413176f2b074cf7815e54615718565b901c90505b6104008216156132b75760806132b2826ff3392b0822b70005940c7a398e4b70f3615718565b901c90505b6108008216156132e25760806132dd826fe7159475a2c29b7443b29c7fa6e889d9615718565b901c90505b61100082161561330d576080613308826fd097f3bdfd2022b8845ad8f792aa5825615718565b901c90505b612000821615613338576080613333826fa9f746462d870fdf8a65dc1f90e061e5615718565b901c90505b61400082161561336357608061335e826f70d869a156d2a1b890bb3df62baf32f7615718565b901c90505b61800082161561338e576080613389826f31be135f97d08fd981231505542fcfa6615718565b901c90505b620100008216156133ba5760806133b5826f09aa508b5b7a84e1c677de54f3e99bc9615718565b901c90505b620200008216156133e55760806133e0826e5d6af8dedb81196699c329225ee604615718565b901c90505b6204000082161561340f57608061340a826d2216e584f5fa1ea926041bedfe98615718565b901c90505b62080000821615613437576080613432826b048a170391f7dc42444e8fa2615718565b901c90505b60008460020b13156134525761344f81600019615745565b90505b613460600160201b826157ed565b1561346c57600161346f565b60005b6134809060ff16602083901c6154bc565b949350505050565b6000600160801b82106134ed5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610824565b5090565b600080836001600160a01b0316856001600160a01b03161115613512579293925b846001600160a01b0316866001600160a01b03161161353d57613536858585614961565b9150612ea3565b836001600160a01b0316866001600160a01b0316101561357657613562868585614961565b915061356f8587856149cb565b9050612ea3565b6135818585856149cb565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e2b9085906323b872dd60e01b90608401612ed8565b6000836001600160a01b0316856001600160a01b031611156135e4579293925b846001600160a01b0316866001600160a01b03161161360f57613608858585614a15565b905061306a565b836001600160a01b0316866001600160a01b03161015613671576000613636878686614a15565b90506000613645878986614a7f565b9050806001600160801b0316826001600160801b0316106136665780613668565b815b9250505061306a565b61367c858584614a7f565b9695505050505050565b6001600160a01b0382166136dc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610824565b80603560008282546136ee91906154bc565b90915550506001600160a01b0382166000908152603360205260408120805483929061371b9084906154bc565b90915550506040518181526001600160a01b03831690600090600080516020615cc68339815191529060200160405180910390a35050565b60008060008060006137636106fc565b915091508160001480156137775750600081115b1561378e576137878689836141b3565b925061383d565b8015801561379c5750600082115b156137ac576137878789846141b3565b811580156137b8575080155b156137df5760405162461bcd60e51b81526020600482015260006024820152604401610824565b60006137ec888a856141b3565b905060006137fb888b856141b3565b905060008211801561380d5750600081115b6138295760405162461bcd60e51b815260040161082490615537565b8082106138365780613838565b815b945050505b61384883838a61302a565b945061385583828a61302a565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff16918391506000906138a0576138a0615801565b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106138cf576138cf615801565b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613915908590600401615817565b600060405180830381865afa158015613932573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261395a919081019061590a565b509050805160021461399a5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610824565b6098548151600091829163ffffffff90911660060b90849083906139c0576139c0615801565b6020026020010151846001815181106139db576139db615801565b60200260200101510360060b816139f4576139f461572f565b059050613a038160020b613073565b6097549092506000915061271090613a2690600160f01b900461ffff16846159cc565b613a3091906159fe565b90508415613a7857613a428183615a24565b6001600160a01b0316866001600160a01b03161015613a735760405162461bcd60e51b815260040161082490615a44565b613ab3565b613a828183615a6b565b6001600160a01b0316866001600160a01b03161115613ab35760405162461bcd60e51b815260040161082490615a44565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613af4903090600401614e39565b602060405180830381865afa158015613b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b359190615475565b613b3f91906153b2565b613b4991906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613b85903090600401614e39565b602060405180830381865afa158015613ba2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bc69190615475565b613bd091906153b2565b613bda91906153b2565b6097549091506000908190613c0590600160a01b8104600290810b91600160b81b9004900b8c6126da565b935093505050613c158282612a0d565b613c1f8282612ae6565b6040519193509150600080516020615ce683398151915290613c449084908490614e4d565b60405180910390a1613c5684836154bc565b9150613c6283826154bc565b609e549091506001600160a01b0390811690861603613def57609754869061271090613c9990600160d01b900461ffff1685615718565b613ca39190615745565b1015613cc15760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613cf9903090600401614e39565b602060405180830381865afa158015613d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d3a9190615475565b613d4491906153b2565b613d4e91906153b2565b613d5891906153b2565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613d93903090600401614e39565b602060405180830381865afa158015613db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dd49190615475565b613dde91906153b2565b613de891906153b2565b9250613f5c565b609f546001600160a01b0390811690861603612e6d57609754869061271090613e2390600160d01b900461ffff1684615718565b613e2d9190615745565b1015613e4b5760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a0823190613e81903090600401614e39565b602060405180830381865afa158015613e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ec29190615475565b613ecc91906153b2565b613ed691906153b2565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a0823190613f11903090600401614e39565b602060405180830381865afa158015613f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f529190615475565b613dd491906153b2565b609754612d1590600160a01b8104600290810b91600160b81b9004900b86868d8d8d612b80565b600054610100900460ff1680613f9c575060005460ff16155b613fb85760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015613fda576000805461ffff19166101011790555b613fe2614ab5565b613fec8383614b1f565b8015612f0f576000805461ff0019169055505050565b600054610100900460ff168061401b575060005460ff16155b6140375760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614059576000805461ffff19166101011790555b614061614ba6565b8015614073576000805461ff00191690555b50565b6001600160a01b0382166140d65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610824565b6001600160a01b0382166000908152603360205260409020548181101561414a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610824565b61415482826153b2565b6001600160a01b038416600090815260336020526040812091909155603580548492906141829084906153b2565b90915550506040518281526000906001600160a01b03851690600080516020615cc68339815191529060200161222c565b60008080600019858709858702925082811083820303915050806000036141ec57600084116141e157600080fd5b508290049050610847565b8084116141f857600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600080871561440157609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b8152600401602060405180830381865afa1580156142c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142e49190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161432491600160a01b90910460020b90600401614f3e565b61010060405180830381865afa158015614342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143669190615a8b565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba9395506143af94600160b81b90910460020b93506004019150614f3e9050565b61010060405180830381865afa1580156143cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143f19190615a8b565b5093975061458f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b8152600401602060405180830381865afa158015614454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144789190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916144b891600160a01b90910460020b90600401614f3e565b61010060405180830381865afa1580156144d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144fa9190615a8b565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506145429450600160b81b900460020b926004019150614f3e9050565b61010060405180830381865afa158015614560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145849190615a8b565b509297505050505050505b609754600090600160a01b9004600290810b9088900b126145b15750826145b6565b508281035b609754600090600160b81b9004600290810b9089900b12156145d95750826145de565b508282035b8183038190036145fe6001600160801b0389168b8303600160801b6141b3565b9b9a5050505050505050505050565b6000600160ff1b82106134ed5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610824565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c40160408051808303816000875af11580156146e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061470c9190615599565b915091508161471a8a61460d565b6147249190615b27565b9350806147308961460d565b61473a9190615b27565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015614791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b5919061530a565b505050505050905060006147e2826147cf8f60020b613073565b6147db8f60020b613073565b89896135c4565b90506001600160801b0381161561487f57609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b815260040161483a9493929190615557565b60408051808303816000875af1158015614858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061487c9190615599565b50505b5050505097509795505050505050565b60006148e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c169092919063ffffffff16565b805190915015612f0f57808060200190518101906149029190615b47565b612f0f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610824565b6000826001600160a01b0316846001600160a01b03161115614981579192915b6001600160a01b0384166149c1600160601b600160e01b03606085901b166149a98787615a24565b6001600160a01b0316866001600160a01b03166141b3565b6134809190615745565b6000826001600160a01b0316846001600160a01b031611156149eb579192915b6134806001600160801b038316614a028686615a24565b6001600160a01b0316600160601b6141b3565b6000826001600160a01b0316846001600160a01b03161115614a35579192915b6000614a58856001600160a01b0316856001600160a01b0316600160601b6141b3565b905061306a614a7a8483614a6c8989615a24565b6001600160a01b03166141b3565b614c25565b6000826001600160a01b0316846001600160a01b03161115614a9f579192915b613480614a7a83600160601b614a6c8888615a24565b600054610100900460ff1680614ace575060005460ff16155b614aea5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614061576000805461ffff19166101011790558015614073576000805461ff001916905550565b600054610100900460ff1680614b38575060005460ff16155b614b545760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614b76576000805461ffff19166101011790555b6036614b828482615baa565b506037614b8f8382615baa565b508015612f0f576000805461ff0019169055505050565b600054610100900460ff1680614bbf575060005460ff16155b614bdb5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614bfd576000805461ffff19166101011790555b60016065558015614073576000805461ff001916905550565b60606134808484600085614c40565b806001600160801b0381168114614c3b57600080fd5b919050565b606082471015614ca15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610824565b843b614cef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610824565b600080866001600160a01b03168587604051614d0b9190615c69565b60006040518083038185875af1925050503d8060008114614d48576040519150601f19603f3d011682016040523d82523d6000602084013e614d4d565b606091505b5091509150614d5d828286614d68565b979650505050505050565b60608315614d77575081610847565b825115614d875782518084602001fd5b8160405162461bcd60e51b81526004016108249190614dc5565b60005b83811015614dbc578181015183820152602001614da4565b50506000910152565b6020815260008251806020840152614de4816040850160208701614da1565b601f01601f19169190910160400192915050565b6001600160a01b038116811461407357600080fd5b60008060408385031215614e2057600080fd5b8235614e2b81614df8565b946020939093013593505050565b6001600160a01b0391909116815260200190565b918252602082015260400190565b600080600060608486031215614e7057600080fd5b8335614e7b81614df8565b92506020840135614e8b81614df8565b929592945050506040919091013590565b8060020b811461407357600080fd5b801515811461407357600080fd5b600080600080600060a08688031215614ed157600080fd5b8535614edc81614e9c565b94506020860135614eec81614e9c565b93506040860135614efc81614df8565b9250606086013591506080860135614f1381614eab565b809150509295509295909350565b600060208284031215614f3357600080fd5b813561084781614df8565b60029190910b815260200190565b60008060408385031215614f5f57600080fd5b823591506020830135614f7181614df8565b809150509250929050565b60008060408385031215614f8f57600080fd5b50508035926020909101359150565b61ffff8116811461407357600080fd5b63ffffffff8116811461407357600080fd5b600080600080600060a08688031215614fd857600080fd5b8535614fe381614f9e565b94506020860135614ff381614f9e565b9350604086013561500381614f9e565b9250606086013561501381614fae565b91506080860135614f1381614df8565b600080600080600060a0868803121561503b57600080fd5b853561504681614df8565b945060208601359350604086013561505d81614eab565b9250606086013591506080860135614f1381614df8565b60008083601f84011261508657600080fd5b5081356001600160401b0381111561509d57600080fd5b6020830191508360208285010111156150b557600080fd5b9250929050565b600080600080606085870312156150d257600080fd5b843593506020850135925060408501356001600160401b038111156150f657600080fd5b61510287828801615074565b95989497509550505050565b6000806040838503121561512157600080fd5b823561512c81614df8565b91506020830135614f7181614df8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561517a5761517a61513c565b604052919050565b600082601f83011261519357600080fd5b81356001600160401b038111156151ac576151ac61513c565b6151bf601f8201601f1916602001615152565b8181528460208386010111156151d457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060e0888a03121561520c57600080fd5b87356001600160401b038082111561522357600080fd5b61522f8b838c01615182565b985060208a013591508082111561524557600080fd5b506152528a828b01615182565b965050604088013561526381614df8565b9450606088013561527381614f9e565b9350608088013561528381614e9c565b925060a088013561529381614e9c565b915060c08801356152a381614df8565b8091505092959891949750929550565b6000602082840312156152c557600080fd5b813561084781614f9e565b600181811c908216806152e457607f821691505b60208210810361530457634e487b7160e01b600052602260045260246000fd5b50919050565b600080600080600080600060e0888a03121561532557600080fd5b875161533081614df8565b602089015190975061534181614e9c565b604089015190965061535281614f9e565b606089015190955061536381614f9e565b608089015190945061537481614f9e565b60a089015190935060ff8116811461538b57600080fd5b60c08901519092506152a381614eab565b634e487b7160e01b600052601160045260246000fd5b818103818111156106f6576106f661539c565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b80516001600160801b0381168114614c3b57600080fd5b600080600080600060a0868803121561543657600080fd5b61543f86615407565b9450602086015193506040860151925061545b60608701615407565b915061546960808701615407565b90509295509295909350565b60006020828403121561548757600080fd5b5051919050565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b808201808211156106f6576106f661539c565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b600080604083850312156155ac57600080fd5b505080516020909101519092909150565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b60208082526003908201526242505360e81b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b61ffff8281168282160390808211156156a3576156a361539c565b5092915050565b6020808252600490820152636d42505360e01b604082015260600190565b6000602082840312156156da57600080fd5b815161084781614df8565b600080604083850312156156f857600080fd5b61570183615407565b915061570f60208401615407565b90509250929050565b80820281158282048414176106f6576106f661539c565b634e487b7160e01b600052601260045260246000fd5b6000826157545761575461572f565b500490565b61ffff8181168382160190808211156156a3576156a361539c565b602080825260089082015267686967682066656560c01b604082015260600190565b6000600182016157a8576157a861539c565b5060010190565b6000600160ff1b82016157c4576157c461539c565b5060000390565b60008160020b627fffff1981036157e4576157e461539c565b60000392915050565b6000826157fc576157fc61572f565b500690565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561585557835163ffffffff1683529284019291840191600101615833565b50909695505050505050565b60006001600160401b0382111561587a5761587a61513c565b5060051b60200190565b8051600681900b8114614c3b57600080fd5b600082601f8301126158a757600080fd5b815160206158bc6158b783615861565b615152565b82815260059290921b840181019181810190868411156158db57600080fd5b8286015b848110156158ff5780516158f281614df8565b83529183019183016158df565b509695505050505050565b6000806040838503121561591d57600080fd5b82516001600160401b038082111561593457600080fd5b818501915085601f83011261594857600080fd5b815160206159586158b783615861565b82815260059290921b8401810191818101908984111561597757600080fd5b948201945b8386101561599c5761598d86615884565b8252948201949082019061597c565b918801519196509093505050808211156159b557600080fd5b506159c285828601615896565b9150509250929050565b6001600160a01b038281168282168181028316929181158285048214176159f5576159f561539c565b50505092915050565b60006001600160a01b0383811680615a1857615a1861572f565b92169190910492915050565b6001600160a01b038281168282160390808211156156a3576156a361539c565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b6001600160a01b038181168382160190808211156156a3576156a361539c565b600080600080600080600080610100898b031215615aa857600080fd5b615ab189615407565b9750602089015180600f0b8114615ac757600080fd5b60408a015160608b015191985096509450615ae460808a01615884565b935060a0890151615af481614df8565b60c08a0151909350615b0581614fae565b60e08a0151909250615b1681614eab565b809150509295985092959890939650565b81810360008312801583831316838312821617156156a3576156a361539c565b600060208284031215615b5957600080fd5b815161084781614eab565b601f821115612f0f57600081815260208120601f850160051c81016020861015615b8b5750805b601f850160051c820191505b81811015613ab357828155600101615b97565b81516001600160401b03811115615bc357615bc361513c565b615bd781615bd184546152d0565b84615b64565b602080601f831160018114615c0c5760008415615bf45750858301515b600019600386901b1c1916600185901b178555613ab3565b600085815260208120601f198616915b82811015615c3b57888601518255948401946001909101908401615c1c565b5085821015615c595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251615c7b818460208701614da1565b919091019291505056fec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a2646970667358221220a11bde499516b0a2e8e737821292815fcefc66549a9729f24ea128d34ed6027364736f6c63430008130033", - "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": "See {IERC20-allowance}." - }, - "approve(address,uint256)": { - "details": "See {IERC20-approve}. Requirements: - `spender` cannot be the zero address." - }, - "balanceOf(address)": { - "details": "See {IERC20-balanceOf}." - }, - "burn(uint256,address)": { - "params": { - "burnAmount": "The number of G-UNI tokens to burn", - "receiver": "The account to receive the underlying amounts of token0 and token1" - }, - "returns": { - "amount0": "amount of token0 transferred to receiver for burning `burnAmount`", - "amount1": "amount of token1 transferred to receiver for burning `burnAmount`", - "liquidityBurned": "amount of liquidity removed from the underlying Uniswap V3 position" - } - }, - "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 this function is overridden; 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`." - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "details": "When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.", - "params": { - "newLowerTick": "The new lower bound of the position's range", - "newUpperTick": "The new upper bound of the position's range", - "swapAmountBPS": "amount of token to swap as proportion of total. Pass 0 to ignore swap.", - "swapThresholdPrice": "slippage parameter on the swap as a max or min sqrtPriceX96", - "zeroForOne": "Which token to input into the swap (true = token0, false = token1)" - } - }, - "getMintAmounts(uint256,uint256)": { - "params": { - "amount0Max": "The maximum amount of token1 to forward on mint" - }, - "returns": { - "amount0": "actual amount of token0 to forward when minting `mintAmount`", - "amount1": "actual amount of token1 to forward when minting `mintAmount`", - "mintAmount": "maximum number of G-UNI tokens to mint" - } - }, - "getUnderlyingBalances()": { - "returns": { - "amount0Current": "current total underlying balance of token0", - "amount1Current": "current total underlying balance of token1" - } - }, - "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." - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "params": { - "_lowerTick": "initial upperTick (only changeable with executiveRebalance)", - "_managerFeeBPS": "proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION", - "_manager_": "address of manager (ownership can be transferred)", - "_name": "name of G-UNI token", - "_pool": "address of Uniswap V3 pool", - "_symbol": "symbol of G-UNI token" - } - }, - "initializeManagerFee(uint16)": { - "params": { - "_managerFeeBPS": "proportion of fees earned that are credited to manager in Basis Points" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "mint(uint256,address)": { - "details": "to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts", - "params": { - "mintAmount": "The number of G-UNI tokens to mint", - "receiver": "The account to receive the minted tokens" - }, - "returns": { - "amount0": "amount of token0 transferred from msg.sender to mint `mintAmount`", - "amount1": "amount of token1 transferred from msg.sender to mint `mintAmount`", - "liquidityMinted": "amount of liquidity added to the underlying Uniswap V3 position" - } - }, - "name()": { - "details": "Returns the name of the token." - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "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 manager." - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "params": { - "newRebalanceBPS": "controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance", - "newSlippageBPS": "maximum slippage on swaps during gelato rebalance", - "newSlippageInterval": "length of time for TWAP used in computing slippage on swaps", - "newTreasury": "address where managerFee withdrawals are sent", - "newWithdrawBPS": "controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "burn(uint256,address)": { - "notice": "burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens" - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "notice": "Change the range of underlying UniswapV3 position, only manager can call" - }, - "getMintAmounts(uint256,uint256)": { - "notice": "compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`" - }, - "getUnderlyingBalances()": { - "notice": "compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)" - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "notice": "initialize storage variables on a new G-UNI pool, only called once" - }, - "initializeManagerFee(uint16)": { - "notice": "initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again." - }, - "mint(uint256,address)": { - "notice": "mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position" - }, - "rebalance(uint160,uint256,bool,uint256,address)": { - "notice": "Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager." - }, - "uniswapV3MintCallback(uint256,uint256,bytes)": { - "notice": "Uniswap V3 callback fn, called back on pool.mint" - }, - "uniswapV3SwapCallback(int256,int256,bytes)": { - "notice": "Uniswap v3 callback fn, called back on pool.swap" - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "notice": "change configurable parameters, only manager can call" - }, - "withdrawGelatoBalance(uint256,address)": { - "notice": "withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - }, - "withdrawManagerBalance(uint256,address)": { - "notice": "withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 5, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 784, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage" - }, - { - "astId": 122, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_balances", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 128, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_allowances", - "offset": 0, - "slot": "52", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 130, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_totalSupply", - "offset": 0, - "slot": "53", - "type": "t_uint256" - }, - { - "astId": 132, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_name", - "offset": 0, - "slot": "54", - "type": "t_string_storage" - }, - { - "astId": 134, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_symbol", - "offset": 0, - "slot": "55", - "type": "t_string_storage" - }, - { - "astId": 636, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "56", - "type": "t_array(t_uint256)45_storage" - }, - { - "astId": 59, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_status", - "offset": 0, - "slot": "101", - "type": "t_uint256" - }, - { - "astId": 102, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "102", - "type": "t_array(t_uint256)49_storage" - }, - { - "astId": 6441, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_manager", - "offset": 0, - "slot": "151", - "type": "t_address" - }, - { - "astId": 6031, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "lowerTick", - "offset": 20, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6033, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "upperTick", - "offset": 23, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6035, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoRebalanceBPS", - "offset": 26, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6037, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoWithdrawBPS", - "offset": 28, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6039, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageBPS", - "offset": 30, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6041, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageInterval", - "offset": 0, - "slot": "152", - "type": "t_uint32" - }, - { - "astId": 6043, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerFeeBPS", - "offset": 4, - "slot": "152", - "type": "t_uint16" - }, - { - "astId": 6045, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerTreasury", - "offset": 6, - "slot": "152", - "type": "t_address" - }, - { - "astId": 6047, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance0", - "offset": 0, - "slot": "153", - "type": "t_uint256" - }, - { - "astId": 6049, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance1", - "offset": 0, - "slot": "154", - "type": "t_uint256" - }, - { - "astId": 6051, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance0", - "offset": 0, - "slot": "155", - "type": "t_uint256" - }, - { - "astId": 6053, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance1", - "offset": 0, - "slot": "156", - "type": "t_uint256" - }, - { - "astId": 6056, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "pool", - "offset": 0, - "slot": "157", - "type": "t_contract(IUniswapV3Pool)2339" - }, - { - "astId": 6059, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token0", - "offset": 0, - "slot": "158", - "type": "t_contract(IERC20)863" - }, - { - "astId": 6062, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token1", - "offset": 0, - "slot": "159", - "type": "t_contract(IERC20)863" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)45_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)49_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "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)863": { - "encoding": "inplace", - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_contract(IUniswapV3Pool)2339": { - "encoding": "inplace", - "label": "contract IUniswapV3Pool", - "numberOfBytes": "20" - }, - "t_int24": { - "encoding": "inplace", - "label": "int24", - "numberOfBytes": "3" - }, - "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_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/baseSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json b/lib/g-uni-v1-core/deployments/baseSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json deleted file mode 100644 index 371127af2..000000000 --- a/lib/g-uni-v1-core/deployments/baseSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\n/// @dev Modified to support 0.8.19\n/// @dev Modified to set the gelatoFeeBPS to 0\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 0;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n event SetManagerFee(uint16 managerFee);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n emit SetManagerFee(_managerFeeBPS);\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidityBefore,\n uint128 liquidityAfter\n );\n\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n SafeCast.toUint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidityBurned);\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n\n amount0 =\n burn0 +\n FullMath.mulDiv(\n token0.balanceOf(address(this)) -\n burn0 -\n managerBalance0 -\n gelatoBalance0,\n burnAmount,\n totalSupply\n );\n amount1 =\n burn1 +\n FullMath.mulDiv(\n token1.balanceOf(address(this)) -\n burn1 -\n managerBalance1 -\n gelatoBalance1,\n burnAmount,\n totalSupply\n );\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n // solhint-disable-next-line function-max-lines\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n uint128 liquidity;\n uint128 newLiquidity;\n if (totalSupply() > 0) {\n (liquidity, , , , ) = pool.positions(_getPositionID());\n if (liquidity > 0) {\n (, , uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n }\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > 0, \"new position 0\");\n } else {\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n }\n\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n _rebalance(\n liquidity,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > liquidity, \"liquidity must increase\");\n\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\n external\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n // solhint-disable-next-line function-max-lines\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\n internal\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint128 liquidity,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n uint256 leftover0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 leftover1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n (, , uint256 feesEarned0, uint256 feesEarned1) =\n _withdraw(lowerTick, upperTick, liquidity);\n _applyFees(feesEarned0, feesEarned1);\n (feesEarned0, feesEarned1) = _subtractAdminFees(\n feesEarned0,\n feesEarned1\n );\n emit FeesEarned(feesEarned0, feesEarned1);\n feesEarned0 += leftover0;\n feesEarned1 += leftover1;\n\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n leftover0,\n leftover1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdraw(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n )\n private\n returns (\n uint256 burn0,\n uint256 burn1,\n uint256 fee0,\n uint256 fee1\n )\n {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n SafeCast.toInt256(\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\n );\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array len\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"high slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"high slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\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 require(value < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return uint128(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 require(value < 2**64, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return uint64(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 require(value < 2**32, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return uint32(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 require(value < 2**16, \"SafeCast: value doesn\\'t fit in 16 bits\");\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 require(value < 2**8, \"SafeCast: value doesn\\'t fit in 8 bits\");\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 require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= -2**127 && value < 2**127, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return int128(value);\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= -2**63 && value < 2**63, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return int64(value);\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= -2**31 && value < 2**31, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return int32(value);\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= -2**15 && value < 2**15, \"SafeCast: value doesn\\'t fit in 16 bits\");\n return int16(value);\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= -2**7 && value < 2**7, \"SafeCast: value doesn\\'t fit in 8 bits\");\n return int8(value);\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 require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IUniswapV3TickSpacing} from \"./interfaces/IUniswapV3TickSpacing.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n }\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n 0,\n lowerTick,\n upperTick,\n address(0)\n );\n }\n\n function _createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n address manager\n ) internal returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory name = \"Gelato Uniswap LP\";\n try this.getTokenName(token0, token1) returns (string memory result) {\n name = result;\n } catch {} // solhint-disable-line no-empty-blocks\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n require(uniPool != address(0), \"uniswap pool does not exist\");\n require(\n _validateTickSpacing(uniPool, lowerTick, upperTick),\n \"tickSpacing mismatch\"\n );\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n manager\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, manager, pool);\n }\n\n function _validateTickSpacing(\n address uniPool,\n int24 lowerTick,\n int24 upperTick\n ) internal view returns (bool) {\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\n return\n lowerTick < upperTick &&\n lowerTick % spacing == 0 &&\n upperTick % spacing == 0;\n }\n\n function getTokenName(address token0, address token1)\n external\n view\n returns (string memory)\n {\n string memory symbol0 = IERC20Metadata(token0).symbol();\n string memory symbol1 = IERC20Metadata(token1).symbol();\n\n return _append(\"Gelato Uniswap \", symbol0, \"/\", symbol1, \" LP\");\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IUniswapV3TickSpacing.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IUniswapV3TickSpacing {\n function tickSpacing() external view returns (int24);\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "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/lib/g-uni-v1-core/deployments/blastSepolia/.chainId b/lib/g-uni-v1-core/deployments/blastSepolia/.chainId deleted file mode 100644 index 771a9653b..000000000 --- a/lib/g-uni-v1-core/deployments/blastSepolia/.chainId +++ /dev/null @@ -1 +0,0 @@ -168587773 \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/blastSepolia/GUniFactory.json b/lib/g-uni-v1-core/deployments/blastSepolia/GUniFactory.json deleted file mode 100644 index c5f74b8f4..000000000 --- a/lib/g-uni-v1-core/deployments/blastSepolia/GUniFactory.json +++ /dev/null @@ -1,721 +0,0 @@ -{ - "address": "0xED28E5230E934cf9C843C08818D0639176040297", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - } - ], - "transactionHash": "0xdc7b9d6bfd2892101980fe09c69d2c4fbef64e4a1ce1b4446ee6e32c781fd917", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0xED28E5230E934cf9C843C08818D0639176040297", - "transactionIndex": 1, - "gasUsed": "551510", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000400000000000000000000000000000000000008000000000000000000000000000200000000000000020000000000000000000800000000002000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000200000050000000000000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000000400000000020000000000000000000100000000000000", - "blockHash": "0xae736e5c5764dd9de424c30bf72ce8be78b721e6cc0ab6c3fdff770a17ec5b8d", - "transactionHash": "0xdc7b9d6bfd2892101980fe09c69d2c4fbef64e4a1ce1b4446ee6e32c781fd917", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 6676806, - "transactionHash": "0xdc7b9d6bfd2892101980fe09c69d2c4fbef64e4a1ce1b4446ee6e32c781fd917", - "address": "0xED28E5230E934cf9C843C08818D0639176040297", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000007b19fe2fc328d3843973d20a4cb0b5b785b02b8e" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0xae736e5c5764dd9de424c30bf72ce8be78b721e6cc0ab6c3fdff770a17ec5b8d" - }, - { - "transactionIndex": 1, - "blockNumber": 6676806, - "transactionHash": "0xdc7b9d6bfd2892101980fe09c69d2c4fbef64e4a1ce1b4446ee6e32c781fd917", - "address": "0xED28E5230E934cf9C843C08818D0639176040297", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0xae736e5c5764dd9de424c30bf72ce8be78b721e6cc0ab6c3fdff770a17ec5b8d" - } - ], - "blockNumber": 6676806, - "cumulativeGasUsed": "595404", - "status": 1, - "byzantium": true - }, - "args": [ - "0x7B19Fe2Fc328d3843973D20a4cb0b5b785b02b8E", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b0000000000000000000000007b19fe2fc328d3843973d20a4cb0b5b785b02b8e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033", - "execute": { - "methodName": "initialize", - "args": [ - "0x7B19Fe2Fc328d3843973D20a4cb0b5b785b02b8E", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - ] - }, - "implementation": "0x7B19Fe2Fc328d3843973D20a4cb0b5b785b02b8E", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/blastSepolia/GUniFactory_Implementation.json b/lib/g-uni-v1-core/deployments/blastSepolia/GUniFactory_Implementation.json deleted file mode 100644 index 59d9055c5..000000000 --- a/lib/g-uni-v1-core/deployments/blastSepolia/GUniFactory_Implementation.json +++ /dev/null @@ -1,802 +0,0 @@ -{ - "address": "0x7B19Fe2Fc328d3843973D20a4cb0b5b785b02b8E", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_uniswapV3Factory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xcb07b45ff94d6fac4a2028b6f96b92b151cb9b341903bcd2b3b570514abac9c2", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x7B19Fe2Fc328d3843973D20a4cb0b5b785b02b8E", - "transactionIndex": 1, - "gasUsed": "2186401", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xd841662057108bf09bfa434492d9a1fbd63e545da625a4250bdbd769840121b3", - "transactionHash": "0xcb07b45ff94d6fac4a2028b6f96b92b151cb9b341903bcd2b3b570514abac9c2", - "logs": [], - "blockNumber": 6676727, - "cumulativeGasUsed": "2230295", - "status": 1, - "byzantium": true - }, - "args": [ - "0x84fF29e6321c9dd328B8B383b08dd2815b121243" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_uniswapV3Factory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"uniPool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previosGelatoDeployer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newGelatoDeployer\",\"type\":\"address\"}],\"name\":\"UpdateGelatoDeployer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"UpdatePoolImplementation\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createManagedPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDeployers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGelatoPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"getTokenName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gelatoDeployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isPoolImmutable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"makePoolsImmutable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numDeployers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextGelatoDeployer\",\"type\":\"address\"}],\"name\":\"setGelatoDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextImplementation\",\"type\":\"address\"}],\"name\":\"setPoolImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"upgradePools\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"bytes[]\",\"name\":\"datas\",\"type\":\"bytes[]\"}],\"name\":\"upgradePoolsAndCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"managerFee\":\"proportion of earned fees that go to pool manager in Basis Points\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"createPool(address,address,uint24,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"getDeployers()\":{\"returns\":{\"_0\":\"deployers the list of deployer addresses\"}},\"getGelatoPools()\":{\"returns\":{\"_0\":\"list of Gelato managed G-UNI pool addresses\"}},\"getPools(address)\":{\"params\":{\"deployer\":\"address that has potentially deployed G-UNI pools (can return empty array)\"},\"returns\":{\"_0\":\"pools the list of G-UNI pool addresses deployed by `deployer`\"}},\"getProxyAdmin(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"address that controls the G-UNI implementation (has power to upgrade it)\"}},\"isPoolImmutable(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"bool signaling if pool is immutable (true) or not (false)\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"numDeployers()\":{\"returns\":{\"_0\":\"total number of G-UNI pool deployer addresses\"}},\"numPools()\":{\"returns\":{\"result\":\"total number of G-UNI pools deployed\"}},\"numPools(address)\":{\"params\":{\"deployer\":\"deployer address\"},\"returns\":{\"_0\":\"total number of G-UNI pools deployed by `deployer`\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"notice\":\"createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`\"},\"createPool(address,address,uint24,int24,int24)\":{\"notice\":\"createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`\"},\"getDeployers()\":{\"notice\":\"getDeployers fetches all addresses that have deployed a G-UNI pool\"},\"getGelatoPools()\":{\"notice\":\"getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)\"},\"getPools(address)\":{\"notice\":\"getPools fetches all the G-UNI pool addresses deployed by `deployer`\"},\"getProxyAdmin(address)\":{\"notice\":\"getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address).\"},\"isPoolImmutable(address)\":{\"notice\":\"isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\"},\"numDeployers()\":{\"notice\":\"numDeployers counts the total number of G-UNI pool deployer addresses\"},\"numPools()\":{\"notice\":\"numPools counts the total number of G-UNI pools in existence\"},\"numPools(address)\":{\"notice\":\"numPools counts the total number of G-UNI pools deployed by `deployer`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniFactory.sol\":\"GUniFactory\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\\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\":\"0x4878ef6c288f4cef3c2a288d32cc548c648831cc55503ad3d9a581ed3b93aad9\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title The interface for the Uniswap V3 Factory\\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\\ninterface IUniswapV3Factory {\\n /// @notice Emitted when the owner of the factory is changed\\n /// @param oldOwner The owner before the owner was changed\\n /// @param newOwner The owner after the owner was changed\\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\\n\\n /// @notice Emitted when a pool is created\\n /// @param token0 The first token of the pool by address sort order\\n /// @param token1 The second token of the pool by address sort order\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks\\n /// @param pool The address of the created pool\\n event PoolCreated(\\n address indexed token0,\\n address indexed token1,\\n uint24 indexed fee,\\n int24 tickSpacing,\\n address pool\\n );\\n\\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\\n /// @param fee The enabled fee, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\\n\\n /// @notice Returns the current owner of the factory\\n /// @dev Can be changed by the current owner via setOwner\\n /// @return The address of the factory owner\\n function owner() external view returns (address);\\n\\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\\n /// @return The tick spacing\\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\\n\\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\\n /// @param tokenA The contract address of either token0 or token1\\n /// @param tokenB The contract address of the other token\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @return pool The pool address\\n function getPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external view returns (address pool);\\n\\n /// @notice Creates a pool for the given two tokens and fee\\n /// @param tokenA One of the two tokens in the desired pool\\n /// @param tokenB The other of the two tokens in the desired pool\\n /// @param fee The desired fee for the pool\\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\\n /// are invalid.\\n /// @return pool The address of the newly created pool\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external returns (address pool);\\n\\n /// @notice Updates the owner of the factory\\n /// @dev Must be called by the current owner\\n /// @param _owner The new owner of the factory\\n function setOwner(address _owner) external;\\n\\n /// @notice Enables a fee amount with the given tickSpacing\\n /// @dev Fee amounts may never be removed once enabled\\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\\n}\\n\",\"keccak256\":\"0xcc3d0c93fc9ac0febbe09f941b465b57f750bcf3b48432da0b97dc289cfdc489\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {\\n IUniswapV3Factory\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\\\";\\nimport {IUniswapV3TickSpacing} from \\\"./interfaces/IUniswapV3TickSpacing.sol\\\";\\nimport {IGUniFactory} from \\\"./interfaces/IGUniFactory.sol\\\";\\nimport {IGUniPoolStorage} from \\\"./interfaces/IGUniPoolStorage.sol\\\";\\nimport {GUniFactoryStorage} from \\\"./abstract/GUniFactoryStorage.sol\\\";\\nimport {EIP173Proxy} from \\\"./vendor/proxy/EIP173Proxy.sol\\\";\\nimport {IEIP173Proxy} from \\\"./interfaces/IEIP173Proxy.sol\\\";\\nimport {\\n IERC20Metadata\\n} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n constructor(address _uniswapV3Factory)\\n GUniFactoryStorage(_uniswapV3Factory)\\n {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n managerFee,\\n lowerTick,\\n upperTick,\\n msg.sender\\n );\\n }\\n\\n /// @notice createPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n 0,\\n lowerTick,\\n upperTick,\\n address(0)\\n );\\n }\\n\\n function _createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick,\\n address manager\\n ) internal returns (address pool) {\\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\\n\\n pool = address(new EIP173Proxy(poolImplementation, address(this), \\\"\\\"));\\n\\n string memory name = \\\"Gelato Uniswap LP\\\";\\n try this.getTokenName(token0, token1) returns (string memory result) {\\n name = result;\\n } catch {} // solhint-disable-line no-empty-blocks\\n\\n address uniPool =\\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\\n require(uniPool != address(0), \\\"uniswap pool does not exist\\\");\\n require(\\n _validateTickSpacing(uniPool, lowerTick, upperTick),\\n \\\"tickSpacing mismatch\\\"\\n );\\n\\n IGUniPoolStorage(pool).initialize(\\n name,\\n \\\"G-UNI\\\",\\n uniPool,\\n managerFee,\\n lowerTick,\\n upperTick,\\n manager\\n );\\n _deployers.add(msg.sender);\\n _pools[msg.sender].add(pool);\\n emit PoolCreated(uniPool, manager, pool);\\n }\\n\\n function _validateTickSpacing(\\n address uniPool,\\n int24 lowerTick,\\n int24 upperTick\\n ) internal view returns (bool) {\\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\\n return\\n lowerTick < upperTick &&\\n lowerTick % spacing == 0 &&\\n upperTick % spacing == 0;\\n }\\n\\n function getTokenName(address token0, address token1)\\n external\\n view\\n returns (string memory)\\n {\\n string memory symbol0 = IERC20Metadata(token0).symbol();\\n string memory symbol1 = IERC20Metadata(token1).symbol();\\n\\n return _append(\\\"Gelato Uniswap \\\", symbol0, \\\"/\\\", symbol1, \\\" LP\\\");\\n }\\n\\n function upgradePools(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\\n }\\n }\\n\\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\\n external\\n onlyManager\\n {\\n require(pools.length == datas.length, \\\"mismatching array length\\\");\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeToAndCall(\\n poolImplementation,\\n datas[i]\\n );\\n }\\n }\\n\\n function makePoolsImmutable(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\\n }\\n }\\n\\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the\\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\\n /// @param pool address of the G-UNI pool\\n /// @return bool signaling if pool is immutable (true) or not (false)\\n function isPoolImmutable(address pool) external view returns (bool) {\\n return address(0) == getProxyAdmin(pool);\\n }\\n\\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\\n /// @return list of Gelato managed G-UNI pool addresses\\n function getGelatoPools() external view returns (address[] memory) {\\n return getPools(gelatoDeployer);\\n }\\n\\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\\n /// @return deployers the list of deployer addresses\\n function getDeployers() public view returns (address[] memory) {\\n uint256 length = numDeployers();\\n address[] memory deployers = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n deployers[i] = _getDeployer(i);\\n }\\n\\n return deployers;\\n }\\n\\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\\n function getPools(address deployer) public view returns (address[] memory) {\\n uint256 length = numPools(deployer);\\n address[] memory pools = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n pools[i] = _getPool(deployer, i);\\n }\\n\\n return pools;\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools in existence\\n /// @return result total number of G-UNI pools deployed\\n function numPools() public view returns (uint256 result) {\\n address[] memory deployers = getDeployers();\\n for (uint256 i = 0; i < deployers.length; i++) {\\n result += numPools(deployers[i]);\\n }\\n }\\n\\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\\n /// @return total number of G-UNI pool deployer addresses\\n function numDeployers() public view returns (uint256) {\\n return _deployers.length();\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\\n /// @param deployer deployer address\\n /// @return total number of G-UNI pools deployed by `deployer`\\n function numPools(address deployer) public view returns (uint256) {\\n return _pools[deployer].length();\\n }\\n\\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\\n /// no longer upgradable (no one owns the zero address).\\n /// @param pool address of the G-UNI pool\\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\\n function getProxyAdmin(address pool) public view returns (address) {\\n return IEIP173Proxy(pool).proxyAdmin();\\n }\\n\\n function _getDeployer(uint256 index) internal view returns (address) {\\n return _deployers.at(index);\\n }\\n\\n function _getPool(address deployer, uint256 index)\\n internal\\n view\\n returns (address)\\n {\\n return _pools[deployer].at(index);\\n }\\n\\n function _getTokenOrder(address tokenA, address tokenB)\\n internal\\n pure\\n returns (address token0, address token1)\\n {\\n require(tokenA != tokenB, \\\"same token\\\");\\n (token0, token1) = tokenA < tokenB\\n ? (tokenA, tokenB)\\n : (tokenB, tokenA);\\n require(token0 != address(0), \\\"no address zero\\\");\\n }\\n\\n function _append(\\n string memory a,\\n string memory b,\\n string memory c,\\n string memory d,\\n string memory e\\n ) internal pure returns (string memory) {\\n return string(abi.encodePacked(a, b, c, d, e));\\n }\\n}\\n\",\"keccak256\":\"0x41d2d6a42321eed641468824c4d0ba4fbe40040895304388315ece96132011d6\",\"license\":\"MIT\"},\"contracts/abstract/GUniFactoryStorage.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n Initializable\\n} from \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\n// solhint-disable-next-line max-states-count\\ncontract GUniFactoryStorage is\\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\\n Initializable\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n address public immutable factory;\\n address public poolImplementation;\\n address public gelatoDeployer;\\n EnumerableSet.AddressSet internal _deployers;\\n mapping(address => EnumerableSet.AddressSet) internal _pools;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdatePoolImplementation(\\n address previousImplementation,\\n address newImplementation\\n );\\n\\n event UpdateGelatoDeployer(\\n address previosGelatoDeployer,\\n address newGelatoDeployer\\n );\\n\\n constructor(address _uniswapV3Factory) {\\n factory = _uniswapV3Factory;\\n }\\n\\n function initialize(\\n address _implementation,\\n address _gelatoDeployer,\\n address _manager_\\n ) external initializer {\\n poolImplementation = _implementation;\\n gelatoDeployer = _gelatoDeployer;\\n _manager = _manager_;\\n }\\n\\n function setPoolImplementation(address nextImplementation)\\n external\\n onlyManager\\n {\\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\\n poolImplementation = nextImplementation;\\n }\\n\\n function setGelatoDeployer(address nextGelatoDeployer)\\n external\\n onlyManager\\n {\\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\\n gelatoDeployer = nextGelatoDeployer;\\n }\\n}\\n\",\"keccak256\":\"0xb0e3a7e77ab8aecf8997593526451e64dd8e8aa07882c210c9aa38d4f7168755\",\"license\":\"MIT\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xb6016d5611f38fbd516a84ea2e56794cb76a8d61c40f6716d5f0133f195759bd\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IEIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IEIP173Proxy {\\n function proxyAdmin() external view returns (address);\\n\\n function transferProxyAdmin(address newAdmin) external;\\n\\n function upgradeTo(address newImplementation) external;\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable;\\n}\\n\",\"keccak256\":\"0xae9996ea370d97cb5fd1934394aca615bee0e46c9a0c161d728490264e83eda5\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IGUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\ninterface IGUniFactory {\\n event PoolCreated(\\n address indexed uniPool,\\n address indexed manager,\\n address indexed pool\\n );\\n\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n}\\n\",\"keccak256\":\"0xe06f79e9b1e6351fc4f40c9f25630f0fbfabae9d2ae2bb642ef1f03d4c2195c1\",\"license\":\"MIT\"},\"contracts/interfaces/IGUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IGUniPoolStorage {\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external;\\n}\\n\",\"keccak256\":\"0x52a3f83a23917772f1eb242cecdfa8b45d7b357a615383628c1ac1f26259dd3f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IUniswapV3TickSpacing.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IUniswapV3TickSpacing {\\n function tickSpacing() external view returns (int24);\\n}\\n\",\"keccak256\":\"0xa6f22651f7e49c6eecf584d8e829d31336de7c43eec3c4c4df3b309db27bd355\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b5060405161273838038061273883398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516126a661009260003960008181610312015261103101526126a66000f3fe60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e620001583660046200151e565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e3660046200160f565b62000448565b6200015e620001a5366004620016b0565b620005b0565b6200016a6200068a565b6200015e620001c6366004620016b0565b620006f5565b6200016a620001dd3660046200151e565b620007d3565b620001ed620007fc565b604051620001749190620016f0565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001758565b6200023a6200080b565b6040516200017491906200176d565b6200023a6200025a3660046200151e565b62000820565b6200023a620008dd565b6200015e62000997565b620001ed62000285366004620017e5565b62000a04565b600254620001ed906001600160a01b031681565b620002b6620002b03660046200151e565b62000a22565b604051901515815260200162000174565b620001ed620002d836600462001878565b62000a3f565b62000221620002ef366004620018f2565b62000a5e565b6200015e6200030636600462001930565b62000bad565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e620003593660046200151e565b62000cb7565b6200015e620003703660046200151e565b62000d56565b620001ed620003873660046200151e565b62000e3d565b3362000398620007fc565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001982565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b03909116908490620019c4565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000ea4565b905090565b3362000453620007fc565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001982565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005aa57838181518110620004eb57620004eb620019de565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052c576200052c620019de565b9050602002810190620005409190620019f4565b6040518463ffffffff1660e01b8152600401620005609392919062001a3d565b600060405180830381600087803b1580156200057b57600080fd5b505af115801562000590573d6000803e3d6000fd5b505050508080620005a19062001a93565b915050620004cc565b50505050565b33620005bb620007fc565b6001600160a01b031614620005e45760405162461bcd60e51b8152600401620003c19062001982565b60005b81518110156200068657818181518110620006065762000606620019de565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063c9190620016f0565b600060405180830381600087803b1580156200065757600080fd5b505af11580156200066c573d6000803e3d6000fd5b5050505080806200067d9062001a93565b915050620005e7565b5050565b60008062000697620008dd565b905060005b8151811015620006f057620006cd828281518110620006bf57620006bf620019de565b6020026020010151620007d3565b620006d9908462001aaf565b925080620006e78162001a93565b9150506200069c565b505090565b3362000700620007fc565b6001600160a01b031614620007295760405162461bcd60e51b8152600401620003c19062001982565b60005b815181101562000686578181815181106200074b576200074b620019de565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200078992911690600401620016f0565b600060405180830381600087803b158015620007a457600080fd5b505af1158015620007b9573d6000803e3d6000fd5b505050508080620007ca9062001a93565b9150506200072c565b6001600160a01b0381166000908152600560205260408120620007f69062000ea4565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200082f83620007d3565b90506000816001600160401b038111156200084e576200084e6200153e565b60405190808252806020026020018201604052801562000878578160200160208202803683370190505b50905060005b82811015620008d55762000893858262000eaf565b828281518110620008a857620008a8620019de565b6001600160a01b039092166020928302919091019091015280620008cc8162001a93565b9150506200087e565b509392505050565b60606000620008eb62000435565b90506000816001600160401b038111156200090a576200090a6200153e565b60405190808252806020026020018201604052801562000934578160200160208202803683370190505b50905060005b8281101562000990576200094e8162000eda565b828281518110620009635762000963620019de565b6001600160a01b039092166020928302919091019091015280620009878162001a93565b9150506200093a565b5092915050565b33620009a2620007fc565b6001600160a01b031614620009cb5760405162461bcd60e51b8152600401620003c19062001982565b600080546040516001600160a01b039091169060008051602062002651833981519152908390a3600080546001600160a01b0319169055565b600062000a178787878787873362000ee9565b979650505050505050565b600062000a2f8262000e3d565b6001600160a01b03161592915050565b600062000a5486868660008787600062000ee9565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000aa1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000acb919081019062001ac5565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000b0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b38919081019062001ac5565b905062000ba46040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001243565b95945050505050565b600054600160a81b900460ff168062000bd05750600054600160a01b900460ff16155b62000c355760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000c60576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005aa576000805460ff60a81b1916905550505050565b3362000cc2620007fc565b6001600160a01b03161462000ceb5760405162461bcd60e51b8152600401620003c19062001982565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000d2c916001600160a01b03909116908490620019c4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000d61620007fc565b6001600160a01b03161462000d8a5760405162461bcd60e51b8152600401620003c19062001982565b6001600160a01b03811662000df35760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200265183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007f6919062001b63565b6000620007f6825490565b6001600160a01b038216600090815260056020526040812062000ed390836200127a565b9392505050565b6000620007f66003836200127a565b600080600062000efa8a8a62001288565b6001546040519294509092506001600160a01b031690309062000f1d90620014f7565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000f60573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb99062000fb29086908690600401620019c4565b600060405180830381865afa92505050801562000ff357506040513d6000823e601f3d908101601f1916820160405262000ff0919081019062001ac5565b60015b1562000ffc5790505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee8290606401602060405180830381865afa1580156200107b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010a1919062001b63565b90506001600160a01b038116620010f95760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b6200110681898962001356565b6200114b5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200118390859085908e908e908e908e9060040162001b83565b600060405180830381600087803b1580156200119e57600080fd5b505af1158015620011b3573d6000803e3d6000fd5b50505050620011cd3360036200140390919063ffffffff16565b50336000908152600560205260409020620011e9908662001403565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200126095949392919062001bf8565b604051602081830303815290604052905095945050505050565b600062000ed383836200141a565b600080826001600160a01b0316846001600160a01b031603620012db5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620012fd57828462001300565b83835b90925090506001600160a01b0382166200134f5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001398573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013be919062001c6d565b90508260020b8460020b128015620013e25750620013dd818562001c8d565b60020b155b801562000ba45750620013f6818462001c8d565b60020b1595945050505050565b600062000ed3836001600160a01b038416620014a5565b815460009082106200147a5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b826000018281548110620014925762001492620019de565b9060005260206000200154905092915050565b6000818152600183016020526040812054620014ee57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007f6565b506000620007f6565b6109928062001cbf83390190565b6001600160a01b03811681146200151b57600080fd5b50565b6000602082840312156200153157600080fd5b813562000ed38162001505565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200157f576200157f6200153e565b604052919050565b600082601f8301126200159957600080fd5b813560206001600160401b03821115620015b757620015b76200153e565b8160051b620015c882820162001554565b9283528481018201928281019087851115620015e357600080fd5b83870192505b8483101562000a17578235620015ff8162001505565b82529183019190830190620015e9565b6000806000604084860312156200162557600080fd5b83356001600160401b03808211156200163d57600080fd5b6200164b8783880162001587565b945060208601359150808211156200166257600080fd5b818601915086601f8301126200167757600080fd5b8135818111156200168757600080fd5b8760208260051b85010111156200169d57600080fd5b6020830194508093505050509250925092565b600060208284031215620016c357600080fd5b81356001600160401b03811115620016da57600080fd5b620016e88482850162001587565b949350505050565b6001600160a01b0391909116815260200190565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b60208152600062000ed360208301846200172a565b6020808252825182820181905260009190848201906040850190845b81811015620017b05783516001600160a01b03168352928401929184019160010162001789565b50909695505050505050565b803562ffffff81168114620017d057600080fd5b919050565b8060020b81146200151b57600080fd5b60008060008060008060c08789031215620017ff57600080fd5b86356200180c8162001505565b955060208701356200181e8162001505565b94506200182e60408801620017bc565b9350606087013561ffff811681146200184657600080fd5b925060808701356200185881620017d5565b915060a08701356200186a81620017d5565b809150509295509295509295565b600080600080600060a086880312156200189157600080fd5b85356200189e8162001505565b94506020860135620018b08162001505565b9350620018c060408701620017bc565b92506060860135620018d281620017d5565b91506080860135620018e481620017d5565b809150509295509295909350565b600080604083850312156200190657600080fd5b8235620019138162001505565b91506020830135620019258162001505565b809150509250929050565b6000806000606084860312156200194657600080fd5b8335620019538162001505565b92506020840135620019658162001505565b91506040840135620019778162001505565b809150509250925092565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811262001a0c57600080fd5b8301803591506001600160401b0382111562001a2757600080fd5b6020019150368190038213156200134f57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001aa85762001aa862001a7d565b5060010190565b80820180821115620007f657620007f662001a7d565b60006020828403121562001ad857600080fd5b81516001600160401b038082111562001af057600080fd5b818401915084601f83011262001b0557600080fd5b81518181111562001b1a5762001b1a6200153e565b62001b2f601f8201601f191660200162001554565b915080825285602082850101111562001b4757600080fd5b62001b5a81602084016020860162001704565b50949350505050565b60006020828403121562001b7657600080fd5b815162000ed38162001505565b60e08152600062001b9860e08301896200172a565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001c0c818460208b0162001704565b86519083019062001c22818360208b0162001704565b865191019062001c37818360208a0162001704565b855191019062001c4c81836020890162001704565b845191019062001c6181836020880162001704565b01979650505050505050565b60006020828403121562001c8057600080fd5b815162000ed381620017d5565b60008260020b8062001caf57634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220bab4dc364f42f8e82ed2983d450c7f7b787f86ecc2b056c62a10271dfd59e29364736f6c63430008130033", - "deployedBytecode": "0x60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e620001583660046200151e565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e3660046200160f565b62000448565b6200015e620001a5366004620016b0565b620005b0565b6200016a6200068a565b6200015e620001c6366004620016b0565b620006f5565b6200016a620001dd3660046200151e565b620007d3565b620001ed620007fc565b604051620001749190620016f0565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001758565b6200023a6200080b565b6040516200017491906200176d565b6200023a6200025a3660046200151e565b62000820565b6200023a620008dd565b6200015e62000997565b620001ed62000285366004620017e5565b62000a04565b600254620001ed906001600160a01b031681565b620002b6620002b03660046200151e565b62000a22565b604051901515815260200162000174565b620001ed620002d836600462001878565b62000a3f565b62000221620002ef366004620018f2565b62000a5e565b6200015e6200030636600462001930565b62000bad565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e620003593660046200151e565b62000cb7565b6200015e620003703660046200151e565b62000d56565b620001ed620003873660046200151e565b62000e3d565b3362000398620007fc565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001982565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b03909116908490620019c4565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000ea4565b905090565b3362000453620007fc565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001982565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005aa57838181518110620004eb57620004eb620019de565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052c576200052c620019de565b9050602002810190620005409190620019f4565b6040518463ffffffff1660e01b8152600401620005609392919062001a3d565b600060405180830381600087803b1580156200057b57600080fd5b505af115801562000590573d6000803e3d6000fd5b505050508080620005a19062001a93565b915050620004cc565b50505050565b33620005bb620007fc565b6001600160a01b031614620005e45760405162461bcd60e51b8152600401620003c19062001982565b60005b81518110156200068657818181518110620006065762000606620019de565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063c9190620016f0565b600060405180830381600087803b1580156200065757600080fd5b505af11580156200066c573d6000803e3d6000fd5b5050505080806200067d9062001a93565b915050620005e7565b5050565b60008062000697620008dd565b905060005b8151811015620006f057620006cd828281518110620006bf57620006bf620019de565b6020026020010151620007d3565b620006d9908462001aaf565b925080620006e78162001a93565b9150506200069c565b505090565b3362000700620007fc565b6001600160a01b031614620007295760405162461bcd60e51b8152600401620003c19062001982565b60005b815181101562000686578181815181106200074b576200074b620019de565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200078992911690600401620016f0565b600060405180830381600087803b158015620007a457600080fd5b505af1158015620007b9573d6000803e3d6000fd5b505050508080620007ca9062001a93565b9150506200072c565b6001600160a01b0381166000908152600560205260408120620007f69062000ea4565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200082f83620007d3565b90506000816001600160401b038111156200084e576200084e6200153e565b60405190808252806020026020018201604052801562000878578160200160208202803683370190505b50905060005b82811015620008d55762000893858262000eaf565b828281518110620008a857620008a8620019de565b6001600160a01b039092166020928302919091019091015280620008cc8162001a93565b9150506200087e565b509392505050565b60606000620008eb62000435565b90506000816001600160401b038111156200090a576200090a6200153e565b60405190808252806020026020018201604052801562000934578160200160208202803683370190505b50905060005b8281101562000990576200094e8162000eda565b828281518110620009635762000963620019de565b6001600160a01b039092166020928302919091019091015280620009878162001a93565b9150506200093a565b5092915050565b33620009a2620007fc565b6001600160a01b031614620009cb5760405162461bcd60e51b8152600401620003c19062001982565b600080546040516001600160a01b039091169060008051602062002651833981519152908390a3600080546001600160a01b0319169055565b600062000a178787878787873362000ee9565b979650505050505050565b600062000a2f8262000e3d565b6001600160a01b03161592915050565b600062000a5486868660008787600062000ee9565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000aa1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000acb919081019062001ac5565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000b0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b38919081019062001ac5565b905062000ba46040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001243565b95945050505050565b600054600160a81b900460ff168062000bd05750600054600160a01b900460ff16155b62000c355760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000c60576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005aa576000805460ff60a81b1916905550505050565b3362000cc2620007fc565b6001600160a01b03161462000ceb5760405162461bcd60e51b8152600401620003c19062001982565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000d2c916001600160a01b03909116908490620019c4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000d61620007fc565b6001600160a01b03161462000d8a5760405162461bcd60e51b8152600401620003c19062001982565b6001600160a01b03811662000df35760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200265183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007f6919062001b63565b6000620007f6825490565b6001600160a01b038216600090815260056020526040812062000ed390836200127a565b9392505050565b6000620007f66003836200127a565b600080600062000efa8a8a62001288565b6001546040519294509092506001600160a01b031690309062000f1d90620014f7565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000f60573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb99062000fb29086908690600401620019c4565b600060405180830381865afa92505050801562000ff357506040513d6000823e601f3d908101601f1916820160405262000ff0919081019062001ac5565b60015b1562000ffc5790505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee8290606401602060405180830381865afa1580156200107b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010a1919062001b63565b90506001600160a01b038116620010f95760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b6200110681898962001356565b6200114b5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200118390859085908e908e908e908e9060040162001b83565b600060405180830381600087803b1580156200119e57600080fd5b505af1158015620011b3573d6000803e3d6000fd5b50505050620011cd3360036200140390919063ffffffff16565b50336000908152600560205260409020620011e9908662001403565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200126095949392919062001bf8565b604051602081830303815290604052905095945050505050565b600062000ed383836200141a565b600080826001600160a01b0316846001600160a01b031603620012db5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620012fd57828462001300565b83835b90925090506001600160a01b0382166200134f5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001398573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013be919062001c6d565b90508260020b8460020b128015620013e25750620013dd818562001c8d565b60020b155b801562000ba45750620013f6818462001c8d565b60020b1595945050505050565b600062000ed3836001600160a01b038416620014a5565b815460009082106200147a5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b826000018281548110620014925762001492620019de565b9060005260206000200154905092915050565b6000818152600183016020526040812054620014ee57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007f6565b506000620007f6565b6109928062001cbf83390190565b6001600160a01b03811681146200151b57600080fd5b50565b6000602082840312156200153157600080fd5b813562000ed38162001505565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200157f576200157f6200153e565b604052919050565b600082601f8301126200159957600080fd5b813560206001600160401b03821115620015b757620015b76200153e565b8160051b620015c882820162001554565b9283528481018201928281019087851115620015e357600080fd5b83870192505b8483101562000a17578235620015ff8162001505565b82529183019190830190620015e9565b6000806000604084860312156200162557600080fd5b83356001600160401b03808211156200163d57600080fd5b6200164b8783880162001587565b945060208601359150808211156200166257600080fd5b818601915086601f8301126200167757600080fd5b8135818111156200168757600080fd5b8760208260051b85010111156200169d57600080fd5b6020830194508093505050509250925092565b600060208284031215620016c357600080fd5b81356001600160401b03811115620016da57600080fd5b620016e88482850162001587565b949350505050565b6001600160a01b0391909116815260200190565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b60208152600062000ed360208301846200172a565b6020808252825182820181905260009190848201906040850190845b81811015620017b05783516001600160a01b03168352928401929184019160010162001789565b50909695505050505050565b803562ffffff81168114620017d057600080fd5b919050565b8060020b81146200151b57600080fd5b60008060008060008060c08789031215620017ff57600080fd5b86356200180c8162001505565b955060208701356200181e8162001505565b94506200182e60408801620017bc565b9350606087013561ffff811681146200184657600080fd5b925060808701356200185881620017d5565b915060a08701356200186a81620017d5565b809150509295509295509295565b600080600080600060a086880312156200189157600080fd5b85356200189e8162001505565b94506020860135620018b08162001505565b9350620018c060408701620017bc565b92506060860135620018d281620017d5565b91506080860135620018e481620017d5565b809150509295509295909350565b600080604083850312156200190657600080fd5b8235620019138162001505565b91506020830135620019258162001505565b809150509250929050565b6000806000606084860312156200194657600080fd5b8335620019538162001505565b92506020840135620019658162001505565b91506040840135620019778162001505565b809150509250925092565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811262001a0c57600080fd5b8301803591506001600160401b0382111562001a2757600080fd5b6020019150368190038213156200134f57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001aa85762001aa862001a7d565b5060010190565b80820180821115620007f657620007f662001a7d565b60006020828403121562001ad857600080fd5b81516001600160401b038082111562001af057600080fd5b818401915084601f83011262001b0557600080fd5b81518181111562001b1a5762001b1a6200153e565b62001b2f601f8201601f191660200162001554565b915080825285602082850101111562001b4757600080fd5b62001b5a81602084016020860162001704565b50949350505050565b60006020828403121562001b7657600080fd5b815162000ed38162001505565b60e08152600062001b9860e08301896200172a565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001c0c818460208b0162001704565b86519083019062001c22818360208b0162001704565b865191019062001c37818360208a0162001704565b855191019062001c4c81836020890162001704565b845191019062001c6181836020880162001704565b01979650505050505050565b60006020828403121562001c8057600080fd5b815162000ed381620017d5565b60008260020b8062001caf57634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220bab4dc364f42f8e82ed2983d450c7f7b787f86ecc2b056c62a10271dfd59e29364736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "managerFee": "proportion of earned fees that go to pool manager in Basis Points", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "createPool(address,address,uint24,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "getDeployers()": { - "returns": { - "_0": "deployers the list of deployer addresses" - } - }, - "getGelatoPools()": { - "returns": { - "_0": "list of Gelato managed G-UNI pool addresses" - } - }, - "getPools(address)": { - "params": { - "deployer": "address that has potentially deployed G-UNI pools (can return empty array)" - }, - "returns": { - "_0": "pools the list of G-UNI pool addresses deployed by `deployer`" - } - }, - "getProxyAdmin(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "address that controls the G-UNI implementation (has power to upgrade it)" - } - }, - "isPoolImmutable(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "bool signaling if pool is immutable (true) or not (false)" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "numDeployers()": { - "returns": { - "_0": "total number of G-UNI pool deployer addresses" - } - }, - "numPools()": { - "returns": { - "result": "total number of G-UNI pools deployed" - } - }, - "numPools(address)": { - "params": { - "deployer": "deployer address" - }, - "returns": { - "_0": "total number of G-UNI pools deployed by `deployer`" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "notice": "createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`" - }, - "createPool(address,address,uint24,int24,int24)": { - "notice": "createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`" - }, - "getDeployers()": { - "notice": "getDeployers fetches all addresses that have deployed a G-UNI pool" - }, - "getGelatoPools()": { - "notice": "getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)" - }, - "getPools(address)": { - "notice": "getPools fetches all the G-UNI pool addresses deployed by `deployer`" - }, - "getProxyAdmin(address)": { - "notice": "getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address)." - }, - "isPoolImmutable(address)": { - "notice": "isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded" - }, - "numDeployers()": { - "notice": "numDeployers counts the total number of G-UNI pool deployer addresses" - }, - "numPools()": { - "notice": "numPools counts the total number of G-UNI pools in existence" - }, - "numPools(address)": { - "notice": "numPools counts the total number of G-UNI pools deployed by `deployer`" - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6441, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_manager", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 5, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initialized", - "offset": 20, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initializing", - "offset": 21, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 5909, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "poolImplementation", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 5911, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "gelatoDeployer", - "offset": 0, - "slot": "2", - "type": "t_address" - }, - { - "astId": 5914, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_deployers", - "offset": 0, - "slot": "3", - "type": "t_struct(AddressSet)2007_storage" - }, - { - "astId": 5919, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_pools", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_struct(AddressSet)2007_storage)" - } - ], - "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_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(AddressSet)2007_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.AddressSet)", - "numberOfBytes": "32", - "value": "t_struct(AddressSet)2007_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(AddressSet)2007_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.AddressSet", - "members": [ - { - "astId": 2006, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1732_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Set)1732_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 1727, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 1731, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "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/lib/g-uni-v1-core/deployments/blastSepolia/GUniFactory_Proxy.json b/lib/g-uni-v1-core/deployments/blastSepolia/GUniFactory_Proxy.json deleted file mode 100644 index 1d26c0c7d..000000000 --- a/lib/g-uni-v1-core/deployments/blastSepolia/GUniFactory_Proxy.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "address": "0xED28E5230E934cf9C843C08818D0639176040297", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xdc7b9d6bfd2892101980fe09c69d2c4fbef64e4a1ce1b4446ee6e32c781fd917", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0xED28E5230E934cf9C843C08818D0639176040297", - "transactionIndex": 1, - "gasUsed": "551510", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000400000000000000000000000000000000000008000000000000000000000000000200000000000000020000000000000000000800000000002000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000200000050000000000000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000000400000000020000000000000000000100000000000000", - "blockHash": "0xae736e5c5764dd9de424c30bf72ce8be78b721e6cc0ab6c3fdff770a17ec5b8d", - "transactionHash": "0xdc7b9d6bfd2892101980fe09c69d2c4fbef64e4a1ce1b4446ee6e32c781fd917", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 6676806, - "transactionHash": "0xdc7b9d6bfd2892101980fe09c69d2c4fbef64e4a1ce1b4446ee6e32c781fd917", - "address": "0xED28E5230E934cf9C843C08818D0639176040297", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000007b19fe2fc328d3843973d20a4cb0b5b785b02b8e" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0xae736e5c5764dd9de424c30bf72ce8be78b721e6cc0ab6c3fdff770a17ec5b8d" - }, - { - "transactionIndex": 1, - "blockNumber": 6676806, - "transactionHash": "0xdc7b9d6bfd2892101980fe09c69d2c4fbef64e4a1ce1b4446ee6e32c781fd917", - "address": "0xED28E5230E934cf9C843C08818D0639176040297", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0xae736e5c5764dd9de424c30bf72ce8be78b721e6cc0ab6c3fdff770a17ec5b8d" - } - ], - "blockNumber": 6676806, - "cumulativeGasUsed": "595404", - "status": 1, - "byzantium": true - }, - "args": [ - "0x7B19Fe2Fc328d3843973D20a4cb0b5b785b02b8E", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b0000000000000000000000007b19fe2fc328d3843973d20a4cb0b5b785b02b8e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/blastSepolia/GUniPool.json b/lib/g-uni-v1-core/deployments/blastSepolia/GUniPool.json deleted file mode 100644 index d2b5797ee..000000000 --- a/lib/g-uni-v1-core/deployments/blastSepolia/GUniPool.json +++ /dev/null @@ -1,1649 +0,0 @@ -{ - "address": "0xdde18C0c3B637F4BA02f5567a671F5e28b7404e7", - "abi": [ - { - "inputs": [ - { - "internalType": "address payable", - "name": "_gelato", - "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": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned0", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned1", - "type": "uint256" - } - ], - "name": "FeesEarned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int24", - "name": "lowerTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "int24", - "name": "upperTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBefore", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityAfter", - "type": "uint128" - } - ], - "name": "Rebalance", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - } - ], - "name": "SetManagerFee", - "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" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldAdminTreasury", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdminTreasury", - "type": "address" - } - ], - "name": "UpdateAdminTreasury", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoRebalanceBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoWithdrawBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoSlippageBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "gelatoSlippageInterval", - "type": "uint32" - } - ], - "name": "UpdateGelatoParams", - "type": "event" - }, - { - "inputs": [], - "name": "GELATO", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "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": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "burn", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "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": [ - { - "internalType": "int24", - "name": "newLowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "newUpperTick", - "type": "int24" - }, - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - } - ], - "name": "executiveRebalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoRebalanceBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageInterval", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoWithdrawBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Max", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Max", - "type": "uint256" - } - ], - "name": "getMintAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPositionID", - "outputs": [ - { - "internalType": "bytes32", - "name": "positionID", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUnderlyingBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "sqrtRatioX96", - "type": "uint160" - } - ], - "name": "getUnderlyingBalancesAtPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "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": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "address", - "name": "_pool", - "type": "address" - }, - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "_lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "_upperTick", - "type": "int24" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - } - ], - "name": "initializeManagerFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "lowerTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerTreasury", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pool", - "outputs": [ - { - "internalType": "contract IUniswapV3Pool", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "paymentToken", - "type": "address" - } - ], - "name": "rebalance", - "outputs": [], - "stateMutability": "nonpayable", - "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": "token0", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token1", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Owed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Owed", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3MintCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amount0Delta", - "type": "int256" - }, - { - "internalType": "int256", - "name": "amount1Delta", - "type": "int256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3SwapCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "newRebalanceBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newWithdrawBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newSlippageBPS", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "newSlippageInterval", - "type": "uint32" - }, - { - "internalType": "address", - "name": "newTreasury", - "type": "address" - } - ], - "name": "updateGelatoParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "upperTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawGelatoBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawManagerBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x6d39c836321bf66ba9109eed55a5780dd6f1f54f0d93cc64ed28bd55209f9386", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0xdde18C0c3B637F4BA02f5567a671F5e28b7404e7", - "transactionIndex": 1, - "gasUsed": "5209546", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x897a336a953079aaaa4ea22700f30bc6535131c6a57606c3d8cdc2541affae33", - "transactionHash": "0x6d39c836321bf66ba9109eed55a5780dd6f1f54f0d93cc64ed28bd55209f9386", - "logs": [], - "blockNumber": 6845439, - "cumulativeGasUsed": "5264652", - "status": 1, - "byzantium": true - }, - "args": [ - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_gelato\",\"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\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned1\",\"type\":\"uint256\"}],\"name\":\"FeesEarned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"lowerTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"upperTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBefore\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityAfter\",\"type\":\"uint128\"}],\"name\":\"Rebalance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"}],\"name\":\"SetManagerFee\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAdminTreasury\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdminTreasury\",\"type\":\"address\"}],\"name\":\"UpdateAdminTreasury\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoRebalanceBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoWithdrawBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoSlippageBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gelatoSlippageInterval\",\"type\":\"uint32\"}],\"name\":\"UpdateGelatoParams\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GELATO\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"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\":[{\"internalType\":\"int24\",\"name\":\"newLowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"newUpperTick\",\"type\":\"int24\"},{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"}],\"name\":\"executiveRebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoRebalanceBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageInterval\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoWithdrawBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Max\",\"type\":\"uint256\"}],\"name\":\"getMintAmounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPositionID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"positionID\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUnderlyingBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtRatioX96\",\"type\":\"uint160\"}],\"name\":\"getUnderlyingBalancesAtPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"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\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_pool\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"_lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"_upperTick\",\"type\":\"int24\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"}],\"name\":\"initializeManagerFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lowerTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pool\",\"outputs\":[{\"internalType\":\"contract IUniswapV3Pool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"}],\"name\":\"rebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"token0\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newRebalanceBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newWithdrawBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newSlippageBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"newSlippageInterval\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateGelatoParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upperTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawGelatoBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawManagerBalance\",\"outputs\":[],\"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\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"burn(uint256,address)\":{\"params\":{\"burnAmount\":\"The number of G-UNI tokens to burn\",\"receiver\":\"The account to receive the underlying amounts of token0 and token1\"},\"returns\":{\"amount0\":\"amount of token0 transferred to receiver for burning `burnAmount`\",\"amount1\":\"amount of token1 transferred to receiver for burning `burnAmount`\",\"liquidityBurned\":\"amount of liquidity removed from the underlying Uniswap V3 position\"}},\"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 this function is overridden; 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`.\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"details\":\"When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.\",\"params\":{\"newLowerTick\":\"The new lower bound of the position's range\",\"newUpperTick\":\"The new upper bound of the position's range\",\"swapAmountBPS\":\"amount of token to swap as proportion of total. Pass 0 to ignore swap.\",\"swapThresholdPrice\":\"slippage parameter on the swap as a max or min sqrtPriceX96\",\"zeroForOne\":\"Which token to input into the swap (true = token0, false = token1)\"}},\"getMintAmounts(uint256,uint256)\":{\"params\":{\"amount0Max\":\"The maximum amount of token1 to forward on mint\"},\"returns\":{\"amount0\":\"actual amount of token0 to forward when minting `mintAmount`\",\"amount1\":\"actual amount of token1 to forward when minting `mintAmount`\",\"mintAmount\":\"maximum number of G-UNI tokens to mint\"}},\"getUnderlyingBalances()\":{\"returns\":{\"amount0Current\":\"current total underlying balance of token0\",\"amount1Current\":\"current total underlying balance of token1\"}},\"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.\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"params\":{\"_lowerTick\":\"initial upperTick (only changeable with executiveRebalance)\",\"_managerFeeBPS\":\"proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\",\"_manager_\":\"address of manager (ownership can be transferred)\",\"_name\":\"name of G-UNI token\",\"_pool\":\"address of Uniswap V3 pool\",\"_symbol\":\"symbol of G-UNI token\"}},\"initializeManagerFee(uint16)\":{\"params\":{\"_managerFeeBPS\":\"proportion of fees earned that are credited to manager in Basis Points\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"mint(uint256,address)\":{\"details\":\"to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\",\"params\":{\"mintAmount\":\"The number of G-UNI tokens to mint\",\"receiver\":\"The account to receive the minted tokens\"},\"returns\":{\"amount0\":\"amount of token0 transferred from msg.sender to mint `mintAmount`\",\"amount1\":\"amount of token1 transferred from msg.sender to mint `mintAmount`\",\"liquidityMinted\":\"amount of liquidity added to the underlying Uniswap V3 position\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"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 manager.\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"params\":{\"newRebalanceBPS\":\"controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\",\"newSlippageBPS\":\"maximum slippage on swaps during gelato rebalance\",\"newSlippageInterval\":\"length of time for TWAP used in computing slippage on swaps\",\"newTreasury\":\"address where managerFee withdrawals are sent\",\"newWithdrawBPS\":\"controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(uint256,address)\":{\"notice\":\"burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"notice\":\"Change the range of underlying UniswapV3 position, only manager can call\"},\"getMintAmounts(uint256,uint256)\":{\"notice\":\"compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\"},\"getUnderlyingBalances()\":{\"notice\":\"compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"notice\":\"initialize storage variables on a new G-UNI pool, only called once\"},\"initializeManagerFee(uint16)\":{\"notice\":\"initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\"},\"mint(uint256,address)\":{\"notice\":\"mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\"},\"rebalance(uint160,uint256,bool,uint256,address)\":{\"notice\":\"Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\"},\"uniswapV3MintCallback(uint256,uint256,bytes)\":{\"notice\":\"Uniswap V3 callback fn, called back on pool.mint\"},\"uniswapV3SwapCallback(int256,int256,bytes)\":{\"notice\":\"Uniswap v3 callback fn, called back on pool.swap\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"notice\":\"change configurable parameters, only manager can call\"},\"withdrawGelatoBalance(uint256,address)\":{\"notice\":\"withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"},\"withdrawManagerBalance(uint256,address)\":{\"notice\":\"withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniPool.sol\":\"GUniPool\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal initializer {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal initializer {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and make it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x89fa60d14355f7ae06af11e28fce2bb90c5c6186645d681a30e1b36234a4c210\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\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\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The defaut value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\\n __Context_init_unchained();\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override 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 override 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 this function is\\n * overridden;\\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 override returns (uint8) {\\n return 18;\\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\\n uint256 currentAllowance = _allowances[sender][_msgSender()];\\n require(currentAllowance >= amount, \\\"ERC20: transfer amount exceeds allowance\\\");\\n _approve(sender, _msgSender(), currentAllowance - amount);\\n\\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\\n\\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 uint256 senderBalance = _balances[sender];\\n require(senderBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n _balances[sender] = senderBalance - amount;\\n _balances[recipient] += amount;\\n\\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 += amount;\\n _balances[account] += 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 uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n _balances[account] = accountBalance - amount;\\n _totalSupply -= amount;\\n\\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 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 uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0x9c2d7425f3343ea340d6ea67e9d90109d4d846bb013c2572096ec88c9e74946b\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\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\":\"0x8d4a0f2b5b760b5e2c19ed3c108d83897a4dfd5bfed97a93867918df19191e5e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x6795c369a4eefa78468e38966f7851fbc2dda5e5b9ccd3fa2b45970e2e4d3abd\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../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 initializer {\\n __Context_init_unchained();\\n }\\n\\n function __Context_init_unchained() internal initializer {\\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x8e9eb503de1189f50c5f16fef327da310b11898d6b9ab3ca937df07c35233b9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.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 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) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\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\":\"0x99f5c21018d796db7833a2100bb0e7411999e248a3c950fb526eee5d2bf47cb7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0x069b2631bb5b5193a58ccf7a06266c7361bd2c20095667af4402817605627f45\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCast {\\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 require(value < 2**128, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return uint128(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 require(value < 2**64, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return uint64(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 require(value < 2**32, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return uint32(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 require(value < 2**16, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\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 require(value < 2**8, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\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 require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n return uint256(value);\\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 * _Available since v3.1._\\n */\\n function toInt128(int256 value) internal pure returns (int128) {\\n require(value >= -2**127 && value < 2**127, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return int128(value);\\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 * _Available since v3.1._\\n */\\n function toInt64(int256 value) internal pure returns (int64) {\\n require(value >= -2**63 && value < 2**63, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return int64(value);\\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 * _Available since v3.1._\\n */\\n function toInt32(int256 value) internal pure returns (int32) {\\n require(value >= -2**31 && value < 2**31, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return int32(value);\\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 * _Available since v3.1._\\n */\\n function toInt16(int256 value) internal pure returns (int16) {\\n require(value >= -2**15 && value < 2**15, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\n return int16(value);\\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 * _Available since v3.1._\\n */\\n function toInt8(int256 value) internal pure returns (int8) {\\n require(value >= -2**7 && value < 2**7, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\n return int8(value);\\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 require(value < 2**255, \\\"SafeCast: value doesn't fit in an int256\\\");\\n return int256(value);\\n }\\n}\\n\",\"keccak256\":\"0xc37d85b96c2a8d7bc09f25958e0a81394bf5780286444147ddf875fa628d53ce\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\nimport './pool/IUniswapV3PoolImmutables.sol';\\nimport './pool/IUniswapV3PoolState.sol';\\nimport './pool/IUniswapV3PoolDerivedState.sol';\\nimport './pool/IUniswapV3PoolActions.sol';\\nimport './pool/IUniswapV3PoolOwnerActions.sol';\\nimport './pool/IUniswapV3PoolEvents.sol';\\n\\n/// @title The interface for a Uniswap V3 Pool\\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\\n/// to the ERC20 specification\\n/// @dev The pool interface is broken up into many smaller pieces\\ninterface IUniswapV3Pool is\\n IUniswapV3PoolImmutables,\\n IUniswapV3PoolState,\\n IUniswapV3PoolDerivedState,\\n IUniswapV3PoolActions,\\n IUniswapV3PoolOwnerActions,\\n IUniswapV3PoolEvents\\n{\\n\\n}\\n\",\"keccak256\":\"0xfe6113d518466cd6652c85b111e01f33eb62157f49ae5ed7d5a3947a2044adb1\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#mint\\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\\ninterface IUniswapV3MintCallback {\\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x27a9725b8f831a92d16380860c3d348a0b926a7f01b34a54ea6eea78cbdbcd6a\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#swap\\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\\ninterface IUniswapV3SwapCallback {\\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x3f485fb1a44e8fbeadefb5da07d66edab3cfe809f0ac4074b1e54e3eb3c4cf69\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissionless pool actions\\n/// @notice Contains pool methods that can be called by anyone\\ninterface IUniswapV3PoolActions {\\n /// @notice Sets the initial price for the pool\\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\\n function initialize(uint160 sqrtPriceX96) external;\\n\\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\\n /// @param recipient The address for which the liquidity will be created\\n /// @param tickLower The lower tick of the position in which to add liquidity\\n /// @param tickUpper The upper tick of the position in which to add liquidity\\n /// @param amount The amount of liquidity to mint\\n /// @param data Any data that should be passed through to the callback\\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n function mint(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount,\\n bytes calldata data\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Collects tokens owed to a position\\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\\n /// @param recipient The address which should receive the fees collected\\n /// @param tickLower The lower tick of the position for which to collect fees\\n /// @param tickUpper The upper tick of the position for which to collect fees\\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\\n /// @return amount0 The amount of fees collected in token0\\n /// @return amount1 The amount of fees collected in token1\\n function collect(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n\\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\\n /// @dev Fees must be collected separately via a call to #collect\\n /// @param tickLower The lower tick of the position for which to burn liquidity\\n /// @param tickUpper The upper tick of the position for which to burn liquidity\\n /// @param amount How much liquidity to burn\\n /// @return amount0 The amount of token0 sent to the recipient\\n /// @return amount1 The amount of token1 sent to the recipient\\n function burn(\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Swap token0 for token1, or token1 for token0\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\\n /// @param recipient The address to receive the output of the swap\\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\\n /// @param data Any data to be passed through to the callback\\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\\n function swap(\\n address recipient,\\n bool zeroForOne,\\n int256 amountSpecified,\\n uint160 sqrtPriceLimitX96,\\n bytes calldata data\\n ) external returns (int256 amount0, int256 amount1);\\n\\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\\n /// @param recipient The address which will receive the token0 and token1 amounts\\n /// @param amount0 The amount of token0 to send\\n /// @param amount1 The amount of token1 to send\\n /// @param data Any data to be passed through to the callback\\n function flash(\\n address recipient,\\n uint256 amount0,\\n uint256 amount1,\\n bytes calldata data\\n ) external;\\n\\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\\n /// the input observationCardinalityNext.\\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0x9453dd0e7442188667d01d9b65de3f1e14e9511ff3e303179a15f6fc267f7634\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that is not stored\\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\\n/// blockchain. The functions here may have variable gas costs.\\ninterface IUniswapV3PoolDerivedState {\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\\n /// you must call it with secondsAgos = [3600, 0].\\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\\n /// timestamp\\n function observe(uint32[] calldata secondsAgos)\\n external\\n view\\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\\n\\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\\n /// snapshot is taken and the second snapshot is taken.\\n /// @param tickLower The lower tick of the range\\n /// @param tickUpper The upper tick of the range\\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\\n /// @return secondsInside The snapshot of seconds per liquidity for the range\\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\\n external\\n view\\n returns (\\n int56 tickCumulativeInside,\\n uint160 secondsPerLiquidityInsideX128,\\n uint32 secondsInside\\n );\\n}\\n\",\"keccak256\":\"0xe603ac5b17ecdee73ba2b27efdf386c257a19c14206e87eee77e2017b742d9e5\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Events emitted by a pool\\n/// @notice Contains all events emitted by the pool\\ninterface IUniswapV3PoolEvents {\\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\\n event Initialize(uint160 sqrtPriceX96, int24 tick);\\n\\n /// @notice Emitted when liquidity is minted for a given position\\n /// @param sender The address that minted the liquidity\\n /// @param owner The owner of the position and recipient of any minted liquidity\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity minted to the position range\\n /// @param amount0 How much token0 was required for the minted liquidity\\n /// @param amount1 How much token1 was required for the minted liquidity\\n event Mint(\\n address sender,\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted when fees are collected by the owner of a position\\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\\n /// @param owner The owner of the position for which fees are collected\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount0 The amount of token0 fees collected\\n /// @param amount1 The amount of token1 fees collected\\n event Collect(\\n address indexed owner,\\n address recipient,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount0,\\n uint128 amount1\\n );\\n\\n /// @notice Emitted when a position's liquidity is removed\\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\\n /// @param owner The owner of the position for which liquidity is removed\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity to remove\\n /// @param amount0 The amount of token0 withdrawn\\n /// @param amount1 The amount of token1 withdrawn\\n event Burn(\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted by the pool for any swaps between token0 and token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the output of the swap\\n /// @param amount0 The delta of the token0 balance of the pool\\n /// @param amount1 The delta of the token1 balance of the pool\\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param liquidity The liquidity of the pool after the swap\\n /// @param tick The log base 1.0001 of price of the pool after the swap\\n event Swap(\\n address indexed sender,\\n address indexed recipient,\\n int256 amount0,\\n int256 amount1,\\n uint160 sqrtPriceX96,\\n uint128 liquidity,\\n int24 tick\\n );\\n\\n /// @notice Emitted by the pool for any flashes of token0/token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the tokens from flash\\n /// @param amount0 The amount of token0 that was flashed\\n /// @param amount1 The amount of token1 that was flashed\\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\\n event Flash(\\n address indexed sender,\\n address indexed recipient,\\n uint256 amount0,\\n uint256 amount1,\\n uint256 paid0,\\n uint256 paid1\\n );\\n\\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\\n /// just before a mint/swap/burn.\\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(\\n uint16 observationCardinalityNextOld,\\n uint16 observationCardinalityNextNew\\n );\\n\\n /// @notice Emitted when the protocol fee is changed by the pool\\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\\n /// @param feeProtocol0New The updated value of the token0 protocol fee\\n /// @param feeProtocol1New The updated value of the token1 protocol fee\\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\\n\\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\\n /// @param sender The address that collects the protocol fees\\n /// @param recipient The address that receives the collected protocol fees\\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x8071514d0fe5d17d6fbd31c191cdfb703031c24e0ece3621d88ab10e871375cd\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that never changes\\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\\ninterface IUniswapV3PoolImmutables {\\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\\n /// @return The contract address\\n function factory() external view returns (address);\\n\\n /// @notice The first of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token0() external view returns (address);\\n\\n /// @notice The second of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token1() external view returns (address);\\n\\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\\n /// @return The fee\\n function fee() external view returns (uint24);\\n\\n /// @notice The pool tick spacing\\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\\n /// This value is an int24 to avoid casting even though it is always positive.\\n /// @return The tick spacing\\n function tickSpacing() external view returns (int24);\\n\\n /// @notice The maximum amount of position liquidity that can use any tick in the range\\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\\n /// @return The max amount of liquidity per tick\\n function maxLiquidityPerTick() external view returns (uint128);\\n}\\n\",\"keccak256\":\"0xf6e5d2cd1139c4c276bdbc8e1d2b256e456c866a91f1b868da265c6d2685c3f7\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissioned pool actions\\n/// @notice Contains pool methods that may only be called by the factory owner\\ninterface IUniswapV3PoolOwnerActions {\\n /// @notice Set the denominator of the protocol's % share of the fees\\n /// @param feeProtocol0 new protocol fee for token0 of the pool\\n /// @param feeProtocol1 new protocol fee for token1 of the pool\\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\\n\\n /// @notice Collect the protocol fee accrued to the pool\\n /// @param recipient The address to which collected protocol fees should be sent\\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\\n /// @return amount0 The protocol fee collected in token0\\n /// @return amount1 The protocol fee collected in token1\\n function collectProtocol(\\n address recipient,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x759b78a2918af9e99e246dc3af084f654e48ef32bb4e4cb8a966aa3dcaece235\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that can change\\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\\n/// per transaction\\ninterface IUniswapV3PoolState {\\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\\n /// when accessed externally.\\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\\n /// boundary.\\n /// observationIndex The index of the last oracle observation that was written,\\n /// observationCardinality The current maximum number of observations stored in the pool,\\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// feeProtocol The protocol fee for both tokens of the pool.\\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\\n /// unlocked Whether the pool is currently locked to reentrancy\\n function slot0()\\n external\\n view\\n returns (\\n uint160 sqrtPriceX96,\\n int24 tick,\\n uint16 observationIndex,\\n uint16 observationCardinality,\\n uint16 observationCardinalityNext,\\n uint8 feeProtocol,\\n bool unlocked\\n );\\n\\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal0X128() external view returns (uint256);\\n\\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal1X128() external view returns (uint256);\\n\\n /// @notice The amounts of token0 and token1 that are owed to the protocol\\n /// @dev Protocol fees will never exceed uint128 max in either token\\n function protocolFees() external view returns (uint128 token0, uint128 token1);\\n\\n /// @notice The currently in range liquidity available to the pool\\n /// @dev This value has no relationship to the total liquidity across all ticks\\n function liquidity() external view returns (uint128);\\n\\n /// @notice Look up information about a specific tick in the pool\\n /// @param tick The tick to look up\\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\\n /// tick upper,\\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\\n /// a specific position.\\n function ticks(int24 tick)\\n external\\n view\\n returns (\\n uint128 liquidityGross,\\n int128 liquidityNet,\\n uint256 feeGrowthOutside0X128,\\n uint256 feeGrowthOutside1X128,\\n int56 tickCumulativeOutside,\\n uint160 secondsPerLiquidityOutsideX128,\\n uint32 secondsOutside,\\n bool initialized\\n );\\n\\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\\n function tickBitmap(int16 wordPosition) external view returns (uint256);\\n\\n /// @notice Returns the information about a position by the position's key\\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\\n /// @return _liquidity The amount of liquidity in the position,\\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\\n function positions(bytes32 key)\\n external\\n view\\n returns (\\n uint128 _liquidity,\\n uint256 feeGrowthInside0LastX128,\\n uint256 feeGrowthInside1LastX128,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param index The element of the observations array to fetch\\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\\n /// ago, rather than at a specific index in the array.\\n /// @return blockTimestamp The timestamp of the observation,\\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// Returns initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 index)\\n external\\n view\\n returns (\\n uint32 blockTimestamp,\\n int56 tickCumulative,\\n uint160 secondsPerLiquidityCumulativeX128,\\n bool initialized\\n );\\n}\\n\",\"keccak256\":\"0x852dc1f5df7dcf7f11e7bb3eed79f0cea72ad4b25f6a9d2c35aafb48925fd49f\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.4.0;\\n\\n/// @title FixedPoint96\\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\\n/// @dev Used in SqrtPriceMath.sol\\nlibrary FixedPoint96 {\\n uint8 internal constant RESOLUTION = 96;\\n uint256 internal constant Q96 = 0x1000000000000000000000000;\\n}\\n\",\"keccak256\":\"0x0ba8a9b95a956a4050749c0158e928398c447c91469682ca8a7cc7e77a7fe032\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {\\n IUniswapV3MintCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\\\";\\nimport {\\n IUniswapV3SwapCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\\\";\\nimport {GUniPoolStorage} from \\\"./abstract/GUniPoolStorage.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {TickMath} from \\\"./vendor/uniswap/TickMath.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {SafeCast} from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport {\\n FullMath,\\n LiquidityAmounts\\n} from \\\"./vendor/uniswap/LiquidityAmounts.sol\\\";\\n\\ncontract GUniPool is\\n IUniswapV3MintCallback,\\n IUniswapV3SwapCallback,\\n GUniPoolStorage\\n{\\n using SafeERC20 for IERC20;\\n using TickMath for int24;\\n\\n event Minted(\\n address receiver,\\n uint256 mintAmount,\\n uint256 amount0In,\\n uint256 amount1In,\\n uint128 liquidityMinted\\n );\\n\\n event Burned(\\n address receiver,\\n uint256 burnAmount,\\n uint256 amount0Out,\\n uint256 amount1Out,\\n uint128 liquidityBurned\\n );\\n\\n event Rebalance(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidityBefore,\\n uint128 liquidityAfter\\n );\\n\\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice Uniswap V3 callback fn, called back on pool.mint\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata /*_data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\\n }\\n\\n /// @notice Uniswap v3 callback fn, called back on pool.swap\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata /*data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Delta > 0)\\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\\n else if (amount1Delta > 0)\\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\\n }\\n\\n // User functions => Should be called via a Router\\n\\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\\n /// @param mintAmount The number of G-UNI tokens to mint\\n /// @param receiver The account to receive the minted tokens\\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function mint(uint256 mintAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityMinted\\n )\\n {\\n require(mintAmount > 0, \\\"mint 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n\\n if (totalSupply > 0) {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n amount0 = FullMath.mulDivRoundingUp(\\n amount0Current,\\n mintAmount,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n amount1Current,\\n mintAmount,\\n totalSupply\\n );\\n } else {\\n // if supply is 0 mintAmount == liquidity to deposit\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n SafeCast.toUint128(mintAmount)\\n );\\n }\\n\\n // transfer amounts owed to contract\\n if (amount0 > 0) {\\n token0.safeTransferFrom(msg.sender, address(this), amount0);\\n }\\n if (amount1 > 0) {\\n token1.safeTransferFrom(msg.sender, address(this), amount1);\\n }\\n\\n // deposit as much new liquidity as possible\\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n\\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \\\"\\\");\\n\\n _mint(receiver, mintAmount);\\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\\n }\\n\\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\\n /// @param burnAmount The number of G-UNI tokens to burn\\n /// @param receiver The account to receive the underlying amounts of token0 and token1\\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines\\n function burn(uint256 burnAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityBurned\\n )\\n {\\n require(burnAmount > 0, \\\"burn 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n\\n _burn(msg.sender, burnAmount);\\n\\n uint256 liquidityBurned_ =\\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidityBurned);\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n\\n amount0 =\\n burn0 +\\n FullMath.mulDiv(\\n token0.balanceOf(address(this)) -\\n burn0 -\\n managerBalance0 -\\n gelatoBalance0,\\n burnAmount,\\n totalSupply\\n );\\n amount1 =\\n burn1 +\\n FullMath.mulDiv(\\n token1.balanceOf(address(this)) -\\n burn1 -\\n managerBalance1 -\\n gelatoBalance1,\\n burnAmount,\\n totalSupply\\n );\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(receiver, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(receiver, amount1);\\n }\\n\\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\\n }\\n\\n // Manager Functions => Called by Pool Manager\\n\\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\\n /// any leftover will be unused and sit idle until the next rebalance.\\n /// @param newLowerTick The new lower bound of the position's range\\n /// @param newUpperTick The new upper bound of the position's range\\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\\n // solhint-disable-next-line function-max-lines\\n function executiveRebalance(\\n int24 newLowerTick,\\n int24 newUpperTick,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) external onlyManager {\\n uint128 liquidity;\\n uint128 newLiquidity;\\n if (totalSupply() > 0) {\\n (liquidity, , , , ) = pool.positions(_getPositionID());\\n if (liquidity > 0) {\\n (, , uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n }\\n\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n\\n uint256 reinvest0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n uint256 reinvest1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n\\n _deposit(\\n newLowerTick,\\n newUpperTick,\\n reinvest0,\\n reinvest1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n\\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > 0, \\\"new position 0\\\");\\n } else {\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n }\\n\\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\\n }\\n\\n // Gelatofied functions => Automatically called by Gelato\\n\\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\\n function rebalance(\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) external gelatofy(feeAmount, paymentToken) {\\n if (swapAmountBPS > 0) {\\n _checkSlippage(swapThresholdPrice, zeroForOne);\\n }\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n _rebalance(\\n liquidity,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne,\\n feeAmount,\\n paymentToken\\n );\\n\\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > liquidity, \\\"liquidity must increase\\\");\\n\\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\\n }\\n\\n /// @notice withdraw manager fees accrued, only gelato executors can call.\\n /// Target account to receive fees is managerTreasury, alterable by manager.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n managerBalance0,\\n managerBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(managerTreasury, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(managerTreasury, amount1);\\n }\\n }\\n\\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n gelatoBalance0,\\n gelatoBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n gelatoBalance0 = 0;\\n gelatoBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(GELATO, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(GELATO, amount1);\\n }\\n }\\n\\n function _balancesToWithdraw(\\n uint256 balance0,\\n uint256 balance1,\\n uint256 feeAmount,\\n address feeToken\\n ) internal view returns (uint256 amount0, uint256 amount1) {\\n if (feeToken == address(token0)) {\\n require(\\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount0 = balance0 - feeAmount;\\n amount1 = balance1;\\n } else if (feeToken == address(token1)) {\\n require(\\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount1 = balance1 - feeAmount;\\n amount0 = balance0;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n }\\n\\n // View functions\\n\\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\\n /// @param amount0Max The maximum amount of token0 to forward on mint\\n /// @param amount0Max The maximum amount of token1 to forward on mint\\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\\n /// @return mintAmount maximum number of G-UNI tokens to mint\\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\\n external\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n uint256 totalSupply = totalSupply();\\n if (totalSupply > 0) {\\n (amount0, amount1, mintAmount) = _computeMintAmounts(\\n totalSupply,\\n amount0Max,\\n amount1Max\\n );\\n } else {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 newLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0Max,\\n amount1Max\\n );\\n mintAmount = uint256(newLiquidity);\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n newLiquidity\\n );\\n }\\n }\\n\\n /// @notice compute total underlying holdings of the G-UNI token supply\\n /// includes current liquidity invested in uniswap position, current fees earned\\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\\n /// @return amount0Current current total underlying balance of token0\\n /// @return amount1Current current total underlying balance of token1\\n function getUnderlyingBalances()\\n public\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\\n external\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\\n internal\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (\\n uint128 liquidity,\\n uint256 feeGrowthInside0Last,\\n uint256 feeGrowthInside1Last,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n ) = pool.positions(_getPositionID());\\n\\n // compute current holdings from liquidity\\n (amount0Current, amount1Current) = LiquidityAmounts\\n .getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n liquidity\\n );\\n\\n // compute current fees earned\\n uint256 fee0 =\\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\\n uint256(tokensOwed0);\\n uint256 fee1 =\\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\\n uint256(tokensOwed1);\\n\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n\\n // add any leftover in contract to current holdings\\n amount0Current +=\\n fee0 +\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n amount1Current +=\\n fee1 +\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n }\\n\\n // Private functions\\n\\n // solhint-disable-next-line function-max-lines\\n function _rebalance(\\n uint128 liquidity,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) private {\\n uint256 leftover0 =\\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\\n uint256 leftover1 =\\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\\n\\n (, , uint256 feesEarned0, uint256 feesEarned1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n _applyFees(feesEarned0, feesEarned1);\\n (feesEarned0, feesEarned1) = _subtractAdminFees(\\n feesEarned0,\\n feesEarned1\\n );\\n emit FeesEarned(feesEarned0, feesEarned1);\\n feesEarned0 += leftover0;\\n feesEarned1 += leftover1;\\n\\n if (paymentToken == address(token0)) {\\n require(\\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0 -\\n feeAmount;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n } else if (paymentToken == address(token1)) {\\n require(\\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1 -\\n feeAmount;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n\\n _deposit(\\n lowerTick,\\n upperTick,\\n leftover0,\\n leftover1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _withdraw(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidity\\n )\\n private\\n returns (\\n uint256 burn0,\\n uint256 burn1,\\n uint256 fee0,\\n uint256 fee1\\n )\\n {\\n uint256 preBalance0 = token0.balanceOf(address(this));\\n uint256 preBalance1 = token1.balanceOf(address(this));\\n\\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\\n\\n pool.collect(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n type(uint128).max,\\n type(uint128).max\\n );\\n\\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _deposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) private {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n // First, deposit as much as we can\\n uint128 baseLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n if (baseLiquidity > 0) {\\n (uint256 amountDeposited0, uint256 amountDeposited1) =\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n baseLiquidity,\\n \\\"\\\"\\n );\\n\\n amount0 -= amountDeposited0;\\n amount1 -= amountDeposited1;\\n }\\n int256 swapAmount =\\n SafeCast.toInt256(\\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\\n );\\n if (swapAmount > 0) {\\n _swapAndDeposit(\\n lowerTick_,\\n upperTick_,\\n amount0,\\n amount1,\\n swapAmount,\\n swapThresholdPrice,\\n zeroForOne\\n );\\n }\\n }\\n\\n function _swapAndDeposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n int256 swapAmount,\\n uint160 swapThresholdPrice,\\n bool zeroForOne\\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\\n (int256 amount0Delta, int256 amount1Delta) =\\n pool.swap(\\n address(this),\\n zeroForOne,\\n swapAmount,\\n swapThresholdPrice,\\n \\\"\\\"\\n );\\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\\n\\n // Add liquidity a second time\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 liquidityAfterSwap =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n finalAmount0,\\n finalAmount1\\n );\\n if (liquidityAfterSwap > 0) {\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n liquidityAfterSwap,\\n \\\"\\\"\\n );\\n }\\n }\\n\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function _computeMintAmounts(\\n uint256 totalSupply,\\n uint256 amount0Max,\\n uint256 amount1Max\\n )\\n private\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n // compute proportional amount of tokens to mint\\n if (amount0Current == 0 && amount1Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount1Max,\\n totalSupply,\\n amount1Current\\n );\\n } else if (amount1Current == 0 && amount0Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount0Max,\\n totalSupply,\\n amount0Current\\n );\\n } else if (amount0Current == 0 && amount1Current == 0) {\\n revert(\\\"\\\");\\n } else {\\n // only if both are non-zero\\n uint256 amount0Mint =\\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\\n uint256 amount1Mint =\\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\\n require(amount0Mint > 0 && amount1Mint > 0, \\\"mint 0\\\");\\n\\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\\n }\\n\\n // compute amounts owed to contract\\n amount0 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount0Current,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount1Current,\\n totalSupply\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _computeFeesEarned(\\n bool isZero,\\n uint256 feeGrowthInsideLast,\\n int24 tick,\\n uint128 liquidity\\n ) private view returns (uint256 fee) {\\n uint256 feeGrowthOutsideLower;\\n uint256 feeGrowthOutsideUpper;\\n uint256 feeGrowthGlobal;\\n if (isZero) {\\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\\n } else {\\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\\n }\\n\\n unchecked {\\n // calculate fee growth below\\n uint256 feeGrowthBelow;\\n if (tick >= lowerTick) {\\n feeGrowthBelow = feeGrowthOutsideLower;\\n } else {\\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\\n }\\n\\n // calculate fee growth above\\n uint256 feeGrowthAbove;\\n if (tick < upperTick) {\\n feeGrowthAbove = feeGrowthOutsideUpper;\\n } else {\\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\\n }\\n\\n uint256 feeGrowthInside =\\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\\n fee = FullMath.mulDiv(\\n liquidity,\\n feeGrowthInside - feeGrowthInsideLast,\\n 0x100000000000000000000000000000000\\n );\\n }\\n }\\n\\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\\n }\\n\\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\\n private\\n view\\n returns (uint256 fee0, uint256 fee1)\\n {\\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n fee0 = rawFee0 - deduct0;\\n fee1 = rawFee1 - deduct1;\\n }\\n\\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\\n private\\n view\\n {\\n uint32[] memory secondsAgo = new uint32[](2);\\n secondsAgo[0] = gelatoSlippageInterval;\\n secondsAgo[1] = 0;\\n\\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\\n\\n require(tickCumulatives.length == 2, \\\"array len\\\");\\n uint160 avgSqrtRatioX96;\\n unchecked {\\n int24 avgTick =\\n int24(\\n (tickCumulatives[1] - tickCumulatives[0]) /\\n int56(uint56(gelatoSlippageInterval))\\n );\\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\\n }\\n\\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\\n if (zeroForOne) {\\n require(\\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\\n \\\"high slippage\\\"\\n );\\n } else {\\n require(\\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\\n \\\"high slippage\\\"\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdd382818c81f34c434bb3d4235ac9ff39034cb68e1b87244837d9250878d9fa0\",\"license\":\"GPL-3.0\"},\"contracts/abstract/GUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {Gelatofied} from \\\"./Gelatofied.sol\\\";\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {\\n ReentrancyGuardUpgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport {\\n ERC20Upgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\n\\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\\n/// @dev ERC20Upgradable Includes Initialize\\n// solhint-disable-next-line max-states-count\\n/// @dev Modified to support 0.8.19\\n/// @dev Modified to set the gelatoFeeBPS to 0\\nabstract contract GUniPoolStorage is\\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\\n ReentrancyGuardUpgradeable,\\n OwnableUninitialized,\\n Gelatofied\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n // solhint-disable-next-line const-name-snakecase\\n uint16 public constant gelatoFeeBPS = 0;\\n\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n int24 public lowerTick;\\n int24 public upperTick;\\n\\n uint16 public gelatoRebalanceBPS;\\n uint16 public gelatoWithdrawBPS;\\n uint16 public gelatoSlippageBPS;\\n uint32 public gelatoSlippageInterval;\\n\\n uint16 public managerFeeBPS;\\n address public managerTreasury;\\n\\n uint256 public managerBalance0;\\n uint256 public managerBalance1;\\n uint256 public gelatoBalance0;\\n uint256 public gelatoBalance1;\\n\\n IUniswapV3Pool public pool;\\n IERC20 public token0;\\n IERC20 public token1;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdateAdminTreasury(\\n address oldAdminTreasury,\\n address newAdminTreasury\\n );\\n\\n event UpdateGelatoParams(\\n uint16 gelatoRebalanceBPS,\\n uint16 gelatoWithdrawBPS,\\n uint16 gelatoSlippageBPS,\\n uint32 gelatoSlippageInterval\\n );\\n\\n event SetManagerFee(uint16 managerFee);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice initialize storage variables on a new G-UNI pool, only called once\\n /// @param _name name of G-UNI token\\n /// @param _symbol symbol of G-UNI token\\n /// @param _pool address of Uniswap V3 pool\\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\\n /// @param _manager_ address of manager (ownership can be transferred)\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external initializer {\\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \\\"mBPS\\\");\\n\\n // these variables are immutable after initialization\\n pool = IUniswapV3Pool(_pool);\\n token0 = IERC20(pool.token0());\\n token1 = IERC20(pool.token1());\\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\\n\\n // these variables can be udpated by the manager\\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\\n gelatoSlippageBPS = 500; // default: 5% slippage\\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\\n managerTreasury = _manager_; // default: treasury is admin\\n lowerTick = _lowerTick;\\n upperTick = _upperTick;\\n _manager = _manager_;\\n\\n // e.g. \\\"Gelato Uniswap V3 USDC/DAI LP\\\" and \\\"G-UNI\\\"\\n __ERC20_init(_name, _symbol);\\n __ReentrancyGuard_init();\\n }\\n\\n /// @notice change configurable parameters, only manager can call\\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\\n /// @param newTreasury address where managerFee withdrawals are sent\\n // solhint-disable-next-line code-complexity\\n function updateGelatoParams(\\n uint16 newRebalanceBPS,\\n uint16 newWithdrawBPS,\\n uint16 newSlippageBPS,\\n uint32 newSlippageInterval,\\n address newTreasury\\n ) external onlyManager {\\n require(newWithdrawBPS <= 10000, \\\"BPS\\\");\\n require(newRebalanceBPS <= 10000, \\\"BPS\\\");\\n require(newSlippageBPS <= 10000, \\\"BPS\\\");\\n emit UpdateGelatoParams(\\n newRebalanceBPS,\\n newWithdrawBPS,\\n newSlippageBPS,\\n newSlippageInterval\\n );\\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\\n if (newSlippageInterval != 0)\\n gelatoSlippageInterval = newSlippageInterval;\\n if (newTreasury != address(0)) managerTreasury = newTreasury;\\n }\\n\\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\\n /// If a manager fee was not set in the initialize function it can be set here\\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\\n require(managerFeeBPS == 0, \\\"fee\\\");\\n require(\\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\\n \\\"mBPS\\\"\\n );\\n emit SetManagerFee(_managerFeeBPS);\\n managerFeeBPS = _managerFeeBPS;\\n }\\n\\n function renounceOwnership() public virtual override onlyManager {\\n managerTreasury = address(0);\\n managerFeeBPS = 0;\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n super.renounceOwnership();\\n }\\n\\n function getPositionID() external view returns (bytes32 positionID) {\\n return _getPositionID();\\n }\\n\\n function _getPositionID() internal view returns (bytes32 positionID) {\\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\\n }\\n}\\n\",\"keccak256\":\"0xd1ad805a13c7cd73554b1e3cc3735f3f369d759f8e0b9188977b85295456d033\",\"license\":\"GPL-3.0\"},\"contracts/abstract/Gelatofied.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract Gelatofied {\\n using Address for address payable;\\n using SafeERC20 for IERC20;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n address payable public immutable GELATO;\\n\\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n constructor(address payable _gelato) {\\n GELATO = _gelato;\\n }\\n\\n modifier gelatofy(uint256 _amount, address _paymentToken) {\\n require(msg.sender == GELATO, \\\"Gelatofied: Only gelato\\\");\\n _;\\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x264bc07e6e1b80c454c311ecf4b56afe245ddde31151ed9bcc4cb9ad25bec46a\",\"license\":\"GPL-3.0\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xb6016d5611f38fbd516a84ea2e56794cb76a8d61c40f6716d5f0133f195759bd\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/FullMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.4;\\n\\n/// @title Contains 512-bit math functions\\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\\n/// @dev Handles \\\"phantom overflow\\\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\\nlibrary FullMath {\\n /// @notice Calculates floor(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\\n function mulDiv(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = a * b\\n // Compute the product mod 2**256 and mod 2**256 - 1\\n // then use the Chinese Remainder Theorem to reconstruct\\n // the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2**256 + prod0\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(a, b, not(0))\\n prod0 := mul(a, b)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division\\n if (prod1 == 0) {\\n require(denominator > 0);\\n assembly {\\n result := div(prod0, denominator)\\n }\\n return result;\\n }\\n\\n // Make sure the result is less than 2**256.\\n // Also prevents denominator == 0\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0]\\n // Compute remainder using mulmod\\n uint256 remainder;\\n assembly {\\n remainder := mulmod(a, b, denominator)\\n }\\n // Subtract 256 bit number from 512 bit number\\n assembly {\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator\\n // Compute largest power of two divisor of denominator.\\n // Always >= 1.\\n // EDIT for 0.8 compatibility:\\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\\n uint256 twos = denominator & (~denominator + 1);\\n\\n // Divide denominator by power of two\\n assembly {\\n denominator := div(denominator, twos)\\n }\\n\\n // Divide [prod1 prod0] by the factors of two\\n assembly {\\n prod0 := div(prod0, twos)\\n }\\n // Shift in bits from prod1 into prod0. For this we need\\n // to flip `twos` such that it is 2**256 / twos.\\n // If twos is zero, then it becomes one\\n assembly {\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2**256\\n // Now that denominator is an odd number, it has an inverse\\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\\n // Compute the inverse by starting with a seed that is correct\\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\\n uint256 inv = (3 * denominator) ^ 2;\\n // Now use Newton-Raphson iteration to improve the precision.\\n // Thanks to Hensel's lifting lemma, this also works in modular\\n // arithmetic, doubling the correct bits in each step.\\n inv *= 2 - denominator * inv; // inverse mod 2**8\\n inv *= 2 - denominator * inv; // inverse mod 2**16\\n inv *= 2 - denominator * inv; // inverse mod 2**32\\n inv *= 2 - denominator * inv; // inverse mod 2**64\\n inv *= 2 - denominator * inv; // inverse mod 2**128\\n inv *= 2 - denominator * inv; // inverse mod 2**256\\n\\n // Because the division is now exact we can divide by multiplying\\n // with the modular inverse of denominator. This will give us the\\n // correct result modulo 2**256. Since the precoditions guarantee\\n // that the outcome is less than 2**256, this is the final result.\\n // We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inv;\\n return result;\\n }\\n }\\n\\n /// @notice Calculates ceil(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n function mulDivRoundingUp(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n result = mulDiv(a, b, denominator);\\n if (mulmod(a, b, denominator) > 0) {\\n require(result < type(uint256).max);\\n result++;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3fa0efa3eea2a84bd6ab7e55badd61f97069a6c50780059b036c810427a9740c\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/LiquidityAmounts.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.5.0;\\n\\nimport {FullMath} from \\\"./FullMath.sol\\\";\\nimport \\\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\\\";\\n\\n/// @title Liquidity amount functions\\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\\nlibrary LiquidityAmounts {\\n function toUint128(uint256 x) private pure returns (uint128 y) {\\n require((y = uint128(x)) == x);\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount0 The amount0 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount0(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n uint256 intermediate =\\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount0,\\n intermediate,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount1 The amount1 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount1(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount1,\\n FixedPoint96.Q96,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\\n /// pool prices and the prices at the tick boundaries\\n function getLiquidityForAmounts(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n liquidity = getLiquidityForAmount0(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount0\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n uint128 liquidity0 =\\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\\n uint128 liquidity1 =\\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\\n\\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\\n } else {\\n liquidity = getLiquidityForAmount1(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount1\\n );\\n }\\n }\\n\\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount0 The amount0\\n function getAmount0ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n uint256(liquidity) << FixedPoint96.RESOLUTION,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n sqrtRatioBX96\\n ) / sqrtRatioAX96;\\n }\\n\\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount1 The amount1\\n function getAmount1ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n liquidity,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n FixedPoint96.Q96\\n );\\n }\\n\\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\\n /// pool prices and the prices at the tick boundaries\\n function getAmountsForLiquidity(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0, uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioX96,\\n liquidity\\n );\\n } else {\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x6205f6409d42fc9565530d2a69819bf8c4e4c66b7a4c61d0827e81c084df6832\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/TickMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\n/// prices between 2**-128 and 2**128\\nlibrary TickMath {\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\n int24 internal constant MIN_TICK = -887272;\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\n int24 internal constant MAX_TICK = -MIN_TICK;\\n\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\n uint160 internal constant MAX_SQRT_RATIO =\\n 1461446703485210103287273052203988822378723970342;\\n\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\n /// @dev Throws if |tick| > max tick\\n /// @param tick The input tick for the above formula\\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\n /// at the given tick\\n function getSqrtRatioAtTick(int24 tick)\\n internal\\n pure\\n returns (uint160 sqrtPriceX96)\\n {\\n uint256 absTick =\\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\\n\\n // EDIT: 0.8 compatibility\\n require(absTick <= uint256(int256(MAX_TICK)), \\\"T\\\");\\n\\n uint256 ratio =\\n absTick & 0x1 != 0\\n ? 0xfffcb933bd6fad37aa2d162d1a594001\\n : 0x100000000000000000000000000000000;\\n if (absTick & 0x2 != 0)\\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\\n if (absTick & 0x4 != 0)\\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\\n if (absTick & 0x8 != 0)\\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\\n if (absTick & 0x10 != 0)\\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\\n if (absTick & 0x20 != 0)\\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\\n if (absTick & 0x40 != 0)\\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\\n if (absTick & 0x80 != 0)\\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\\n if (absTick & 0x100 != 0)\\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\\n if (absTick & 0x200 != 0)\\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\\n if (absTick & 0x400 != 0)\\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\\n if (absTick & 0x800 != 0)\\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\\n if (absTick & 0x1000 != 0)\\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\\n if (absTick & 0x2000 != 0)\\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\\n if (absTick & 0x4000 != 0)\\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\\n if (absTick & 0x8000 != 0)\\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\\n if (absTick & 0x10000 != 0)\\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\\n if (absTick & 0x20000 != 0)\\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\\n if (absTick & 0x40000 != 0)\\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\\n if (absTick & 0x80000 != 0)\\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\\n\\n if (tick > 0) ratio = type(uint256).max / ratio;\\n\\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\n sqrtPriceX96 = uint160(\\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\\n );\\n }\\n\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\n /// ever return.\\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\\n internal\\n pure\\n returns (int24 tick)\\n {\\n // second inequality must be < because the price can never reach the price at the max tick\\n require(\\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\\n \\\"R\\\"\\n );\\n uint256 ratio = uint256(sqrtPriceX96) << 32;\\n\\n uint256 r = ratio;\\n uint256 msb = 0;\\n\\n assembly {\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(4, gt(r, 0xFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(3, gt(r, 0xFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(2, gt(r, 0xF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(1, gt(r, 0x3))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := gt(r, 0x1)\\n msb := or(msb, f)\\n }\\n\\n if (msb >= 128) r = ratio >> (msb - 127);\\n else r = ratio << (127 - msb);\\n\\n int256 log_2 = (int256(msb) - 128) << 64;\\n\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(63, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(62, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(61, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(60, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(59, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(58, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(57, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(56, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(55, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(54, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(53, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(52, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(51, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(50, f))\\n }\\n\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\n\\n int24 tickLow =\\n int24(\\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\\n );\\n int24 tickHi =\\n int24(\\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\\n );\\n\\n tick = tickLow == tickHi\\n ? tickLow\\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\\n ? tickHi\\n : tickLow;\\n }\\n}\\n\",\"keccak256\":\"0x589b6104fd07d2e56e5b52edcfa53e6e47e2c38cace38025c16278ca73413f2d\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b5060405162005e0e38038062005e0e833981016040819052620000349162000046565b6001600160a01b031660805262000078565b6000602082840312156200005957600080fd5b81516001600160a01b03811681146200007157600080fd5b9392505050565b608051615d3b620000d3600039600081816105f801528181610ce301528181610dcc01528181610e06015281816114a7015281816116d50152818161170f015281816117e20152818161185901526118960152615d3b6000f3fe608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190614dc5565b61026e610269366004614e0d565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d9190614e39565b6102a66106fc565b60405161023d929190614e4d565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004614e5b565b610796565b6102f56102f0366004614eb9565b61084e565b005b6102ff600081565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004614e0d565b610c3a565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610c71565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b1366004614f21565b6001600160a01b031660009081526033602052604090205490565b6102f5610c80565b6097546103e890600160b81b900460020b81565b60405161023d9190614f3e565b6102f5610403366004614f4c565b610cd6565b61041b610416366004614f4c565b610e31565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e6110ea565b61045a610455366004614f7c565b6110f9565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004614fc0565b611232565b6097546103e890600160a01b900460020b81565b61026e6104aa366004614e0d565b6113f2565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004614e0d565b61148d565b6102f56104e5366004615023565b61149a565b610233609b5481565b6102a6610501366004614f21565b61173d565b6102f5610514366004614f4c565b6117d5565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046150bc565b6118bb565b6097546102ff90600160f01b900461ffff1681565b61023361059a36600461510e565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b61023361191f565b6102f56105db3660046151f1565b61192e565b6102f56105ee3660046152b3565b611ba3565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f5610628366004614f21565b611cb0565b6102f561063b3660046150bc565b611d90565b61041b61064e366004614f4c565b611dfa565b606060368054610662906152d0565b80601f016020809104026020016040519081016040528092919081815260200182805461068e906152d0565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f2338484612114565b5060015b92915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610779919061530a565b50505050509150915061078c8282612239565b9350935050509091565b60006107a38484846124b9565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561082d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610841853361083c86856153b2565b612114565b60019150505b9392505050565b33610857610c71565b6001600160a01b03161461087d5760405162461bcd60e51b8152600401610824906153c5565b600080600061088b60355490565b1115610bca57609d546001600160a01b031663514ea4bf6108aa61267f565b6040518263ffffffff1660e01b81526004016108c891815260200190565b60a060405180830381865afa1580156108e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610909919061541e565b5092945050506001600160801b03831615905061099257609754600090819061094890600160a01b8104600290810b91600160b81b9004900b866126da565b9350935050506109588282612a0d565b6109628282612ae6565b6040519193509150600080516020615ce6833981519152906109879084908490614e4d565b60405180910390a150505b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a06903090600401614e39565b602060405180830381865afa158015610a23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a479190615475565b610a5191906153b2565b610a5b91906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610a97903090600401614e39565b602060405180830381865afa158015610ab4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad89190615475565b610ae291906153b2565b610aec91906153b2565b9050610afd898984848b8b8b612b80565b609d546001600160a01b031663514ea4bf610b1661267f565b6040518263ffffffff1660e01b8152600401610b3491815260200190565b60a060405180830381865afa158015610b51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b75919061541e565b509295505050506001600160801b038316610bc35760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610824565b5050610c06565b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615c8683398151915287878484604051610c29949392919061548e565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061083c9086906154bc565b6097546001600160a01b031690565b33610c89610c71565b6001600160a01b031614610caf5760405162461bcd60e51b8152600401610824906153c5565b60988054600160201b600160d01b031916905560006099819055609a55610cd4612d21565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d205760405162461bcd60e51b8152600401610824906154cf565b600080610d33609954609a548888612d88565b60006099819055609a5590925090508115610d6d57609854609e54610d6d916001600160a01b0391821691600160301b9091041684612eac565b8015610d9857609854609f54610d98916001600160a01b0391821691600160301b9091041683612eac565b505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601610df757610df26001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b610e2b565b610e2b6001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050565b6000806000600260655403610e585760405162461bcd60e51b815260040161082490615500565b600260655584610e7a5760405162461bcd60e51b815260040161082490615537565b6000610e8560355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610edc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f00919061530a565b50505050505090506000821115610f4157600080610f1c6106fc565b91509150610f2b828a8661302a565b9650610f38818a8661302a565b95505050610f87565b609754610f81908290610f5d90600160a01b900460020b613073565b609754610f7390600160b81b900460020b613073565b610f7c8b613488565b6134f1565b90955093505b8415610fa557609e54610fa5906001600160a01b031633308861358c565b8315610fc357609f54610fc3906001600160a01b031633308761358c565b609754610ffc908290610fdf90600160a01b900460020b613073565b609754610ff590600160b81b900460020b613073565b88886135c4565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d9161104c913091600160a01b8104600290810b92600160b81b909204900b908990600401615557565b60408051808303816000875af115801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190615599565b505061109a8688613686565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e786888787876040516110d19594939291906155bd565b60405180910390a1505060016065819055509250925092565b606060378054610662906152d0565b60008060008061110860355490565b905080156111275761111b818787613753565b9195509350915061122a565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611195919061530a565b505050505050905060006111db826111be609760149054906101000a900460020b60020b613073565b6097546111d490600160b81b900460020b613073565b8b8b6135c4565b6097546001600160801b038216955090915061122290839061120690600160a01b900460020b613073565b60975461121c90600160b81b900460020b613073565b846134f1565b909650945050505b509250925092565b3361123b610c71565b6001600160a01b0316146112615760405162461bcd60e51b8152600401610824906153c5565b6127108461ffff1611156112875760405162461bcd60e51b8152600401610824906155f4565b6127108561ffff1611156112ad5760405162461bcd60e51b8152600401610824906155f4565b6127108361ffff1611156112d35760405162461bcd60e51b8152600401610824906155f4565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff85161561134a576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff84161561136f576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561139557609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff8216156113b7576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156113eb5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156114745760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610824565b611483338561083c86856153b2565b5060019392505050565b60006106f23384846124b9565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114e45760405162461bcd60e51b8152600401610824906154cf565b85156114f4576114f48786613862565b609d546000906001600160a01b031663514ea4bf61151061267f565b6040518263ffffffff1660e01b815260040161152e91815260200190565b60a060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f919061541e565b505050509050611583818989898989613abb565b609d546000906001600160a01b031663514ea4bf61159f61267f565b6040518263ffffffff1660e01b81526004016115bd91815260200190565b60a060405180830381865afa1580156115da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fe919061541e565b505050509050816001600160801b0316816001600160801b03161161165f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610824565b609754604051600080516020615c868339815191529161169991600160a01b8204600290810b92600160b81b9004900b908690869061548e565b60405180910390a1505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601611700576116fb6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b611734565b6117346001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b9919061530a565b50505050509150506117cb8482612239565b9250925050915091565b8181336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461181f5760405162461bcd60e51b8152600401610824906154cf565b600080611832609b54609c548888612d88565b6000609b819055609c559092509050811561187e57609e5461187e906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084612eac565b8015610d9857609f54610d98906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083612eac565b609d546001600160a01b031633146118e55760405162461bcd60e51b815260040161082490615611565b831561190257609e54611902906001600160a01b03163386612eac565b8215610e2b57609f54610e2b906001600160a01b03163385612eac565b600061192961267f565b905090565b600054610100900460ff1680611947575060005460ff16155b6119635760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015611985576000805461ffff19166101011790555b6119926000612710615688565b61ffff168561ffff1611156119b95760405162461bcd60e51b8152600401610824906156aa565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe1681916004808201926020929091908290030181865afa158015611a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3691906156c8565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a79160048083019260209291908290030181865afa158015611a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab891906156c8565b609f80546001600160a01b039283166001600160a01b0319918216179091556098805460978054948716600160301b8102600160301b600160d01b031963ffffffff1961ffff8e16600160201b021665ffffffffffff199095169490941761012c17939093169290921790925562ffffff878116600160b81b02909316600165ffffff00000160a01b0319938916600160a01b02600165ffffff00000160a01b0390951694909417643e800c801960d31b179290921692909217179055611b7f8888613f83565b611b87614002565b8015611b99576000805461ff00191690555b5050505050505050565b33611bac610c71565b6001600160a01b031614611bd25760405162461bcd60e51b8152600401610824906153c5565b609854600160201b900461ffff1615611c135760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610824565b60008161ffff16118015611c3b5750611c2f6000612710615688565b61ffff168161ffff1611155b611c575760405162461bcd60e51b8152600401610824906156aa565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611cb9610c71565b6001600160a01b031614611cdf5760405162461bcd60e51b8152600401610824906153c5565b6001600160a01b038116611d465760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610824565b6097546040516001600160a01b03808416921690600080516020615ca683398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611dba5760405162461bcd60e51b815260040161082490615611565b6000841315611dda57609e54610df2906001600160a01b03163386612eac565b6000831315610e2b57609f54610e2b906001600160a01b03163385612eac565b6000806000600260655403611e215760405162461bcd60e51b815260040161082490615500565b600260655584611e5c5760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610824565b6000611e6760355490565b609d549091506000906001600160a01b031663514ea4bf611e8661267f565b6040518263ffffffff1660e01b8152600401611ea491815260200190565b60a060405180830381865afa158015611ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee5919061541e565b505050509050611ef53388614076565b6000611f0b88836001600160801b0316856141b3565b9050611f1681613488565b609754909450600090819081908190611f4590600160a01b8104600290810b91600160b81b9004900b8a6126da565b9350935093509350611f578282612a0d565b611f618282612ae6565b6040519193509150600080516020615ce683398151915290611f869084908490614e4d565b60405180910390a1609b54609954609e546040516370a0823160e01b815261203293929188916001600160a01b03909116906370a0823190611fcc903090600401614e39565b602060405180830381865afa158015611fe9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200d9190615475565b61201791906153b2565b61202191906153b2565b61202b91906153b2565b8d896141b3565b61203c90856154bc565b609c54609a54609f546040516370a0823160e01b8152939d506120799387916001600160a01b0316906370a0823190611fcc903090600401614e39565b61208390846154bc565b985089156120a257609e546120a2906001600160a01b03168c8c612eac565b88156120bf57609f546120bf906001600160a01b03168c8b612eac565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516120f69594939291906155bd565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166121765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610824565b6001600160a01b0382166121d75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610824565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61226161267f565b6040518263ffffffff1660e01b815260040161227f91815260200190565b60a060405180830381865afa15801561229c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c0919061541e565b94509450945094509450612305896122e9609760149054906101000a900460020b60020b613073565b6097546122ff90600160b81b900460020b613073565b886134f1565b909750955060006001600160801b0383166123236001878c8a614261565b61232d91906154bc565b90506000826001600160801b03166123486000878d8b614261565b61235291906154bc565b905061235e8282612ae6565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a082319061239c903090600401614e39565b602060405180830381865afa1580156123b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dd9190615475565b6123e790856154bc565b6123f191906153b2565b6123fb91906153b2565b612405908a6154bc565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a0823190612440903090600401614e39565b602060405180830381865afa15801561245d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124819190615475565b61248b90846154bc565b61249591906153b2565b61249f91906153b2565b6124a990896154bc565b9750505050505050509250929050565b6001600160a01b03831661251d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610824565b6001600160a01b03821661257f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610824565b6001600160a01b038316600090815260336020526040902054818110156125f75760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610824565b61260182826153b2565b6001600160a01b0380861660009081526033602052604080822093909355908516815290812080548492906126379084906154bc565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615cc68339815191528460405161267191815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b820460e890811b6034830152600160b81b90920490911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a0823190612713903090600401614e39565b602060405180830381865afa158015612730573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127549190615475565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061278a903090600401614e39565b602060405180830381865afa1580156127a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cb9190615475565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a79060640160408051808303816000875af1158015612830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128549190615599565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a40160408051808303816000875af11580156128c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128eb91906156e5565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612921903090600401614e39565b602060405180830381865afa15801561293e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129629190615475565b61296c91906153b2565b61297691906153b2565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a08231906129ab903090600401614e39565b602060405180830381865afa1580156129c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ec9190615475565b6129f691906153b2565b612a0091906153b2565b9250505093509350935093565b612710612a1b600084615718565b612a259190615745565b609b6000828254612a3691906154bc565b909155506127109050612a4a600083615718565b612a549190615745565b609c6000828254612a6591906154bc565b909155505060985461271090612a8690600160201b900461ffff1684615718565b612a909190615745565b60996000828254612aa191906154bc565b909155505060985461271090612ac290600160201b900461ffff1683615718565b612acc9190615745565b609a6000828254612add91906154bc565b90915550505050565b6000806000612710609860049054906101000a900461ffff166000612b0b9190615759565b612b199061ffff1687615718565b612b239190615745565b60985490915060009061271090612b4590600160201b900461ffff1683615759565b612b539061ffff1687615718565b612b5d9190615745565b9050612b6982876153b2565b9350612b7581866153b2565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015612bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bee919061530a565b50505050505090506000612c1b82612c088b60020b613073565b612c148b60020b613073565b8a8a6135c4565b90506001600160801b03811615612cc957609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612c679030908f908f908990600401615557565b60408051808303816000875af1158015612c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ca99190615599565b9092509050612cb8828a6153b2565b9850612cc481896153b2565b975050505b6000612cf86127108686612cdd5789612cdf565b8a5b612ce99190615718565b612cf39190615745565b61460d565b90506000811315612d1557612d128a8a8a8a858b8a614673565b50505b50505050505050505050565b33612d2a610c71565b6001600160a01b031614612d505760405162461bcd60e51b8152600401610824906153c5565b6097546040516000916001600160a01b031690600080516020615ca6833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0390811690841603612dfd57609754849061271090612dc190600160e01b900461ffff1689615718565b612dcb9190615745565b1015612de95760405162461bcd60e51b815260040161082490615774565b612df384876153b2565b9150849050612ea3565b609f546001600160a01b0390811690841603612e6d57609754849061271090612e3190600160e01b900461ffff1688615718565b612e3b9190615745565b1015612e595760405162461bcd60e51b815260040161082490615774565b612e6384866153b2565b9050859150612ea3565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610824565b94509492505050565b6040516001600160a01b038316602482015260448101829052612f0f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261488f565b505050565b80471015612f645760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610824565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612fb1576040519150601f19603f3d011682016040523d82523d6000602084013e612fb6565b606091505b5050905080612f0f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610824565b60006130378484846141b3565b9050600082806130495761304961572f565b848609111561084757600019811061306057600080fd5b8061306a81615796565b95945050505050565b60008060008360020b1261308a578260020b613097565b8260020b613097906157af565b90506130a6620d89e7196157cb565b60020b8111156130dc5760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610824565b6000816001166000036130f357600160801b613105565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561313a576080613135826ffff97272373d413259a46990580e213a615718565b901c90505b600482161561316457608061315f826ffff2e50f5f656932ef12357cf3c7fdcc615718565b901c90505b600882161561318e576080613189826fffe5caca7e10e4e61c3624eaa0941cd0615718565b901c90505b60108216156131b85760806131b3826fffcb9843d60f6159c9db58835c926644615718565b901c90505b60208216156131e25760806131dd826fff973b41fa98c081472e6896dfb254c0615718565b901c90505b604082161561320c576080613207826fff2ea16466c96a3843ec78b326b52861615718565b901c90505b6080821615613236576080613231826ffe5dee046a99a2a811c461f1969c3053615718565b901c90505b61010082161561326157608061325c826ffcbe86c7900a88aedcffc83b479aa3a4615718565b901c90505b61020082161561328c576080613287826ff987a7253ac413176f2b074cf7815e54615718565b901c90505b6104008216156132b75760806132b2826ff3392b0822b70005940c7a398e4b70f3615718565b901c90505b6108008216156132e25760806132dd826fe7159475a2c29b7443b29c7fa6e889d9615718565b901c90505b61100082161561330d576080613308826fd097f3bdfd2022b8845ad8f792aa5825615718565b901c90505b612000821615613338576080613333826fa9f746462d870fdf8a65dc1f90e061e5615718565b901c90505b61400082161561336357608061335e826f70d869a156d2a1b890bb3df62baf32f7615718565b901c90505b61800082161561338e576080613389826f31be135f97d08fd981231505542fcfa6615718565b901c90505b620100008216156133ba5760806133b5826f09aa508b5b7a84e1c677de54f3e99bc9615718565b901c90505b620200008216156133e55760806133e0826e5d6af8dedb81196699c329225ee604615718565b901c90505b6204000082161561340f57608061340a826d2216e584f5fa1ea926041bedfe98615718565b901c90505b62080000821615613437576080613432826b048a170391f7dc42444e8fa2615718565b901c90505b60008460020b13156134525761344f81600019615745565b90505b613460600160201b826157ed565b1561346c57600161346f565b60005b6134809060ff16602083901c6154bc565b949350505050565b6000600160801b82106134ed5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610824565b5090565b600080836001600160a01b0316856001600160a01b03161115613512579293925b846001600160a01b0316866001600160a01b03161161353d57613536858585614961565b9150612ea3565b836001600160a01b0316866001600160a01b0316101561357657613562868585614961565b915061356f8587856149cb565b9050612ea3565b6135818585856149cb565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e2b9085906323b872dd60e01b90608401612ed8565b6000836001600160a01b0316856001600160a01b031611156135e4579293925b846001600160a01b0316866001600160a01b03161161360f57613608858585614a15565b905061306a565b836001600160a01b0316866001600160a01b03161015613671576000613636878686614a15565b90506000613645878986614a7f565b9050806001600160801b0316826001600160801b0316106136665780613668565b815b9250505061306a565b61367c858584614a7f565b9695505050505050565b6001600160a01b0382166136dc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610824565b80603560008282546136ee91906154bc565b90915550506001600160a01b0382166000908152603360205260408120805483929061371b9084906154bc565b90915550506040518181526001600160a01b03831690600090600080516020615cc68339815191529060200160405180910390a35050565b60008060008060006137636106fc565b915091508160001480156137775750600081115b1561378e576137878689836141b3565b925061383d565b8015801561379c5750600082115b156137ac576137878789846141b3565b811580156137b8575080155b156137df5760405162461bcd60e51b81526020600482015260006024820152604401610824565b60006137ec888a856141b3565b905060006137fb888b856141b3565b905060008211801561380d5750600081115b6138295760405162461bcd60e51b815260040161082490615537565b8082106138365780613838565b815b945050505b61384883838a61302a565b945061385583828a61302a565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff16918391506000906138a0576138a0615801565b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106138cf576138cf615801565b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613915908590600401615817565b600060405180830381865afa158015613932573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261395a919081019061590a565b509050805160021461399a5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610824565b6098548151600091829163ffffffff90911660060b90849083906139c0576139c0615801565b6020026020010151846001815181106139db576139db615801565b60200260200101510360060b816139f4576139f461572f565b059050613a038160020b613073565b6097549092506000915061271090613a2690600160f01b900461ffff16846159cc565b613a3091906159fe565b90508415613a7857613a428183615a24565b6001600160a01b0316866001600160a01b03161015613a735760405162461bcd60e51b815260040161082490615a44565b613ab3565b613a828183615a6b565b6001600160a01b0316866001600160a01b03161115613ab35760405162461bcd60e51b815260040161082490615a44565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613af4903090600401614e39565b602060405180830381865afa158015613b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b359190615475565b613b3f91906153b2565b613b4991906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613b85903090600401614e39565b602060405180830381865afa158015613ba2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bc69190615475565b613bd091906153b2565b613bda91906153b2565b6097549091506000908190613c0590600160a01b8104600290810b91600160b81b9004900b8c6126da565b935093505050613c158282612a0d565b613c1f8282612ae6565b6040519193509150600080516020615ce683398151915290613c449084908490614e4d565b60405180910390a1613c5684836154bc565b9150613c6283826154bc565b609e549091506001600160a01b0390811690861603613def57609754869061271090613c9990600160d01b900461ffff1685615718565b613ca39190615745565b1015613cc15760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613cf9903090600401614e39565b602060405180830381865afa158015613d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d3a9190615475565b613d4491906153b2565b613d4e91906153b2565b613d5891906153b2565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613d93903090600401614e39565b602060405180830381865afa158015613db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dd49190615475565b613dde91906153b2565b613de891906153b2565b9250613f5c565b609f546001600160a01b0390811690861603612e6d57609754869061271090613e2390600160d01b900461ffff1684615718565b613e2d9190615745565b1015613e4b5760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a0823190613e81903090600401614e39565b602060405180830381865afa158015613e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ec29190615475565b613ecc91906153b2565b613ed691906153b2565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a0823190613f11903090600401614e39565b602060405180830381865afa158015613f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f529190615475565b613dd491906153b2565b609754612d1590600160a01b8104600290810b91600160b81b9004900b86868d8d8d612b80565b600054610100900460ff1680613f9c575060005460ff16155b613fb85760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015613fda576000805461ffff19166101011790555b613fe2614ab5565b613fec8383614b1f565b8015612f0f576000805461ff0019169055505050565b600054610100900460ff168061401b575060005460ff16155b6140375760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614059576000805461ffff19166101011790555b614061614ba6565b8015614073576000805461ff00191690555b50565b6001600160a01b0382166140d65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610824565b6001600160a01b0382166000908152603360205260409020548181101561414a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610824565b61415482826153b2565b6001600160a01b038416600090815260336020526040812091909155603580548492906141829084906153b2565b90915550506040518281526000906001600160a01b03851690600080516020615cc68339815191529060200161222c565b60008080600019858709858702925082811083820303915050806000036141ec57600084116141e157600080fd5b508290049050610847565b8084116141f857600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600080871561440157609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b8152600401602060405180830381865afa1580156142c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142e49190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161432491600160a01b90910460020b90600401614f3e565b61010060405180830381865afa158015614342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143669190615a8b565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba9395506143af94600160b81b90910460020b93506004019150614f3e9050565b61010060405180830381865afa1580156143cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143f19190615a8b565b5093975061458f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b8152600401602060405180830381865afa158015614454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144789190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916144b891600160a01b90910460020b90600401614f3e565b61010060405180830381865afa1580156144d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144fa9190615a8b565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506145429450600160b81b900460020b926004019150614f3e9050565b61010060405180830381865afa158015614560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145849190615a8b565b509297505050505050505b609754600090600160a01b9004600290810b9088900b126145b15750826145b6565b508281035b609754600090600160b81b9004600290810b9089900b12156145d95750826145de565b508282035b8183038190036145fe6001600160801b0389168b8303600160801b6141b3565b9b9a5050505050505050505050565b6000600160ff1b82106134ed5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610824565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c40160408051808303816000875af11580156146e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061470c9190615599565b915091508161471a8a61460d565b6147249190615b27565b9350806147308961460d565b61473a9190615b27565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015614791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b5919061530a565b505050505050905060006147e2826147cf8f60020b613073565b6147db8f60020b613073565b89896135c4565b90506001600160801b0381161561487f57609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b815260040161483a9493929190615557565b60408051808303816000875af1158015614858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061487c9190615599565b50505b5050505097509795505050505050565b60006148e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c169092919063ffffffff16565b805190915015612f0f57808060200190518101906149029190615b47565b612f0f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610824565b6000826001600160a01b0316846001600160a01b03161115614981579192915b6001600160a01b0384166149c1600160601b600160e01b03606085901b166149a98787615a24565b6001600160a01b0316866001600160a01b03166141b3565b6134809190615745565b6000826001600160a01b0316846001600160a01b031611156149eb579192915b6134806001600160801b038316614a028686615a24565b6001600160a01b0316600160601b6141b3565b6000826001600160a01b0316846001600160a01b03161115614a35579192915b6000614a58856001600160a01b0316856001600160a01b0316600160601b6141b3565b905061306a614a7a8483614a6c8989615a24565b6001600160a01b03166141b3565b614c25565b6000826001600160a01b0316846001600160a01b03161115614a9f579192915b613480614a7a83600160601b614a6c8888615a24565b600054610100900460ff1680614ace575060005460ff16155b614aea5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614061576000805461ffff19166101011790558015614073576000805461ff001916905550565b600054610100900460ff1680614b38575060005460ff16155b614b545760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614b76576000805461ffff19166101011790555b6036614b828482615baa565b506037614b8f8382615baa565b508015612f0f576000805461ff0019169055505050565b600054610100900460ff1680614bbf575060005460ff16155b614bdb5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614bfd576000805461ffff19166101011790555b60016065558015614073576000805461ff001916905550565b60606134808484600085614c40565b806001600160801b0381168114614c3b57600080fd5b919050565b606082471015614ca15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610824565b843b614cef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610824565b600080866001600160a01b03168587604051614d0b9190615c69565b60006040518083038185875af1925050503d8060008114614d48576040519150601f19603f3d011682016040523d82523d6000602084013e614d4d565b606091505b5091509150614d5d828286614d68565b979650505050505050565b60608315614d77575081610847565b825115614d875782518084602001fd5b8160405162461bcd60e51b81526004016108249190614dc5565b60005b83811015614dbc578181015183820152602001614da4565b50506000910152565b6020815260008251806020840152614de4816040850160208701614da1565b601f01601f19169190910160400192915050565b6001600160a01b038116811461407357600080fd5b60008060408385031215614e2057600080fd5b8235614e2b81614df8565b946020939093013593505050565b6001600160a01b0391909116815260200190565b918252602082015260400190565b600080600060608486031215614e7057600080fd5b8335614e7b81614df8565b92506020840135614e8b81614df8565b929592945050506040919091013590565b8060020b811461407357600080fd5b801515811461407357600080fd5b600080600080600060a08688031215614ed157600080fd5b8535614edc81614e9c565b94506020860135614eec81614e9c565b93506040860135614efc81614df8565b9250606086013591506080860135614f1381614eab565b809150509295509295909350565b600060208284031215614f3357600080fd5b813561084781614df8565b60029190910b815260200190565b60008060408385031215614f5f57600080fd5b823591506020830135614f7181614df8565b809150509250929050565b60008060408385031215614f8f57600080fd5b50508035926020909101359150565b61ffff8116811461407357600080fd5b63ffffffff8116811461407357600080fd5b600080600080600060a08688031215614fd857600080fd5b8535614fe381614f9e565b94506020860135614ff381614f9e565b9350604086013561500381614f9e565b9250606086013561501381614fae565b91506080860135614f1381614df8565b600080600080600060a0868803121561503b57600080fd5b853561504681614df8565b945060208601359350604086013561505d81614eab565b9250606086013591506080860135614f1381614df8565b60008083601f84011261508657600080fd5b5081356001600160401b0381111561509d57600080fd5b6020830191508360208285010111156150b557600080fd5b9250929050565b600080600080606085870312156150d257600080fd5b843593506020850135925060408501356001600160401b038111156150f657600080fd5b61510287828801615074565b95989497509550505050565b6000806040838503121561512157600080fd5b823561512c81614df8565b91506020830135614f7181614df8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561517a5761517a61513c565b604052919050565b600082601f83011261519357600080fd5b81356001600160401b038111156151ac576151ac61513c565b6151bf601f8201601f1916602001615152565b8181528460208386010111156151d457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060e0888a03121561520c57600080fd5b87356001600160401b038082111561522357600080fd5b61522f8b838c01615182565b985060208a013591508082111561524557600080fd5b506152528a828b01615182565b965050604088013561526381614df8565b9450606088013561527381614f9e565b9350608088013561528381614e9c565b925060a088013561529381614e9c565b915060c08801356152a381614df8565b8091505092959891949750929550565b6000602082840312156152c557600080fd5b813561084781614f9e565b600181811c908216806152e457607f821691505b60208210810361530457634e487b7160e01b600052602260045260246000fd5b50919050565b600080600080600080600060e0888a03121561532557600080fd5b875161533081614df8565b602089015190975061534181614e9c565b604089015190965061535281614f9e565b606089015190955061536381614f9e565b608089015190945061537481614f9e565b60a089015190935060ff8116811461538b57600080fd5b60c08901519092506152a381614eab565b634e487b7160e01b600052601160045260246000fd5b818103818111156106f6576106f661539c565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b80516001600160801b0381168114614c3b57600080fd5b600080600080600060a0868803121561543657600080fd5b61543f86615407565b9450602086015193506040860151925061545b60608701615407565b915061546960808701615407565b90509295509295909350565b60006020828403121561548757600080fd5b5051919050565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b808201808211156106f6576106f661539c565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b600080604083850312156155ac57600080fd5b505080516020909101519092909150565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b60208082526003908201526242505360e81b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b61ffff8281168282160390808211156156a3576156a361539c565b5092915050565b6020808252600490820152636d42505360e01b604082015260600190565b6000602082840312156156da57600080fd5b815161084781614df8565b600080604083850312156156f857600080fd5b61570183615407565b915061570f60208401615407565b90509250929050565b80820281158282048414176106f6576106f661539c565b634e487b7160e01b600052601260045260246000fd5b6000826157545761575461572f565b500490565b61ffff8181168382160190808211156156a3576156a361539c565b602080825260089082015267686967682066656560c01b604082015260600190565b6000600182016157a8576157a861539c565b5060010190565b6000600160ff1b82016157c4576157c461539c565b5060000390565b60008160020b627fffff1981036157e4576157e461539c565b60000392915050565b6000826157fc576157fc61572f565b500690565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561585557835163ffffffff1683529284019291840191600101615833565b50909695505050505050565b60006001600160401b0382111561587a5761587a61513c565b5060051b60200190565b8051600681900b8114614c3b57600080fd5b600082601f8301126158a757600080fd5b815160206158bc6158b783615861565b615152565b82815260059290921b840181019181810190868411156158db57600080fd5b8286015b848110156158ff5780516158f281614df8565b83529183019183016158df565b509695505050505050565b6000806040838503121561591d57600080fd5b82516001600160401b038082111561593457600080fd5b818501915085601f83011261594857600080fd5b815160206159586158b783615861565b82815260059290921b8401810191818101908984111561597757600080fd5b948201945b8386101561599c5761598d86615884565b8252948201949082019061597c565b918801519196509093505050808211156159b557600080fd5b506159c285828601615896565b9150509250929050565b6001600160a01b038281168282168181028316929181158285048214176159f5576159f561539c565b50505092915050565b60006001600160a01b0383811680615a1857615a1861572f565b92169190910492915050565b6001600160a01b038281168282160390808211156156a3576156a361539c565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b6001600160a01b038181168382160190808211156156a3576156a361539c565b600080600080600080600080610100898b031215615aa857600080fd5b615ab189615407565b9750602089015180600f0b8114615ac757600080fd5b60408a015160608b015191985096509450615ae460808a01615884565b935060a0890151615af481614df8565b60c08a0151909350615b0581614fae565b60e08a0151909250615b1681614eab565b809150509295985092959890939650565b81810360008312801583831316838312821617156156a3576156a361539c565b600060208284031215615b5957600080fd5b815161084781614eab565b601f821115612f0f57600081815260208120601f850160051c81016020861015615b8b5750805b601f850160051c820191505b81811015613ab357828155600101615b97565b81516001600160401b03811115615bc357615bc361513c565b615bd781615bd184546152d0565b84615b64565b602080601f831160018114615c0c5760008415615bf45750858301515b600019600386901b1c1916600185901b178555613ab3565b600085815260208120601f198616915b82811015615c3b57888601518255948401946001909101908401615c1c565b5085821015615c595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251615c7b818460208701614da1565b919091019291505056fec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a2646970667358221220a11bde499516b0a2e8e737821292815fcefc66549a9729f24ea128d34ed6027364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190614dc5565b61026e610269366004614e0d565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d9190614e39565b6102a66106fc565b60405161023d929190614e4d565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004614e5b565b610796565b6102f56102f0366004614eb9565b61084e565b005b6102ff600081565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004614e0d565b610c3a565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610c71565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b1366004614f21565b6001600160a01b031660009081526033602052604090205490565b6102f5610c80565b6097546103e890600160b81b900460020b81565b60405161023d9190614f3e565b6102f5610403366004614f4c565b610cd6565b61041b610416366004614f4c565b610e31565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e6110ea565b61045a610455366004614f7c565b6110f9565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004614fc0565b611232565b6097546103e890600160a01b900460020b81565b61026e6104aa366004614e0d565b6113f2565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004614e0d565b61148d565b6102f56104e5366004615023565b61149a565b610233609b5481565b6102a6610501366004614f21565b61173d565b6102f5610514366004614f4c565b6117d5565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046150bc565b6118bb565b6097546102ff90600160f01b900461ffff1681565b61023361059a36600461510e565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b61023361191f565b6102f56105db3660046151f1565b61192e565b6102f56105ee3660046152b3565b611ba3565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f5610628366004614f21565b611cb0565b6102f561063b3660046150bc565b611d90565b61041b61064e366004614f4c565b611dfa565b606060368054610662906152d0565b80601f016020809104026020016040519081016040528092919081815260200182805461068e906152d0565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f2338484612114565b5060015b92915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610779919061530a565b50505050509150915061078c8282612239565b9350935050509091565b60006107a38484846124b9565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561082d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610841853361083c86856153b2565b612114565b60019150505b9392505050565b33610857610c71565b6001600160a01b03161461087d5760405162461bcd60e51b8152600401610824906153c5565b600080600061088b60355490565b1115610bca57609d546001600160a01b031663514ea4bf6108aa61267f565b6040518263ffffffff1660e01b81526004016108c891815260200190565b60a060405180830381865afa1580156108e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610909919061541e565b5092945050506001600160801b03831615905061099257609754600090819061094890600160a01b8104600290810b91600160b81b9004900b866126da565b9350935050506109588282612a0d565b6109628282612ae6565b6040519193509150600080516020615ce6833981519152906109879084908490614e4d565b60405180910390a150505b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a06903090600401614e39565b602060405180830381865afa158015610a23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a479190615475565b610a5191906153b2565b610a5b91906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610a97903090600401614e39565b602060405180830381865afa158015610ab4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad89190615475565b610ae291906153b2565b610aec91906153b2565b9050610afd898984848b8b8b612b80565b609d546001600160a01b031663514ea4bf610b1661267f565b6040518263ffffffff1660e01b8152600401610b3491815260200190565b60a060405180830381865afa158015610b51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b75919061541e565b509295505050506001600160801b038316610bc35760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610824565b5050610c06565b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615c8683398151915287878484604051610c29949392919061548e565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061083c9086906154bc565b6097546001600160a01b031690565b33610c89610c71565b6001600160a01b031614610caf5760405162461bcd60e51b8152600401610824906153c5565b60988054600160201b600160d01b031916905560006099819055609a55610cd4612d21565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d205760405162461bcd60e51b8152600401610824906154cf565b600080610d33609954609a548888612d88565b60006099819055609a5590925090508115610d6d57609854609e54610d6d916001600160a01b0391821691600160301b9091041684612eac565b8015610d9857609854609f54610d98916001600160a01b0391821691600160301b9091041683612eac565b505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601610df757610df26001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b610e2b565b610e2b6001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050565b6000806000600260655403610e585760405162461bcd60e51b815260040161082490615500565b600260655584610e7a5760405162461bcd60e51b815260040161082490615537565b6000610e8560355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610edc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f00919061530a565b50505050505090506000821115610f4157600080610f1c6106fc565b91509150610f2b828a8661302a565b9650610f38818a8661302a565b95505050610f87565b609754610f81908290610f5d90600160a01b900460020b613073565b609754610f7390600160b81b900460020b613073565b610f7c8b613488565b6134f1565b90955093505b8415610fa557609e54610fa5906001600160a01b031633308861358c565b8315610fc357609f54610fc3906001600160a01b031633308761358c565b609754610ffc908290610fdf90600160a01b900460020b613073565b609754610ff590600160b81b900460020b613073565b88886135c4565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d9161104c913091600160a01b8104600290810b92600160b81b909204900b908990600401615557565b60408051808303816000875af115801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190615599565b505061109a8688613686565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e786888787876040516110d19594939291906155bd565b60405180910390a1505060016065819055509250925092565b606060378054610662906152d0565b60008060008061110860355490565b905080156111275761111b818787613753565b9195509350915061122a565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611195919061530a565b505050505050905060006111db826111be609760149054906101000a900460020b60020b613073565b6097546111d490600160b81b900460020b613073565b8b8b6135c4565b6097546001600160801b038216955090915061122290839061120690600160a01b900460020b613073565b60975461121c90600160b81b900460020b613073565b846134f1565b909650945050505b509250925092565b3361123b610c71565b6001600160a01b0316146112615760405162461bcd60e51b8152600401610824906153c5565b6127108461ffff1611156112875760405162461bcd60e51b8152600401610824906155f4565b6127108561ffff1611156112ad5760405162461bcd60e51b8152600401610824906155f4565b6127108361ffff1611156112d35760405162461bcd60e51b8152600401610824906155f4565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff85161561134a576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff84161561136f576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561139557609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff8216156113b7576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156113eb5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156114745760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610824565b611483338561083c86856153b2565b5060019392505050565b60006106f23384846124b9565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114e45760405162461bcd60e51b8152600401610824906154cf565b85156114f4576114f48786613862565b609d546000906001600160a01b031663514ea4bf61151061267f565b6040518263ffffffff1660e01b815260040161152e91815260200190565b60a060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f919061541e565b505050509050611583818989898989613abb565b609d546000906001600160a01b031663514ea4bf61159f61267f565b6040518263ffffffff1660e01b81526004016115bd91815260200190565b60a060405180830381865afa1580156115da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fe919061541e565b505050509050816001600160801b0316816001600160801b03161161165f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610824565b609754604051600080516020615c868339815191529161169991600160a01b8204600290810b92600160b81b9004900b908690869061548e565b60405180910390a1505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601611700576116fb6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b611734565b6117346001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b9919061530a565b50505050509150506117cb8482612239565b9250925050915091565b8181336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461181f5760405162461bcd60e51b8152600401610824906154cf565b600080611832609b54609c548888612d88565b6000609b819055609c559092509050811561187e57609e5461187e906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084612eac565b8015610d9857609f54610d98906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083612eac565b609d546001600160a01b031633146118e55760405162461bcd60e51b815260040161082490615611565b831561190257609e54611902906001600160a01b03163386612eac565b8215610e2b57609f54610e2b906001600160a01b03163385612eac565b600061192961267f565b905090565b600054610100900460ff1680611947575060005460ff16155b6119635760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015611985576000805461ffff19166101011790555b6119926000612710615688565b61ffff168561ffff1611156119b95760405162461bcd60e51b8152600401610824906156aa565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe1681916004808201926020929091908290030181865afa158015611a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3691906156c8565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a79160048083019260209291908290030181865afa158015611a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab891906156c8565b609f80546001600160a01b039283166001600160a01b0319918216179091556098805460978054948716600160301b8102600160301b600160d01b031963ffffffff1961ffff8e16600160201b021665ffffffffffff199095169490941761012c17939093169290921790925562ffffff878116600160b81b02909316600165ffffff00000160a01b0319938916600160a01b02600165ffffff00000160a01b0390951694909417643e800c801960d31b179290921692909217179055611b7f8888613f83565b611b87614002565b8015611b99576000805461ff00191690555b5050505050505050565b33611bac610c71565b6001600160a01b031614611bd25760405162461bcd60e51b8152600401610824906153c5565b609854600160201b900461ffff1615611c135760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610824565b60008161ffff16118015611c3b5750611c2f6000612710615688565b61ffff168161ffff1611155b611c575760405162461bcd60e51b8152600401610824906156aa565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611cb9610c71565b6001600160a01b031614611cdf5760405162461bcd60e51b8152600401610824906153c5565b6001600160a01b038116611d465760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610824565b6097546040516001600160a01b03808416921690600080516020615ca683398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611dba5760405162461bcd60e51b815260040161082490615611565b6000841315611dda57609e54610df2906001600160a01b03163386612eac565b6000831315610e2b57609f54610e2b906001600160a01b03163385612eac565b6000806000600260655403611e215760405162461bcd60e51b815260040161082490615500565b600260655584611e5c5760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610824565b6000611e6760355490565b609d549091506000906001600160a01b031663514ea4bf611e8661267f565b6040518263ffffffff1660e01b8152600401611ea491815260200190565b60a060405180830381865afa158015611ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee5919061541e565b505050509050611ef53388614076565b6000611f0b88836001600160801b0316856141b3565b9050611f1681613488565b609754909450600090819081908190611f4590600160a01b8104600290810b91600160b81b9004900b8a6126da565b9350935093509350611f578282612a0d565b611f618282612ae6565b6040519193509150600080516020615ce683398151915290611f869084908490614e4d565b60405180910390a1609b54609954609e546040516370a0823160e01b815261203293929188916001600160a01b03909116906370a0823190611fcc903090600401614e39565b602060405180830381865afa158015611fe9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200d9190615475565b61201791906153b2565b61202191906153b2565b61202b91906153b2565b8d896141b3565b61203c90856154bc565b609c54609a54609f546040516370a0823160e01b8152939d506120799387916001600160a01b0316906370a0823190611fcc903090600401614e39565b61208390846154bc565b985089156120a257609e546120a2906001600160a01b03168c8c612eac565b88156120bf57609f546120bf906001600160a01b03168c8b612eac565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516120f69594939291906155bd565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166121765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610824565b6001600160a01b0382166121d75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610824565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61226161267f565b6040518263ffffffff1660e01b815260040161227f91815260200190565b60a060405180830381865afa15801561229c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c0919061541e565b94509450945094509450612305896122e9609760149054906101000a900460020b60020b613073565b6097546122ff90600160b81b900460020b613073565b886134f1565b909750955060006001600160801b0383166123236001878c8a614261565b61232d91906154bc565b90506000826001600160801b03166123486000878d8b614261565b61235291906154bc565b905061235e8282612ae6565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a082319061239c903090600401614e39565b602060405180830381865afa1580156123b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dd9190615475565b6123e790856154bc565b6123f191906153b2565b6123fb91906153b2565b612405908a6154bc565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a0823190612440903090600401614e39565b602060405180830381865afa15801561245d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124819190615475565b61248b90846154bc565b61249591906153b2565b61249f91906153b2565b6124a990896154bc565b9750505050505050509250929050565b6001600160a01b03831661251d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610824565b6001600160a01b03821661257f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610824565b6001600160a01b038316600090815260336020526040902054818110156125f75760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610824565b61260182826153b2565b6001600160a01b0380861660009081526033602052604080822093909355908516815290812080548492906126379084906154bc565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615cc68339815191528460405161267191815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b820460e890811b6034830152600160b81b90920490911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a0823190612713903090600401614e39565b602060405180830381865afa158015612730573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127549190615475565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061278a903090600401614e39565b602060405180830381865afa1580156127a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cb9190615475565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a79060640160408051808303816000875af1158015612830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128549190615599565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a40160408051808303816000875af11580156128c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128eb91906156e5565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612921903090600401614e39565b602060405180830381865afa15801561293e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129629190615475565b61296c91906153b2565b61297691906153b2565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a08231906129ab903090600401614e39565b602060405180830381865afa1580156129c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ec9190615475565b6129f691906153b2565b612a0091906153b2565b9250505093509350935093565b612710612a1b600084615718565b612a259190615745565b609b6000828254612a3691906154bc565b909155506127109050612a4a600083615718565b612a549190615745565b609c6000828254612a6591906154bc565b909155505060985461271090612a8690600160201b900461ffff1684615718565b612a909190615745565b60996000828254612aa191906154bc565b909155505060985461271090612ac290600160201b900461ffff1683615718565b612acc9190615745565b609a6000828254612add91906154bc565b90915550505050565b6000806000612710609860049054906101000a900461ffff166000612b0b9190615759565b612b199061ffff1687615718565b612b239190615745565b60985490915060009061271090612b4590600160201b900461ffff1683615759565b612b539061ffff1687615718565b612b5d9190615745565b9050612b6982876153b2565b9350612b7581866153b2565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015612bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bee919061530a565b50505050505090506000612c1b82612c088b60020b613073565b612c148b60020b613073565b8a8a6135c4565b90506001600160801b03811615612cc957609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612c679030908f908f908990600401615557565b60408051808303816000875af1158015612c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ca99190615599565b9092509050612cb8828a6153b2565b9850612cc481896153b2565b975050505b6000612cf86127108686612cdd5789612cdf565b8a5b612ce99190615718565b612cf39190615745565b61460d565b90506000811315612d1557612d128a8a8a8a858b8a614673565b50505b50505050505050505050565b33612d2a610c71565b6001600160a01b031614612d505760405162461bcd60e51b8152600401610824906153c5565b6097546040516000916001600160a01b031690600080516020615ca6833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0390811690841603612dfd57609754849061271090612dc190600160e01b900461ffff1689615718565b612dcb9190615745565b1015612de95760405162461bcd60e51b815260040161082490615774565b612df384876153b2565b9150849050612ea3565b609f546001600160a01b0390811690841603612e6d57609754849061271090612e3190600160e01b900461ffff1688615718565b612e3b9190615745565b1015612e595760405162461bcd60e51b815260040161082490615774565b612e6384866153b2565b9050859150612ea3565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610824565b94509492505050565b6040516001600160a01b038316602482015260448101829052612f0f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261488f565b505050565b80471015612f645760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610824565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612fb1576040519150601f19603f3d011682016040523d82523d6000602084013e612fb6565b606091505b5050905080612f0f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610824565b60006130378484846141b3565b9050600082806130495761304961572f565b848609111561084757600019811061306057600080fd5b8061306a81615796565b95945050505050565b60008060008360020b1261308a578260020b613097565b8260020b613097906157af565b90506130a6620d89e7196157cb565b60020b8111156130dc5760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610824565b6000816001166000036130f357600160801b613105565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561313a576080613135826ffff97272373d413259a46990580e213a615718565b901c90505b600482161561316457608061315f826ffff2e50f5f656932ef12357cf3c7fdcc615718565b901c90505b600882161561318e576080613189826fffe5caca7e10e4e61c3624eaa0941cd0615718565b901c90505b60108216156131b85760806131b3826fffcb9843d60f6159c9db58835c926644615718565b901c90505b60208216156131e25760806131dd826fff973b41fa98c081472e6896dfb254c0615718565b901c90505b604082161561320c576080613207826fff2ea16466c96a3843ec78b326b52861615718565b901c90505b6080821615613236576080613231826ffe5dee046a99a2a811c461f1969c3053615718565b901c90505b61010082161561326157608061325c826ffcbe86c7900a88aedcffc83b479aa3a4615718565b901c90505b61020082161561328c576080613287826ff987a7253ac413176f2b074cf7815e54615718565b901c90505b6104008216156132b75760806132b2826ff3392b0822b70005940c7a398e4b70f3615718565b901c90505b6108008216156132e25760806132dd826fe7159475a2c29b7443b29c7fa6e889d9615718565b901c90505b61100082161561330d576080613308826fd097f3bdfd2022b8845ad8f792aa5825615718565b901c90505b612000821615613338576080613333826fa9f746462d870fdf8a65dc1f90e061e5615718565b901c90505b61400082161561336357608061335e826f70d869a156d2a1b890bb3df62baf32f7615718565b901c90505b61800082161561338e576080613389826f31be135f97d08fd981231505542fcfa6615718565b901c90505b620100008216156133ba5760806133b5826f09aa508b5b7a84e1c677de54f3e99bc9615718565b901c90505b620200008216156133e55760806133e0826e5d6af8dedb81196699c329225ee604615718565b901c90505b6204000082161561340f57608061340a826d2216e584f5fa1ea926041bedfe98615718565b901c90505b62080000821615613437576080613432826b048a170391f7dc42444e8fa2615718565b901c90505b60008460020b13156134525761344f81600019615745565b90505b613460600160201b826157ed565b1561346c57600161346f565b60005b6134809060ff16602083901c6154bc565b949350505050565b6000600160801b82106134ed5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610824565b5090565b600080836001600160a01b0316856001600160a01b03161115613512579293925b846001600160a01b0316866001600160a01b03161161353d57613536858585614961565b9150612ea3565b836001600160a01b0316866001600160a01b0316101561357657613562868585614961565b915061356f8587856149cb565b9050612ea3565b6135818585856149cb565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e2b9085906323b872dd60e01b90608401612ed8565b6000836001600160a01b0316856001600160a01b031611156135e4579293925b846001600160a01b0316866001600160a01b03161161360f57613608858585614a15565b905061306a565b836001600160a01b0316866001600160a01b03161015613671576000613636878686614a15565b90506000613645878986614a7f565b9050806001600160801b0316826001600160801b0316106136665780613668565b815b9250505061306a565b61367c858584614a7f565b9695505050505050565b6001600160a01b0382166136dc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610824565b80603560008282546136ee91906154bc565b90915550506001600160a01b0382166000908152603360205260408120805483929061371b9084906154bc565b90915550506040518181526001600160a01b03831690600090600080516020615cc68339815191529060200160405180910390a35050565b60008060008060006137636106fc565b915091508160001480156137775750600081115b1561378e576137878689836141b3565b925061383d565b8015801561379c5750600082115b156137ac576137878789846141b3565b811580156137b8575080155b156137df5760405162461bcd60e51b81526020600482015260006024820152604401610824565b60006137ec888a856141b3565b905060006137fb888b856141b3565b905060008211801561380d5750600081115b6138295760405162461bcd60e51b815260040161082490615537565b8082106138365780613838565b815b945050505b61384883838a61302a565b945061385583828a61302a565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff16918391506000906138a0576138a0615801565b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106138cf576138cf615801565b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613915908590600401615817565b600060405180830381865afa158015613932573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261395a919081019061590a565b509050805160021461399a5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610824565b6098548151600091829163ffffffff90911660060b90849083906139c0576139c0615801565b6020026020010151846001815181106139db576139db615801565b60200260200101510360060b816139f4576139f461572f565b059050613a038160020b613073565b6097549092506000915061271090613a2690600160f01b900461ffff16846159cc565b613a3091906159fe565b90508415613a7857613a428183615a24565b6001600160a01b0316866001600160a01b03161015613a735760405162461bcd60e51b815260040161082490615a44565b613ab3565b613a828183615a6b565b6001600160a01b0316866001600160a01b03161115613ab35760405162461bcd60e51b815260040161082490615a44565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613af4903090600401614e39565b602060405180830381865afa158015613b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b359190615475565b613b3f91906153b2565b613b4991906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613b85903090600401614e39565b602060405180830381865afa158015613ba2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bc69190615475565b613bd091906153b2565b613bda91906153b2565b6097549091506000908190613c0590600160a01b8104600290810b91600160b81b9004900b8c6126da565b935093505050613c158282612a0d565b613c1f8282612ae6565b6040519193509150600080516020615ce683398151915290613c449084908490614e4d565b60405180910390a1613c5684836154bc565b9150613c6283826154bc565b609e549091506001600160a01b0390811690861603613def57609754869061271090613c9990600160d01b900461ffff1685615718565b613ca39190615745565b1015613cc15760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613cf9903090600401614e39565b602060405180830381865afa158015613d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d3a9190615475565b613d4491906153b2565b613d4e91906153b2565b613d5891906153b2565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613d93903090600401614e39565b602060405180830381865afa158015613db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dd49190615475565b613dde91906153b2565b613de891906153b2565b9250613f5c565b609f546001600160a01b0390811690861603612e6d57609754869061271090613e2390600160d01b900461ffff1684615718565b613e2d9190615745565b1015613e4b5760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a0823190613e81903090600401614e39565b602060405180830381865afa158015613e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ec29190615475565b613ecc91906153b2565b613ed691906153b2565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a0823190613f11903090600401614e39565b602060405180830381865afa158015613f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f529190615475565b613dd491906153b2565b609754612d1590600160a01b8104600290810b91600160b81b9004900b86868d8d8d612b80565b600054610100900460ff1680613f9c575060005460ff16155b613fb85760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015613fda576000805461ffff19166101011790555b613fe2614ab5565b613fec8383614b1f565b8015612f0f576000805461ff0019169055505050565b600054610100900460ff168061401b575060005460ff16155b6140375760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614059576000805461ffff19166101011790555b614061614ba6565b8015614073576000805461ff00191690555b50565b6001600160a01b0382166140d65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610824565b6001600160a01b0382166000908152603360205260409020548181101561414a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610824565b61415482826153b2565b6001600160a01b038416600090815260336020526040812091909155603580548492906141829084906153b2565b90915550506040518281526000906001600160a01b03851690600080516020615cc68339815191529060200161222c565b60008080600019858709858702925082811083820303915050806000036141ec57600084116141e157600080fd5b508290049050610847565b8084116141f857600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600080871561440157609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b8152600401602060405180830381865afa1580156142c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142e49190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161432491600160a01b90910460020b90600401614f3e565b61010060405180830381865afa158015614342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143669190615a8b565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba9395506143af94600160b81b90910460020b93506004019150614f3e9050565b61010060405180830381865afa1580156143cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143f19190615a8b565b5093975061458f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b8152600401602060405180830381865afa158015614454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144789190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916144b891600160a01b90910460020b90600401614f3e565b61010060405180830381865afa1580156144d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144fa9190615a8b565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506145429450600160b81b900460020b926004019150614f3e9050565b61010060405180830381865afa158015614560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145849190615a8b565b509297505050505050505b609754600090600160a01b9004600290810b9088900b126145b15750826145b6565b508281035b609754600090600160b81b9004600290810b9089900b12156145d95750826145de565b508282035b8183038190036145fe6001600160801b0389168b8303600160801b6141b3565b9b9a5050505050505050505050565b6000600160ff1b82106134ed5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610824565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c40160408051808303816000875af11580156146e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061470c9190615599565b915091508161471a8a61460d565b6147249190615b27565b9350806147308961460d565b61473a9190615b27565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015614791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b5919061530a565b505050505050905060006147e2826147cf8f60020b613073565b6147db8f60020b613073565b89896135c4565b90506001600160801b0381161561487f57609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b815260040161483a9493929190615557565b60408051808303816000875af1158015614858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061487c9190615599565b50505b5050505097509795505050505050565b60006148e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c169092919063ffffffff16565b805190915015612f0f57808060200190518101906149029190615b47565b612f0f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610824565b6000826001600160a01b0316846001600160a01b03161115614981579192915b6001600160a01b0384166149c1600160601b600160e01b03606085901b166149a98787615a24565b6001600160a01b0316866001600160a01b03166141b3565b6134809190615745565b6000826001600160a01b0316846001600160a01b031611156149eb579192915b6134806001600160801b038316614a028686615a24565b6001600160a01b0316600160601b6141b3565b6000826001600160a01b0316846001600160a01b03161115614a35579192915b6000614a58856001600160a01b0316856001600160a01b0316600160601b6141b3565b905061306a614a7a8483614a6c8989615a24565b6001600160a01b03166141b3565b614c25565b6000826001600160a01b0316846001600160a01b03161115614a9f579192915b613480614a7a83600160601b614a6c8888615a24565b600054610100900460ff1680614ace575060005460ff16155b614aea5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614061576000805461ffff19166101011790558015614073576000805461ff001916905550565b600054610100900460ff1680614b38575060005460ff16155b614b545760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614b76576000805461ffff19166101011790555b6036614b828482615baa565b506037614b8f8382615baa565b508015612f0f576000805461ff0019169055505050565b600054610100900460ff1680614bbf575060005460ff16155b614bdb5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614bfd576000805461ffff19166101011790555b60016065558015614073576000805461ff001916905550565b60606134808484600085614c40565b806001600160801b0381168114614c3b57600080fd5b919050565b606082471015614ca15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610824565b843b614cef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610824565b600080866001600160a01b03168587604051614d0b9190615c69565b60006040518083038185875af1925050503d8060008114614d48576040519150601f19603f3d011682016040523d82523d6000602084013e614d4d565b606091505b5091509150614d5d828286614d68565b979650505050505050565b60608315614d77575081610847565b825115614d875782518084602001fd5b8160405162461bcd60e51b81526004016108249190614dc5565b60005b83811015614dbc578181015183820152602001614da4565b50506000910152565b6020815260008251806020840152614de4816040850160208701614da1565b601f01601f19169190910160400192915050565b6001600160a01b038116811461407357600080fd5b60008060408385031215614e2057600080fd5b8235614e2b81614df8565b946020939093013593505050565b6001600160a01b0391909116815260200190565b918252602082015260400190565b600080600060608486031215614e7057600080fd5b8335614e7b81614df8565b92506020840135614e8b81614df8565b929592945050506040919091013590565b8060020b811461407357600080fd5b801515811461407357600080fd5b600080600080600060a08688031215614ed157600080fd5b8535614edc81614e9c565b94506020860135614eec81614e9c565b93506040860135614efc81614df8565b9250606086013591506080860135614f1381614eab565b809150509295509295909350565b600060208284031215614f3357600080fd5b813561084781614df8565b60029190910b815260200190565b60008060408385031215614f5f57600080fd5b823591506020830135614f7181614df8565b809150509250929050565b60008060408385031215614f8f57600080fd5b50508035926020909101359150565b61ffff8116811461407357600080fd5b63ffffffff8116811461407357600080fd5b600080600080600060a08688031215614fd857600080fd5b8535614fe381614f9e565b94506020860135614ff381614f9e565b9350604086013561500381614f9e565b9250606086013561501381614fae565b91506080860135614f1381614df8565b600080600080600060a0868803121561503b57600080fd5b853561504681614df8565b945060208601359350604086013561505d81614eab565b9250606086013591506080860135614f1381614df8565b60008083601f84011261508657600080fd5b5081356001600160401b0381111561509d57600080fd5b6020830191508360208285010111156150b557600080fd5b9250929050565b600080600080606085870312156150d257600080fd5b843593506020850135925060408501356001600160401b038111156150f657600080fd5b61510287828801615074565b95989497509550505050565b6000806040838503121561512157600080fd5b823561512c81614df8565b91506020830135614f7181614df8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561517a5761517a61513c565b604052919050565b600082601f83011261519357600080fd5b81356001600160401b038111156151ac576151ac61513c565b6151bf601f8201601f1916602001615152565b8181528460208386010111156151d457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060e0888a03121561520c57600080fd5b87356001600160401b038082111561522357600080fd5b61522f8b838c01615182565b985060208a013591508082111561524557600080fd5b506152528a828b01615182565b965050604088013561526381614df8565b9450606088013561527381614f9e565b9350608088013561528381614e9c565b925060a088013561529381614e9c565b915060c08801356152a381614df8565b8091505092959891949750929550565b6000602082840312156152c557600080fd5b813561084781614f9e565b600181811c908216806152e457607f821691505b60208210810361530457634e487b7160e01b600052602260045260246000fd5b50919050565b600080600080600080600060e0888a03121561532557600080fd5b875161533081614df8565b602089015190975061534181614e9c565b604089015190965061535281614f9e565b606089015190955061536381614f9e565b608089015190945061537481614f9e565b60a089015190935060ff8116811461538b57600080fd5b60c08901519092506152a381614eab565b634e487b7160e01b600052601160045260246000fd5b818103818111156106f6576106f661539c565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b80516001600160801b0381168114614c3b57600080fd5b600080600080600060a0868803121561543657600080fd5b61543f86615407565b9450602086015193506040860151925061545b60608701615407565b915061546960808701615407565b90509295509295909350565b60006020828403121561548757600080fd5b5051919050565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b808201808211156106f6576106f661539c565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b600080604083850312156155ac57600080fd5b505080516020909101519092909150565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b60208082526003908201526242505360e81b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b61ffff8281168282160390808211156156a3576156a361539c565b5092915050565b6020808252600490820152636d42505360e01b604082015260600190565b6000602082840312156156da57600080fd5b815161084781614df8565b600080604083850312156156f857600080fd5b61570183615407565b915061570f60208401615407565b90509250929050565b80820281158282048414176106f6576106f661539c565b634e487b7160e01b600052601260045260246000fd5b6000826157545761575461572f565b500490565b61ffff8181168382160190808211156156a3576156a361539c565b602080825260089082015267686967682066656560c01b604082015260600190565b6000600182016157a8576157a861539c565b5060010190565b6000600160ff1b82016157c4576157c461539c565b5060000390565b60008160020b627fffff1981036157e4576157e461539c565b60000392915050565b6000826157fc576157fc61572f565b500690565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561585557835163ffffffff1683529284019291840191600101615833565b50909695505050505050565b60006001600160401b0382111561587a5761587a61513c565b5060051b60200190565b8051600681900b8114614c3b57600080fd5b600082601f8301126158a757600080fd5b815160206158bc6158b783615861565b615152565b82815260059290921b840181019181810190868411156158db57600080fd5b8286015b848110156158ff5780516158f281614df8565b83529183019183016158df565b509695505050505050565b6000806040838503121561591d57600080fd5b82516001600160401b038082111561593457600080fd5b818501915085601f83011261594857600080fd5b815160206159586158b783615861565b82815260059290921b8401810191818101908984111561597757600080fd5b948201945b8386101561599c5761598d86615884565b8252948201949082019061597c565b918801519196509093505050808211156159b557600080fd5b506159c285828601615896565b9150509250929050565b6001600160a01b038281168282168181028316929181158285048214176159f5576159f561539c565b50505092915050565b60006001600160a01b0383811680615a1857615a1861572f565b92169190910492915050565b6001600160a01b038281168282160390808211156156a3576156a361539c565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b6001600160a01b038181168382160190808211156156a3576156a361539c565b600080600080600080600080610100898b031215615aa857600080fd5b615ab189615407565b9750602089015180600f0b8114615ac757600080fd5b60408a015160608b015191985096509450615ae460808a01615884565b935060a0890151615af481614df8565b60c08a0151909350615b0581614fae565b60e08a0151909250615b1681614eab565b809150509295985092959890939650565b81810360008312801583831316838312821617156156a3576156a361539c565b600060208284031215615b5957600080fd5b815161084781614eab565b601f821115612f0f57600081815260208120601f850160051c81016020861015615b8b5750805b601f850160051c820191505b81811015613ab357828155600101615b97565b81516001600160401b03811115615bc357615bc361513c565b615bd781615bd184546152d0565b84615b64565b602080601f831160018114615c0c5760008415615bf45750858301515b600019600386901b1c1916600185901b178555613ab3565b600085815260208120601f198616915b82811015615c3b57888601518255948401946001909101908401615c1c565b5085821015615c595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251615c7b818460208701614da1565b919091019291505056fec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a2646970667358221220a11bde499516b0a2e8e737821292815fcefc66549a9729f24ea128d34ed6027364736f6c63430008130033", - "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": "See {IERC20-allowance}." - }, - "approve(address,uint256)": { - "details": "See {IERC20-approve}. Requirements: - `spender` cannot be the zero address." - }, - "balanceOf(address)": { - "details": "See {IERC20-balanceOf}." - }, - "burn(uint256,address)": { - "params": { - "burnAmount": "The number of G-UNI tokens to burn", - "receiver": "The account to receive the underlying amounts of token0 and token1" - }, - "returns": { - "amount0": "amount of token0 transferred to receiver for burning `burnAmount`", - "amount1": "amount of token1 transferred to receiver for burning `burnAmount`", - "liquidityBurned": "amount of liquidity removed from the underlying Uniswap V3 position" - } - }, - "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 this function is overridden; 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`." - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "details": "When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.", - "params": { - "newLowerTick": "The new lower bound of the position's range", - "newUpperTick": "The new upper bound of the position's range", - "swapAmountBPS": "amount of token to swap as proportion of total. Pass 0 to ignore swap.", - "swapThresholdPrice": "slippage parameter on the swap as a max or min sqrtPriceX96", - "zeroForOne": "Which token to input into the swap (true = token0, false = token1)" - } - }, - "getMintAmounts(uint256,uint256)": { - "params": { - "amount0Max": "The maximum amount of token1 to forward on mint" - }, - "returns": { - "amount0": "actual amount of token0 to forward when minting `mintAmount`", - "amount1": "actual amount of token1 to forward when minting `mintAmount`", - "mintAmount": "maximum number of G-UNI tokens to mint" - } - }, - "getUnderlyingBalances()": { - "returns": { - "amount0Current": "current total underlying balance of token0", - "amount1Current": "current total underlying balance of token1" - } - }, - "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." - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "params": { - "_lowerTick": "initial upperTick (only changeable with executiveRebalance)", - "_managerFeeBPS": "proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION", - "_manager_": "address of manager (ownership can be transferred)", - "_name": "name of G-UNI token", - "_pool": "address of Uniswap V3 pool", - "_symbol": "symbol of G-UNI token" - } - }, - "initializeManagerFee(uint16)": { - "params": { - "_managerFeeBPS": "proportion of fees earned that are credited to manager in Basis Points" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "mint(uint256,address)": { - "details": "to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts", - "params": { - "mintAmount": "The number of G-UNI tokens to mint", - "receiver": "The account to receive the minted tokens" - }, - "returns": { - "amount0": "amount of token0 transferred from msg.sender to mint `mintAmount`", - "amount1": "amount of token1 transferred from msg.sender to mint `mintAmount`", - "liquidityMinted": "amount of liquidity added to the underlying Uniswap V3 position" - } - }, - "name()": { - "details": "Returns the name of the token." - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "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 manager." - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "params": { - "newRebalanceBPS": "controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance", - "newSlippageBPS": "maximum slippage on swaps during gelato rebalance", - "newSlippageInterval": "length of time for TWAP used in computing slippage on swaps", - "newTreasury": "address where managerFee withdrawals are sent", - "newWithdrawBPS": "controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "burn(uint256,address)": { - "notice": "burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens" - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "notice": "Change the range of underlying UniswapV3 position, only manager can call" - }, - "getMintAmounts(uint256,uint256)": { - "notice": "compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`" - }, - "getUnderlyingBalances()": { - "notice": "compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)" - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "notice": "initialize storage variables on a new G-UNI pool, only called once" - }, - "initializeManagerFee(uint16)": { - "notice": "initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again." - }, - "mint(uint256,address)": { - "notice": "mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position" - }, - "rebalance(uint160,uint256,bool,uint256,address)": { - "notice": "Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager." - }, - "uniswapV3MintCallback(uint256,uint256,bytes)": { - "notice": "Uniswap V3 callback fn, called back on pool.mint" - }, - "uniswapV3SwapCallback(int256,int256,bytes)": { - "notice": "Uniswap v3 callback fn, called back on pool.swap" - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "notice": "change configurable parameters, only manager can call" - }, - "withdrawGelatoBalance(uint256,address)": { - "notice": "withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - }, - "withdrawManagerBalance(uint256,address)": { - "notice": "withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 5, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 784, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage" - }, - { - "astId": 122, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_balances", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 128, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_allowances", - "offset": 0, - "slot": "52", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 130, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_totalSupply", - "offset": 0, - "slot": "53", - "type": "t_uint256" - }, - { - "astId": 132, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_name", - "offset": 0, - "slot": "54", - "type": "t_string_storage" - }, - { - "astId": 134, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_symbol", - "offset": 0, - "slot": "55", - "type": "t_string_storage" - }, - { - "astId": 636, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "56", - "type": "t_array(t_uint256)45_storage" - }, - { - "astId": 59, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_status", - "offset": 0, - "slot": "101", - "type": "t_uint256" - }, - { - "astId": 102, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "102", - "type": "t_array(t_uint256)49_storage" - }, - { - "astId": 6441, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_manager", - "offset": 0, - "slot": "151", - "type": "t_address" - }, - { - "astId": 6031, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "lowerTick", - "offset": 20, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6033, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "upperTick", - "offset": 23, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6035, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoRebalanceBPS", - "offset": 26, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6037, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoWithdrawBPS", - "offset": 28, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6039, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageBPS", - "offset": 30, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6041, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageInterval", - "offset": 0, - "slot": "152", - "type": "t_uint32" - }, - { - "astId": 6043, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerFeeBPS", - "offset": 4, - "slot": "152", - "type": "t_uint16" - }, - { - "astId": 6045, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerTreasury", - "offset": 6, - "slot": "152", - "type": "t_address" - }, - { - "astId": 6047, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance0", - "offset": 0, - "slot": "153", - "type": "t_uint256" - }, - { - "astId": 6049, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance1", - "offset": 0, - "slot": "154", - "type": "t_uint256" - }, - { - "astId": 6051, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance0", - "offset": 0, - "slot": "155", - "type": "t_uint256" - }, - { - "astId": 6053, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance1", - "offset": 0, - "slot": "156", - "type": "t_uint256" - }, - { - "astId": 6056, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "pool", - "offset": 0, - "slot": "157", - "type": "t_contract(IUniswapV3Pool)2339" - }, - { - "astId": 6059, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token0", - "offset": 0, - "slot": "158", - "type": "t_contract(IERC20)863" - }, - { - "astId": 6062, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token1", - "offset": 0, - "slot": "159", - "type": "t_contract(IERC20)863" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)45_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)49_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "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)863": { - "encoding": "inplace", - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_contract(IUniswapV3Pool)2339": { - "encoding": "inplace", - "label": "contract IUniswapV3Pool", - "numberOfBytes": "20" - }, - "t_int24": { - "encoding": "inplace", - "label": "int24", - "numberOfBytes": "3" - }, - "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_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/blastSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json b/lib/g-uni-v1-core/deployments/blastSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json deleted file mode 100644 index 371127af2..000000000 --- a/lib/g-uni-v1-core/deployments/blastSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\n/// @dev Modified to support 0.8.19\n/// @dev Modified to set the gelatoFeeBPS to 0\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 0;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n event SetManagerFee(uint16 managerFee);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n emit SetManagerFee(_managerFeeBPS);\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidityBefore,\n uint128 liquidityAfter\n );\n\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n SafeCast.toUint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidityBurned);\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n\n amount0 =\n burn0 +\n FullMath.mulDiv(\n token0.balanceOf(address(this)) -\n burn0 -\n managerBalance0 -\n gelatoBalance0,\n burnAmount,\n totalSupply\n );\n amount1 =\n burn1 +\n FullMath.mulDiv(\n token1.balanceOf(address(this)) -\n burn1 -\n managerBalance1 -\n gelatoBalance1,\n burnAmount,\n totalSupply\n );\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n // solhint-disable-next-line function-max-lines\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n uint128 liquidity;\n uint128 newLiquidity;\n if (totalSupply() > 0) {\n (liquidity, , , , ) = pool.positions(_getPositionID());\n if (liquidity > 0) {\n (, , uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n }\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > 0, \"new position 0\");\n } else {\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n }\n\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n _rebalance(\n liquidity,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > liquidity, \"liquidity must increase\");\n\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\n external\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n // solhint-disable-next-line function-max-lines\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\n internal\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint128 liquidity,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n uint256 leftover0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 leftover1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n (, , uint256 feesEarned0, uint256 feesEarned1) =\n _withdraw(lowerTick, upperTick, liquidity);\n _applyFees(feesEarned0, feesEarned1);\n (feesEarned0, feesEarned1) = _subtractAdminFees(\n feesEarned0,\n feesEarned1\n );\n emit FeesEarned(feesEarned0, feesEarned1);\n feesEarned0 += leftover0;\n feesEarned1 += leftover1;\n\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n leftover0,\n leftover1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdraw(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n )\n private\n returns (\n uint256 burn0,\n uint256 burn1,\n uint256 fee0,\n uint256 fee1\n )\n {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n SafeCast.toInt256(\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\n );\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array len\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"high slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"high slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\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 require(value < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return uint128(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 require(value < 2**64, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return uint64(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 require(value < 2**32, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return uint32(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 require(value < 2**16, \"SafeCast: value doesn\\'t fit in 16 bits\");\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 require(value < 2**8, \"SafeCast: value doesn\\'t fit in 8 bits\");\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 require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= -2**127 && value < 2**127, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return int128(value);\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= -2**63 && value < 2**63, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return int64(value);\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= -2**31 && value < 2**31, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return int32(value);\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= -2**15 && value < 2**15, \"SafeCast: value doesn\\'t fit in 16 bits\");\n return int16(value);\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= -2**7 && value < 2**7, \"SafeCast: value doesn\\'t fit in 8 bits\");\n return int8(value);\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 require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IUniswapV3TickSpacing} from \"./interfaces/IUniswapV3TickSpacing.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n }\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n 0,\n lowerTick,\n upperTick,\n address(0)\n );\n }\n\n function _createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n address manager\n ) internal returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory name = \"Gelato Uniswap LP\";\n try this.getTokenName(token0, token1) returns (string memory result) {\n name = result;\n } catch {} // solhint-disable-line no-empty-blocks\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n require(uniPool != address(0), \"uniswap pool does not exist\");\n require(\n _validateTickSpacing(uniPool, lowerTick, upperTick),\n \"tickSpacing mismatch\"\n );\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n manager\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, manager, pool);\n }\n\n function _validateTickSpacing(\n address uniPool,\n int24 lowerTick,\n int24 upperTick\n ) internal view returns (bool) {\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\n return\n lowerTick < upperTick &&\n lowerTick % spacing == 0 &&\n upperTick % spacing == 0;\n }\n\n function getTokenName(address token0, address token1)\n external\n view\n returns (string memory)\n {\n string memory symbol0 = IERC20Metadata(token0).symbol();\n string memory symbol1 = IERC20Metadata(token1).symbol();\n\n return _append(\"Gelato Uniswap \", symbol0, \"/\", symbol1, \" LP\");\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IUniswapV3TickSpacing.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IUniswapV3TickSpacing {\n function tickSpacing() external view returns (int24);\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "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/lib/g-uni-v1-core/deployments/goerli/.chainId b/lib/g-uni-v1-core/deployments/goerli/.chainId deleted file mode 100644 index 7813681f5..000000000 --- a/lib/g-uni-v1-core/deployments/goerli/.chainId +++ /dev/null @@ -1 +0,0 @@ -5 \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/goerli/GUniFactory_Implementation.json b/lib/g-uni-v1-core/deployments/goerli/GUniFactory_Implementation.json deleted file mode 100644 index 4a4ee49c7..000000000 --- a/lib/g-uni-v1-core/deployments/goerli/GUniFactory_Implementation.json +++ /dev/null @@ -1,746 +0,0 @@ -{ - "address": "0x40637e26ACA023289ACca7737b99A395f4679B19", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_uniswapV3Factory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x3d5d85d7e3a5e5c82166c7f093a3186842e6705c2a9901c2f336591f8ad4f3d0", - "receipt": { - "to": null, - "from": "0x4B5BaD436CcA8df3bD39A095b84991fAc9A226F1", - "contractAddress": "0x40637e26ACA023289ACca7737b99A395f4679B19", - "transactionIndex": 3, - "gasUsed": "2104936", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x1015b2b34887954837c91c35cb1843dd1740c362277cf52cbd1b4b46d117479e", - "transactionHash": "0x3d5d85d7e3a5e5c82166c7f093a3186842e6705c2a9901c2f336591f8ad4f3d0", - "logs": [], - "blockNumber": 5498501, - "cumulativeGasUsed": "2339986", - "status": 1, - "byzantium": true - }, - "args": ["0x1F98431c8aD98523631AE4a59f267346ea31F984"], - "solcInputHash": "869261aeb304b707d80e5edda679e3aa", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_uniswapV3Factory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"uniPool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previosGelatoDeployer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newGelatoDeployer\",\"type\":\"address\"}],\"name\":\"UpdateGelatoDeployer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"UpdatePoolImplementation\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDeployers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGelatoPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"getTokenName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gelatoDeployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isPoolImmutable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"makePoolsImmutable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numDeployers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextGelatoDeployer\",\"type\":\"address\"}],\"name\":\"setGelatoDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextImplementation\",\"type\":\"address\"}],\"name\":\"setPoolImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"upgradePools\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"bytes[]\",\"name\":\"datas\",\"type\":\"bytes[]\"}],\"name\":\"upgradePoolsAndCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"createPool(address,address,uint24,uint16,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"managerFee\":\"proportion of earned fees that go to pool manager in Basis Points\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"getDeployers()\":{\"returns\":{\"_0\":\"deployers the list of deployer addresses\"}},\"getGelatoPools()\":{\"returns\":{\"_0\":\"list of Gelato managed G-UNI pool addresses\"}},\"getPools(address)\":{\"params\":{\"deployer\":\"address that has potentially deployed G-UNI pools (can return empty array)\"},\"returns\":{\"_0\":\"pools the list of G-UNI pool addresses deployed by `deployer`\"}},\"getProxyAdmin(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"address that controls the G-UNI implementation (has power to upgrade it)\"}},\"isPoolImmutable(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"bool signaling if pool is immutable (true) or not (false)\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"numDeployers()\":{\"returns\":{\"_0\":\"total number of G-UNI pool deployer addresses\"}},\"numPools()\":{\"returns\":{\"result\":\"total number of G-UNI pools deployed\"}},\"numPools(address)\":{\"params\":{\"deployer\":\"deployer address\"},\"returns\":{\"_0\":\"total number of G-UNI pools deployed by `deployer`\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"createPool(address,address,uint24,uint16,int24,int24)\":{\"notice\":\"createPool creates a new instance of a G-UNI token on a specified UniswapV3 pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`\"},\"getDeployers()\":{\"notice\":\"getDeployers fetches all addresses that have deployed a G-UNI pool\"},\"getGelatoPools()\":{\"notice\":\"getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)\"},\"getPools(address)\":{\"notice\":\"getPools fetches all the G-UNI pool addresses deployed by `deployer`\"},\"getProxyAdmin(address)\":{\"notice\":\"getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address).\"},\"isPoolImmutable(address)\":{\"notice\":\"isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\"},\"numDeployers()\":{\"notice\":\"numDeployers counts the total number of G-UNI pool deployer addresses\"},\"numPools()\":{\"notice\":\"numPools counts the total number of G-UNI pools in existence\"},\"numPools(address)\":{\"notice\":\"numPools counts the total number of G-UNI pools deployed by `deployer`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniFactory.sol\":\"GUniFactory\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\\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\":\"0x4878ef6c288f4cef3c2a288d32cc548c648831cc55503ad3d9a581ed3b93aad9\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title The interface for the Uniswap V3 Factory\\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\\ninterface IUniswapV3Factory {\\n /// @notice Emitted when the owner of the factory is changed\\n /// @param oldOwner The owner before the owner was changed\\n /// @param newOwner The owner after the owner was changed\\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\\n\\n /// @notice Emitted when a pool is created\\n /// @param token0 The first token of the pool by address sort order\\n /// @param token1 The second token of the pool by address sort order\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks\\n /// @param pool The address of the created pool\\n event PoolCreated(\\n address indexed token0,\\n address indexed token1,\\n uint24 indexed fee,\\n int24 tickSpacing,\\n address pool\\n );\\n\\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\\n /// @param fee The enabled fee, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\\n\\n /// @notice Returns the current owner of the factory\\n /// @dev Can be changed by the current owner via setOwner\\n /// @return The address of the factory owner\\n function owner() external view returns (address);\\n\\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\\n /// @return The tick spacing\\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\\n\\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\\n /// @param tokenA The contract address of either token0 or token1\\n /// @param tokenB The contract address of the other token\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @return pool The pool address\\n function getPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external view returns (address pool);\\n\\n /// @notice Creates a pool for the given two tokens and fee\\n /// @param tokenA One of the two tokens in the desired pool\\n /// @param tokenB The other of the two tokens in the desired pool\\n /// @param fee The desired fee for the pool\\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\\n /// are invalid.\\n /// @return pool The address of the newly created pool\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external returns (address pool);\\n\\n /// @notice Updates the owner of the factory\\n /// @dev Must be called by the current owner\\n /// @param _owner The new owner of the factory\\n function setOwner(address _owner) external;\\n\\n /// @notice Enables a fee amount with the given tickSpacing\\n /// @dev Fee amounts may never be removed once enabled\\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\\n}\\n\",\"keccak256\":\"0xcc3d0c93fc9ac0febbe09f941b465b57f750bcf3b48432da0b97dc289cfdc489\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\nimport {\\n IUniswapV3Factory\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\\\";\\nimport {IGUniFactory} from \\\"./interfaces/IGUniFactory.sol\\\";\\nimport {IGUniPoolStorage} from \\\"./interfaces/IGUniPoolStorage.sol\\\";\\nimport {GUniFactoryStorage} from \\\"./abstract/GUniFactoryStorage.sol\\\";\\nimport {EIP173Proxy} from \\\"./vendor/proxy/EIP173Proxy.sol\\\";\\nimport {IEIP173Proxy} from \\\"./interfaces/IEIP173Proxy.sol\\\";\\nimport {\\n IERC20Metadata\\n} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n constructor(address _uniswapV3Factory)\\n GUniFactoryStorage(_uniswapV3Factory)\\n {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice createPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3 pool. The msg.sender is the initial manager of the pool and will\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n // solhint-disable-next-line function-max-lines\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\\n\\n pool = address(new EIP173Proxy(poolImplementation, address(this), \\\"\\\"));\\n\\n string memory name = \\\"Gelato Uniswap LP\\\";\\n try this.getTokenName(token0, token1) returns (string memory result) {\\n name = result;\\n } catch {} // solhint-disable-line no-empty-blocks\\n\\n address uniPool =\\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\\n\\n require(uniPool != address(0), \\\"uniswap pool does not exist\\\");\\n\\n IGUniPoolStorage(pool).initialize(\\n name,\\n \\\"G-UNI\\\",\\n uniPool,\\n managerFee,\\n lowerTick,\\n upperTick,\\n msg.sender\\n );\\n _deployers.add(msg.sender);\\n _pools[msg.sender].add(pool);\\n emit PoolCreated(uniPool, msg.sender, pool);\\n }\\n\\n function getTokenName(address token0, address token1)\\n external\\n view\\n returns (string memory)\\n {\\n string memory symbol0 = IERC20Metadata(token0).symbol();\\n string memory symbol1 = IERC20Metadata(token1).symbol();\\n\\n return _append(\\\"Gelato Uniswap \\\", symbol0, \\\"/\\\", symbol1, \\\" LP\\\");\\n }\\n\\n function upgradePools(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\\n }\\n }\\n\\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\\n external\\n onlyManager\\n {\\n require(pools.length == datas.length, \\\"mismatching array length\\\");\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeToAndCall(\\n poolImplementation,\\n datas[i]\\n );\\n }\\n }\\n\\n function makePoolsImmutable(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\\n }\\n }\\n\\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the\\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\\n /// @param pool address of the G-UNI pool\\n /// @return bool signaling if pool is immutable (true) or not (false)\\n function isPoolImmutable(address pool) external view returns (bool) {\\n return address(0) == getProxyAdmin(pool);\\n }\\n\\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\\n /// @return list of Gelato managed G-UNI pool addresses\\n function getGelatoPools() external view returns (address[] memory) {\\n return getPools(gelatoDeployer);\\n }\\n\\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\\n /// @return deployers the list of deployer addresses\\n function getDeployers() public view returns (address[] memory) {\\n uint256 length = numDeployers();\\n address[] memory deployers = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n deployers[i] = _getDeployer(i);\\n }\\n\\n return deployers;\\n }\\n\\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\\n function getPools(address deployer) public view returns (address[] memory) {\\n uint256 length = numPools(deployer);\\n address[] memory pools = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n pools[i] = _getPool(deployer, i);\\n }\\n\\n return pools;\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools in existence\\n /// @return result total number of G-UNI pools deployed\\n function numPools() public view returns (uint256 result) {\\n address[] memory deployers = getDeployers();\\n for (uint256 i = 0; i < deployers.length; i++) {\\n result += numPools(deployers[i]);\\n }\\n }\\n\\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\\n /// @return total number of G-UNI pool deployer addresses\\n function numDeployers() public view returns (uint256) {\\n return _deployers.length();\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\\n /// @param deployer deployer address\\n /// @return total number of G-UNI pools deployed by `deployer`\\n function numPools(address deployer) public view returns (uint256) {\\n return _pools[deployer].length();\\n }\\n\\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\\n /// no longer upgradable (no one owns the zero address).\\n /// @param pool address of the G-UNI pool\\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\\n function getProxyAdmin(address pool) public view returns (address) {\\n return IEIP173Proxy(pool).proxyAdmin();\\n }\\n\\n function _getDeployer(uint256 index) internal view returns (address) {\\n return _deployers.at(index);\\n }\\n\\n function _getPool(address deployer, uint256 index)\\n internal\\n view\\n returns (address)\\n {\\n return _pools[deployer].at(index);\\n }\\n\\n function _getTokenOrder(address tokenA, address tokenB)\\n internal\\n pure\\n returns (address token0, address token1)\\n {\\n require(tokenA != tokenB, \\\"same token\\\");\\n (token0, token1) = tokenA < tokenB\\n ? (tokenA, tokenB)\\n : (tokenB, tokenA);\\n require(token0 != address(0), \\\"no address zero\\\");\\n }\\n\\n function _append(\\n string memory a,\\n string memory b,\\n string memory c,\\n string memory d,\\n string memory e\\n ) internal pure returns (string memory) {\\n return string(abi.encodePacked(a, b, c, d, e));\\n }\\n}\\n\",\"keccak256\":\"0xe16e2c76e649e8c6118402a49852222473e50177412c44707e07eee12262b481\",\"license\":\"MIT\"},\"contracts/abstract/GUniFactoryStorage.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n Initializable\\n} from \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\n// solhint-disable-next-line max-states-count\\ncontract GUniFactoryStorage is\\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\\n Initializable\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n address public immutable factory;\\n address public poolImplementation;\\n address public gelatoDeployer;\\n EnumerableSet.AddressSet internal _deployers;\\n mapping(address => EnumerableSet.AddressSet) internal _pools;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdatePoolImplementation(\\n address previousImplementation,\\n address newImplementation\\n );\\n\\n event UpdateGelatoDeployer(\\n address previosGelatoDeployer,\\n address newGelatoDeployer\\n );\\n\\n constructor(address _uniswapV3Factory) {\\n factory = _uniswapV3Factory;\\n }\\n\\n function initialize(\\n address _implementation,\\n address _gelatoDeployer,\\n address _manager_\\n ) external initializer {\\n poolImplementation = _implementation;\\n gelatoDeployer = _gelatoDeployer;\\n _manager = _manager_;\\n }\\n\\n function setPoolImplementation(address nextImplementation)\\n external\\n onlyManager\\n {\\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\\n poolImplementation = nextImplementation;\\n }\\n\\n function setGelatoDeployer(address nextGelatoDeployer)\\n external\\n onlyManager\\n {\\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\\n gelatoDeployer = nextGelatoDeployer;\\n }\\n}\\n\",\"keccak256\":\"0x81b65c0b1c660c0935d6c40310b19e62df7fdd7c0af94915afcc600bdb647fb0\",\"license\":\"MIT\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.4;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x81d888640e2261ac5189e6061a0cf4a7f3cec5994be1859ba60ffeb961f70c01\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IEIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\ninterface IEIP173Proxy {\\n function proxyAdmin() external view returns (address);\\n\\n function transferProxyAdmin(address newAdmin) external;\\n\\n function upgradeTo(address newImplementation) external;\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable;\\n}\\n\",\"keccak256\":\"0x3ff5ed428adeaaa9ba05a91b4ccec7df22cd5de80a53a7bff109543bdebe1a68\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IGUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\ninterface IGUniFactory {\\n event PoolCreated(\\n address indexed uniPool,\\n address indexed manager,\\n address indexed pool\\n );\\n\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n}\\n\",\"keccak256\":\"0xd3a394c8b7a3961b2c0420b846dbaa35739f28be9ea300bbf084d62c23a92e03\",\"license\":\"MIT\"},\"contracts/interfaces/IGUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\ninterface IGUniPoolStorage {\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external;\\n}\\n\",\"keccak256\":\"0x39f4bc4e8684c9674e1967a3ac4ea5531f45492266586c4e6e9eb2f6d9108ced\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x4ad41656a53bc38d766197d9974be4be70f506b1d1f78def2c3726e8d580a3f5\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x00dbb59cf486ff9a2930fb588ef70d761dbf439aa05d48ef0001a0448769ec11\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b506040516125c23803806125c283398101604081905261002f91610044565b60601b6001600160601b031916608052610072565b600060208284031215610055578081fd5b81516001600160a01b038116811461006b578182fd5b9392505050565b60805160601c61252b610097600039600081816102ef0152610981015261252b6000f3fe60806040523480156200001157600080fd5b5060043610620001365760003560e01c806308893328146200013b578063098eddb114620001545780630dfc574b1462000171578063260fc2b8146200018857806335c62bc2146200019f57806340aee04114620001a957806342f5de9914620001c0578063481c6a7514620001d7578063483248ca14620001f057806354fd4d501462000207578063562b8103146200023b5780635c39f4671462000254578063607c12b5146200026b578063715018a6146200027557806386238765146200027f57806395d807f11462000293578063bd30dfb914620002bb578063c0c53b8b14620002d2578063c45a015514620002e9578063cefa77991462000311578063d6f748981462000325578063f2fde38b146200033c578063f3b7dead1462000353575b600080fd5b620001526200014c3660046200150b565b6200036a565b005b6200015e62000412565b6040519081526020015b60405180910390f35b6200015262000182366004620016a8565b62000425565b62000152620001993660046200166a565b620005a5565b6200015e6200068b565b62000152620001ba3660046200166a565b62000702565b6200015e620001d13660046200150b565b620007ec565b620001e162000815565b60405162000168919062001880565b620001e162000201366004620015d7565b62000824565b6200022c604051806040016040528060058152602001640312e302e360dc1b81525081565b6040516200016891906200193d565b6200024562000b40565b604051620001689190620018ee565b62000245620002653660046200150b565b62000b55565b6200024562000c2a565b6200015262000cfc565b600254620001e1906001600160a01b031681565b620002aa620002a43660046200150b565b62000d69565b604051901515815260200162000168565b6200022c620002cc36600462001549565b62000d86565b62000152620002e336600462001586565b62000ef5565b620001e17f000000000000000000000000000000000000000000000000000000000000000081565b600154620001e1906001600160a01b031681565b62000152620003363660046200150b565b62000fff565b620001526200034d3660046200150b565b6200109e565b620001e1620003643660046200150b565b62001185565b336200037562000815565b6001600160a01b031614620003a75760405162461bcd60e51b81526004016200039e90620019c7565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c908591620003e8916001600160a01b0390911690849062001894565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000620004206003620011fc565b905090565b336200043062000815565b6001600160a01b031614620004595760405162461bcd60e51b81526004016200039e90620019c7565b82518114620004a65760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b60448201526064016200039e565b60005b83518110156200059f57838181518110620004d457634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052157634e487b7160e01b600052603260045260246000fd5b905060200281019062000535919062001a09565b6040518463ffffffff1660e01b81526004016200055593929190620018ae565b600060405180830381600087803b1580156200057057600080fd5b505af115801562000585573d6000803e3d6000fd5b505050508080620005969062001acd565b915050620004a9565b50505050565b33620005b062000815565b6001600160a01b031614620005d95760405162461bcd60e51b81526004016200039e90620019c7565b60005b815181101562000687578181815181106200060757634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063d919062001880565b600060405180830381600087803b1580156200065857600080fd5b505af11580156200066d573d6000803e3d6000fd5b5050505080806200067e9062001acd565b915050620005dc565b5050565b6000806200069862000c2a565b905060005b8151811015620006fd57620006da828281518110620006cc57634e487b7160e01b600052603260045260246000fd5b6020026020010151620007ec565b620006e6908462001a83565b925080620006f48162001acd565b9150506200069d565b505090565b336200070d62000815565b6001600160a01b031614620007365760405162461bcd60e51b81526004016200039e90620019c7565b60005b815181101562000687578181815181106200076457634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe692620007a29291169060040162001880565b600060405180830381600087803b158015620007bd57600080fd5b505af1158015620007d2573d6000803e3d6000fd5b505050508080620007e39062001acd565b91505062000739565b6001600160a01b03811660009081526005602052604081206200080f90620011fc565b92915050565b6000546001600160a01b031690565b600080600062000835898962001207565b6001546040519294509092506001600160a01b031690309062000858906200144f565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f0801580156200089b573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb990620008ed908690869060040162001894565b60006040518083038186803b1580156200090657600080fd5b505afa9250505080156200093e57506040513d6000823e601f3d908101601f191682016040526200093b919081019062001743565b60015b62000949576200094c565b90505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8a1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee829060640160206040518083038186803b158015620009c657600080fd5b505afa158015620009db573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a0191906200152a565b90506001600160a01b03811662000a595760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b60448201526064016200039e565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e39062000a9190859085908d908d908d90339060040162001952565b600060405180830381600087803b15801562000aac57600080fd5b505af115801562000ac1573d6000803e3d6000fd5b5050505062000adb336003620012d690919063ffffffff16565b5033600090815260056020526040902062000af79086620012d6565b506040516001600160a01b038087169133918416907f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b90600090a4505050509695505050505050565b60025460609062000420906001600160a01b03165b6060600062000b6483620007ec565b90506000816001600160401b0381111562000b8f57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000bb9578160200160208202803683370190505b50905060005b8281101562000c225762000bd48582620012f4565b82828151811062000bf557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101528062000c198162001acd565b91505062000bbf565b509392505050565b6060600062000c3862000412565b90506000816001600160401b0381111562000c6357634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000c8d578160200160208202803683370190505b50905060005b8281101562000cf55762000ca78162001318565b82828151811062000cc857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101528062000cec8162001acd565b91505062000c93565b5092915050565b3362000d0762000815565b6001600160a01b03161462000d305760405162461bcd60e51b81526004016200039e90620019c7565b600080546040516001600160a01b0390911690600080516020620024d6833981519152908390a3600080546001600160a01b0319169055565b600062000d768262001185565b6001600160a01b03161592915050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000dc457600080fd5b505afa15801562000dd9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000e03919081019062001743565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000e4157600080fd5b505afa15801562000e56573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000e80919081019062001743565b905062000eec6040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001327565b95945050505050565b600054600160a81b900460ff168062000f185750600054600160a01b900460ff16155b62000f7d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200039e565b600054600160a81b900460ff1615801562000fa8576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b03199283161790925560028054868416908316179055600080549285169290911691909117905580156200059f576000805460ff60a81b1916905550505050565b336200100a62000815565b6001600160a01b031614620010335760405162461bcd60e51b81526004016200039e90620019c7565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162001074916001600160a01b0390911690849062001894565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b33620010a962000815565b6001600160a01b031614620010d25760405162461bcd60e51b81526004016200039e90620019c7565b6001600160a01b0381166200113b5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b60648201526084016200039e565b600080546040516001600160a01b0380851693921691600080516020620024d683398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b158015620011c157600080fd5b505afa158015620011d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200080f91906200152a565b60006200080f825490565b600080826001600160a01b0316846001600160a01b031614156200125b5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b60448201526064016200039e565b826001600160a01b0316846001600160a01b0316106200127d57828462001280565b83835b90925090506001600160a01b038216620012cf5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b60448201526064016200039e565b9250929050565b6000620012ed836001600160a01b0384166200135e565b9392505050565b6001600160a01b0382166000908152600560205260408120620012ed9083620013b0565b60006200080f600383620013b0565b60608585858585604051602001620013449594939291906200180b565b604051602081830303815290604052905095945050505050565b6000818152600183016020526040812054620013a7575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200080f565b5060006200080f565b6000620012ed838381546000908210620014185760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b60648201526084016200039e565b8260000182815481106200143c57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b6109a58062001b3183390190565b600082601f8301126200146e578081fd5b813560206001600160401b038211156200148c576200148c62001b01565b8160051b6200149d82820162001a50565b838152828101908684018388018501891015620014b8578687fd5b8693505b85841015620014e7578035620014d28162001b17565b835260019390930192918401918401620014bc565b50979650505050505050565b8035600281900b81146200150657600080fd5b919050565b6000602082840312156200151d578081fd5b8135620012ed8162001b17565b6000602082840312156200153c578081fd5b8151620012ed8162001b17565b600080604083850312156200155c578081fd5b8235620015698162001b17565b915060208301356200157b8162001b17565b809150509250929050565b6000806000606084860312156200159b578081fd5b8335620015a88162001b17565b92506020840135620015ba8162001b17565b91506040840135620015cc8162001b17565b809150509250925092565b60008060008060008060c08789031215620015f0578182fd5b8635620015fd8162001b17565b955060208701356200160f8162001b17565b9450604087013562ffffff8116811462001627578283fd5b9350606087013561ffff811681146200163e578283fd5b92506200164e60808801620014f3565b91506200165e60a08801620014f3565b90509295509295509295565b6000602082840312156200167c578081fd5b81356001600160401b0381111562001692578182fd5b620016a0848285016200145d565b949350505050565b600080600060408486031215620016bd578283fd5b83356001600160401b0380821115620016d4578485fd5b620016e2878388016200145d565b94506020860135915080821115620016f8578384fd5b818601915086601f8301126200170c578384fd5b8135818111156200171b578485fd5b8760208260051b850101111562001730578485fd5b6020830194508093505050509250925092565b60006020828403121562001755578081fd5b81516001600160401b03808211156200176c578283fd5b818401915084601f83011262001780578283fd5b81518181111562001795576200179562001b01565b620017aa601f8201601f191660200162001a50565b9150808252856020828501011115620017c1578384fd5b620017d481602084016020860162001a9e565b50949350505050565b60008151808452620017f781602086016020860162001a9e565b601f01601f19169290920160200192915050565b600086516200181f818460208b0162001a9e565b86519083019062001835818360208b0162001a9e565b86519101906200184a818360208a0162001a9e565b85519101906200185f81836020890162001a9e565b84519101906200187481836020880162001a9e565b01979650505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b6020808252825182820181905260009190848201906040850190845b81811015620019315783516001600160a01b0316835292840192918401916001016200190a565b50909695505050505050565b602081526000620012ed6020830184620017dd565b60e0815260006200196760e0830189620017dd565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6000808335601e1984360301811262001a20578283fd5b8301803591506001600160401b0382111562001a3a578283fd5b602001915036819003821315620012cf57600080fd5b604051601f8201601f191681016001600160401b038111828210171562001a7b5762001a7b62001b01565b604052919050565b6000821982111562001a995762001a9962001aeb565b500190565b60005b8381101562001abb57818101518382015260200162001aa1565b838111156200059f5750506000910152565b600060001982141562001ae45762001ae462001aeb565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811462001b2d57600080fd5b5056fe60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220fd0e5804e7aefeeb0f059ca3dc4c86f4da48cbb855b0820c8aa0c217e946778964736f6c63430008040033", - "deployedBytecode": "0x60806040523480156200001157600080fd5b5060043610620001365760003560e01c806308893328146200013b578063098eddb114620001545780630dfc574b1462000171578063260fc2b8146200018857806335c62bc2146200019f57806340aee04114620001a957806342f5de9914620001c0578063481c6a7514620001d7578063483248ca14620001f057806354fd4d501462000207578063562b8103146200023b5780635c39f4671462000254578063607c12b5146200026b578063715018a6146200027557806386238765146200027f57806395d807f11462000293578063bd30dfb914620002bb578063c0c53b8b14620002d2578063c45a015514620002e9578063cefa77991462000311578063d6f748981462000325578063f2fde38b146200033c578063f3b7dead1462000353575b600080fd5b620001526200014c3660046200150b565b6200036a565b005b6200015e62000412565b6040519081526020015b60405180910390f35b6200015262000182366004620016a8565b62000425565b62000152620001993660046200166a565b620005a5565b6200015e6200068b565b62000152620001ba3660046200166a565b62000702565b6200015e620001d13660046200150b565b620007ec565b620001e162000815565b60405162000168919062001880565b620001e162000201366004620015d7565b62000824565b6200022c604051806040016040528060058152602001640312e302e360dc1b81525081565b6040516200016891906200193d565b6200024562000b40565b604051620001689190620018ee565b62000245620002653660046200150b565b62000b55565b6200024562000c2a565b6200015262000cfc565b600254620001e1906001600160a01b031681565b620002aa620002a43660046200150b565b62000d69565b604051901515815260200162000168565b6200022c620002cc36600462001549565b62000d86565b62000152620002e336600462001586565b62000ef5565b620001e17f000000000000000000000000000000000000000000000000000000000000000081565b600154620001e1906001600160a01b031681565b62000152620003363660046200150b565b62000fff565b620001526200034d3660046200150b565b6200109e565b620001e1620003643660046200150b565b62001185565b336200037562000815565b6001600160a01b031614620003a75760405162461bcd60e51b81526004016200039e90620019c7565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c908591620003e8916001600160a01b0390911690849062001894565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000620004206003620011fc565b905090565b336200043062000815565b6001600160a01b031614620004595760405162461bcd60e51b81526004016200039e90620019c7565b82518114620004a65760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b60448201526064016200039e565b60005b83518110156200059f57838181518110620004d457634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052157634e487b7160e01b600052603260045260246000fd5b905060200281019062000535919062001a09565b6040518463ffffffff1660e01b81526004016200055593929190620018ae565b600060405180830381600087803b1580156200057057600080fd5b505af115801562000585573d6000803e3d6000fd5b505050508080620005969062001acd565b915050620004a9565b50505050565b33620005b062000815565b6001600160a01b031614620005d95760405162461bcd60e51b81526004016200039e90620019c7565b60005b815181101562000687578181815181106200060757634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063d919062001880565b600060405180830381600087803b1580156200065857600080fd5b505af11580156200066d573d6000803e3d6000fd5b5050505080806200067e9062001acd565b915050620005dc565b5050565b6000806200069862000c2a565b905060005b8151811015620006fd57620006da828281518110620006cc57634e487b7160e01b600052603260045260246000fd5b6020026020010151620007ec565b620006e6908462001a83565b925080620006f48162001acd565b9150506200069d565b505090565b336200070d62000815565b6001600160a01b031614620007365760405162461bcd60e51b81526004016200039e90620019c7565b60005b815181101562000687578181815181106200076457634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe692620007a29291169060040162001880565b600060405180830381600087803b158015620007bd57600080fd5b505af1158015620007d2573d6000803e3d6000fd5b505050508080620007e39062001acd565b91505062000739565b6001600160a01b03811660009081526005602052604081206200080f90620011fc565b92915050565b6000546001600160a01b031690565b600080600062000835898962001207565b6001546040519294509092506001600160a01b031690309062000858906200144f565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f0801580156200089b573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb990620008ed908690869060040162001894565b60006040518083038186803b1580156200090657600080fd5b505afa9250505080156200093e57506040513d6000823e601f3d908101601f191682016040526200093b919081019062001743565b60015b62000949576200094c565b90505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8a1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee829060640160206040518083038186803b158015620009c657600080fd5b505afa158015620009db573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a0191906200152a565b90506001600160a01b03811662000a595760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b60448201526064016200039e565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e39062000a9190859085908d908d908d90339060040162001952565b600060405180830381600087803b15801562000aac57600080fd5b505af115801562000ac1573d6000803e3d6000fd5b5050505062000adb336003620012d690919063ffffffff16565b5033600090815260056020526040902062000af79086620012d6565b506040516001600160a01b038087169133918416907f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b90600090a4505050509695505050505050565b60025460609062000420906001600160a01b03165b6060600062000b6483620007ec565b90506000816001600160401b0381111562000b8f57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000bb9578160200160208202803683370190505b50905060005b8281101562000c225762000bd48582620012f4565b82828151811062000bf557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101528062000c198162001acd565b91505062000bbf565b509392505050565b6060600062000c3862000412565b90506000816001600160401b0381111562000c6357634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000c8d578160200160208202803683370190505b50905060005b8281101562000cf55762000ca78162001318565b82828151811062000cc857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101528062000cec8162001acd565b91505062000c93565b5092915050565b3362000d0762000815565b6001600160a01b03161462000d305760405162461bcd60e51b81526004016200039e90620019c7565b600080546040516001600160a01b0390911690600080516020620024d6833981519152908390a3600080546001600160a01b0319169055565b600062000d768262001185565b6001600160a01b03161592915050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000dc457600080fd5b505afa15801562000dd9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000e03919081019062001743565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000e4157600080fd5b505afa15801562000e56573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000e80919081019062001743565b905062000eec6040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001327565b95945050505050565b600054600160a81b900460ff168062000f185750600054600160a01b900460ff16155b62000f7d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200039e565b600054600160a81b900460ff1615801562000fa8576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b03199283161790925560028054868416908316179055600080549285169290911691909117905580156200059f576000805460ff60a81b1916905550505050565b336200100a62000815565b6001600160a01b031614620010335760405162461bcd60e51b81526004016200039e90620019c7565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162001074916001600160a01b0390911690849062001894565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b33620010a962000815565b6001600160a01b031614620010d25760405162461bcd60e51b81526004016200039e90620019c7565b6001600160a01b0381166200113b5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b60648201526084016200039e565b600080546040516001600160a01b0380851693921691600080516020620024d683398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b158015620011c157600080fd5b505afa158015620011d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200080f91906200152a565b60006200080f825490565b600080826001600160a01b0316846001600160a01b031614156200125b5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b60448201526064016200039e565b826001600160a01b0316846001600160a01b0316106200127d57828462001280565b83835b90925090506001600160a01b038216620012cf5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b60448201526064016200039e565b9250929050565b6000620012ed836001600160a01b0384166200135e565b9392505050565b6001600160a01b0382166000908152600560205260408120620012ed9083620013b0565b60006200080f600383620013b0565b60608585858585604051602001620013449594939291906200180b565b604051602081830303815290604052905095945050505050565b6000818152600183016020526040812054620013a7575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200080f565b5060006200080f565b6000620012ed838381546000908210620014185760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b60648201526084016200039e565b8260000182815481106200143c57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b6109a58062001b3183390190565b600082601f8301126200146e578081fd5b813560206001600160401b038211156200148c576200148c62001b01565b8160051b6200149d82820162001a50565b838152828101908684018388018501891015620014b8578687fd5b8693505b85841015620014e7578035620014d28162001b17565b835260019390930192918401918401620014bc565b50979650505050505050565b8035600281900b81146200150657600080fd5b919050565b6000602082840312156200151d578081fd5b8135620012ed8162001b17565b6000602082840312156200153c578081fd5b8151620012ed8162001b17565b600080604083850312156200155c578081fd5b8235620015698162001b17565b915060208301356200157b8162001b17565b809150509250929050565b6000806000606084860312156200159b578081fd5b8335620015a88162001b17565b92506020840135620015ba8162001b17565b91506040840135620015cc8162001b17565b809150509250925092565b60008060008060008060c08789031215620015f0578182fd5b8635620015fd8162001b17565b955060208701356200160f8162001b17565b9450604087013562ffffff8116811462001627578283fd5b9350606087013561ffff811681146200163e578283fd5b92506200164e60808801620014f3565b91506200165e60a08801620014f3565b90509295509295509295565b6000602082840312156200167c578081fd5b81356001600160401b0381111562001692578182fd5b620016a0848285016200145d565b949350505050565b600080600060408486031215620016bd578283fd5b83356001600160401b0380821115620016d4578485fd5b620016e2878388016200145d565b94506020860135915080821115620016f8578384fd5b818601915086601f8301126200170c578384fd5b8135818111156200171b578485fd5b8760208260051b850101111562001730578485fd5b6020830194508093505050509250925092565b60006020828403121562001755578081fd5b81516001600160401b03808211156200176c578283fd5b818401915084601f83011262001780578283fd5b81518181111562001795576200179562001b01565b620017aa601f8201601f191660200162001a50565b9150808252856020828501011115620017c1578384fd5b620017d481602084016020860162001a9e565b50949350505050565b60008151808452620017f781602086016020860162001a9e565b601f01601f19169290920160200192915050565b600086516200181f818460208b0162001a9e565b86519083019062001835818360208b0162001a9e565b86519101906200184a818360208a0162001a9e565b85519101906200185f81836020890162001a9e565b84519101906200187481836020880162001a9e565b01979650505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b6020808252825182820181905260009190848201906040850190845b81811015620019315783516001600160a01b0316835292840192918401916001016200190a565b50909695505050505050565b602081526000620012ed6020830184620017dd565b60e0815260006200196760e0830189620017dd565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6000808335601e1984360301811262001a20578283fd5b8301803591506001600160401b0382111562001a3a578283fd5b602001915036819003821315620012cf57600080fd5b604051601f8201601f191681016001600160401b038111828210171562001a7b5762001a7b62001b01565b604052919050565b6000821982111562001a995762001a9962001aeb565b500190565b60005b8381101562001abb57818101518382015260200162001aa1565b838111156200059f5750506000910152565b600060001982141562001ae45762001ae462001aeb565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811462001b2d57600080fd5b5056fe60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220fd0e5804e7aefeeb0f059ca3dc4c86f4da48cbb855b0820c8aa0c217e946778964736f6c63430008040033", - "devdoc": { - "kind": "dev", - "methods": { - "createPool(address,address,uint24,uint16,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "managerFee": "proportion of earned fees that go to pool manager in Basis Points", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "getDeployers()": { - "returns": { - "_0": "deployers the list of deployer addresses" - } - }, - "getGelatoPools()": { - "returns": { - "_0": "list of Gelato managed G-UNI pool addresses" - } - }, - "getPools(address)": { - "params": { - "deployer": "address that has potentially deployed G-UNI pools (can return empty array)" - }, - "returns": { - "_0": "pools the list of G-UNI pool addresses deployed by `deployer`" - } - }, - "getProxyAdmin(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "address that controls the G-UNI implementation (has power to upgrade it)" - } - }, - "isPoolImmutable(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "bool signaling if pool is immutable (true) or not (false)" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "numDeployers()": { - "returns": { - "_0": "total number of G-UNI pool deployer addresses" - } - }, - "numPools()": { - "returns": { - "result": "total number of G-UNI pools deployed" - } - }, - "numPools(address)": { - "params": { - "deployer": "deployer address" - }, - "returns": { - "_0": "total number of G-UNI pools deployed by `deployer`" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "createPool(address,address,uint24,uint16,int24,int24)": { - "notice": "createPool creates a new instance of a G-UNI token on a specified UniswapV3 pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`" - }, - "getDeployers()": { - "notice": "getDeployers fetches all addresses that have deployed a G-UNI pool" - }, - "getGelatoPools()": { - "notice": "getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)" - }, - "getPools(address)": { - "notice": "getPools fetches all the G-UNI pool addresses deployed by `deployer`" - }, - "getProxyAdmin(address)": { - "notice": "getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address)." - }, - "isPoolImmutable(address)": { - "notice": "isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded" - }, - "numDeployers()": { - "notice": "numDeployers counts the total number of G-UNI pool deployer addresses" - }, - "numPools()": { - "notice": "numPools counts the total number of G-UNI pools in existence" - }, - "numPools(address)": { - "notice": "numPools counts the total number of G-UNI pools deployed by `deployer`" - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6311, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_manager", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 5, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initialized", - "offset": 20, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initializing", - "offset": 21, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 5779, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "poolImplementation", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 5781, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "gelatoDeployer", - "offset": 0, - "slot": "2", - "type": "t_address" - }, - { - "astId": 5784, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_deployers", - "offset": 0, - "slot": "3", - "type": "t_struct(AddressSet)2007_storage" - }, - { - "astId": 5789, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_pools", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_struct(AddressSet)2007_storage)" - } - ], - "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_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(AddressSet)2007_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.AddressSet)", - "numberOfBytes": "32", - "value": "t_struct(AddressSet)2007_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(AddressSet)2007_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.AddressSet", - "members": [ - { - "astId": 2006, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1732_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Set)1732_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 1727, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 1731, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_indexes", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_uint256)" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} diff --git a/lib/g-uni-v1-core/deployments/goerli/GUniFactory_Proxy.json b/lib/g-uni-v1-core/deployments/goerli/GUniFactory_Proxy.json deleted file mode 100644 index e88713002..000000000 --- a/lib/g-uni-v1-core/deployments/goerli/GUniFactory_Proxy.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "address": "0x399cFce1F3f5AB74C46d9F0361BE18f87c23FCC3", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xa570d7471be911c90418ac42d008e3740d7c987df8566c14e13cdb00b85be56b", - "receipt": { - "to": null, - "from": "0x4B5BaD436CcA8df3bD39A095b84991fAc9A226F1", - "contractAddress": "0x399cFce1F3f5AB74C46d9F0361BE18f87c23FCC3", - "transactionIndex": 1, - "gasUsed": "470944", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000020000000000000000000000000000000004000000000000000000000000000000000000004000000000000000000020000000000000000000800000000000000000000800000000000000000000400000000000000000000000000000002000000000000000000000000000000000000000000000020000200000000000000000000000000000000000000000000000000000000000000000010000000000000000000000200000020000000000200000000000400000000000000000000000000000000000000000000", - "blockHash": "0xa9643ba5b4db1d500f475faad1fe661513917e6c9937c4463a8a40358b51e412", - "transactionHash": "0xa570d7471be911c90418ac42d008e3740d7c987df8566c14e13cdb00b85be56b", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 5498502, - "transactionHash": "0xa570d7471be911c90418ac42d008e3740d7c987df8566c14e13cdb00b85be56b", - "address": "0x399cFce1F3f5AB74C46d9F0361BE18f87c23FCC3", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000040637e26aca023289acca7737b99a395f4679b19" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0xa9643ba5b4db1d500f475faad1fe661513917e6c9937c4463a8a40358b51e412" - }, - { - "transactionIndex": 1, - "blockNumber": 5498502, - "transactionHash": "0xa570d7471be911c90418ac42d008e3740d7c987df8566c14e13cdb00b85be56b", - "address": "0x399cFce1F3f5AB74C46d9F0361BE18f87c23FCC3", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004b5bad436cca8df3bd39a095b84991fac9a226f1" - ], - "data": "0x", - "logIndex": 2, - "blockHash": "0xa9643ba5b4db1d500f475faad1fe661513917e6c9937c4463a8a40358b51e412" - } - ], - "blockNumber": 5498502, - "cumulativeGasUsed": "549432", - "status": 1, - "byzantium": true - }, - "args": [ - "0x40637e26ACA023289ACca7737b99A395f4679B19", - "0x4B5BaD436CcA8df3bD39A095b84991fAc9A226F1", - "0x" - ], - "solcInputHash": "869261aeb304b707d80e5edda679e3aa", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management that accept ETH via receive\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173ProxyWithReceive.sol\":\"EIP173ProxyWithReceive\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x4ad41656a53bc38d766197d9974be4be70f506b1d1f78def2c3726e8d580a3f5\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173ProxyWithReceive.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./EIP173Proxy.sol\\\";\\n\\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\\ncontract EIP173ProxyWithReceive is EIP173Proxy {\\n constructor(\\n address implementationAddress,\\n address ownerAddress,\\n bytes memory data\\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\\n\\n receive() external payable override {}\\n}\\n\",\"keccak256\":\"0x7f0dea5e3cba284c86fe466d7f39ff6b8584c8134c69203a896410d679222414\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x00dbb59cf486ff9a2930fb588ef70d761dbf439aa05d48ef0001a0448769ec11\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610978380380610978833981016040819052610022916101aa565b82828261002f8382610043565b6100388261011f565b5050505050506102d4565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561011a576000836001600160a01b0316836040516100c49190610276565b600060405180830381855af49150503d80600081146100ff576040519150601f19603f3d011682016040523d82523d6000602084013e610104565b606091505b5050905080610118573d806000803e806000fd5b505b505050565b60006101376000805160206109588339815191525490565b90508160008051602061095883398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b03811681146101a557600080fd5b919050565b6000806000606084860312156101be578283fd5b6101c78461018e565b92506101d56020850161018e565b60408501519092506001600160401b03808211156101f1578283fd5b818601915086601f830112610204578283fd5b815181811115610216576102166102be565b604051601f8201601f19908116603f0116810190838211818310171561023e5761023e6102be565b81604052828152896020848701011115610256578586fd5b610267836020830160208801610292565b80955050505050509250925092565b60008251610288818460208701610292565b9190910192915050565b60005b838110156102ad578181015183820152602001610295565b838111156101185750506000910152565b634e487b7160e01b600052604160045260246000fd5b610675806102e36000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461005f5780633659cfe6146100945780633e47158c146100b45780634f1ef286146100e15780638356ca4f146100f457610055565b3661005557005b61005d610114565b005b34801561006b57600080fd5b5061007f61007a366004610576565b61014d565b60405190151581526020015b60405180910390f35b3480156100a057600080fd5b5061005d6100af3660046104bf565b610242565b3480156100c057600080fd5b506100c961029f565b6040516001600160a01b03909116815260200161008b565b61005d6100ef3660046104d9565b6102ae565b34801561010057600080fd5b5061005d61010f3660046104bf565b61032b565b6000805160206106208339815191525460003681823780813683855af491503d8082833e828015610143578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b03198316148061017e57506307f5828d60e41b6001600160e01b03198316145b1561018b57506001919050565b6001600160e01b031980831614156101a557506000919050565b600080516020610620833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b1580156101fe57600080fd5b505afa92505050801561022e575060408051601f3d908101601f1916820190925261022b91810190610556565b60015b61023b5750600092915050565b9392505050565b61024a61036c565b6001600160a01b0316336001600160a01b0316146102835760405162461bcd60e51b815260040161027a906105d7565b60405180910390fd5b61029c816040518060200160405280600081525061037f565b50565b60006102a961036c565b905090565b6102b661036c565b6001600160a01b0316336001600160a01b0316146102e65760405162461bcd60e51b815260040161027a906105d7565b6103268383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061037f92505050565b505050565b61033361036c565b6001600160a01b0316336001600160a01b0316146103635760405162461bcd60e51b815260040161027a906105d7565b61029c81610442565b6000805160206106008339815191525490565b6000805160206106208339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610326576000836001600160a01b0316836040516103ee919061059e565b600060405180830381855af49150503d8060008114610429576040519150601f19603f3d011682016040523d82523d6000602084013e61042e565b606091505b5050905080610147573d806000803e806000fd5b600061044c61036c565b90508160008051602061060083398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ba57600080fd5b919050565b6000602082840312156104d0578081fd5b61023b826104a3565b6000806000604084860312156104ed578182fd5b6104f6846104a3565b925060208401356001600160401b0380821115610511578384fd5b818601915086601f830112610524578384fd5b813581811115610532578485fd5b876020828501011115610543578485fd5b6020830194508093505050509250925092565b600060208284031215610567578081fd5b8151801515811461023b578182fd5b600060208284031215610587578081fd5b81356001600160e01b03198116811461023b578182fd5b60008251815b818110156105be57602081860181015185830152016105a4565b818111156105cc5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220b98e06a95fa86acb89692e6d911ca1aec63357dba2aa77647751548c0ff4a4b764736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461005f5780633659cfe6146100945780633e47158c146100b45780634f1ef286146100e15780638356ca4f146100f457610055565b3661005557005b61005d610114565b005b34801561006b57600080fd5b5061007f61007a366004610576565b61014d565b60405190151581526020015b60405180910390f35b3480156100a057600080fd5b5061005d6100af3660046104bf565b610242565b3480156100c057600080fd5b506100c961029f565b6040516001600160a01b03909116815260200161008b565b61005d6100ef3660046104d9565b6102ae565b34801561010057600080fd5b5061005d61010f3660046104bf565b61032b565b6000805160206106208339815191525460003681823780813683855af491503d8082833e828015610143578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b03198316148061017e57506307f5828d60e41b6001600160e01b03198316145b1561018b57506001919050565b6001600160e01b031980831614156101a557506000919050565b600080516020610620833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b1580156101fe57600080fd5b505afa92505050801561022e575060408051601f3d908101601f1916820190925261022b91810190610556565b60015b61023b5750600092915050565b9392505050565b61024a61036c565b6001600160a01b0316336001600160a01b0316146102835760405162461bcd60e51b815260040161027a906105d7565b60405180910390fd5b61029c816040518060200160405280600081525061037f565b50565b60006102a961036c565b905090565b6102b661036c565b6001600160a01b0316336001600160a01b0316146102e65760405162461bcd60e51b815260040161027a906105d7565b6103268383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061037f92505050565b505050565b61033361036c565b6001600160a01b0316336001600160a01b0316146103635760405162461bcd60e51b815260040161027a906105d7565b61029c81610442565b6000805160206106008339815191525490565b6000805160206106208339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610326576000836001600160a01b0316836040516103ee919061059e565b600060405180830381855af49150503d8060008114610429576040519150601f19603f3d011682016040523d82523d6000602084013e61042e565b606091505b5050905080610147573d806000803e806000fd5b600061044c61036c565b90508160008051602061060083398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ba57600080fd5b919050565b6000602082840312156104d0578081fd5b61023b826104a3565b6000806000604084860312156104ed578182fd5b6104f6846104a3565b925060208401356001600160401b0380821115610511578384fd5b818601915086601f830112610524578384fd5b813581811115610532578485fd5b876020828501011115610543578485fd5b6020830194508093505050509250925092565b600060208284031215610567578081fd5b8151801515811461023b578182fd5b600060208284031215610587578081fd5b81356001600160e01b03198116811461023b578182fd5b60008251815b818110156105be57602081860181015185830152016105a4565b818111156105cc5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220b98e06a95fa86acb89692e6d911ca1aec63357dba2aa77647751548c0ff4a4b764736f6c63430008040033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management that accept ETH via receive", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} diff --git a/lib/g-uni-v1-core/deployments/goerli/GUniPool.json b/lib/g-uni-v1-core/deployments/goerli/GUniPool.json deleted file mode 100644 index cae0e8854..000000000 --- a/lib/g-uni-v1-core/deployments/goerli/GUniPool.json +++ /dev/null @@ -1,1639 +0,0 @@ -{ - "address": "0x183D656bF1995D6f5e4b0604F42D3a1B4f521BB9", - "abi": [ - { - "inputs": [ - { - "internalType": "address payable", - "name": "_gelato", - "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": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned0", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned1", - "type": "uint256" - } - ], - "name": "FeesEarned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int24", - "name": "lowerTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "int24", - "name": "upperTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBefore", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityAfter", - "type": "uint128" - } - ], - "name": "Rebalance", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - } - ], - "name": "SetManagerFee", - "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" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldAdminTreasury", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdminTreasury", - "type": "address" - } - ], - "name": "UpdateAdminTreasury", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoRebalanceBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoWithdrawBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoSlippageBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "gelatoSlippageInterval", - "type": "uint32" - } - ], - "name": "UpdateGelatoParams", - "type": "event" - }, - { - "inputs": [], - "name": "GELATO", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "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": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "burn", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "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": [ - { - "internalType": "int24", - "name": "newLowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "newUpperTick", - "type": "int24" - }, - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - } - ], - "name": "executiveRebalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoRebalanceBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageInterval", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoWithdrawBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Max", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Max", - "type": "uint256" - } - ], - "name": "getMintAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPositionID", - "outputs": [ - { - "internalType": "bytes32", - "name": "positionID", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUnderlyingBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "sqrtRatioX96", - "type": "uint160" - } - ], - "name": "getUnderlyingBalancesAtPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "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": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "address", - "name": "_pool", - "type": "address" - }, - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "_lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "_upperTick", - "type": "int24" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - } - ], - "name": "initializeManagerFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "lowerTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerTreasury", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pool", - "outputs": [ - { - "internalType": "contract IUniswapV3Pool", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "paymentToken", - "type": "address" - } - ], - "name": "rebalance", - "outputs": [], - "stateMutability": "nonpayable", - "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": "token0", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token1", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Owed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Owed", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3MintCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amount0Delta", - "type": "int256" - }, - { - "internalType": "int256", - "name": "amount1Delta", - "type": "int256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3SwapCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "newRebalanceBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newWithdrawBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newSlippageBPS", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "newSlippageInterval", - "type": "uint32" - }, - { - "internalType": "address", - "name": "newTreasury", - "type": "address" - } - ], - "name": "updateGelatoParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "upperTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawGelatoBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawManagerBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x92c73b10efa0ca3833f1633e3be21ca89b19dedd6bcd7abcb87d2aa12f1a32ab", - "receipt": { - "to": null, - "from": "0x4B5BaD436CcA8df3bD39A095b84991fAc9A226F1", - "contractAddress": "0x183D656bF1995D6f5e4b0604F42D3a1B4f521BB9", - "transactionIndex": 14, - "gasUsed": "5340472", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x97a350f9e8b36877fb97a1c0cea20a860ae8797aa380c9410f941a68ccf728a6", - "transactionHash": "0x92c73b10efa0ca3833f1633e3be21ca89b19dedd6bcd7abcb87d2aa12f1a32ab", - "logs": [], - "blockNumber": 5498523, - "cumulativeGasUsed": "7080805", - "status": 1, - "byzantium": true - }, - "args": ["0x683913B3A32ada4F8100458A3E1675425BdAa7DF"], - "solcInputHash": "869261aeb304b707d80e5edda679e3aa", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_gelato\",\"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\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned1\",\"type\":\"uint256\"}],\"name\":\"FeesEarned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"lowerTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"upperTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBefore\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityAfter\",\"type\":\"uint128\"}],\"name\":\"Rebalance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"}],\"name\":\"SetManagerFee\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAdminTreasury\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdminTreasury\",\"type\":\"address\"}],\"name\":\"UpdateAdminTreasury\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoRebalanceBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoWithdrawBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoSlippageBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gelatoSlippageInterval\",\"type\":\"uint32\"}],\"name\":\"UpdateGelatoParams\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GELATO\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"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\":[{\"internalType\":\"int24\",\"name\":\"newLowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"newUpperTick\",\"type\":\"int24\"},{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"}],\"name\":\"executiveRebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoRebalanceBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageInterval\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoWithdrawBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Max\",\"type\":\"uint256\"}],\"name\":\"getMintAmounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPositionID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"positionID\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUnderlyingBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtRatioX96\",\"type\":\"uint160\"}],\"name\":\"getUnderlyingBalancesAtPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"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\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_pool\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"_lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"_upperTick\",\"type\":\"int24\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"}],\"name\":\"initializeManagerFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lowerTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pool\",\"outputs\":[{\"internalType\":\"contract IUniswapV3Pool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"}],\"name\":\"rebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"token0\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newRebalanceBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newWithdrawBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newSlippageBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"newSlippageInterval\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateGelatoParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upperTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawGelatoBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawManagerBalance\",\"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}.\"},\"burn(uint256,address)\":{\"params\":{\"burnAmount\":\"The number of G-UNI tokens to burn\",\"receiver\":\"The account to receive the underlying amounts of token0 and token1\"},\"returns\":{\"amount0\":\"amount of token0 transferred to receiver for burning `burnAmount`\",\"amount1\":\"amount of token1 transferred to receiver for burning `burnAmount`\",\"liquidityBurned\":\"amount of liquidity removed from the underlying Uniswap V3 position\"}},\"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 this function is overridden; 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`.\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"details\":\"When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.\",\"params\":{\"newLowerTick\":\"The new lower bound of the position's range\",\"newUpperTick\":\"The new upper bound of the position's range\",\"swapAmountBPS\":\"amount of token to swap as proportion of total. Pass 0 to ignore swap.\",\"swapThresholdPrice\":\"slippage parameter on the swap as a max or min sqrtPriceX96\",\"zeroForOne\":\"Which token to input into the swap (true = token0, false = token1)\"}},\"getMintAmounts(uint256,uint256)\":{\"params\":{\"amount0Max\":\"The maximum amount of token1 to forward on mint\"},\"returns\":{\"amount0\":\"actual amount of token0 to forward when minting `mintAmount`\",\"amount1\":\"actual amount of token1 to forward when minting `mintAmount`\",\"mintAmount\":\"maximum number of G-UNI tokens to mint\"}},\"getUnderlyingBalances()\":{\"returns\":{\"amount0Current\":\"current total underlying balance of token0\",\"amount1Current\":\"current total underlying balance of token1\"}},\"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.\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"params\":{\"_lowerTick\":\"initial upperTick (only changeable with executiveRebalance)\",\"_managerFeeBPS\":\"proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\",\"_manager_\":\"address of manager (ownership can be transferred)\",\"_name\":\"name of G-UNI token\",\"_pool\":\"address of Uniswap V3 pool\",\"_symbol\":\"symbol of G-UNI token\"}},\"initializeManagerFee(uint16)\":{\"params\":{\"_managerFeeBPS\":\"proportion of fees earned that are credited to manager in Basis Points\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"mint(uint256,address)\":{\"details\":\"to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\",\"params\":{\"mintAmount\":\"The number of G-UNI tokens to mint\",\"receiver\":\"The account to receive the minted tokens\"},\"returns\":{\"amount0\":\"amount of token0 transferred from msg.sender to mint `mintAmount`\",\"amount1\":\"amount of token1 transferred from msg.sender to mint `mintAmount`\",\"liquidityMinted\":\"amount of liquidity added to the underlying Uniswap V3 position\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"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 manager.\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"params\":{\"newRebalanceBPS\":\"controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\",\"newSlippageBPS\":\"maximum slippage on swaps during gelato rebalance\",\"newSlippageInterval\":\"length of time for TWAP used in computing slippage on swaps\",\"newTreasury\":\"address where managerFee withdrawals are sent\",\"newWithdrawBPS\":\"controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(uint256,address)\":{\"notice\":\"burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"notice\":\"Change the range of underlying UniswapV3 position, only manager can call\"},\"getMintAmounts(uint256,uint256)\":{\"notice\":\"compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\"},\"getUnderlyingBalances()\":{\"notice\":\"compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"notice\":\"initialize storage variables on a new G-UNI pool, only called once\"},\"initializeManagerFee(uint16)\":{\"notice\":\"initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\"},\"mint(uint256,address)\":{\"notice\":\"mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\"},\"rebalance(uint160,uint256,bool,uint256,address)\":{\"notice\":\"Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\"},\"uniswapV3MintCallback(uint256,uint256,bytes)\":{\"notice\":\"Uniswap V3 callback fn, called back on pool.mint\"},\"uniswapV3SwapCallback(int256,int256,bytes)\":{\"notice\":\"Uniswap v3 callback fn, called back on pool.swap\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"notice\":\"change configurable parameters, only manager can call\"},\"withdrawGelatoBalance(uint256,address)\":{\"notice\":\"withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"},\"withdrawManagerBalance(uint256,address)\":{\"notice\":\"withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniPool.sol\":\"GUniPool\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal initializer {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal initializer {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and make it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x89fa60d14355f7ae06af11e28fce2bb90c5c6186645d681a30e1b36234a4c210\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\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\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The defaut value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\\n __Context_init_unchained();\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override 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 override 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 this function is\\n * overridden;\\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 override returns (uint8) {\\n return 18;\\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\\n uint256 currentAllowance = _allowances[sender][_msgSender()];\\n require(currentAllowance >= amount, \\\"ERC20: transfer amount exceeds allowance\\\");\\n _approve(sender, _msgSender(), currentAllowance - amount);\\n\\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\\n\\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 uint256 senderBalance = _balances[sender];\\n require(senderBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n _balances[sender] = senderBalance - amount;\\n _balances[recipient] += amount;\\n\\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 += amount;\\n _balances[account] += 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 uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n _balances[account] = accountBalance - amount;\\n _totalSupply -= amount;\\n\\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 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 uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0x9c2d7425f3343ea340d6ea67e9d90109d4d846bb013c2572096ec88c9e74946b\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\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\":\"0x8d4a0f2b5b760b5e2c19ed3c108d83897a4dfd5bfed97a93867918df19191e5e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x6795c369a4eefa78468e38966f7851fbc2dda5e5b9ccd3fa2b45970e2e4d3abd\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../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 initializer {\\n __Context_init_unchained();\\n }\\n\\n function __Context_init_unchained() internal initializer {\\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x8e9eb503de1189f50c5f16fef327da310b11898d6b9ab3ca937df07c35233b9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.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 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) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\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\":\"0x99f5c21018d796db7833a2100bb0e7411999e248a3c950fb526eee5d2bf47cb7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0x069b2631bb5b5193a58ccf7a06266c7361bd2c20095667af4402817605627f45\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCast {\\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 require(value < 2**128, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return uint128(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 require(value < 2**64, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return uint64(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 require(value < 2**32, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return uint32(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 require(value < 2**16, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\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 require(value < 2**8, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\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 require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n return uint256(value);\\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 * _Available since v3.1._\\n */\\n function toInt128(int256 value) internal pure returns (int128) {\\n require(value >= -2**127 && value < 2**127, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return int128(value);\\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 * _Available since v3.1._\\n */\\n function toInt64(int256 value) internal pure returns (int64) {\\n require(value >= -2**63 && value < 2**63, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return int64(value);\\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 * _Available since v3.1._\\n */\\n function toInt32(int256 value) internal pure returns (int32) {\\n require(value >= -2**31 && value < 2**31, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return int32(value);\\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 * _Available since v3.1._\\n */\\n function toInt16(int256 value) internal pure returns (int16) {\\n require(value >= -2**15 && value < 2**15, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\n return int16(value);\\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 * _Available since v3.1._\\n */\\n function toInt8(int256 value) internal pure returns (int8) {\\n require(value >= -2**7 && value < 2**7, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\n return int8(value);\\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 require(value < 2**255, \\\"SafeCast: value doesn't fit in an int256\\\");\\n return int256(value);\\n }\\n}\\n\",\"keccak256\":\"0xc37d85b96c2a8d7bc09f25958e0a81394bf5780286444147ddf875fa628d53ce\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\nimport './pool/IUniswapV3PoolImmutables.sol';\\nimport './pool/IUniswapV3PoolState.sol';\\nimport './pool/IUniswapV3PoolDerivedState.sol';\\nimport './pool/IUniswapV3PoolActions.sol';\\nimport './pool/IUniswapV3PoolOwnerActions.sol';\\nimport './pool/IUniswapV3PoolEvents.sol';\\n\\n/// @title The interface for a Uniswap V3 Pool\\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\\n/// to the ERC20 specification\\n/// @dev The pool interface is broken up into many smaller pieces\\ninterface IUniswapV3Pool is\\n IUniswapV3PoolImmutables,\\n IUniswapV3PoolState,\\n IUniswapV3PoolDerivedState,\\n IUniswapV3PoolActions,\\n IUniswapV3PoolOwnerActions,\\n IUniswapV3PoolEvents\\n{\\n\\n}\\n\",\"keccak256\":\"0xfe6113d518466cd6652c85b111e01f33eb62157f49ae5ed7d5a3947a2044adb1\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#mint\\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\\ninterface IUniswapV3MintCallback {\\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x27a9725b8f831a92d16380860c3d348a0b926a7f01b34a54ea6eea78cbdbcd6a\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#swap\\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\\ninterface IUniswapV3SwapCallback {\\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x3f485fb1a44e8fbeadefb5da07d66edab3cfe809f0ac4074b1e54e3eb3c4cf69\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissionless pool actions\\n/// @notice Contains pool methods that can be called by anyone\\ninterface IUniswapV3PoolActions {\\n /// @notice Sets the initial price for the pool\\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\\n function initialize(uint160 sqrtPriceX96) external;\\n\\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\\n /// @param recipient The address for which the liquidity will be created\\n /// @param tickLower The lower tick of the position in which to add liquidity\\n /// @param tickUpper The upper tick of the position in which to add liquidity\\n /// @param amount The amount of liquidity to mint\\n /// @param data Any data that should be passed through to the callback\\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n function mint(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount,\\n bytes calldata data\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Collects tokens owed to a position\\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\\n /// @param recipient The address which should receive the fees collected\\n /// @param tickLower The lower tick of the position for which to collect fees\\n /// @param tickUpper The upper tick of the position for which to collect fees\\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\\n /// @return amount0 The amount of fees collected in token0\\n /// @return amount1 The amount of fees collected in token1\\n function collect(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n\\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\\n /// @dev Fees must be collected separately via a call to #collect\\n /// @param tickLower The lower tick of the position for which to burn liquidity\\n /// @param tickUpper The upper tick of the position for which to burn liquidity\\n /// @param amount How much liquidity to burn\\n /// @return amount0 The amount of token0 sent to the recipient\\n /// @return amount1 The amount of token1 sent to the recipient\\n function burn(\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Swap token0 for token1, or token1 for token0\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\\n /// @param recipient The address to receive the output of the swap\\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\\n /// @param data Any data to be passed through to the callback\\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\\n function swap(\\n address recipient,\\n bool zeroForOne,\\n int256 amountSpecified,\\n uint160 sqrtPriceLimitX96,\\n bytes calldata data\\n ) external returns (int256 amount0, int256 amount1);\\n\\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\\n /// @param recipient The address which will receive the token0 and token1 amounts\\n /// @param amount0 The amount of token0 to send\\n /// @param amount1 The amount of token1 to send\\n /// @param data Any data to be passed through to the callback\\n function flash(\\n address recipient,\\n uint256 amount0,\\n uint256 amount1,\\n bytes calldata data\\n ) external;\\n\\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\\n /// the input observationCardinalityNext.\\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0x9453dd0e7442188667d01d9b65de3f1e14e9511ff3e303179a15f6fc267f7634\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that is not stored\\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\\n/// blockchain. The functions here may have variable gas costs.\\ninterface IUniswapV3PoolDerivedState {\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\\n /// you must call it with secondsAgos = [3600, 0].\\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\\n /// timestamp\\n function observe(uint32[] calldata secondsAgos)\\n external\\n view\\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\\n\\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\\n /// snapshot is taken and the second snapshot is taken.\\n /// @param tickLower The lower tick of the range\\n /// @param tickUpper The upper tick of the range\\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\\n /// @return secondsInside The snapshot of seconds per liquidity for the range\\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\\n external\\n view\\n returns (\\n int56 tickCumulativeInside,\\n uint160 secondsPerLiquidityInsideX128,\\n uint32 secondsInside\\n );\\n}\\n\",\"keccak256\":\"0xe603ac5b17ecdee73ba2b27efdf386c257a19c14206e87eee77e2017b742d9e5\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Events emitted by a pool\\n/// @notice Contains all events emitted by the pool\\ninterface IUniswapV3PoolEvents {\\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\\n event Initialize(uint160 sqrtPriceX96, int24 tick);\\n\\n /// @notice Emitted when liquidity is minted for a given position\\n /// @param sender The address that minted the liquidity\\n /// @param owner The owner of the position and recipient of any minted liquidity\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity minted to the position range\\n /// @param amount0 How much token0 was required for the minted liquidity\\n /// @param amount1 How much token1 was required for the minted liquidity\\n event Mint(\\n address sender,\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted when fees are collected by the owner of a position\\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\\n /// @param owner The owner of the position for which fees are collected\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount0 The amount of token0 fees collected\\n /// @param amount1 The amount of token1 fees collected\\n event Collect(\\n address indexed owner,\\n address recipient,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount0,\\n uint128 amount1\\n );\\n\\n /// @notice Emitted when a position's liquidity is removed\\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\\n /// @param owner The owner of the position for which liquidity is removed\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity to remove\\n /// @param amount0 The amount of token0 withdrawn\\n /// @param amount1 The amount of token1 withdrawn\\n event Burn(\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted by the pool for any swaps between token0 and token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the output of the swap\\n /// @param amount0 The delta of the token0 balance of the pool\\n /// @param amount1 The delta of the token1 balance of the pool\\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param liquidity The liquidity of the pool after the swap\\n /// @param tick The log base 1.0001 of price of the pool after the swap\\n event Swap(\\n address indexed sender,\\n address indexed recipient,\\n int256 amount0,\\n int256 amount1,\\n uint160 sqrtPriceX96,\\n uint128 liquidity,\\n int24 tick\\n );\\n\\n /// @notice Emitted by the pool for any flashes of token0/token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the tokens from flash\\n /// @param amount0 The amount of token0 that was flashed\\n /// @param amount1 The amount of token1 that was flashed\\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\\n event Flash(\\n address indexed sender,\\n address indexed recipient,\\n uint256 amount0,\\n uint256 amount1,\\n uint256 paid0,\\n uint256 paid1\\n );\\n\\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\\n /// just before a mint/swap/burn.\\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(\\n uint16 observationCardinalityNextOld,\\n uint16 observationCardinalityNextNew\\n );\\n\\n /// @notice Emitted when the protocol fee is changed by the pool\\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\\n /// @param feeProtocol0New The updated value of the token0 protocol fee\\n /// @param feeProtocol1New The updated value of the token1 protocol fee\\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\\n\\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\\n /// @param sender The address that collects the protocol fees\\n /// @param recipient The address that receives the collected protocol fees\\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x8071514d0fe5d17d6fbd31c191cdfb703031c24e0ece3621d88ab10e871375cd\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that never changes\\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\\ninterface IUniswapV3PoolImmutables {\\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\\n /// @return The contract address\\n function factory() external view returns (address);\\n\\n /// @notice The first of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token0() external view returns (address);\\n\\n /// @notice The second of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token1() external view returns (address);\\n\\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\\n /// @return The fee\\n function fee() external view returns (uint24);\\n\\n /// @notice The pool tick spacing\\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\\n /// This value is an int24 to avoid casting even though it is always positive.\\n /// @return The tick spacing\\n function tickSpacing() external view returns (int24);\\n\\n /// @notice The maximum amount of position liquidity that can use any tick in the range\\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\\n /// @return The max amount of liquidity per tick\\n function maxLiquidityPerTick() external view returns (uint128);\\n}\\n\",\"keccak256\":\"0xf6e5d2cd1139c4c276bdbc8e1d2b256e456c866a91f1b868da265c6d2685c3f7\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissioned pool actions\\n/// @notice Contains pool methods that may only be called by the factory owner\\ninterface IUniswapV3PoolOwnerActions {\\n /// @notice Set the denominator of the protocol's % share of the fees\\n /// @param feeProtocol0 new protocol fee for token0 of the pool\\n /// @param feeProtocol1 new protocol fee for token1 of the pool\\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\\n\\n /// @notice Collect the protocol fee accrued to the pool\\n /// @param recipient The address to which collected protocol fees should be sent\\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\\n /// @return amount0 The protocol fee collected in token0\\n /// @return amount1 The protocol fee collected in token1\\n function collectProtocol(\\n address recipient,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x759b78a2918af9e99e246dc3af084f654e48ef32bb4e4cb8a966aa3dcaece235\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that can change\\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\\n/// per transaction\\ninterface IUniswapV3PoolState {\\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\\n /// when accessed externally.\\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\\n /// boundary.\\n /// observationIndex The index of the last oracle observation that was written,\\n /// observationCardinality The current maximum number of observations stored in the pool,\\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// feeProtocol The protocol fee for both tokens of the pool.\\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\\n /// unlocked Whether the pool is currently locked to reentrancy\\n function slot0()\\n external\\n view\\n returns (\\n uint160 sqrtPriceX96,\\n int24 tick,\\n uint16 observationIndex,\\n uint16 observationCardinality,\\n uint16 observationCardinalityNext,\\n uint8 feeProtocol,\\n bool unlocked\\n );\\n\\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal0X128() external view returns (uint256);\\n\\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal1X128() external view returns (uint256);\\n\\n /// @notice The amounts of token0 and token1 that are owed to the protocol\\n /// @dev Protocol fees will never exceed uint128 max in either token\\n function protocolFees() external view returns (uint128 token0, uint128 token1);\\n\\n /// @notice The currently in range liquidity available to the pool\\n /// @dev This value has no relationship to the total liquidity across all ticks\\n function liquidity() external view returns (uint128);\\n\\n /// @notice Look up information about a specific tick in the pool\\n /// @param tick The tick to look up\\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\\n /// tick upper,\\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\\n /// a specific position.\\n function ticks(int24 tick)\\n external\\n view\\n returns (\\n uint128 liquidityGross,\\n int128 liquidityNet,\\n uint256 feeGrowthOutside0X128,\\n uint256 feeGrowthOutside1X128,\\n int56 tickCumulativeOutside,\\n uint160 secondsPerLiquidityOutsideX128,\\n uint32 secondsOutside,\\n bool initialized\\n );\\n\\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\\n function tickBitmap(int16 wordPosition) external view returns (uint256);\\n\\n /// @notice Returns the information about a position by the position's key\\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\\n /// @return _liquidity The amount of liquidity in the position,\\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\\n function positions(bytes32 key)\\n external\\n view\\n returns (\\n uint128 _liquidity,\\n uint256 feeGrowthInside0LastX128,\\n uint256 feeGrowthInside1LastX128,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param index The element of the observations array to fetch\\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\\n /// ago, rather than at a specific index in the array.\\n /// @return blockTimestamp The timestamp of the observation,\\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// Returns initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 index)\\n external\\n view\\n returns (\\n uint32 blockTimestamp,\\n int56 tickCumulative,\\n uint160 secondsPerLiquidityCumulativeX128,\\n bool initialized\\n );\\n}\\n\",\"keccak256\":\"0x852dc1f5df7dcf7f11e7bb3eed79f0cea72ad4b25f6a9d2c35aafb48925fd49f\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.4.0;\\n\\n/// @title FixedPoint96\\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\\n/// @dev Used in SqrtPriceMath.sol\\nlibrary FixedPoint96 {\\n uint8 internal constant RESOLUTION = 96;\\n uint256 internal constant Q96 = 0x1000000000000000000000000;\\n}\\n\",\"keccak256\":\"0x0ba8a9b95a956a4050749c0158e928398c447c91469682ca8a7cc7e77a7fe032\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {\\n IUniswapV3MintCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\\\";\\nimport {\\n IUniswapV3SwapCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\\\";\\nimport {GUniPoolStorage} from \\\"./abstract/GUniPoolStorage.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {TickMath} from \\\"./vendor/uniswap/TickMath.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {SafeCast} from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport {\\n FullMath,\\n LiquidityAmounts\\n} from \\\"./vendor/uniswap/LiquidityAmounts.sol\\\";\\n\\ncontract GUniPool is\\n IUniswapV3MintCallback,\\n IUniswapV3SwapCallback,\\n GUniPoolStorage\\n{\\n using SafeERC20 for IERC20;\\n using TickMath for int24;\\n\\n event Minted(\\n address receiver,\\n uint256 mintAmount,\\n uint256 amount0In,\\n uint256 amount1In,\\n uint128 liquidityMinted\\n );\\n\\n event Burned(\\n address receiver,\\n uint256 burnAmount,\\n uint256 amount0Out,\\n uint256 amount1Out,\\n uint128 liquidityBurned\\n );\\n\\n event Rebalance(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidityBefore,\\n uint128 liquidityAfter\\n );\\n\\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice Uniswap V3 callback fn, called back on pool.mint\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata /*_data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\\n }\\n\\n /// @notice Uniswap v3 callback fn, called back on pool.swap\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata /*data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Delta > 0)\\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\\n else if (amount1Delta > 0)\\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\\n }\\n\\n // User functions => Should be called via a Router\\n\\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\\n /// @param mintAmount The number of G-UNI tokens to mint\\n /// @param receiver The account to receive the minted tokens\\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function mint(uint256 mintAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityMinted\\n )\\n {\\n require(mintAmount > 0, \\\"mint 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n\\n if (totalSupply > 0) {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n amount0 = FullMath.mulDivRoundingUp(\\n amount0Current,\\n mintAmount,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n amount1Current,\\n mintAmount,\\n totalSupply\\n );\\n } else {\\n // if supply is 0 mintAmount == liquidity to deposit\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n SafeCast.toUint128(mintAmount)\\n );\\n }\\n\\n // transfer amounts owed to contract\\n if (amount0 > 0) {\\n token0.safeTransferFrom(msg.sender, address(this), amount0);\\n }\\n if (amount1 > 0) {\\n token1.safeTransferFrom(msg.sender, address(this), amount1);\\n }\\n\\n // deposit as much new liquidity as possible\\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n\\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \\\"\\\");\\n\\n _mint(receiver, mintAmount);\\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\\n }\\n\\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\\n /// @param burnAmount The number of G-UNI tokens to burn\\n /// @param receiver The account to receive the underlying amounts of token0 and token1\\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines\\n function burn(uint256 burnAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityBurned\\n )\\n {\\n require(burnAmount > 0, \\\"burn 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n\\n _burn(msg.sender, burnAmount);\\n\\n uint256 liquidityBurned_ =\\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidityBurned);\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n\\n amount0 =\\n burn0 +\\n FullMath.mulDiv(\\n token0.balanceOf(address(this)) -\\n burn0 -\\n managerBalance0 -\\n gelatoBalance0,\\n burnAmount,\\n totalSupply\\n );\\n amount1 =\\n burn1 +\\n FullMath.mulDiv(\\n token1.balanceOf(address(this)) -\\n burn1 -\\n managerBalance1 -\\n gelatoBalance1,\\n burnAmount,\\n totalSupply\\n );\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(receiver, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(receiver, amount1);\\n }\\n\\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\\n }\\n\\n // Manager Functions => Called by Pool Manager\\n\\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\\n /// any leftover will be unused and sit idle until the next rebalance.\\n /// @param newLowerTick The new lower bound of the position's range\\n /// @param newUpperTick The new upper bound of the position's range\\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\\n function executiveRebalance(\\n int24 newLowerTick,\\n int24 newUpperTick,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) external onlyManager {\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n if (liquidity > 0) {\\n (, , uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n }\\n\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n\\n uint256 reinvest0 =\\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\\n uint256 reinvest1 =\\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\\n\\n _deposit(\\n newLowerTick,\\n newUpperTick,\\n reinvest0,\\n reinvest1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n\\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > 0, \\\"new position 0\\\");\\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\\n }\\n\\n // Gelatofied functions => Automatically called by Gelato\\n\\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\\n function rebalance(\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) external gelatofy(feeAmount, paymentToken) {\\n if (swapAmountBPS > 0) {\\n _checkSlippage(swapThresholdPrice, zeroForOne);\\n }\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n _rebalance(\\n liquidity,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne,\\n feeAmount,\\n paymentToken\\n );\\n\\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity >= liquidity, \\\"liquidity decrease\\\");\\n\\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\\n }\\n\\n /// @notice withdraw manager fees accrued, only gelato executors can call.\\n /// Target account to receive fees is managerTreasury, alterable by manager.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n managerBalance0,\\n managerBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(managerTreasury, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(managerTreasury, amount1);\\n }\\n }\\n\\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n gelatoBalance0,\\n gelatoBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n gelatoBalance0 = 0;\\n gelatoBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(GELATO, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(GELATO, amount1);\\n }\\n }\\n\\n function _balancesToWithdraw(\\n uint256 balance0,\\n uint256 balance1,\\n uint256 feeAmount,\\n address feeToken\\n ) internal view returns (uint256 amount0, uint256 amount1) {\\n if (feeToken == address(token0)) {\\n require(\\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount0 = balance0 - feeAmount;\\n amount1 = balance1;\\n } else if (feeToken == address(token1)) {\\n require(\\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount1 = balance1 - feeAmount;\\n amount0 = balance0;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n }\\n\\n // View functions\\n\\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\\n /// @param amount0Max The maximum amount of token0 to forward on mint\\n /// @param amount0Max The maximum amount of token1 to forward on mint\\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\\n /// @return mintAmount maximum number of G-UNI tokens to mint\\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\\n external\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n uint256 totalSupply = totalSupply();\\n if (totalSupply > 0) {\\n (amount0, amount1, mintAmount) = _computeMintAmounts(\\n totalSupply,\\n amount0Max,\\n amount1Max\\n );\\n } else {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 newLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0Max,\\n amount1Max\\n );\\n mintAmount = uint256(newLiquidity);\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n newLiquidity\\n );\\n }\\n }\\n\\n /// @notice compute total underlying holdings of the G-UNI token supply\\n /// includes current liquidity invested in uniswap position, current fees earned\\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\\n /// @return amount0Current current total underlying balance of token0\\n /// @return amount1Current current total underlying balance of token1\\n function getUnderlyingBalances()\\n public\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\\n external\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\\n internal\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (\\n uint128 liquidity,\\n uint256 feeGrowthInside0Last,\\n uint256 feeGrowthInside1Last,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n ) = pool.positions(_getPositionID());\\n\\n // compute current holdings from liquidity\\n (amount0Current, amount1Current) = LiquidityAmounts\\n .getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n liquidity\\n );\\n\\n // compute current fees earned\\n uint256 fee0 =\\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\\n uint256(tokensOwed0);\\n uint256 fee1 =\\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\\n uint256(tokensOwed1);\\n\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n\\n // add any leftover in contract to current holdings\\n amount0Current +=\\n fee0 +\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n amount1Current +=\\n fee1 +\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n }\\n\\n // Private functions\\n\\n // solhint-disable-next-line function-max-lines\\n function _rebalance(\\n uint128 liquidity,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) private {\\n uint256 leftover0 =\\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\\n uint256 leftover1 =\\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\\n\\n (, , uint256 feesEarned0, uint256 feesEarned1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n _applyFees(feesEarned0, feesEarned1);\\n (feesEarned0, feesEarned1) = _subtractAdminFees(\\n feesEarned0,\\n feesEarned1\\n );\\n emit FeesEarned(feesEarned0, feesEarned1);\\n feesEarned0 += leftover0;\\n feesEarned1 += leftover1;\\n\\n if (paymentToken == address(token0)) {\\n require(\\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0 -\\n feeAmount;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n } else if (paymentToken == address(token1)) {\\n require(\\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1 -\\n feeAmount;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n\\n _deposit(\\n lowerTick,\\n upperTick,\\n leftover0,\\n leftover1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _withdraw(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidity\\n )\\n private\\n returns (\\n uint256 burn0,\\n uint256 burn1,\\n uint256 fee0,\\n uint256 fee1\\n )\\n {\\n uint256 preBalance0 = token0.balanceOf(address(this));\\n uint256 preBalance1 = token1.balanceOf(address(this));\\n\\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\\n\\n pool.collect(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n type(uint128).max,\\n type(uint128).max\\n );\\n\\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _deposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) private {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n // First, deposit as much as we can\\n uint128 baseLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n if (baseLiquidity > 0) {\\n (uint256 amountDeposited0, uint256 amountDeposited1) =\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n baseLiquidity,\\n \\\"\\\"\\n );\\n\\n amount0 -= amountDeposited0;\\n amount1 -= amountDeposited1;\\n }\\n int256 swapAmount =\\n SafeCast.toInt256(\\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\\n );\\n if (swapAmount > 0) {\\n _swapAndDeposit(\\n lowerTick_,\\n upperTick_,\\n amount0,\\n amount1,\\n swapAmount,\\n swapThresholdPrice,\\n zeroForOne\\n );\\n }\\n }\\n\\n function _swapAndDeposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n int256 swapAmount,\\n uint160 swapThresholdPrice,\\n bool zeroForOne\\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\\n (int256 amount0Delta, int256 amount1Delta) =\\n pool.swap(\\n address(this),\\n zeroForOne,\\n swapAmount,\\n swapThresholdPrice,\\n \\\"\\\"\\n );\\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\\n\\n // Add liquidity a second time\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 liquidityAfterSwap =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n finalAmount0,\\n finalAmount1\\n );\\n if (liquidityAfterSwap > 0) {\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n liquidityAfterSwap,\\n \\\"\\\"\\n );\\n }\\n }\\n\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function _computeMintAmounts(\\n uint256 totalSupply,\\n uint256 amount0Max,\\n uint256 amount1Max\\n )\\n private\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n // compute proportional amount of tokens to mint\\n if (amount0Current == 0 && amount1Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount1Max,\\n totalSupply,\\n amount1Current\\n );\\n } else if (amount1Current == 0 && amount0Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount0Max,\\n totalSupply,\\n amount0Current\\n );\\n } else if (amount0Current == 0 && amount1Current == 0) {\\n revert(\\\"\\\");\\n } else {\\n // only if both are non-zero\\n uint256 amount0Mint =\\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\\n uint256 amount1Mint =\\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\\n require(amount0Mint > 0 && amount1Mint > 0, \\\"mint 0\\\");\\n\\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\\n }\\n\\n // compute amounts owed to contract\\n amount0 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount0Current,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount1Current,\\n totalSupply\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _computeFeesEarned(\\n bool isZero,\\n uint256 feeGrowthInsideLast,\\n int24 tick,\\n uint128 liquidity\\n ) private view returns (uint256 fee) {\\n uint256 feeGrowthOutsideLower;\\n uint256 feeGrowthOutsideUpper;\\n uint256 feeGrowthGlobal;\\n if (isZero) {\\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\\n } else {\\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\\n }\\n\\n unchecked {\\n // calculate fee growth below\\n uint256 feeGrowthBelow;\\n if (tick >= lowerTick) {\\n feeGrowthBelow = feeGrowthOutsideLower;\\n } else {\\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\\n }\\n\\n // calculate fee growth above\\n uint256 feeGrowthAbove;\\n if (tick < upperTick) {\\n feeGrowthAbove = feeGrowthOutsideUpper;\\n } else {\\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\\n }\\n\\n uint256 feeGrowthInside =\\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\\n fee = FullMath.mulDiv(\\n liquidity,\\n feeGrowthInside - feeGrowthInsideLast,\\n 0x100000000000000000000000000000000\\n );\\n }\\n }\\n\\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\\n }\\n\\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\\n private\\n view\\n returns (uint256 fee0, uint256 fee1)\\n {\\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n fee0 = rawFee0 - deduct0;\\n fee1 = rawFee1 - deduct1;\\n }\\n\\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\\n private\\n view\\n {\\n uint32[] memory secondsAgo = new uint32[](2);\\n secondsAgo[0] = gelatoSlippageInterval;\\n secondsAgo[1] = 0;\\n\\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\\n\\n require(tickCumulatives.length == 2, \\\"array len\\\");\\n uint160 avgSqrtRatioX96;\\n unchecked {\\n int24 avgTick =\\n int24(\\n (tickCumulatives[1] - tickCumulatives[0]) /\\n int56(uint56(gelatoSlippageInterval))\\n );\\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\\n }\\n\\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\\n if (zeroForOne) {\\n require(\\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\\n \\\"high slippage\\\"\\n );\\n } else {\\n require(\\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\\n \\\"high slippage\\\"\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x84970c32cae8e5924078573e172989faaf71af981e2bcfdf89f3adf989d4cdfd\",\"license\":\"GPL-3.0\"},\"contracts/abstract/GUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {Gelatofied} from \\\"./Gelatofied.sol\\\";\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {\\n ReentrancyGuardUpgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport {\\n ERC20Upgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\n\\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\\n/// @dev ERC20Upgradable Includes Initialize\\n// solhint-disable-next-line max-states-count\\nabstract contract GUniPoolStorage is\\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\\n ReentrancyGuardUpgradeable,\\n OwnableUninitialized,\\n Gelatofied\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n // solhint-disable-next-line const-name-snakecase\\n uint16 public constant gelatoFeeBPS = 100;\\n\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n int24 public lowerTick;\\n int24 public upperTick;\\n\\n uint16 public gelatoRebalanceBPS;\\n uint16 public gelatoWithdrawBPS;\\n uint16 public gelatoSlippageBPS;\\n uint32 public gelatoSlippageInterval;\\n\\n uint16 public managerFeeBPS;\\n address public managerTreasury;\\n\\n uint256 public managerBalance0;\\n uint256 public managerBalance1;\\n uint256 public gelatoBalance0;\\n uint256 public gelatoBalance1;\\n\\n IUniswapV3Pool public pool;\\n IERC20 public token0;\\n IERC20 public token1;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdateAdminTreasury(\\n address oldAdminTreasury,\\n address newAdminTreasury\\n );\\n\\n event UpdateGelatoParams(\\n uint16 gelatoRebalanceBPS,\\n uint16 gelatoWithdrawBPS,\\n uint16 gelatoSlippageBPS,\\n uint32 gelatoSlippageInterval\\n );\\n\\n event SetManagerFee(uint16 managerFee);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice initialize storage variables on a new G-UNI pool, only called once\\n /// @param _name name of G-UNI token\\n /// @param _symbol symbol of G-UNI token\\n /// @param _pool address of Uniswap V3 pool\\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\\n /// @param _manager_ address of manager (ownership can be transferred)\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external initializer {\\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \\\"mBPS\\\");\\n\\n // these variables are immutable after initialization\\n pool = IUniswapV3Pool(_pool);\\n token0 = IERC20(pool.token0());\\n token1 = IERC20(pool.token1());\\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\\n\\n // these variables can be udpated by the manager\\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\\n gelatoSlippageBPS = 500; // default: 5% slippage\\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\\n managerTreasury = _manager_; // default: treasury is admin\\n lowerTick = _lowerTick;\\n upperTick = _upperTick;\\n _manager = _manager_;\\n\\n // e.g. \\\"Gelato Uniswap V3 USDC/DAI LP\\\" and \\\"G-UNI\\\"\\n __ERC20_init(_name, _symbol);\\n __ReentrancyGuard_init();\\n }\\n\\n /// @notice change configurable parameters, only manager can call\\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\\n /// @param newTreasury address where managerFee withdrawals are sent\\n // solhint-disable-next-line code-complexity\\n function updateGelatoParams(\\n uint16 newRebalanceBPS,\\n uint16 newWithdrawBPS,\\n uint16 newSlippageBPS,\\n uint32 newSlippageInterval,\\n address newTreasury\\n ) external onlyManager {\\n require(newWithdrawBPS <= 10000, \\\"BPS\\\");\\n require(newRebalanceBPS <= 10000, \\\"BPS\\\");\\n require(newSlippageBPS <= 10000, \\\"BPS\\\");\\n emit UpdateGelatoParams(\\n newRebalanceBPS,\\n newWithdrawBPS,\\n newSlippageBPS,\\n newSlippageInterval\\n );\\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\\n if (newSlippageInterval != 0)\\n gelatoSlippageInterval = newSlippageInterval;\\n if (newTreasury != address(0)) managerTreasury = newTreasury;\\n }\\n\\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\\n /// If a manager fee was not set in the initialize function it can be set here\\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\\n require(managerFeeBPS == 0, \\\"fee\\\");\\n require(\\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\\n \\\"mBPS\\\"\\n );\\n emit SetManagerFee(_managerFeeBPS);\\n managerFeeBPS = _managerFeeBPS;\\n }\\n\\n function renounceOwnership() public virtual override onlyManager {\\n managerTreasury = address(0);\\n managerFeeBPS = 0;\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n super.renounceOwnership();\\n }\\n\\n function getPositionID() external view returns (bytes32 positionID) {\\n return _getPositionID();\\n }\\n\\n function _getPositionID() internal view returns (bytes32 positionID) {\\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\\n }\\n}\\n\",\"keccak256\":\"0xb5512ca50ae540fb224bdd86498995cb13f59532663c7f188956c62ac7165353\",\"license\":\"GPL-3.0\"},\"contracts/abstract/Gelatofied.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract Gelatofied {\\n using Address for address payable;\\n using SafeERC20 for IERC20;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n address payable public immutable GELATO;\\n\\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n constructor(address payable _gelato) {\\n GELATO = _gelato;\\n }\\n\\n modifier gelatofy(uint256 _amount, address _paymentToken) {\\n require(msg.sender == GELATO, \\\"Gelatofied: Only gelato\\\");\\n _;\\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x31ddffff0545c4342d3cea88f4d2af520057f467f5e550e4e7166d24cc911cf1\",\"license\":\"GPL-3.0\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.4;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x81d888640e2261ac5189e6061a0cf4a7f3cec5994be1859ba60ffeb961f70c01\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/FullMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.4;\\n\\n/// @title Contains 512-bit math functions\\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\\n/// @dev Handles \\\"phantom overflow\\\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\\nlibrary FullMath {\\n /// @notice Calculates floor(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\\n function mulDiv(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = a * b\\n // Compute the product mod 2**256 and mod 2**256 - 1\\n // then use the Chinese Remainder Theorem to reconstruct\\n // the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2**256 + prod0\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(a, b, not(0))\\n prod0 := mul(a, b)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division\\n if (prod1 == 0) {\\n require(denominator > 0);\\n assembly {\\n result := div(prod0, denominator)\\n }\\n return result;\\n }\\n\\n // Make sure the result is less than 2**256.\\n // Also prevents denominator == 0\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0]\\n // Compute remainder using mulmod\\n uint256 remainder;\\n assembly {\\n remainder := mulmod(a, b, denominator)\\n }\\n // Subtract 256 bit number from 512 bit number\\n assembly {\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator\\n // Compute largest power of two divisor of denominator.\\n // Always >= 1.\\n // EDIT for 0.8 compatibility:\\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\\n uint256 twos = denominator & (~denominator + 1);\\n\\n // Divide denominator by power of two\\n assembly {\\n denominator := div(denominator, twos)\\n }\\n\\n // Divide [prod1 prod0] by the factors of two\\n assembly {\\n prod0 := div(prod0, twos)\\n }\\n // Shift in bits from prod1 into prod0. For this we need\\n // to flip `twos` such that it is 2**256 / twos.\\n // If twos is zero, then it becomes one\\n assembly {\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2**256\\n // Now that denominator is an odd number, it has an inverse\\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\\n // Compute the inverse by starting with a seed that is correct\\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\\n uint256 inv = (3 * denominator) ^ 2;\\n // Now use Newton-Raphson iteration to improve the precision.\\n // Thanks to Hensel's lifting lemma, this also works in modular\\n // arithmetic, doubling the correct bits in each step.\\n inv *= 2 - denominator * inv; // inverse mod 2**8\\n inv *= 2 - denominator * inv; // inverse mod 2**16\\n inv *= 2 - denominator * inv; // inverse mod 2**32\\n inv *= 2 - denominator * inv; // inverse mod 2**64\\n inv *= 2 - denominator * inv; // inverse mod 2**128\\n inv *= 2 - denominator * inv; // inverse mod 2**256\\n\\n // Because the division is now exact we can divide by multiplying\\n // with the modular inverse of denominator. This will give us the\\n // correct result modulo 2**256. Since the precoditions guarantee\\n // that the outcome is less than 2**256, this is the final result.\\n // We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inv;\\n return result;\\n }\\n }\\n\\n /// @notice Calculates ceil(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n function mulDivRoundingUp(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n result = mulDiv(a, b, denominator);\\n if (mulmod(a, b, denominator) > 0) {\\n require(result < type(uint256).max);\\n result++;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3fa0efa3eea2a84bd6ab7e55badd61f97069a6c50780059b036c810427a9740c\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/LiquidityAmounts.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.5.0;\\n\\nimport {FullMath} from \\\"./FullMath.sol\\\";\\nimport \\\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\\\";\\n\\n/// @title Liquidity amount functions\\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\\nlibrary LiquidityAmounts {\\n function toUint128(uint256 x) private pure returns (uint128 y) {\\n require((y = uint128(x)) == x);\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount0 The amount0 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount0(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n uint256 intermediate =\\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount0,\\n intermediate,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount1 The amount1 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount1(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount1,\\n FixedPoint96.Q96,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\\n /// pool prices and the prices at the tick boundaries\\n function getLiquidityForAmounts(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n liquidity = getLiquidityForAmount0(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount0\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n uint128 liquidity0 =\\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\\n uint128 liquidity1 =\\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\\n\\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\\n } else {\\n liquidity = getLiquidityForAmount1(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount1\\n );\\n }\\n }\\n\\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount0 The amount0\\n function getAmount0ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n uint256(liquidity) << FixedPoint96.RESOLUTION,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n sqrtRatioBX96\\n ) / sqrtRatioAX96;\\n }\\n\\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount1 The amount1\\n function getAmount1ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n liquidity,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n FixedPoint96.Q96\\n );\\n }\\n\\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\\n /// pool prices and the prices at the tick boundaries\\n function getAmountsForLiquidity(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0, uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioX96,\\n liquidity\\n );\\n } else {\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x6205f6409d42fc9565530d2a69819bf8c4e4c66b7a4c61d0827e81c084df6832\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/TickMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\n/// prices between 2**-128 and 2**128\\nlibrary TickMath {\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\n int24 internal constant MIN_TICK = -887272;\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\n int24 internal constant MAX_TICK = -MIN_TICK;\\n\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\n uint160 internal constant MAX_SQRT_RATIO =\\n 1461446703485210103287273052203988822378723970342;\\n\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\n /// @dev Throws if |tick| > max tick\\n /// @param tick The input tick for the above formula\\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\n /// at the given tick\\n function getSqrtRatioAtTick(int24 tick)\\n internal\\n pure\\n returns (uint160 sqrtPriceX96)\\n {\\n uint256 absTick =\\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\\n\\n // EDIT: 0.8 compatibility\\n require(absTick <= uint256(int256(MAX_TICK)), \\\"T\\\");\\n\\n uint256 ratio =\\n absTick & 0x1 != 0\\n ? 0xfffcb933bd6fad37aa2d162d1a594001\\n : 0x100000000000000000000000000000000;\\n if (absTick & 0x2 != 0)\\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\\n if (absTick & 0x4 != 0)\\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\\n if (absTick & 0x8 != 0)\\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\\n if (absTick & 0x10 != 0)\\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\\n if (absTick & 0x20 != 0)\\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\\n if (absTick & 0x40 != 0)\\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\\n if (absTick & 0x80 != 0)\\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\\n if (absTick & 0x100 != 0)\\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\\n if (absTick & 0x200 != 0)\\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\\n if (absTick & 0x400 != 0)\\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\\n if (absTick & 0x800 != 0)\\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\\n if (absTick & 0x1000 != 0)\\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\\n if (absTick & 0x2000 != 0)\\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\\n if (absTick & 0x4000 != 0)\\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\\n if (absTick & 0x8000 != 0)\\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\\n if (absTick & 0x10000 != 0)\\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\\n if (absTick & 0x20000 != 0)\\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\\n if (absTick & 0x40000 != 0)\\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\\n if (absTick & 0x80000 != 0)\\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\\n\\n if (tick > 0) ratio = type(uint256).max / ratio;\\n\\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\n sqrtPriceX96 = uint160(\\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\\n );\\n }\\n\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\n /// ever return.\\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\\n internal\\n pure\\n returns (int24 tick)\\n {\\n // second inequality must be < because the price can never reach the price at the max tick\\n require(\\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\\n \\\"R\\\"\\n );\\n uint256 ratio = uint256(sqrtPriceX96) << 32;\\n\\n uint256 r = ratio;\\n uint256 msb = 0;\\n\\n assembly {\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(4, gt(r, 0xFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(3, gt(r, 0xFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(2, gt(r, 0xF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(1, gt(r, 0x3))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := gt(r, 0x1)\\n msb := or(msb, f)\\n }\\n\\n if (msb >= 128) r = ratio >> (msb - 127);\\n else r = ratio << (127 - msb);\\n\\n int256 log_2 = (int256(msb) - 128) << 64;\\n\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(63, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(62, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(61, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(60, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(59, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(58, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(57, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(56, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(55, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(54, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(53, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(52, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(51, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(50, f))\\n }\\n\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\n\\n int24 tickLow =\\n int24(\\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\\n );\\n int24 tickHi =\\n int24(\\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\\n );\\n\\n tick = tickLow == tickHi\\n ? tickLow\\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\\n ? tickHi\\n : tickLow;\\n }\\n}\\n\",\"keccak256\":\"0xc0faed28071dc68a5f4b03abbb6115759824980feb95a7fcf3b66ae7e1bab58f\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b50604051620060783803806200607883398101604081905262000034916200004a565b60601b6001600160601b0319166080526200007a565b6000602082840312156200005c578081fd5b81516001600160a01b038116811462000073578182fd5b9392505050565b60805160601c615fa0620000d8600039600081816105f801528181610cea01528181610dd301528181610e0d015281816114f40152818161173c0152818161177601528181611858015281816118cf015261190c0152615fa06000f3fe608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d91906159a9565b61026e6102693660046152fa565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d9190615896565b6102a66106fb565b60405161023d929190615ba1565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd3660046152ba565b6107a4565b6102f56102f0366004615404565b61085c565b005b6102ff606481565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f3660046152fa565b610c41565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610c78565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b136600461524a565b6001600160a01b031660009081526033602052604090205490565b6102f5610c87565b6097546103e890600160b81b900460020b81565b60405161023d919061596d565b6102f5610403366004615835565b610cdd565b61041b610416366004615835565b610e38565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e61111e565b61045a610455366004615859565b61112d565b6040805193845260208401929092529082015260600161023d565b6102f56104833660046157bb565b61127f565b6097546103e890600160a01b900460020b81565b61026e6104aa3660046152fa565b61143f565b6097546102ff90600160d01b900461ffff1681565b61026e6104d23660046152fa565b6114da565b6102f56104e536600461576b565b6114e7565b610233609b5481565b6102a661050136600461524a565b6117a4565b6102f5610514366004615835565b61184b565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f561057236600461548e565b611931565b6097546102ff90600160f01b900461ffff1681565b61023361059a366004615282565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b610233611995565b6102f56105db3660046154de565b6119a4565b6102f56105ee3660046156bf565b611c41565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f561062836600461524a565b611d4e565b6102f561063b36600461548e565b611e2e565b61041b61064e366004615835565b611e98565b60606036805461066290615daf565b80601f016020809104026020016040519081016040528092919081815260200182805461068e90615daf565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f23384846121d1565b50600192915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078791906156db565b50505050509150915061079a82826122f6565b9350935050509091565b60006107b18484846125a7565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561083b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61084f853361084a8685615d6c565b6121d1565b60019150505b9392505050565b33610865610c78565b6001600160a01b03161461088b5760405162461bcd60e51b815260040161083290615b08565b609d546000906001600160a01b031663514ea4bf6108a761276d565b6040518263ffffffff1660e01b81526004016108c591815260200190565b60a06040518083038186803b1580156108dd57600080fd5b505afa1580156108f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109159190615669565b5050505090506000816001600160801b0316111561099f57609754600090819061095590600160a01b8104600290810b91600160b81b9004900b856127d3565b9350935050506109658282612b60565b61096f8282612c39565b6040519193509150600080516020615f4b833981519152906109949084908490615ba1565b60405180910390a150505b60978054600287810b62ffffff908116600160b81b0262ffffff60b81b19928b900b909116600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a1c903090600401615896565b60206040518083038186803b158015610a3457600080fd5b505afa158015610a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6c919061581d565b610a769190615d6c565b610a809190615d6c565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610abc903090600401615896565b60206040518083038186803b158015610ad457600080fd5b505afa158015610ae8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0c919061581d565b610b169190615d6c565b610b209190615d6c565b9050610b31888884848a8a8a612cd4565b609d546000906001600160a01b031663514ea4bf610b4d61276d565b6040518263ffffffff1660e01b8152600401610b6b91815260200190565b60a06040518083038186803b158015610b8357600080fd5b505afa158015610b97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbb9190615669565b5050505090506000816001600160801b031611610c0b5760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610832565b600080516020615eeb83398151915289898684604051610c2e949392919061597b565b60405180910390a1505050505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061084a908690615c4a565b6097546001600160a01b031690565b33610c90610c78565b6001600160a01b031614610cb65760405162461bcd60e51b815260040161083290615b08565b60988054600160201b600160d01b031916905560006099819055609a55610cdb612e93565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d275760405162461bcd60e51b8152600401610832906159dc565b600080610d3a609954609a548888612efa565b60006099819055609a5590925090508115610d7457609854609e54610d74916001600160a01b0391821691600160301b909104168461301e565b8015610d9f57609854609f54610d9f916001600160a01b0391821691600160301b909104168361301e565b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610dfe57610df96001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683613086565b610e32565b610e326001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000008461301e565b50505050565b600080600060026065541415610e605760405162461bcd60e51b815260040161083290615b6a565b600260655584610e825760405162461bcd60e51b815260040161083290615b4a565b6000610e8d60355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610edf57600080fd5b505afa158015610ef3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1791906156db565b50505050505090506000821115610f5857600080610f336106fb565b91509150610f42828a8661319c565b9650610f4f818a8661319c565b95505050610fa5565b610f9f81610f77609760149054906101000a900460020b60020b6131f3565b609754610f9190600160b81b9004600290810b900b6131f3565b610f9a8b613605565b61366e565b90955093505b8415610fc357609e54610fc3906001600160a01b0316333088613709565b8315610fe157609f54610fe1906001600160a01b0316333087613709565b61102181611000609760149054906101000a900460020b60020b6131f3565b60975461101a90600160b81b9004600290810b900b6131f3565b8888613741565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d91611071913091600160a01b8104600290810b92600160b81b909204900b9089906004016158aa565b6040805180830381600087803b15801561108a57600080fd5b505af115801561109e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c2919061546b565b50506110ce8688613803565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e786888787876040516111059594939291906158ec565b60405180910390a1505060016065819055509250925092565b60606037805461066290615daf565b60008060008061113c60355490565b9050801561115b5761114f8187876138d0565b91955093509150611277565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b1580156111a057600080fd5b505afa1580156111b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d891906156db565b5050505050509050600061122282611201609760149054906101000a900460020b60020b6131f3565b60975461121b90600160b81b9004600290810b900b6131f3565b8b8b613741565b9050806001600160801b0316935061126f8261124f609760149054906101000a900460020b60020b6131f3565b60975461126990600160b81b9004600290810b900b6131f3565b8461366e565b909650945050505b509250925092565b33611288610c78565b6001600160a01b0316146112ae5760405162461bcd60e51b815260040161083290615b08565b6127108461ffff1611156112d45760405162461bcd60e51b815260040161083290615aeb565b6127108561ffff1611156112fa5760405162461bcd60e51b815260040161083290615aeb565b6127108361ffff1611156113205760405162461bcd60e51b815260040161083290615aeb565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff851615611397576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff8416156113bc576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff8316156113e257609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff821615611404576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156114385760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156114c15760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610832565b6114d0338561084a8685615d6c565b5060019392505050565b60006106f23384846125a7565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146115315760405162461bcd60e51b8152600401610832906159dc565b85156115415761154187866139df565b609d546000906001600160a01b031663514ea4bf61155d61276d565b6040518263ffffffff1660e01b815260040161157b91815260200190565b60a06040518083038186803b15801561159357600080fd5b505afa1580156115a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115cb9190615669565b5050505090506115df818989898989613c8d565b609d546000906001600160a01b031663514ea4bf6115fb61276d565b6040518263ffffffff1660e01b815260040161161991815260200190565b60a06040518083038186803b15801561163157600080fd5b505afa158015611645573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116699190615669565b505050509050816001600160801b0316816001600160801b031610156116c65760405162461bcd60e51b81526020600482015260126024820152716c697175696469747920646563726561736560701b6044820152606401610832565b609754604051600080516020615eeb8339815191529161170091600160a01b8204600290810b92600160b81b9004900b908690869061597b565b60405180910390a150506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611767576117626001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683613086565b61179b565b61179b6001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000008461301e565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b1580156117f757600080fd5b505afa15801561180b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182f91906156db565b505050505091505061184184826122f6565b9250925050915091565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118955760405162461bcd60e51b8152600401610832906159dc565b6000806118a8609b54609c548888612efa565b6000609b819055609c55909250905081156118f457609e546118f4906001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000008461301e565b8015610d9f57609f54610d9f906001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000008361301e565b609d546001600160a01b0316331461195b5760405162461bcd60e51b815260040161083290615a2b565b831561197857609e54611978906001600160a01b0316338661301e565b8215610e3257609f54610e32906001600160a01b0316338561301e565b600061199f61276d565b905090565b600054610100900460ff16806119bd575060005460ff16155b6119d95760405162461bcd60e51b815260040161083290615a54565b600054610100900460ff161580156119fb576000805461ffff19166101011790555b611a086064612710615d29565b61ffff168561ffff161115611a2f5760405162461bcd60e51b815260040161083290615a0d565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe168191600480820192602092909190829003018186803b158015611a8357600080fd5b505afa158015611a97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abb9190615266565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611b1457600080fd5b505afa158015611b28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4c9190615266565b609f80546001600160a01b03199081166001600160a01b0393841617909155609880546097805461012c65ffffffffffff19909316600160201b61ffff8d160263ffffffff19161792909217600160301b600160d01b031916600160301b95881695860217909255643e800c801960d31b600165ffffff00000160a01b03909116600160a01b60028a810b62ffffff908116929092029290921792909217600165ffffff00000160a01b031916600160b81b9189900b9290921602909216919091179091179055611c1d88886141af565b611c2561422e565b8015611c37576000805461ff00191690555b5050505050505050565b33611c4a610c78565b6001600160a01b031614611c705760405162461bcd60e51b815260040161083290615b08565b609854600160201b900461ffff1615611cb15760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610832565b60008161ffff16118015611cd95750611ccd6064612710615d29565b61ffff168161ffff1611155b611cf55760405162461bcd60e51b815260040161083290615a0d565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611d57610c78565b6001600160a01b031614611d7d5760405162461bcd60e51b815260040161083290615b08565b6001600160a01b038116611de45760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610832565b6097546040516001600160a01b03808416921690600080516020615f0b83398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611e585760405162461bcd60e51b815260040161083290615a2b565b6000841315611e7857609e54610df9906001600160a01b0316338661301e565b6000831315610e3257609f54610e32906001600160a01b0316338561301e565b600080600060026065541415611ec05760405162461bcd60e51b815260040161083290615b6a565b600260655584611efb5760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610832565b6000611f0660355490565b609d549091506000906001600160a01b031663514ea4bf611f2561276d565b6040518263ffffffff1660e01b8152600401611f4391815260200190565b60a06040518083038186803b158015611f5b57600080fd5b505afa158015611f6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f939190615669565b505050509050611fa333886142a2565b6000611fb988836001600160801b0316856143df565b9050611fc481613605565b609754909450600090819081908190611ff390600160a01b8104600290810b91600160b81b9004900b8a6127d3565b93509350935093506120058282612b60565b61200f8282612c39565b6040519193509150600080516020615f4b833981519152906120349084908490615ba1565b60405180910390a1609b54609954609e546040516370a0823160e01b81526120ef93929188916001600160a01b03909116906370a082319061207a903090600401615896565b60206040518083038186803b15801561209257600080fd5b505afa1580156120a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ca919061581d565b6120d49190615d6c565b6120de9190615d6c565b6120e89190615d6c565b8d896143df565b6120f99085615c4a565b609c54609a54609f546040516370a0823160e01b8152939d506121369387916001600160a01b0316906370a082319061207a903090600401615896565b6121409084615c4a565b9850891561215f57609e5461215f906001600160a01b03168c8c61301e565b881561217c57609f5461217c906001600160a01b03168c8b61301e565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516121b39594939291906158ec565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166122335760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610832565b6001600160a01b0382166122945760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610832565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61231e61276d565b6040518263ffffffff1660e01b815260040161233c91815260200190565b60a06040518083038186803b15801561235457600080fd5b505afa158015612368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238c9190615669565b945094509450945094506123d5896123b5609760149054906101000a900460020b60020b6131f3565b6097546123cf90600160b81b9004600290810b900b6131f3565b8861366e565b909750955060006001600160801b0383166123f36001878c8a61448e565b6123fd9190615c4a565b90506000826001600160801b03166124186000878d8b61448e565b6124229190615c4a565b905061242e8282612c39565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a082319061246c903090600401615896565b60206040518083038186803b15801561248457600080fd5b505afa158015612498573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124bc919061581d565b6124c69085615c4a565b6124d09190615d6c565b6124da9190615d6c565b6124e4908a615c4a565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a082319061251f903090600401615896565b60206040518083038186803b15801561253757600080fd5b505afa15801561254b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061256f919061581d565b6125799084615c4a565b6125839190615d6c565b61258d9190615d6c565b6125979089615c4a565b9750505050505050509250929050565b6001600160a01b03831661260b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610832565b6001600160a01b03821661266d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610832565b6001600160a01b038316600090815260336020526040902054818110156126e55760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610832565b6126ef8282615d6c565b6001600160a01b038086166000908152603360205260408082209390935590851681529081208054849290612725908490615c4a565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615f2b8339815191528460405161275f91815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b8204600290810b810b60e890811b6034840152600160b81b909304810b900b90911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a082319061280c903090600401615896565b60206040518083038186803b15801561282457600080fd5b505afa158015612838573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061285c919061581d565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a0823190612892903090600401615896565b60206040518083038186803b1580156128aa57600080fd5b505afa1580156128be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e2919061581d565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a7906064016040805180830381600087803b15801561294257600080fd5b505af1158015612956573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061297a919061546b565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a4016040805180830381600087803b1580156129e857600080fd5b505af11580156129fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a209190615637565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612a56903090600401615896565b60206040518083038186803b158015612a6e57600080fd5b505afa158015612a82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aa6919061581d565b612ab09190615d6c565b612aba9190615d6c565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a0823190612aef903090600401615896565b60206040518083038186803b158015612b0757600080fd5b505afa158015612b1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b3f919061581d565b612b499190615d6c565b612b539190615d6c565b9250505093509350935093565b612710612b6e606484615ccb565b612b789190615c88565b609b6000828254612b899190615c4a565b909155506127109050612b9d606483615ccb565b612ba79190615c88565b609c6000828254612bb89190615c4a565b909155505060985461271090612bd990600160201b900461ffff1684615ccb565b612be39190615c88565b60996000828254612bf49190615c4a565b909155505060985461271090612c1590600160201b900461ffff1683615ccb565b612c1f9190615c88565b609a6000828254612c309190615c4a565b90915550505050565b6000806000612710609860049054906101000a900461ffff166064612c5e9190615c02565b612c6c9061ffff1687615ccb565b612c769190615c88565b60985490915060009061271090612c9990600160201b900461ffff166064615c02565b612ca79061ffff1687615ccb565b612cb19190615c88565b9050612cbd8287615d6c565b9350612cc98186615d6c565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b158015612d1957600080fd5b505afa158015612d2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5191906156db565b50505050505090506000612d7e82612d6b8b60020b6131f3565b612d778b60020b6131f3565b8a8a613741565b90506001600160801b03811615612e3b57609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612dca9030908f908f9089906004016158aa565b6040805180830381600087803b158015612de357600080fd5b505af1158015612df7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e1b919061546b565b9092509050612e2a828a615d6c565b9850612e368189615d6c565b975050505b6000612e6a6127108686612e4f5789612e51565b8a5b612e5b9190615ccb565b612e659190615c88565b61489a565b90506000811315612e8757612e848a8a8a8a858b8a614900565b50505b50505050505050505050565b33612e9c610c78565b6001600160a01b031614612ec25760405162461bcd60e51b815260040161083290615b08565b6097546040516000916001600160a01b031690600080516020615f0b833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0384811691161415612f6f57609754849061271090612f3390600160e01b900461ffff1689615ccb565b612f3d9190615c88565b1015612f5b5760405162461bcd60e51b815260040161083290615aa2565b612f658487615d6c565b9150849050613015565b609f546001600160a01b0384811691161415612fdf57609754849061271090612fa390600160e01b900461ffff1688615ccb565b612fad9190615c88565b1015612fcb5760405162461bcd60e51b815260040161083290615aa2565b612fd58486615d6c565b9050859150613015565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610832565b94509492505050565b6040516001600160a01b03831660248201526044810182905261308190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614b49565b505050565b804710156130d65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610832565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613123576040519150601f19603f3d011682016040523d82523d6000602084013e613128565b606091505b50509050806130815760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610832565b60006131a98484846143df565b9050600082806131c957634e487b7160e01b600052601260045260246000fd5b84860911156108555760001981106131e057600080fd5b806131ea81615dea565b95945050505050565b60008060008360020b1261320a578260020b613217565b8260020b61321790615e3a565b9050613226620d89e719615e19565b60020b81111561325c5760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610832565b60006001821661327057600160801b613282565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b0316905060028216156132b75760806132b2826ffff97272373d413259a46990580e213a615ccb565b901c90505b60048216156132e15760806132dc826ffff2e50f5f656932ef12357cf3c7fdcc615ccb565b901c90505b600882161561330b576080613306826fffe5caca7e10e4e61c3624eaa0941cd0615ccb565b901c90505b6010821615613335576080613330826fffcb9843d60f6159c9db58835c926644615ccb565b901c90505b602082161561335f57608061335a826fff973b41fa98c081472e6896dfb254c0615ccb565b901c90505b6040821615613389576080613384826fff2ea16466c96a3843ec78b326b52861615ccb565b901c90505b60808216156133b35760806133ae826ffe5dee046a99a2a811c461f1969c3053615ccb565b901c90505b6101008216156133de5760806133d9826ffcbe86c7900a88aedcffc83b479aa3a4615ccb565b901c90505b610200821615613409576080613404826ff987a7253ac413176f2b074cf7815e54615ccb565b901c90505b61040082161561343457608061342f826ff3392b0822b70005940c7a398e4b70f3615ccb565b901c90505b61080082161561345f57608061345a826fe7159475a2c29b7443b29c7fa6e889d9615ccb565b901c90505b61100082161561348a576080613485826fd097f3bdfd2022b8845ad8f792aa5825615ccb565b901c90505b6120008216156134b55760806134b0826fa9f746462d870fdf8a65dc1f90e061e5615ccb565b901c90505b6140008216156134e05760806134db826f70d869a156d2a1b890bb3df62baf32f7615ccb565b901c90505b61800082161561350b576080613506826f31be135f97d08fd981231505542fcfa6615ccb565b901c90505b62010000821615613537576080613532826f09aa508b5b7a84e1c677de54f3e99bc9615ccb565b901c90505b6202000082161561356257608061355d826e5d6af8dedb81196699c329225ee604615ccb565b901c90505b6204000082161561358c576080613587826d2216e584f5fa1ea926041bedfe98615ccb565b901c90505b620800008216156135b45760806135af826b048a170391f7dc42444e8fa2615ccb565b901c90505b60008460020b13156135cf576135cc81600019615c88565b90505b6135dd600160201b82615e05565b156135e95760016135ec565b60005b6135fd9060ff16602083901c615c4a565b949350505050565b6000600160801b821061366a5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610832565b5090565b600080836001600160a01b0316856001600160a01b0316111561368f579293925b846001600160a01b0316866001600160a01b0316116136ba576136b3858585614c1b565b9150613015565b836001600160a01b0316866001600160a01b031610156136f3576136df868585614c1b565b91506136ec858785614c85565b9050613015565b6136fe858585614c85565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e329085906323b872dd60e01b9060840161304a565b6000836001600160a01b0316856001600160a01b03161115613761579293925b846001600160a01b0316866001600160a01b03161161378c57613785858585614ccf565b90506131ea565b836001600160a01b0316866001600160a01b031610156137ee5760006137b3878686614ccf565b905060006137c2878986614d39565b9050806001600160801b0316826001600160801b0316106137e357806137e5565b815b925050506131ea565b6137f9858584614d39565b9695505050505050565b6001600160a01b0382166138595760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610832565b806035600082825461386b9190615c4a565b90915550506001600160a01b03821660009081526033602052604081208054839290613898908490615c4a565b90915550506040518181526001600160a01b03831690600090600080516020615f2b8339815191529060200160405180910390a35050565b60008060008060006138e06106fb565b915091508160001480156138f45750600081115b1561390b576139048689836143df565b92506139ba565b801580156139195750600082115b15613929576139048789846143df565b81158015613935575080155b1561395c5760405162461bcd60e51b81526020600482015260006024820152604401610832565b6000613969888a856143df565b90506000613978888b856143df565b905060008211801561398a5750600081115b6139a65760405162461bcd60e51b815260040161083290615b4a565b8082106139b357806139b5565b815b945050505b6139c583838a61319c565b94506139d283828a61319c565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff1691839150600090613a2b57634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110613a6857634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613aae908590600401615923565b60006040518083038186803b158015613ac657600080fd5b505afa158015613ada573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613b029190810190615325565b5090508051600214613b425760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610832565b6098548151600091829163ffffffff90911660060b9084908390613b7657634e487b7160e01b600052603260045260246000fd5b602002602001015184600181518110613b9f57634e487b7160e01b600052603260045260246000fd5b60200260200101510360060b81613bc657634e487b7160e01b600052601260045260246000fd5b059050613bd58160020b6131f3565b6097549092506000915061271090613bf890600160f01b900461ffff1684615c9c565b613c029190615c62565b90508415613c4a57613c148183615d4c565b6001600160a01b0316866001600160a01b03161015613c455760405162461bcd60e51b815260040161083290615ac4565b613c85565b613c548183615c28565b6001600160a01b0316866001600160a01b03161115613c855760405162461bcd60e51b815260040161083290615ac4565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613cc6903090600401615896565b60206040518083038186803b158015613cde57600080fd5b505afa158015613cf2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d16919061581d565b613d209190615d6c565b613d2a9190615d6c565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613d66903090600401615896565b60206040518083038186803b158015613d7e57600080fd5b505afa158015613d92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613db6919061581d565b613dc09190615d6c565b613dca9190615d6c565b6097549091506000908190613df590600160a01b8104600290810b91600160b81b9004900b8c6127d3565b935093505050613e058282612b60565b613e0f8282612c39565b6040519193509150600080516020615f4b83398151915290613e349084908490615ba1565b60405180910390a1613e468483615c4a565b9150613e528382615c4a565b609e549091506001600160a01b0386811691161415613ffd57609754869061271090613e8990600160d01b900461ffff1685615ccb565b613e939190615c88565b1015613eb15760405162461bcd60e51b815260040161083290615aa2565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613ee9903090600401615896565b60206040518083038186803b158015613f0157600080fd5b505afa158015613f15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f39919061581d565b613f439190615d6c565b613f4d9190615d6c565b613f579190615d6c565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613f92903090600401615896565b60206040518083038186803b158015613faa57600080fd5b505afa158015613fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fe2919061581d565b613fec9190615d6c565b613ff69190615d6c565b9250614188565b609f546001600160a01b0386811691161415612fdf5760975486906127109061403190600160d01b900461ffff1684615ccb565b61403b9190615c88565b10156140595760405162461bcd60e51b815260040161083290615aa2565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a082319061408f903090600401615896565b60206040518083038186803b1580156140a757600080fd5b505afa1580156140bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140df919061581d565b6140e99190615d6c565b6140f39190615d6c565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a082319061412e903090600401615896565b60206040518083038186803b15801561414657600080fd5b505afa15801561415a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061417e919061581d565b613fe29190615d6c565b609754612e8790600160a01b8104600290810b91600160b81b9004900b86868d8d8d612cd4565b600054610100900460ff16806141c8575060005460ff16155b6141e45760405162461bcd60e51b815260040161083290615a54565b600054610100900460ff16158015614206576000805461ffff19166101011790555b61420e614d6f565b6142188383614dd9565b8015613081576000805461ff0019169055505050565b600054610100900460ff1680614247575060005460ff16155b6142635760405162461bcd60e51b815260040161083290615a54565b600054610100900460ff16158015614285576000805461ffff19166101011790555b61428d614e6e565b801561429f576000805461ff00191690555b50565b6001600160a01b0382166143025760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610832565b6001600160a01b038216600090815260336020526040902054818110156143765760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610832565b6143808282615d6c565b6001600160a01b038416600090815260336020526040812091909155603580548492906143ae908490615d6c565b90915550506040518281526000906001600160a01b03851690600080516020615f2b833981519152906020016122e9565b600080806000198587098587029250828110838203039150508060001415614419576000841161440e57600080fd5b508290049050610855565b80841161442557600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600080871561465b57609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b815260040160206040518083038186803b1580156144e857600080fd5b505afa1580156144fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614520919061581d565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161456091600160a01b90910460020b9060040161596d565b6101006040518083038186803b15801561457957600080fd5b505afa15801561458d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145b1919061559d565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba9395506145fa94600160b81b90910460020b9350600401915061596d9050565b6101006040518083038186803b15801561461357600080fd5b505afa158015614627573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061464b919061559d565b5093975061481695505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b815260040160206040518083038186803b1580156146a957600080fd5b505afa1580156146bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146e1919061581d565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161472191600160a01b90910460020b9060040161596d565b6101006040518083038186803b15801561473a57600080fd5b505afa15801561474e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614772919061559d565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506147ba9450600160b81b900460020b92600401915061596d9050565b6101006040518083038186803b1580156147d357600080fd5b505afa1580156147e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061480b919061559d565b509297505050505050505b6000609760149054906101000a900460020b60020b8760020b1261483b575082614840565b508281035b6000609760179054906101000a900460020b60020b8860020b121561486657508261486b565b508282035b81830381900361488b6001600160801b0389168b8303600160801b6143df565b9b9a5050505050505050505050565b6000600160ff1b821061366a5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610832565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c4016040805180830381600087803b15801561497057600080fd5b505af1158015614984573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906149a8919061546b565b91509150816149b68a61489a565b6149c09190615cea565b9350806149cc8961489a565b6149d69190615cea565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015614a2857600080fd5b505afa158015614a3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a6091906156db565b50505050505090506000614a8d82614a7a8f60020b6131f3565b614a868f60020b6131f3565b8989613741565b90506001600160801b03811615614b3957609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b8152600401614ae594939291906158aa565b6040805180830381600087803b158015614afe57600080fd5b505af1158015614b12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b36919061546b565b50505b5050505097509795505050505050565b6000614b9e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614ede9092919063ffffffff16565b8051909150156130815780806020019051810190614bbc91906153e8565b6130815760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610832565b6000826001600160a01b0316846001600160a01b03161115614c3b579192915b6001600160a01b038416614c7b600160601b600160e01b03606085901b16614c638787615d4c565b6001600160a01b0316866001600160a01b03166143df565b6135fd9190615c88565b6000826001600160a01b0316846001600160a01b03161115614ca5579192915b6135fd6001600160801b038316614cbc8686615d4c565b6001600160a01b0316600160601b6143df565b6000826001600160a01b0316846001600160a01b03161115614cef579192915b6000614d12856001600160a01b0316856001600160a01b0316600160601b6143df565b90506131ea614d348483614d268989615d4c565b6001600160a01b03166143df565b614eed565b6000826001600160a01b0316846001600160a01b03161115614d59579192915b6135fd614d3483600160601b614d268888615d4c565b600054610100900460ff1680614d88575060005460ff16155b614da45760405162461bcd60e51b815260040161083290615a54565b600054610100900460ff1615801561428d576000805461ffff1916610101179055801561429f576000805461ff001916905550565b600054610100900460ff1680614df2575060005460ff16155b614e0e5760405162461bcd60e51b815260040161083290615a54565b600054610100900460ff16158015614e30576000805461ffff19166101011790555b8251614e43906036906020860190615069565b508151614e57906037906020850190615069565b508015613081576000805461ff0019169055505050565b600054610100900460ff1680614e87575060005460ff16155b614ea35760405162461bcd60e51b815260040161083290615a54565b600054610100900460ff16158015614ec5576000805461ffff19166101011790555b6001606555801561429f576000805461ff001916905550565b60606135fd8484600085614f08565b806001600160801b0381168114614f0357600080fd5b919050565b606082471015614f695760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610832565b843b614fb75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610832565b600080866001600160a01b03168587604051614fd3919061587a565b60006040518083038185875af1925050503d8060008114615010576040519150601f19603f3d011682016040523d82523d6000602084013e615015565b606091505b5091509150615025828286615030565b979650505050505050565b6060831561503f575081610855565b82511561504f5782518084602001fd5b8160405162461bcd60e51b815260040161083291906159a9565b82805461507590615daf565b90600052602060002090601f01602090048101928261509757600085556150dd565b82601f106150b057805160ff19168380011785556150dd565b828001600101855582156150dd579182015b828111156150dd5782518255916020019190600101906150c2565b5061366a9291505b8082111561366a57600081556001016150e5565b600082601f830112615109578081fd5b8151602061511e61511983615bdf565b615baf565b80838252828201915082860187848660051b890101111561513d578586fd5b855b8581101561516457815161515281615e96565b8452928401929084019060010161513f565b5090979650505050505050565b60008083601f840112615182578182fd5b5081356001600160401b03811115615198578182fd5b6020830191508360208285010111156151b057600080fd5b9250929050565b8051600681900b8114614f0357600080fd5b600082601f8301126151d9578081fd5b81356001600160401b038111156151f2576151f2615e80565b615205601f8201601f1916602001615baf565b818152846020838601011115615219578283fd5b816020850160208301379081016020019190915292915050565b80516001600160801b0381168114614f0357600080fd5b60006020828403121561525b578081fd5b813561085581615e96565b600060208284031215615277578081fd5b815161085581615e96565b60008060408385031215615294578081fd5b823561529f81615e96565b915060208301356152af81615e96565b809150509250929050565b6000806000606084860312156152ce578081fd5b83356152d981615e96565b925060208401356152e981615e96565b929592945050506040919091013590565b6000806040838503121561530c578182fd5b823561531781615e96565b946020939093013593505050565b60008060408385031215615337578182fd5b82516001600160401b038082111561534d578384fd5b818501915085601f830112615360578384fd5b8151602061537061511983615bdf565b8083825282820191508286018a848660051b890101111561538f578889fd5b8896505b848710156153b8576153a4816151b7565b835260019690960195918301918301615393565b50918801519196509093505050808211156153d1578283fd5b506153de858286016150f9565b9150509250929050565b6000602082840312156153f9578081fd5b815161085581615eab565b600080600080600060a0868803121561541b578283fd5b853561542681615eb9565b9450602086013561543681615eb9565b9350604086013561544681615e96565b925060608601359150608086013561545d81615eab565b809150509295509295909350565b6000806040838503121561547d578182fd5b505080516020909101519092909150565b600080600080606085870312156154a3578182fd5b843593506020850135925060408501356001600160401b038111156154c6578283fd5b6154d287828801615171565b95989497509550505050565b600080600080600080600060e0888a0312156154f8578485fd5b87356001600160401b038082111561550e578687fd5b61551a8b838c016151c9565b985060208a013591508082111561552f578687fd5b5061553c8a828b016151c9565b965050604088013561554d81615e96565b9450606088013561555d81615ec8565b9350608088013561556d81615eb9565b925060a088013561557d81615eb9565b915060c088013561558d81615e96565b8091505092959891949750929550565b600080600080600080600080610100898b0312156155b9578182fd5b6155c289615233565b9750602089015180600f0b81146155d7578283fd5b60408a015160608b0151919850965094506155f460808a016151b7565b935060a089015161560481615e96565b60c08a015190935061561581615ed8565b60e08a015190925061562681615eab565b809150509295985092959890939650565b60008060408385031215615649578182fd5b61565283615233565b915061566060208401615233565b90509250929050565b600080600080600060a08688031215615680578283fd5b61568986615233565b945060208601519350604086015192506156a560608701615233565b91506156b360808701615233565b90509295509295909350565b6000602082840312156156d0578081fd5b813561085581615ec8565b600080600080600080600060e0888a0312156156f5578081fd5b875161570081615e96565b602089015190975061571181615eb9565b604089015190965061572281615ec8565b606089015190955061573381615ec8565b608089015190945061574481615ec8565b60a089015190935060ff8116811461575a578182fd5b60c089015190925061558d81615eab565b600080600080600060a08688031215615782578283fd5b853561578d81615e96565b94506020860135935060408601356157a481615eab565b925060608601359150608086013561545d81615e96565b600080600080600060a086880312156157d2578283fd5b85356157dd81615ec8565b945060208601356157ed81615ec8565b935060408601356157fd81615ec8565b9250606086013561580d81615ed8565b9150608086013561545d81615e96565b60006020828403121561582e578081fd5b5051919050565b60008060408385031215615847578182fd5b8235915060208301356152af81615e96565b6000806040838503121561586b578182fd5b50508035926020909101359150565b6000825161588c818460208701615d83565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b6020808252825182820181905260009190848201906040850190845b8181101561596157835163ffffffff168352928401929184019160010161593f565b50909695505050505050565b60029190910b815260200190565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b60208152600082518060208401526159c8816040850160208701615d83565b601f01601f19169190910160400192915050565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252600490820152636d42505360e01b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260089082015267686967682066656560c01b604082015260600190565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b60208082526003908201526242505360e81b604082015260600190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b918252602082015260400190565b604051601f8201601f191681016001600160401b0381118282101715615bd757615bd7615e80565b604052919050565b60006001600160401b03821115615bf857615bf8615e80565b5060051b60200190565b600061ffff808316818516808303821115615c1f57615c1f615e54565b01949350505050565b60006001600160a01b03828116848216808303821115615c1f57615c1f615e54565b60008219821115615c5d57615c5d615e54565b500190565b60006001600160a01b0383811680615c7c57615c7c615e6a565b92169190910492915050565b600082615c9757615c97615e6a565b500490565b60006001600160a01b0382811684821681151582840482111615615cc257615cc2615e54565b02949350505050565b6000816000190483118215151615615ce557615ce5615e54565b500290565b60008083128015600160ff1b850184121615615d0857615d08615e54565b6001600160ff1b0384018313811615615d2357615d23615e54565b50500390565b600061ffff83811690831681811015615d4457615d44615e54565b039392505050565b60006001600160a01b0383811690831681811015615d4457615d44615e54565b600082821015615d7e57615d7e615e54565b500390565b60005b83811015615d9e578181015183820152602001615d86565b83811115610e325750506000910152565b600181811c90821680615dc357607f821691505b60208210811415615de457634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615dfe57615dfe615e54565b5060010190565b600082615e1457615e14615e6a565b500690565b60008160020b627fffff19811415615e3357615e33615e54565b9003919050565b6000600160ff1b821415615e5057615e50615e54565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461429f57600080fd5b801515811461429f57600080fd5b8060020b811461429f57600080fd5b61ffff8116811461429f57600080fd5b63ffffffff8116811461429f57600080fdfec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a2646970667358221220170d5c58be0bffd3988864d87cdc1b356071783a6ebf8d42552270cc9e4d530f64736f6c63430008040033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d91906159a9565b61026e6102693660046152fa565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d9190615896565b6102a66106fb565b60405161023d929190615ba1565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd3660046152ba565b6107a4565b6102f56102f0366004615404565b61085c565b005b6102ff606481565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f3660046152fa565b610c41565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610c78565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b136600461524a565b6001600160a01b031660009081526033602052604090205490565b6102f5610c87565b6097546103e890600160b81b900460020b81565b60405161023d919061596d565b6102f5610403366004615835565b610cdd565b61041b610416366004615835565b610e38565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e61111e565b61045a610455366004615859565b61112d565b6040805193845260208401929092529082015260600161023d565b6102f56104833660046157bb565b61127f565b6097546103e890600160a01b900460020b81565b61026e6104aa3660046152fa565b61143f565b6097546102ff90600160d01b900461ffff1681565b61026e6104d23660046152fa565b6114da565b6102f56104e536600461576b565b6114e7565b610233609b5481565b6102a661050136600461524a565b6117a4565b6102f5610514366004615835565b61184b565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f561057236600461548e565b611931565b6097546102ff90600160f01b900461ffff1681565b61023361059a366004615282565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b610233611995565b6102f56105db3660046154de565b6119a4565b6102f56105ee3660046156bf565b611c41565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f561062836600461524a565b611d4e565b6102f561063b36600461548e565b611e2e565b61041b61064e366004615835565b611e98565b60606036805461066290615daf565b80601f016020809104026020016040519081016040528092919081815260200182805461068e90615daf565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f23384846121d1565b50600192915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078791906156db565b50505050509150915061079a82826122f6565b9350935050509091565b60006107b18484846125a7565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561083b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61084f853361084a8685615d6c565b6121d1565b60019150505b9392505050565b33610865610c78565b6001600160a01b03161461088b5760405162461bcd60e51b815260040161083290615b08565b609d546000906001600160a01b031663514ea4bf6108a761276d565b6040518263ffffffff1660e01b81526004016108c591815260200190565b60a06040518083038186803b1580156108dd57600080fd5b505afa1580156108f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109159190615669565b5050505090506000816001600160801b0316111561099f57609754600090819061095590600160a01b8104600290810b91600160b81b9004900b856127d3565b9350935050506109658282612b60565b61096f8282612c39565b6040519193509150600080516020615f4b833981519152906109949084908490615ba1565b60405180910390a150505b60978054600287810b62ffffff908116600160b81b0262ffffff60b81b19928b900b909116600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a1c903090600401615896565b60206040518083038186803b158015610a3457600080fd5b505afa158015610a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6c919061581d565b610a769190615d6c565b610a809190615d6c565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610abc903090600401615896565b60206040518083038186803b158015610ad457600080fd5b505afa158015610ae8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0c919061581d565b610b169190615d6c565b610b209190615d6c565b9050610b31888884848a8a8a612cd4565b609d546000906001600160a01b031663514ea4bf610b4d61276d565b6040518263ffffffff1660e01b8152600401610b6b91815260200190565b60a06040518083038186803b158015610b8357600080fd5b505afa158015610b97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbb9190615669565b5050505090506000816001600160801b031611610c0b5760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610832565b600080516020615eeb83398151915289898684604051610c2e949392919061597b565b60405180910390a1505050505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061084a908690615c4a565b6097546001600160a01b031690565b33610c90610c78565b6001600160a01b031614610cb65760405162461bcd60e51b815260040161083290615b08565b60988054600160201b600160d01b031916905560006099819055609a55610cdb612e93565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d275760405162461bcd60e51b8152600401610832906159dc565b600080610d3a609954609a548888612efa565b60006099819055609a5590925090508115610d7457609854609e54610d74916001600160a01b0391821691600160301b909104168461301e565b8015610d9f57609854609f54610d9f916001600160a01b0391821691600160301b909104168361301e565b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610dfe57610df96001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683613086565b610e32565b610e326001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000008461301e565b50505050565b600080600060026065541415610e605760405162461bcd60e51b815260040161083290615b6a565b600260655584610e825760405162461bcd60e51b815260040161083290615b4a565b6000610e8d60355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610edf57600080fd5b505afa158015610ef3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1791906156db565b50505050505090506000821115610f5857600080610f336106fb565b91509150610f42828a8661319c565b9650610f4f818a8661319c565b95505050610fa5565b610f9f81610f77609760149054906101000a900460020b60020b6131f3565b609754610f9190600160b81b9004600290810b900b6131f3565b610f9a8b613605565b61366e565b90955093505b8415610fc357609e54610fc3906001600160a01b0316333088613709565b8315610fe157609f54610fe1906001600160a01b0316333087613709565b61102181611000609760149054906101000a900460020b60020b6131f3565b60975461101a90600160b81b9004600290810b900b6131f3565b8888613741565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d91611071913091600160a01b8104600290810b92600160b81b909204900b9089906004016158aa565b6040805180830381600087803b15801561108a57600080fd5b505af115801561109e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c2919061546b565b50506110ce8688613803565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e786888787876040516111059594939291906158ec565b60405180910390a1505060016065819055509250925092565b60606037805461066290615daf565b60008060008061113c60355490565b9050801561115b5761114f8187876138d0565b91955093509150611277565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b1580156111a057600080fd5b505afa1580156111b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d891906156db565b5050505050509050600061122282611201609760149054906101000a900460020b60020b6131f3565b60975461121b90600160b81b9004600290810b900b6131f3565b8b8b613741565b9050806001600160801b0316935061126f8261124f609760149054906101000a900460020b60020b6131f3565b60975461126990600160b81b9004600290810b900b6131f3565b8461366e565b909650945050505b509250925092565b33611288610c78565b6001600160a01b0316146112ae5760405162461bcd60e51b815260040161083290615b08565b6127108461ffff1611156112d45760405162461bcd60e51b815260040161083290615aeb565b6127108561ffff1611156112fa5760405162461bcd60e51b815260040161083290615aeb565b6127108361ffff1611156113205760405162461bcd60e51b815260040161083290615aeb565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff851615611397576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff8416156113bc576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff8316156113e257609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff821615611404576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156114385760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156114c15760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610832565b6114d0338561084a8685615d6c565b5060019392505050565b60006106f23384846125a7565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146115315760405162461bcd60e51b8152600401610832906159dc565b85156115415761154187866139df565b609d546000906001600160a01b031663514ea4bf61155d61276d565b6040518263ffffffff1660e01b815260040161157b91815260200190565b60a06040518083038186803b15801561159357600080fd5b505afa1580156115a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115cb9190615669565b5050505090506115df818989898989613c8d565b609d546000906001600160a01b031663514ea4bf6115fb61276d565b6040518263ffffffff1660e01b815260040161161991815260200190565b60a06040518083038186803b15801561163157600080fd5b505afa158015611645573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116699190615669565b505050509050816001600160801b0316816001600160801b031610156116c65760405162461bcd60e51b81526020600482015260126024820152716c697175696469747920646563726561736560701b6044820152606401610832565b609754604051600080516020615eeb8339815191529161170091600160a01b8204600290810b92600160b81b9004900b908690869061597b565b60405180910390a150506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611767576117626001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683613086565b61179b565b61179b6001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000008461301e565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b1580156117f757600080fd5b505afa15801561180b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182f91906156db565b505050505091505061184184826122f6565b9250925050915091565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118955760405162461bcd60e51b8152600401610832906159dc565b6000806118a8609b54609c548888612efa565b6000609b819055609c55909250905081156118f457609e546118f4906001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000008461301e565b8015610d9f57609f54610d9f906001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000008361301e565b609d546001600160a01b0316331461195b5760405162461bcd60e51b815260040161083290615a2b565b831561197857609e54611978906001600160a01b0316338661301e565b8215610e3257609f54610e32906001600160a01b0316338561301e565b600061199f61276d565b905090565b600054610100900460ff16806119bd575060005460ff16155b6119d95760405162461bcd60e51b815260040161083290615a54565b600054610100900460ff161580156119fb576000805461ffff19166101011790555b611a086064612710615d29565b61ffff168561ffff161115611a2f5760405162461bcd60e51b815260040161083290615a0d565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe168191600480820192602092909190829003018186803b158015611a8357600080fd5b505afa158015611a97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abb9190615266565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611b1457600080fd5b505afa158015611b28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4c9190615266565b609f80546001600160a01b03199081166001600160a01b0393841617909155609880546097805461012c65ffffffffffff19909316600160201b61ffff8d160263ffffffff19161792909217600160301b600160d01b031916600160301b95881695860217909255643e800c801960d31b600165ffffff00000160a01b03909116600160a01b60028a810b62ffffff908116929092029290921792909217600165ffffff00000160a01b031916600160b81b9189900b9290921602909216919091179091179055611c1d88886141af565b611c2561422e565b8015611c37576000805461ff00191690555b5050505050505050565b33611c4a610c78565b6001600160a01b031614611c705760405162461bcd60e51b815260040161083290615b08565b609854600160201b900461ffff1615611cb15760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610832565b60008161ffff16118015611cd95750611ccd6064612710615d29565b61ffff168161ffff1611155b611cf55760405162461bcd60e51b815260040161083290615a0d565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611d57610c78565b6001600160a01b031614611d7d5760405162461bcd60e51b815260040161083290615b08565b6001600160a01b038116611de45760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610832565b6097546040516001600160a01b03808416921690600080516020615f0b83398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611e585760405162461bcd60e51b815260040161083290615a2b565b6000841315611e7857609e54610df9906001600160a01b0316338661301e565b6000831315610e3257609f54610e32906001600160a01b0316338561301e565b600080600060026065541415611ec05760405162461bcd60e51b815260040161083290615b6a565b600260655584611efb5760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610832565b6000611f0660355490565b609d549091506000906001600160a01b031663514ea4bf611f2561276d565b6040518263ffffffff1660e01b8152600401611f4391815260200190565b60a06040518083038186803b158015611f5b57600080fd5b505afa158015611f6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f939190615669565b505050509050611fa333886142a2565b6000611fb988836001600160801b0316856143df565b9050611fc481613605565b609754909450600090819081908190611ff390600160a01b8104600290810b91600160b81b9004900b8a6127d3565b93509350935093506120058282612b60565b61200f8282612c39565b6040519193509150600080516020615f4b833981519152906120349084908490615ba1565b60405180910390a1609b54609954609e546040516370a0823160e01b81526120ef93929188916001600160a01b03909116906370a082319061207a903090600401615896565b60206040518083038186803b15801561209257600080fd5b505afa1580156120a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ca919061581d565b6120d49190615d6c565b6120de9190615d6c565b6120e89190615d6c565b8d896143df565b6120f99085615c4a565b609c54609a54609f546040516370a0823160e01b8152939d506121369387916001600160a01b0316906370a082319061207a903090600401615896565b6121409084615c4a565b9850891561215f57609e5461215f906001600160a01b03168c8c61301e565b881561217c57609f5461217c906001600160a01b03168c8b61301e565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516121b39594939291906158ec565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166122335760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610832565b6001600160a01b0382166122945760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610832565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61231e61276d565b6040518263ffffffff1660e01b815260040161233c91815260200190565b60a06040518083038186803b15801561235457600080fd5b505afa158015612368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238c9190615669565b945094509450945094506123d5896123b5609760149054906101000a900460020b60020b6131f3565b6097546123cf90600160b81b9004600290810b900b6131f3565b8861366e565b909750955060006001600160801b0383166123f36001878c8a61448e565b6123fd9190615c4a565b90506000826001600160801b03166124186000878d8b61448e565b6124229190615c4a565b905061242e8282612c39565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a082319061246c903090600401615896565b60206040518083038186803b15801561248457600080fd5b505afa158015612498573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124bc919061581d565b6124c69085615c4a565b6124d09190615d6c565b6124da9190615d6c565b6124e4908a615c4a565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a082319061251f903090600401615896565b60206040518083038186803b15801561253757600080fd5b505afa15801561254b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061256f919061581d565b6125799084615c4a565b6125839190615d6c565b61258d9190615d6c565b6125979089615c4a565b9750505050505050509250929050565b6001600160a01b03831661260b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610832565b6001600160a01b03821661266d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610832565b6001600160a01b038316600090815260336020526040902054818110156126e55760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610832565b6126ef8282615d6c565b6001600160a01b038086166000908152603360205260408082209390935590851681529081208054849290612725908490615c4a565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615f2b8339815191528460405161275f91815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b8204600290810b810b60e890811b6034840152600160b81b909304810b900b90911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a082319061280c903090600401615896565b60206040518083038186803b15801561282457600080fd5b505afa158015612838573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061285c919061581d565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a0823190612892903090600401615896565b60206040518083038186803b1580156128aa57600080fd5b505afa1580156128be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e2919061581d565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a7906064016040805180830381600087803b15801561294257600080fd5b505af1158015612956573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061297a919061546b565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a4016040805180830381600087803b1580156129e857600080fd5b505af11580156129fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a209190615637565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612a56903090600401615896565b60206040518083038186803b158015612a6e57600080fd5b505afa158015612a82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aa6919061581d565b612ab09190615d6c565b612aba9190615d6c565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a0823190612aef903090600401615896565b60206040518083038186803b158015612b0757600080fd5b505afa158015612b1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b3f919061581d565b612b499190615d6c565b612b539190615d6c565b9250505093509350935093565b612710612b6e606484615ccb565b612b789190615c88565b609b6000828254612b899190615c4a565b909155506127109050612b9d606483615ccb565b612ba79190615c88565b609c6000828254612bb89190615c4a565b909155505060985461271090612bd990600160201b900461ffff1684615ccb565b612be39190615c88565b60996000828254612bf49190615c4a565b909155505060985461271090612c1590600160201b900461ffff1683615ccb565b612c1f9190615c88565b609a6000828254612c309190615c4a565b90915550505050565b6000806000612710609860049054906101000a900461ffff166064612c5e9190615c02565b612c6c9061ffff1687615ccb565b612c769190615c88565b60985490915060009061271090612c9990600160201b900461ffff166064615c02565b612ca79061ffff1687615ccb565b612cb19190615c88565b9050612cbd8287615d6c565b9350612cc98186615d6c565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b158015612d1957600080fd5b505afa158015612d2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5191906156db565b50505050505090506000612d7e82612d6b8b60020b6131f3565b612d778b60020b6131f3565b8a8a613741565b90506001600160801b03811615612e3b57609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612dca9030908f908f9089906004016158aa565b6040805180830381600087803b158015612de357600080fd5b505af1158015612df7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e1b919061546b565b9092509050612e2a828a615d6c565b9850612e368189615d6c565b975050505b6000612e6a6127108686612e4f5789612e51565b8a5b612e5b9190615ccb565b612e659190615c88565b61489a565b90506000811315612e8757612e848a8a8a8a858b8a614900565b50505b50505050505050505050565b33612e9c610c78565b6001600160a01b031614612ec25760405162461bcd60e51b815260040161083290615b08565b6097546040516000916001600160a01b031690600080516020615f0b833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0384811691161415612f6f57609754849061271090612f3390600160e01b900461ffff1689615ccb565b612f3d9190615c88565b1015612f5b5760405162461bcd60e51b815260040161083290615aa2565b612f658487615d6c565b9150849050613015565b609f546001600160a01b0384811691161415612fdf57609754849061271090612fa390600160e01b900461ffff1688615ccb565b612fad9190615c88565b1015612fcb5760405162461bcd60e51b815260040161083290615aa2565b612fd58486615d6c565b9050859150613015565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610832565b94509492505050565b6040516001600160a01b03831660248201526044810182905261308190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614b49565b505050565b804710156130d65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610832565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613123576040519150601f19603f3d011682016040523d82523d6000602084013e613128565b606091505b50509050806130815760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610832565b60006131a98484846143df565b9050600082806131c957634e487b7160e01b600052601260045260246000fd5b84860911156108555760001981106131e057600080fd5b806131ea81615dea565b95945050505050565b60008060008360020b1261320a578260020b613217565b8260020b61321790615e3a565b9050613226620d89e719615e19565b60020b81111561325c5760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610832565b60006001821661327057600160801b613282565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b0316905060028216156132b75760806132b2826ffff97272373d413259a46990580e213a615ccb565b901c90505b60048216156132e15760806132dc826ffff2e50f5f656932ef12357cf3c7fdcc615ccb565b901c90505b600882161561330b576080613306826fffe5caca7e10e4e61c3624eaa0941cd0615ccb565b901c90505b6010821615613335576080613330826fffcb9843d60f6159c9db58835c926644615ccb565b901c90505b602082161561335f57608061335a826fff973b41fa98c081472e6896dfb254c0615ccb565b901c90505b6040821615613389576080613384826fff2ea16466c96a3843ec78b326b52861615ccb565b901c90505b60808216156133b35760806133ae826ffe5dee046a99a2a811c461f1969c3053615ccb565b901c90505b6101008216156133de5760806133d9826ffcbe86c7900a88aedcffc83b479aa3a4615ccb565b901c90505b610200821615613409576080613404826ff987a7253ac413176f2b074cf7815e54615ccb565b901c90505b61040082161561343457608061342f826ff3392b0822b70005940c7a398e4b70f3615ccb565b901c90505b61080082161561345f57608061345a826fe7159475a2c29b7443b29c7fa6e889d9615ccb565b901c90505b61100082161561348a576080613485826fd097f3bdfd2022b8845ad8f792aa5825615ccb565b901c90505b6120008216156134b55760806134b0826fa9f746462d870fdf8a65dc1f90e061e5615ccb565b901c90505b6140008216156134e05760806134db826f70d869a156d2a1b890bb3df62baf32f7615ccb565b901c90505b61800082161561350b576080613506826f31be135f97d08fd981231505542fcfa6615ccb565b901c90505b62010000821615613537576080613532826f09aa508b5b7a84e1c677de54f3e99bc9615ccb565b901c90505b6202000082161561356257608061355d826e5d6af8dedb81196699c329225ee604615ccb565b901c90505b6204000082161561358c576080613587826d2216e584f5fa1ea926041bedfe98615ccb565b901c90505b620800008216156135b45760806135af826b048a170391f7dc42444e8fa2615ccb565b901c90505b60008460020b13156135cf576135cc81600019615c88565b90505b6135dd600160201b82615e05565b156135e95760016135ec565b60005b6135fd9060ff16602083901c615c4a565b949350505050565b6000600160801b821061366a5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610832565b5090565b600080836001600160a01b0316856001600160a01b0316111561368f579293925b846001600160a01b0316866001600160a01b0316116136ba576136b3858585614c1b565b9150613015565b836001600160a01b0316866001600160a01b031610156136f3576136df868585614c1b565b91506136ec858785614c85565b9050613015565b6136fe858585614c85565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e329085906323b872dd60e01b9060840161304a565b6000836001600160a01b0316856001600160a01b03161115613761579293925b846001600160a01b0316866001600160a01b03161161378c57613785858585614ccf565b90506131ea565b836001600160a01b0316866001600160a01b031610156137ee5760006137b3878686614ccf565b905060006137c2878986614d39565b9050806001600160801b0316826001600160801b0316106137e357806137e5565b815b925050506131ea565b6137f9858584614d39565b9695505050505050565b6001600160a01b0382166138595760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610832565b806035600082825461386b9190615c4a565b90915550506001600160a01b03821660009081526033602052604081208054839290613898908490615c4a565b90915550506040518181526001600160a01b03831690600090600080516020615f2b8339815191529060200160405180910390a35050565b60008060008060006138e06106fb565b915091508160001480156138f45750600081115b1561390b576139048689836143df565b92506139ba565b801580156139195750600082115b15613929576139048789846143df565b81158015613935575080155b1561395c5760405162461bcd60e51b81526020600482015260006024820152604401610832565b6000613969888a856143df565b90506000613978888b856143df565b905060008211801561398a5750600081115b6139a65760405162461bcd60e51b815260040161083290615b4a565b8082106139b357806139b5565b815b945050505b6139c583838a61319c565b94506139d283828a61319c565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff1691839150600090613a2b57634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110613a6857634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613aae908590600401615923565b60006040518083038186803b158015613ac657600080fd5b505afa158015613ada573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613b029190810190615325565b5090508051600214613b425760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610832565b6098548151600091829163ffffffff90911660060b9084908390613b7657634e487b7160e01b600052603260045260246000fd5b602002602001015184600181518110613b9f57634e487b7160e01b600052603260045260246000fd5b60200260200101510360060b81613bc657634e487b7160e01b600052601260045260246000fd5b059050613bd58160020b6131f3565b6097549092506000915061271090613bf890600160f01b900461ffff1684615c9c565b613c029190615c62565b90508415613c4a57613c148183615d4c565b6001600160a01b0316866001600160a01b03161015613c455760405162461bcd60e51b815260040161083290615ac4565b613c85565b613c548183615c28565b6001600160a01b0316866001600160a01b03161115613c855760405162461bcd60e51b815260040161083290615ac4565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613cc6903090600401615896565b60206040518083038186803b158015613cde57600080fd5b505afa158015613cf2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d16919061581d565b613d209190615d6c565b613d2a9190615d6c565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613d66903090600401615896565b60206040518083038186803b158015613d7e57600080fd5b505afa158015613d92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613db6919061581d565b613dc09190615d6c565b613dca9190615d6c565b6097549091506000908190613df590600160a01b8104600290810b91600160b81b9004900b8c6127d3565b935093505050613e058282612b60565b613e0f8282612c39565b6040519193509150600080516020615f4b83398151915290613e349084908490615ba1565b60405180910390a1613e468483615c4a565b9150613e528382615c4a565b609e549091506001600160a01b0386811691161415613ffd57609754869061271090613e8990600160d01b900461ffff1685615ccb565b613e939190615c88565b1015613eb15760405162461bcd60e51b815260040161083290615aa2565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613ee9903090600401615896565b60206040518083038186803b158015613f0157600080fd5b505afa158015613f15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f39919061581d565b613f439190615d6c565b613f4d9190615d6c565b613f579190615d6c565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613f92903090600401615896565b60206040518083038186803b158015613faa57600080fd5b505afa158015613fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fe2919061581d565b613fec9190615d6c565b613ff69190615d6c565b9250614188565b609f546001600160a01b0386811691161415612fdf5760975486906127109061403190600160d01b900461ffff1684615ccb565b61403b9190615c88565b10156140595760405162461bcd60e51b815260040161083290615aa2565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a082319061408f903090600401615896565b60206040518083038186803b1580156140a757600080fd5b505afa1580156140bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140df919061581d565b6140e99190615d6c565b6140f39190615d6c565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a082319061412e903090600401615896565b60206040518083038186803b15801561414657600080fd5b505afa15801561415a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061417e919061581d565b613fe29190615d6c565b609754612e8790600160a01b8104600290810b91600160b81b9004900b86868d8d8d612cd4565b600054610100900460ff16806141c8575060005460ff16155b6141e45760405162461bcd60e51b815260040161083290615a54565b600054610100900460ff16158015614206576000805461ffff19166101011790555b61420e614d6f565b6142188383614dd9565b8015613081576000805461ff0019169055505050565b600054610100900460ff1680614247575060005460ff16155b6142635760405162461bcd60e51b815260040161083290615a54565b600054610100900460ff16158015614285576000805461ffff19166101011790555b61428d614e6e565b801561429f576000805461ff00191690555b50565b6001600160a01b0382166143025760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610832565b6001600160a01b038216600090815260336020526040902054818110156143765760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610832565b6143808282615d6c565b6001600160a01b038416600090815260336020526040812091909155603580548492906143ae908490615d6c565b90915550506040518281526000906001600160a01b03851690600080516020615f2b833981519152906020016122e9565b600080806000198587098587029250828110838203039150508060001415614419576000841161440e57600080fd5b508290049050610855565b80841161442557600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600080871561465b57609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b815260040160206040518083038186803b1580156144e857600080fd5b505afa1580156144fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614520919061581d565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161456091600160a01b90910460020b9060040161596d565b6101006040518083038186803b15801561457957600080fd5b505afa15801561458d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145b1919061559d565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba9395506145fa94600160b81b90910460020b9350600401915061596d9050565b6101006040518083038186803b15801561461357600080fd5b505afa158015614627573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061464b919061559d565b5093975061481695505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b815260040160206040518083038186803b1580156146a957600080fd5b505afa1580156146bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146e1919061581d565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161472191600160a01b90910460020b9060040161596d565b6101006040518083038186803b15801561473a57600080fd5b505afa15801561474e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614772919061559d565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506147ba9450600160b81b900460020b92600401915061596d9050565b6101006040518083038186803b1580156147d357600080fd5b505afa1580156147e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061480b919061559d565b509297505050505050505b6000609760149054906101000a900460020b60020b8760020b1261483b575082614840565b508281035b6000609760179054906101000a900460020b60020b8860020b121561486657508261486b565b508282035b81830381900361488b6001600160801b0389168b8303600160801b6143df565b9b9a5050505050505050505050565b6000600160ff1b821061366a5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610832565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c4016040805180830381600087803b15801561497057600080fd5b505af1158015614984573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906149a8919061546b565b91509150816149b68a61489a565b6149c09190615cea565b9350806149cc8961489a565b6149d69190615cea565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015614a2857600080fd5b505afa158015614a3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a6091906156db565b50505050505090506000614a8d82614a7a8f60020b6131f3565b614a868f60020b6131f3565b8989613741565b90506001600160801b03811615614b3957609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b8152600401614ae594939291906158aa565b6040805180830381600087803b158015614afe57600080fd5b505af1158015614b12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b36919061546b565b50505b5050505097509795505050505050565b6000614b9e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614ede9092919063ffffffff16565b8051909150156130815780806020019051810190614bbc91906153e8565b6130815760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610832565b6000826001600160a01b0316846001600160a01b03161115614c3b579192915b6001600160a01b038416614c7b600160601b600160e01b03606085901b16614c638787615d4c565b6001600160a01b0316866001600160a01b03166143df565b6135fd9190615c88565b6000826001600160a01b0316846001600160a01b03161115614ca5579192915b6135fd6001600160801b038316614cbc8686615d4c565b6001600160a01b0316600160601b6143df565b6000826001600160a01b0316846001600160a01b03161115614cef579192915b6000614d12856001600160a01b0316856001600160a01b0316600160601b6143df565b90506131ea614d348483614d268989615d4c565b6001600160a01b03166143df565b614eed565b6000826001600160a01b0316846001600160a01b03161115614d59579192915b6135fd614d3483600160601b614d268888615d4c565b600054610100900460ff1680614d88575060005460ff16155b614da45760405162461bcd60e51b815260040161083290615a54565b600054610100900460ff1615801561428d576000805461ffff1916610101179055801561429f576000805461ff001916905550565b600054610100900460ff1680614df2575060005460ff16155b614e0e5760405162461bcd60e51b815260040161083290615a54565b600054610100900460ff16158015614e30576000805461ffff19166101011790555b8251614e43906036906020860190615069565b508151614e57906037906020850190615069565b508015613081576000805461ff0019169055505050565b600054610100900460ff1680614e87575060005460ff16155b614ea35760405162461bcd60e51b815260040161083290615a54565b600054610100900460ff16158015614ec5576000805461ffff19166101011790555b6001606555801561429f576000805461ff001916905550565b60606135fd8484600085614f08565b806001600160801b0381168114614f0357600080fd5b919050565b606082471015614f695760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610832565b843b614fb75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610832565b600080866001600160a01b03168587604051614fd3919061587a565b60006040518083038185875af1925050503d8060008114615010576040519150601f19603f3d011682016040523d82523d6000602084013e615015565b606091505b5091509150615025828286615030565b979650505050505050565b6060831561503f575081610855565b82511561504f5782518084602001fd5b8160405162461bcd60e51b815260040161083291906159a9565b82805461507590615daf565b90600052602060002090601f01602090048101928261509757600085556150dd565b82601f106150b057805160ff19168380011785556150dd565b828001600101855582156150dd579182015b828111156150dd5782518255916020019190600101906150c2565b5061366a9291505b8082111561366a57600081556001016150e5565b600082601f830112615109578081fd5b8151602061511e61511983615bdf565b615baf565b80838252828201915082860187848660051b890101111561513d578586fd5b855b8581101561516457815161515281615e96565b8452928401929084019060010161513f565b5090979650505050505050565b60008083601f840112615182578182fd5b5081356001600160401b03811115615198578182fd5b6020830191508360208285010111156151b057600080fd5b9250929050565b8051600681900b8114614f0357600080fd5b600082601f8301126151d9578081fd5b81356001600160401b038111156151f2576151f2615e80565b615205601f8201601f1916602001615baf565b818152846020838601011115615219578283fd5b816020850160208301379081016020019190915292915050565b80516001600160801b0381168114614f0357600080fd5b60006020828403121561525b578081fd5b813561085581615e96565b600060208284031215615277578081fd5b815161085581615e96565b60008060408385031215615294578081fd5b823561529f81615e96565b915060208301356152af81615e96565b809150509250929050565b6000806000606084860312156152ce578081fd5b83356152d981615e96565b925060208401356152e981615e96565b929592945050506040919091013590565b6000806040838503121561530c578182fd5b823561531781615e96565b946020939093013593505050565b60008060408385031215615337578182fd5b82516001600160401b038082111561534d578384fd5b818501915085601f830112615360578384fd5b8151602061537061511983615bdf565b8083825282820191508286018a848660051b890101111561538f578889fd5b8896505b848710156153b8576153a4816151b7565b835260019690960195918301918301615393565b50918801519196509093505050808211156153d1578283fd5b506153de858286016150f9565b9150509250929050565b6000602082840312156153f9578081fd5b815161085581615eab565b600080600080600060a0868803121561541b578283fd5b853561542681615eb9565b9450602086013561543681615eb9565b9350604086013561544681615e96565b925060608601359150608086013561545d81615eab565b809150509295509295909350565b6000806040838503121561547d578182fd5b505080516020909101519092909150565b600080600080606085870312156154a3578182fd5b843593506020850135925060408501356001600160401b038111156154c6578283fd5b6154d287828801615171565b95989497509550505050565b600080600080600080600060e0888a0312156154f8578485fd5b87356001600160401b038082111561550e578687fd5b61551a8b838c016151c9565b985060208a013591508082111561552f578687fd5b5061553c8a828b016151c9565b965050604088013561554d81615e96565b9450606088013561555d81615ec8565b9350608088013561556d81615eb9565b925060a088013561557d81615eb9565b915060c088013561558d81615e96565b8091505092959891949750929550565b600080600080600080600080610100898b0312156155b9578182fd5b6155c289615233565b9750602089015180600f0b81146155d7578283fd5b60408a015160608b0151919850965094506155f460808a016151b7565b935060a089015161560481615e96565b60c08a015190935061561581615ed8565b60e08a015190925061562681615eab565b809150509295985092959890939650565b60008060408385031215615649578182fd5b61565283615233565b915061566060208401615233565b90509250929050565b600080600080600060a08688031215615680578283fd5b61568986615233565b945060208601519350604086015192506156a560608701615233565b91506156b360808701615233565b90509295509295909350565b6000602082840312156156d0578081fd5b813561085581615ec8565b600080600080600080600060e0888a0312156156f5578081fd5b875161570081615e96565b602089015190975061571181615eb9565b604089015190965061572281615ec8565b606089015190955061573381615ec8565b608089015190945061574481615ec8565b60a089015190935060ff8116811461575a578182fd5b60c089015190925061558d81615eab565b600080600080600060a08688031215615782578283fd5b853561578d81615e96565b94506020860135935060408601356157a481615eab565b925060608601359150608086013561545d81615e96565b600080600080600060a086880312156157d2578283fd5b85356157dd81615ec8565b945060208601356157ed81615ec8565b935060408601356157fd81615ec8565b9250606086013561580d81615ed8565b9150608086013561545d81615e96565b60006020828403121561582e578081fd5b5051919050565b60008060408385031215615847578182fd5b8235915060208301356152af81615e96565b6000806040838503121561586b578182fd5b50508035926020909101359150565b6000825161588c818460208701615d83565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b6020808252825182820181905260009190848201906040850190845b8181101561596157835163ffffffff168352928401929184019160010161593f565b50909695505050505050565b60029190910b815260200190565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b60208152600082518060208401526159c8816040850160208701615d83565b601f01601f19169190910160400192915050565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252600490820152636d42505360e01b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260089082015267686967682066656560c01b604082015260600190565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b60208082526003908201526242505360e81b604082015260600190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b918252602082015260400190565b604051601f8201601f191681016001600160401b0381118282101715615bd757615bd7615e80565b604052919050565b60006001600160401b03821115615bf857615bf8615e80565b5060051b60200190565b600061ffff808316818516808303821115615c1f57615c1f615e54565b01949350505050565b60006001600160a01b03828116848216808303821115615c1f57615c1f615e54565b60008219821115615c5d57615c5d615e54565b500190565b60006001600160a01b0383811680615c7c57615c7c615e6a565b92169190910492915050565b600082615c9757615c97615e6a565b500490565b60006001600160a01b0382811684821681151582840482111615615cc257615cc2615e54565b02949350505050565b6000816000190483118215151615615ce557615ce5615e54565b500290565b60008083128015600160ff1b850184121615615d0857615d08615e54565b6001600160ff1b0384018313811615615d2357615d23615e54565b50500390565b600061ffff83811690831681811015615d4457615d44615e54565b039392505050565b60006001600160a01b0383811690831681811015615d4457615d44615e54565b600082821015615d7e57615d7e615e54565b500390565b60005b83811015615d9e578181015183820152602001615d86565b83811115610e325750506000910152565b600181811c90821680615dc357607f821691505b60208210811415615de457634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615dfe57615dfe615e54565b5060010190565b600082615e1457615e14615e6a565b500690565b60008160020b627fffff19811415615e3357615e33615e54565b9003919050565b6000600160ff1b821415615e5057615e50615e54565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461429f57600080fd5b801515811461429f57600080fd5b8060020b811461429f57600080fd5b61ffff8116811461429f57600080fd5b63ffffffff8116811461429f57600080fdfec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a2646970667358221220170d5c58be0bffd3988864d87cdc1b356071783a6ebf8d42552270cc9e4d530f64736f6c63430008040033", - "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}." - }, - "burn(uint256,address)": { - "params": { - "burnAmount": "The number of G-UNI tokens to burn", - "receiver": "The account to receive the underlying amounts of token0 and token1" - }, - "returns": { - "amount0": "amount of token0 transferred to receiver for burning `burnAmount`", - "amount1": "amount of token1 transferred to receiver for burning `burnAmount`", - "liquidityBurned": "amount of liquidity removed from the underlying Uniswap V3 position" - } - }, - "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 this function is overridden; 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`." - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "details": "When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.", - "params": { - "newLowerTick": "The new lower bound of the position's range", - "newUpperTick": "The new upper bound of the position's range", - "swapAmountBPS": "amount of token to swap as proportion of total. Pass 0 to ignore swap.", - "swapThresholdPrice": "slippage parameter on the swap as a max or min sqrtPriceX96", - "zeroForOne": "Which token to input into the swap (true = token0, false = token1)" - } - }, - "getMintAmounts(uint256,uint256)": { - "params": { - "amount0Max": "The maximum amount of token1 to forward on mint" - }, - "returns": { - "amount0": "actual amount of token0 to forward when minting `mintAmount`", - "amount1": "actual amount of token1 to forward when minting `mintAmount`", - "mintAmount": "maximum number of G-UNI tokens to mint" - } - }, - "getUnderlyingBalances()": { - "returns": { - "amount0Current": "current total underlying balance of token0", - "amount1Current": "current total underlying balance of token1" - } - }, - "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." - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "params": { - "_lowerTick": "initial upperTick (only changeable with executiveRebalance)", - "_managerFeeBPS": "proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION", - "_manager_": "address of manager (ownership can be transferred)", - "_name": "name of G-UNI token", - "_pool": "address of Uniswap V3 pool", - "_symbol": "symbol of G-UNI token" - } - }, - "initializeManagerFee(uint16)": { - "params": { - "_managerFeeBPS": "proportion of fees earned that are credited to manager in Basis Points" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "mint(uint256,address)": { - "details": "to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts", - "params": { - "mintAmount": "The number of G-UNI tokens to mint", - "receiver": "The account to receive the minted tokens" - }, - "returns": { - "amount0": "amount of token0 transferred from msg.sender to mint `mintAmount`", - "amount1": "amount of token1 transferred from msg.sender to mint `mintAmount`", - "liquidityMinted": "amount of liquidity added to the underlying Uniswap V3 position" - } - }, - "name()": { - "details": "Returns the name of the token." - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "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 manager." - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "params": { - "newRebalanceBPS": "controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance", - "newSlippageBPS": "maximum slippage on swaps during gelato rebalance", - "newSlippageInterval": "length of time for TWAP used in computing slippage on swaps", - "newTreasury": "address where managerFee withdrawals are sent", - "newWithdrawBPS": "controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "burn(uint256,address)": { - "notice": "burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens" - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "notice": "Change the range of underlying UniswapV3 position, only manager can call" - }, - "getMintAmounts(uint256,uint256)": { - "notice": "compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`" - }, - "getUnderlyingBalances()": { - "notice": "compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)" - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "notice": "initialize storage variables on a new G-UNI pool, only called once" - }, - "initializeManagerFee(uint16)": { - "notice": "initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again." - }, - "mint(uint256,address)": { - "notice": "mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position" - }, - "rebalance(uint160,uint256,bool,uint256,address)": { - "notice": "Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager." - }, - "uniswapV3MintCallback(uint256,uint256,bytes)": { - "notice": "Uniswap V3 callback fn, called back on pool.mint" - }, - "uniswapV3SwapCallback(int256,int256,bytes)": { - "notice": "Uniswap v3 callback fn, called back on pool.swap" - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "notice": "change configurable parameters, only manager can call" - }, - "withdrawGelatoBalance(uint256,address)": { - "notice": "withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - }, - "withdrawManagerBalance(uint256,address)": { - "notice": "withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 5, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 784, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage" - }, - { - "astId": 122, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_balances", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 128, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_allowances", - "offset": 0, - "slot": "52", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 130, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_totalSupply", - "offset": 0, - "slot": "53", - "type": "t_uint256" - }, - { - "astId": 132, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_name", - "offset": 0, - "slot": "54", - "type": "t_string_storage" - }, - { - "astId": 134, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_symbol", - "offset": 0, - "slot": "55", - "type": "t_string_storage" - }, - { - "astId": 636, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "56", - "type": "t_array(t_uint256)45_storage" - }, - { - "astId": 59, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_status", - "offset": 0, - "slot": "101", - "type": "t_uint256" - }, - { - "astId": 102, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "102", - "type": "t_array(t_uint256)49_storage" - }, - { - "astId": 6311, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_manager", - "offset": 0, - "slot": "151", - "type": "t_address" - }, - { - "astId": 5901, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "lowerTick", - "offset": 20, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 5903, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "upperTick", - "offset": 23, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 5905, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoRebalanceBPS", - "offset": 26, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 5907, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoWithdrawBPS", - "offset": 28, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 5909, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageBPS", - "offset": 30, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 5911, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageInterval", - "offset": 0, - "slot": "152", - "type": "t_uint32" - }, - { - "astId": 5913, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerFeeBPS", - "offset": 4, - "slot": "152", - "type": "t_uint16" - }, - { - "astId": 5915, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerTreasury", - "offset": 6, - "slot": "152", - "type": "t_address" - }, - { - "astId": 5917, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance0", - "offset": 0, - "slot": "153", - "type": "t_uint256" - }, - { - "astId": 5919, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance1", - "offset": 0, - "slot": "154", - "type": "t_uint256" - }, - { - "astId": 5921, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance0", - "offset": 0, - "slot": "155", - "type": "t_uint256" - }, - { - "astId": 5923, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance1", - "offset": 0, - "slot": "156", - "type": "t_uint256" - }, - { - "astId": 5926, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "pool", - "offset": 0, - "slot": "157", - "type": "t_contract(IUniswapV3Pool)2339" - }, - { - "astId": 5929, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token0", - "offset": 0, - "slot": "158", - "type": "t_contract(IERC20)863" - }, - { - "astId": 5932, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token1", - "offset": 0, - "slot": "159", - "type": "t_contract(IERC20)863" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)45_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)49_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "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)863": { - "encoding": "inplace", - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_contract(IUniswapV3Pool)2339": { - "encoding": "inplace", - "label": "contract IUniswapV3Pool", - "numberOfBytes": "20" - }, - "t_int24": { - "encoding": "inplace", - "label": "int24", - "numberOfBytes": "3" - }, - "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_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} diff --git a/lib/g-uni-v1-core/deployments/goerli/solcInputs/869261aeb304b707d80e5edda679e3aa.json b/lib/g-uni-v1-core/deployments/goerli/solcInputs/869261aeb304b707d80e5edda679e3aa.json deleted file mode 100644 index e7e7ccf0c..000000000 --- a/lib/g-uni-v1-core/deployments/goerli/solcInputs/869261aeb304b707d80e5edda679e3aa.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 100;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n event SetManagerFee(uint16 managerFee);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n emit SetManagerFee(_managerFeeBPS);\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.4;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidityBefore,\n uint128 liquidityAfter\n );\n\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n SafeCast.toUint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidityBurned);\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n\n amount0 =\n burn0 +\n FullMath.mulDiv(\n token0.balanceOf(address(this)) -\n burn0 -\n managerBalance0 -\n gelatoBalance0,\n burnAmount,\n totalSupply\n );\n amount1 =\n burn1 +\n FullMath.mulDiv(\n token1.balanceOf(address(this)) -\n burn1 -\n managerBalance1 -\n gelatoBalance1,\n burnAmount,\n totalSupply\n );\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n if (liquidity > 0) {\n (, , uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n }\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > 0, \"new position 0\");\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n _rebalance(\n liquidity,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity >= liquidity, \"liquidity decrease\");\n\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\n external\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n // solhint-disable-next-line function-max-lines\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\n internal\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint128 liquidity,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n uint256 leftover0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 leftover1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n (, , uint256 feesEarned0, uint256 feesEarned1) =\n _withdraw(lowerTick, upperTick, liquidity);\n _applyFees(feesEarned0, feesEarned1);\n (feesEarned0, feesEarned1) = _subtractAdminFees(\n feesEarned0,\n feesEarned1\n );\n emit FeesEarned(feesEarned0, feesEarned1);\n feesEarned0 += leftover0;\n feesEarned1 += leftover1;\n\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n leftover0,\n leftover1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdraw(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n )\n private\n returns (\n uint256 burn0,\n uint256 burn1,\n uint256 fee0,\n uint256 fee1\n )\n {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n SafeCast.toInt256(\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\n );\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array len\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"high slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"high slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\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 require(value < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return uint128(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 require(value < 2**64, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return uint64(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 require(value < 2**32, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return uint32(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 require(value < 2**16, \"SafeCast: value doesn\\'t fit in 16 bits\");\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 require(value < 2**8, \"SafeCast: value doesn\\'t fit in 8 bits\");\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 require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= -2**127 && value < 2**127, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return int128(value);\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= -2**63 && value < 2**63, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return int64(value);\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= -2**31 && value < 2**31, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return int32(value);\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= -2**15 && value < 2**15, \"SafeCast: value doesn\\'t fit in 16 bits\");\n return int16(value);\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= -2**7 && value < 2**7, \"SafeCast: value doesn\\'t fit in 8 bits\");\n return int8(value);\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 require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3 pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n // solhint-disable-next-line function-max-lines\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory name = \"Gelato Uniswap LP\";\n try this.getTokenName(token0, token1) returns (string memory result) {\n name = result;\n } catch {} // solhint-disable-line no-empty-blocks\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n\n require(uniPool != address(0), \"uniswap pool does not exist\");\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, msg.sender, pool);\n }\n\n function getTokenName(address token0, address token1)\n external\n view\n returns (string memory)\n {\n string memory symbol0 = IERC20Metadata(token0).symbol();\n string memory symbol1 = IERC20Metadata(token1).symbol();\n\n return _append(\"Gelato Uniswap \", symbol0, \"/\", symbol1, \" LP\");\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": ["ast"] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} diff --git a/lib/g-uni-v1-core/deployments/mainnet/.chainId b/lib/g-uni-v1-core/deployments/mainnet/.chainId deleted file mode 100644 index 56a6051ca..000000000 --- a/lib/g-uni-v1-core/deployments/mainnet/.chainId +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/mainnet/GUniFactory_Implementation.json b/lib/g-uni-v1-core/deployments/mainnet/GUniFactory_Implementation.json deleted file mode 100644 index 13265de21..000000000 --- a/lib/g-uni-v1-core/deployments/mainnet/GUniFactory_Implementation.json +++ /dev/null @@ -1,800 +0,0 @@ -{ - "address": "0x9A999C8835e975bBCd255d5E9E9A11f59CC58F40", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_uniswapV3Factory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x3e033d88ec41df4532242cffff8ff2ee443b50e387b68beb5abe84c0147fdf53", - "receipt": { - "to": null, - "from": "0x88215a2794ddC031439C72922EC8983bDE831c78", - "contractAddress": "0x9A999C8835e975bBCd255d5E9E9A11f59CC58F40", - "transactionIndex": 81, - "gasUsed": "2234889", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xc8548e7e0390ce797b4c14ffa9be95632b6251ba707599620d179751d8f1b83f", - "transactionHash": "0x3e033d88ec41df4532242cffff8ff2ee443b50e387b68beb5abe84c0147fdf53", - "logs": [], - "blockNumber": 13607674, - "cumulativeGasUsed": "7871062", - "status": 1, - "byzantium": true - }, - "args": ["0x1F98431c8aD98523631AE4a59f267346ea31F984"], - "solcInputHash": "493646f17088f1465f203a02d910145c", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_uniswapV3Factory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"uniPool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previosGelatoDeployer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newGelatoDeployer\",\"type\":\"address\"}],\"name\":\"UpdateGelatoDeployer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"UpdatePoolImplementation\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createManagedPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDeployers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGelatoPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"getTokenName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gelatoDeployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isPoolImmutable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"makePoolsImmutable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numDeployers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextGelatoDeployer\",\"type\":\"address\"}],\"name\":\"setGelatoDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextImplementation\",\"type\":\"address\"}],\"name\":\"setPoolImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"upgradePools\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"bytes[]\",\"name\":\"datas\",\"type\":\"bytes[]\"}],\"name\":\"upgradePoolsAndCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"managerFee\":\"proportion of earned fees that go to pool manager in Basis Points\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"createPool(address,address,uint24,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"getDeployers()\":{\"returns\":{\"_0\":\"deployers the list of deployer addresses\"}},\"getGelatoPools()\":{\"returns\":{\"_0\":\"list of Gelato managed G-UNI pool addresses\"}},\"getPools(address)\":{\"params\":{\"deployer\":\"address that has potentially deployed G-UNI pools (can return empty array)\"},\"returns\":{\"_0\":\"pools the list of G-UNI pool addresses deployed by `deployer`\"}},\"getProxyAdmin(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"address that controls the G-UNI implementation (has power to upgrade it)\"}},\"isPoolImmutable(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"bool signaling if pool is immutable (true) or not (false)\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"numDeployers()\":{\"returns\":{\"_0\":\"total number of G-UNI pool deployer addresses\"}},\"numPools()\":{\"returns\":{\"result\":\"total number of G-UNI pools deployed\"}},\"numPools(address)\":{\"params\":{\"deployer\":\"deployer address\"},\"returns\":{\"_0\":\"total number of G-UNI pools deployed by `deployer`\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"notice\":\"createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`\"},\"createPool(address,address,uint24,int24,int24)\":{\"notice\":\"createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`\"},\"getDeployers()\":{\"notice\":\"getDeployers fetches all addresses that have deployed a G-UNI pool\"},\"getGelatoPools()\":{\"notice\":\"getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)\"},\"getPools(address)\":{\"notice\":\"getPools fetches all the G-UNI pool addresses deployed by `deployer`\"},\"getProxyAdmin(address)\":{\"notice\":\"getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address).\"},\"isPoolImmutable(address)\":{\"notice\":\"isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\"},\"numDeployers()\":{\"notice\":\"numDeployers counts the total number of G-UNI pool deployer addresses\"},\"numPools()\":{\"notice\":\"numPools counts the total number of G-UNI pools in existence\"},\"numPools(address)\":{\"notice\":\"numPools counts the total number of G-UNI pools deployed by `deployer`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniFactory.sol\":\"GUniFactory\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\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 {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 */\\nabstract contract Initializable {\\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 || !_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\",\"keccak256\":\"0x8b2abd85d0ece7e866e100e9d47ca9cbec93c87cf71a8d267b2b93eb81f7d5e9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\\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\":\"0x4878ef6c288f4cef3c2a288d32cc548c648831cc55503ad3d9a581ed3b93aad9\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title The interface for the Uniswap V3 Factory\\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\\ninterface IUniswapV3Factory {\\n /// @notice Emitted when the owner of the factory is changed\\n /// @param oldOwner The owner before the owner was changed\\n /// @param newOwner The owner after the owner was changed\\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\\n\\n /// @notice Emitted when a pool is created\\n /// @param token0 The first token of the pool by address sort order\\n /// @param token1 The second token of the pool by address sort order\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks\\n /// @param pool The address of the created pool\\n event PoolCreated(\\n address indexed token0,\\n address indexed token1,\\n uint24 indexed fee,\\n int24 tickSpacing,\\n address pool\\n );\\n\\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\\n /// @param fee The enabled fee, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\\n\\n /// @notice Returns the current owner of the factory\\n /// @dev Can be changed by the current owner via setOwner\\n /// @return The address of the factory owner\\n function owner() external view returns (address);\\n\\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\\n /// @return The tick spacing\\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\\n\\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\\n /// @param tokenA The contract address of either token0 or token1\\n /// @param tokenB The contract address of the other token\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @return pool The pool address\\n function getPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external view returns (address pool);\\n\\n /// @notice Creates a pool for the given two tokens and fee\\n /// @param tokenA One of the two tokens in the desired pool\\n /// @param tokenB The other of the two tokens in the desired pool\\n /// @param fee The desired fee for the pool\\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\\n /// are invalid.\\n /// @return pool The address of the newly created pool\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external returns (address pool);\\n\\n /// @notice Updates the owner of the factory\\n /// @dev Must be called by the current owner\\n /// @param _owner The new owner of the factory\\n function setOwner(address _owner) external;\\n\\n /// @notice Enables a fee amount with the given tickSpacing\\n /// @dev Fee amounts may never be removed once enabled\\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\\n}\\n\",\"keccak256\":\"0xcc3d0c93fc9ac0febbe09f941b465b57f750bcf3b48432da0b97dc289cfdc489\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\nimport {\\n IUniswapV3Factory\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\\\";\\nimport {IUniswapV3TickSpacing} from \\\"./interfaces/IUniswapV3TickSpacing.sol\\\";\\nimport {IGUniFactory} from \\\"./interfaces/IGUniFactory.sol\\\";\\nimport {IGUniPoolStorage} from \\\"./interfaces/IGUniPoolStorage.sol\\\";\\nimport {GUniFactoryStorage} from \\\"./abstract/GUniFactoryStorage.sol\\\";\\nimport {EIP173Proxy} from \\\"./vendor/proxy/EIP173Proxy.sol\\\";\\nimport {IEIP173Proxy} from \\\"./interfaces/IEIP173Proxy.sol\\\";\\nimport {\\n IERC20Metadata\\n} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n constructor(address _uniswapV3Factory)\\n GUniFactoryStorage(_uniswapV3Factory)\\n {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n managerFee,\\n lowerTick,\\n upperTick,\\n msg.sender\\n );\\n }\\n\\n /// @notice createPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n 0,\\n lowerTick,\\n upperTick,\\n address(0)\\n );\\n }\\n\\n function _createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick,\\n address manager\\n ) internal returns (address pool) {\\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\\n\\n pool = address(new EIP173Proxy(poolImplementation, address(this), \\\"\\\"));\\n\\n string memory name = \\\"Gelato Uniswap LP\\\";\\n try this.getTokenName(token0, token1) returns (string memory result) {\\n name = result;\\n } catch {} // solhint-disable-line no-empty-blocks\\n\\n address uniPool =\\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\\n require(uniPool != address(0), \\\"uniswap pool does not exist\\\");\\n require(\\n _validateTickSpacing(uniPool, lowerTick, upperTick),\\n \\\"tickSpacing mismatch\\\"\\n );\\n\\n IGUniPoolStorage(pool).initialize(\\n name,\\n \\\"G-UNI\\\",\\n uniPool,\\n managerFee,\\n lowerTick,\\n upperTick,\\n manager\\n );\\n _deployers.add(msg.sender);\\n _pools[msg.sender].add(pool);\\n emit PoolCreated(uniPool, manager, pool);\\n }\\n\\n function _validateTickSpacing(\\n address uniPool,\\n int24 lowerTick,\\n int24 upperTick\\n ) internal view returns (bool) {\\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\\n return\\n lowerTick < upperTick &&\\n lowerTick % spacing == 0 &&\\n upperTick % spacing == 0;\\n }\\n\\n function getTokenName(address token0, address token1)\\n external\\n view\\n returns (string memory)\\n {\\n string memory symbol0 = IERC20Metadata(token0).symbol();\\n string memory symbol1 = IERC20Metadata(token1).symbol();\\n\\n return _append(\\\"Gelato Uniswap \\\", symbol0, \\\"/\\\", symbol1, \\\" LP\\\");\\n }\\n\\n function upgradePools(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\\n }\\n }\\n\\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\\n external\\n onlyManager\\n {\\n require(pools.length == datas.length, \\\"mismatching array length\\\");\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeToAndCall(\\n poolImplementation,\\n datas[i]\\n );\\n }\\n }\\n\\n function makePoolsImmutable(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\\n }\\n }\\n\\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the\\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\\n /// @param pool address of the G-UNI pool\\n /// @return bool signaling if pool is immutable (true) or not (false)\\n function isPoolImmutable(address pool) external view returns (bool) {\\n return address(0) == getProxyAdmin(pool);\\n }\\n\\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\\n /// @return list of Gelato managed G-UNI pool addresses\\n function getGelatoPools() external view returns (address[] memory) {\\n return getPools(gelatoDeployer);\\n }\\n\\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\\n /// @return deployers the list of deployer addresses\\n function getDeployers() public view returns (address[] memory) {\\n uint256 length = numDeployers();\\n address[] memory deployers = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n deployers[i] = _getDeployer(i);\\n }\\n\\n return deployers;\\n }\\n\\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\\n function getPools(address deployer) public view returns (address[] memory) {\\n uint256 length = numPools(deployer);\\n address[] memory pools = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n pools[i] = _getPool(deployer, i);\\n }\\n\\n return pools;\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools in existence\\n /// @return result total number of G-UNI pools deployed\\n function numPools() public view returns (uint256 result) {\\n address[] memory deployers = getDeployers();\\n for (uint256 i = 0; i < deployers.length; i++) {\\n result += numPools(deployers[i]);\\n }\\n }\\n\\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\\n /// @return total number of G-UNI pool deployer addresses\\n function numDeployers() public view returns (uint256) {\\n return _deployers.length();\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\\n /// @param deployer deployer address\\n /// @return total number of G-UNI pools deployed by `deployer`\\n function numPools(address deployer) public view returns (uint256) {\\n return _pools[deployer].length();\\n }\\n\\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\\n /// no longer upgradable (no one owns the zero address).\\n /// @param pool address of the G-UNI pool\\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\\n function getProxyAdmin(address pool) public view returns (address) {\\n return IEIP173Proxy(pool).proxyAdmin();\\n }\\n\\n function _getDeployer(uint256 index) internal view returns (address) {\\n return _deployers.at(index);\\n }\\n\\n function _getPool(address deployer, uint256 index)\\n internal\\n view\\n returns (address)\\n {\\n return _pools[deployer].at(index);\\n }\\n\\n function _getTokenOrder(address tokenA, address tokenB)\\n internal\\n pure\\n returns (address token0, address token1)\\n {\\n require(tokenA != tokenB, \\\"same token\\\");\\n (token0, token1) = tokenA < tokenB\\n ? (tokenA, tokenB)\\n : (tokenB, tokenA);\\n require(token0 != address(0), \\\"no address zero\\\");\\n }\\n\\n function _append(\\n string memory a,\\n string memory b,\\n string memory c,\\n string memory d,\\n string memory e\\n ) internal pure returns (string memory) {\\n return string(abi.encodePacked(a, b, c, d, e));\\n }\\n}\\n\",\"keccak256\":\"0x476238c3222674c2c192a71fed95dbf9a54ac2b0f09867b7dbae7cd56bc52942\",\"license\":\"MIT\"},\"contracts/abstract/GUniFactoryStorage.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n Initializable\\n} from \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\n// solhint-disable-next-line max-states-count\\ncontract GUniFactoryStorage is\\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\\n Initializable\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n address public immutable factory;\\n address public poolImplementation;\\n address public gelatoDeployer;\\n EnumerableSet.AddressSet internal _deployers;\\n mapping(address => EnumerableSet.AddressSet) internal _pools;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdatePoolImplementation(\\n address previousImplementation,\\n address newImplementation\\n );\\n\\n event UpdateGelatoDeployer(\\n address previosGelatoDeployer,\\n address newGelatoDeployer\\n );\\n\\n constructor(address _uniswapV3Factory) {\\n factory = _uniswapV3Factory;\\n }\\n\\n function initialize(\\n address _implementation,\\n address _gelatoDeployer,\\n address _manager_\\n ) external initializer {\\n poolImplementation = _implementation;\\n gelatoDeployer = _gelatoDeployer;\\n _manager = _manager_;\\n }\\n\\n function setPoolImplementation(address nextImplementation)\\n external\\n onlyManager\\n {\\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\\n poolImplementation = nextImplementation;\\n }\\n\\n function setGelatoDeployer(address nextGelatoDeployer)\\n external\\n onlyManager\\n {\\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\\n gelatoDeployer = nextGelatoDeployer;\\n }\\n}\\n\",\"keccak256\":\"0x81b65c0b1c660c0935d6c40310b19e62df7fdd7c0af94915afcc600bdb647fb0\",\"license\":\"MIT\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.4;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x81d888640e2261ac5189e6061a0cf4a7f3cec5994be1859ba60ffeb961f70c01\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IEIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\ninterface IEIP173Proxy {\\n function proxyAdmin() external view returns (address);\\n\\n function transferProxyAdmin(address newAdmin) external;\\n\\n function upgradeTo(address newImplementation) external;\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable;\\n}\\n\",\"keccak256\":\"0x3ff5ed428adeaaa9ba05a91b4ccec7df22cd5de80a53a7bff109543bdebe1a68\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IGUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\ninterface IGUniFactory {\\n event PoolCreated(\\n address indexed uniPool,\\n address indexed manager,\\n address indexed pool\\n );\\n\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n}\\n\",\"keccak256\":\"0xd284f6caaca9268dbe508b0ceae918eedcf96d3a7beee2b19f3b57e732deba66\",\"license\":\"MIT\"},\"contracts/interfaces/IGUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\ninterface IGUniPoolStorage {\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external;\\n}\\n\",\"keccak256\":\"0x39f4bc4e8684c9674e1967a3ac4ea5531f45492266586c4e6e9eb2f6d9108ced\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IUniswapV3TickSpacing.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\ninterface IUniswapV3TickSpacing {\\n function tickSpacing() external view returns (int24);\\n}\\n\",\"keccak256\":\"0x3fa60458d5f66e28118c971b0bcf2d2ef25d28383f1ce94f2f1d4c02643cd7af\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x4ad41656a53bc38d766197d9974be4be70f506b1d1f78def2c3726e8d580a3f5\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x00dbb59cf486ff9a2930fb588ef70d761dbf439aa05d48ef0001a0448769ec11\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b5060405161281e38038061281e83398101604081905261002f91610044565b60601b6001600160601b031916608052610072565b600060208284031215610055578081fd5b81516001600160a01b038116811461006b578182fd5b9392505050565b60805160601c6127876100976000396000818161031201526110e201526127876000f3fe60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e6200015836600462001692565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e366004620018a6565b62000448565b6200015e620001a536600462001868565b620005c8565b6200016a620006ae565b6200015e620001c636600462001868565b62000725565b6200016a620001dd36600462001692565b6200080f565b620001ed62000838565b60405162000174919062001a9d565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001b5a565b6200023a62000847565b60405162000174919062001b0b565b6200023a6200025a36600462001692565b6200085c565b6200023a62000931565b6200015e62000a03565b620001ed62000285366004620017d7565b62000a70565b600254620001ed906001600160a01b031681565b620002b6620002b036600462001692565b62000a8e565b604051901515815260200162000174565b620001ed620002d83660046200175e565b62000aab565b62000221620002ef366004620016d0565b62000aca565b6200015e620003063660046200170d565b62000c39565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e6200035936600462001692565b62000d43565b6200015e6200037036600462001692565b62000de2565b620001ed6200038736600462001692565b62000ec9565b336200039862000838565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001be4565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b0390911690849062001ab1565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000f40565b905090565b336200045362000838565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001be4565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005c257838181518110620004f757634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200054457634e487b7160e01b600052603260045260246000fd5b905060200281019062000558919062001c26565b6040518463ffffffff1660e01b8152600401620005789392919062001acb565b600060405180830381600087803b1580156200059357600080fd5b505af1158015620005a8573d6000803e3d6000fd5b505050508080620005b99062001cea565b915050620004cc565b50505050565b33620005d362000838565b6001600160a01b031614620005fc5760405162461bcd60e51b8152600401620003c19062001be4565b60005b8151811015620006aa578181815181106200062a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b815260040162000660919062001a9d565b600060405180830381600087803b1580156200067b57600080fd5b505af115801562000690573d6000803e3d6000fd5b505050508080620006a19062001cea565b915050620005ff565b5050565b600080620006bb62000931565b905060005b81518110156200072057620006fd828281518110620006ef57634e487b7160e01b600052603260045260246000fd5b60200260200101516200080f565b62000709908462001ca0565b925080620007178162001cea565b915050620006c0565b505090565b336200073062000838565b6001600160a01b031614620007595760405162461bcd60e51b8152600401620003c19062001be4565b60005b8151811015620006aa578181815181106200078757634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe692620007c59291169060040162001a9d565b600060405180830381600087803b158015620007e057600080fd5b505af1158015620007f5573d6000803e3d6000fd5b505050508080620008069062001cea565b9150506200075c565b6001600160a01b0381166000908152600560205260408120620008329062000f40565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200086b836200080f565b90506000816001600160401b038111156200089657634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015620008c0578160200160208202803683370190505b50905060005b828110156200092957620008db858262000f4b565b828281518110620008fc57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280620009208162001cea565b915050620008c6565b509392505050565b606060006200093f62000435565b90506000816001600160401b038111156200096a57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000994578160200160208202803683370190505b50905060005b82811015620009fc57620009ae8162000f76565b828281518110620009cf57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280620009f38162001cea565b9150506200099a565b5092915050565b3362000a0e62000838565b6001600160a01b03161462000a375760405162461bcd60e51b8152600401620003c19062001be4565b600080546040516001600160a01b039091169060008051602062002732833981519152908390a3600080546001600160a01b0319169055565b600062000a838787878787873362000f85565b979650505050505050565b600062000a9b8262000ec9565b6001600160a01b03161592915050565b600062000ac086868660008787600062000f85565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000b0857600080fd5b505afa15801562000b1d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b47919081019062001960565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000b8557600080fd5b505afa15801562000b9a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000bc4919081019062001960565b905062000c306040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001304565b95945050505050565b600054600160a81b900460ff168062000c5c5750600054600160a01b900460ff16155b62000cc15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000cec576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005c2576000805460ff60a81b1916905550505050565b3362000d4e62000838565b6001600160a01b03161462000d775760405162461bcd60e51b8152600401620003c19062001be4565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000db8916001600160a01b0390911690849062001ab1565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000ded62000838565b6001600160a01b03161462000e165760405162461bcd60e51b8152600401620003c19062001be4565b6001600160a01b03811662000e7f5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200273283398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000f0557600080fd5b505afa15801562000f1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620008329190620016b1565b600062000832825490565b6001600160a01b038216600090815260056020526040812062000f6f90836200133b565b9392505050565b6000620008326003836200133b565b600080600062000f968a8a62001349565b6001546040519294509092506001600160a01b031690309062000fb990620015d5565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000ffc573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb9906200104e908690869060040162001ab1565b60006040518083038186803b1580156200106757600080fd5b505afa9250505080156200109f57506040513d6000823e601f3d908101601f191682016040526200109c919081019062001960565b60015b620010aa57620010ad565b90505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee829060640160206040518083038186803b1580156200112757600080fd5b505afa1580156200113c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011629190620016b1565b90506001600160a01b038116620011ba5760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b620011c781898962001418565b6200120c5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200124490859085908e908e908e908e9060040162001b6f565b600060405180830381600087803b1580156200125f57600080fd5b505af115801562001274573d6000803e3d6000fd5b505050506200128e336003620014d590919063ffffffff16565b50336000908152600560205260409020620012aa9086620014d5565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200132195949392919062001a28565b604051602081830303815290604052905095945050505050565b600062000f6f8383620014ec565b600080826001600160a01b0316846001600160a01b031614156200139d5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620013bf578284620013c2565b83835b90925090506001600160a01b038216620014115760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200145557600080fd5b505afa1580156200146a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001490919062001941565b90508260020b8460020b128015620014b45750620014af818562001d08565b60020b155b801562000c305750620014c8818462001d08565b60020b1595945050505050565b600062000f6f836001600160a01b03841662001583565b815460009082106200154c5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b8260000182815481106200157057634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b6000818152600183016020526040812054620015cc5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000832565b50600062000832565b6109a58062001d8d83390190565b600082601f830112620015f4578081fd5b813560206001600160401b0382111562001612576200161262001d4d565b8160051b6200162382820162001c6d565b8381528281019086840183880185018910156200163e578687fd5b8693505b858410156200166d578035620016588162001d63565b83526001939093019291840191840162001642565b50979650505050505050565b803562ffffff811681146200168d57600080fd5b919050565b600060208284031215620016a4578081fd5b813562000f6f8162001d63565b600060208284031215620016c3578081fd5b815162000f6f8162001d63565b60008060408385031215620016e3578081fd5b8235620016f08162001d63565b91506020830135620017028162001d63565b809150509250929050565b60008060006060848603121562001722578081fd5b83356200172f8162001d63565b92506020840135620017418162001d63565b91506040840135620017538162001d63565b809150509250925092565b600080600080600060a0868803121562001776578081fd5b8535620017838162001d63565b94506020860135620017958162001d63565b9350620017a56040870162001679565b92506060860135620017b78162001d7c565b91506080860135620017c98162001d7c565b809150509295509295909350565b60008060008060008060c08789031215620017f0578081fd5b8635620017fd8162001d63565b955060208701356200180f8162001d63565b94506200181f6040880162001679565b9350606087013561ffff8116811462001836578182fd5b92506080870135620018488162001d7c565b915060a08701356200185a8162001d7c565b809150509295509295509295565b6000602082840312156200187a578081fd5b81356001600160401b0381111562001890578182fd5b6200189e84828501620015e3565b949350505050565b600080600060408486031215620018bb578283fd5b83356001600160401b0380821115620018d2578485fd5b620018e087838801620015e3565b94506020860135915080821115620018f6578384fd5b818601915086601f8301126200190a578384fd5b81358181111562001919578485fd5b8760208260051b85010111156200192e578485fd5b6020830194508093505050509250925092565b60006020828403121562001953578081fd5b815162000f6f8162001d7c565b60006020828403121562001972578081fd5b81516001600160401b038082111562001989578283fd5b818401915084601f8301126200199d578283fd5b815181811115620019b257620019b262001d4d565b620019c7601f8201601f191660200162001c6d565b9150808252856020828501011115620019de578384fd5b620019f181602084016020860162001cbb565b50949350505050565b6000815180845262001a1481602086016020860162001cbb565b601f01601f19169290920160200192915050565b6000865162001a3c818460208b0162001cbb565b86519083019062001a52818360208b0162001cbb565b865191019062001a67818360208a0162001cbb565b855191019062001a7c81836020890162001cbb565b845191019062001a9181836020880162001cbb565b01979650505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b6020808252825182820181905260009190848201906040850190845b8181101562001b4e5783516001600160a01b03168352928401929184019160010162001b27565b50909695505050505050565b60208152600062000f6f6020830184620019fa565b60e08152600062001b8460e0830189620019fa565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6000808335601e1984360301811262001c3d578283fd5b8301803591506001600160401b0382111562001c57578283fd5b6020019150368190038213156200141157600080fd5b604051601f8201601f191681016001600160401b038111828210171562001c985762001c9862001d4d565b604052919050565b6000821982111562001cb65762001cb662001d37565b500190565b60005b8381101562001cd857818101518382015260200162001cbe565b83811115620005c25750506000910152565b600060001982141562001d015762001d0162001d37565b5060010190565b60008260020b8062001d2857634e487b7160e01b82526012600452602482fd5b808360020b0791505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811462001d7957600080fd5b50565b8060020b811462001d7957600080fdfe60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a26469706673582212202ef15d5eb8608deda17c4a20ff0ffe7ec85dfe0753d82e4255e1d8508bf6bf4064736f6c63430008040033", - "deployedBytecode": "0x60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e6200015836600462001692565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e366004620018a6565b62000448565b6200015e620001a536600462001868565b620005c8565b6200016a620006ae565b6200015e620001c636600462001868565b62000725565b6200016a620001dd36600462001692565b6200080f565b620001ed62000838565b60405162000174919062001a9d565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001b5a565b6200023a62000847565b60405162000174919062001b0b565b6200023a6200025a36600462001692565b6200085c565b6200023a62000931565b6200015e62000a03565b620001ed62000285366004620017d7565b62000a70565b600254620001ed906001600160a01b031681565b620002b6620002b036600462001692565b62000a8e565b604051901515815260200162000174565b620001ed620002d83660046200175e565b62000aab565b62000221620002ef366004620016d0565b62000aca565b6200015e620003063660046200170d565b62000c39565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e6200035936600462001692565b62000d43565b6200015e6200037036600462001692565b62000de2565b620001ed6200038736600462001692565b62000ec9565b336200039862000838565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001be4565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b0390911690849062001ab1565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000f40565b905090565b336200045362000838565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001be4565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005c257838181518110620004f757634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200054457634e487b7160e01b600052603260045260246000fd5b905060200281019062000558919062001c26565b6040518463ffffffff1660e01b8152600401620005789392919062001acb565b600060405180830381600087803b1580156200059357600080fd5b505af1158015620005a8573d6000803e3d6000fd5b505050508080620005b99062001cea565b915050620004cc565b50505050565b33620005d362000838565b6001600160a01b031614620005fc5760405162461bcd60e51b8152600401620003c19062001be4565b60005b8151811015620006aa578181815181106200062a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b815260040162000660919062001a9d565b600060405180830381600087803b1580156200067b57600080fd5b505af115801562000690573d6000803e3d6000fd5b505050508080620006a19062001cea565b915050620005ff565b5050565b600080620006bb62000931565b905060005b81518110156200072057620006fd828281518110620006ef57634e487b7160e01b600052603260045260246000fd5b60200260200101516200080f565b62000709908462001ca0565b925080620007178162001cea565b915050620006c0565b505090565b336200073062000838565b6001600160a01b031614620007595760405162461bcd60e51b8152600401620003c19062001be4565b60005b8151811015620006aa578181815181106200078757634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe692620007c59291169060040162001a9d565b600060405180830381600087803b158015620007e057600080fd5b505af1158015620007f5573d6000803e3d6000fd5b505050508080620008069062001cea565b9150506200075c565b6001600160a01b0381166000908152600560205260408120620008329062000f40565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200086b836200080f565b90506000816001600160401b038111156200089657634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015620008c0578160200160208202803683370190505b50905060005b828110156200092957620008db858262000f4b565b828281518110620008fc57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280620009208162001cea565b915050620008c6565b509392505050565b606060006200093f62000435565b90506000816001600160401b038111156200096a57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000994578160200160208202803683370190505b50905060005b82811015620009fc57620009ae8162000f76565b828281518110620009cf57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280620009f38162001cea565b9150506200099a565b5092915050565b3362000a0e62000838565b6001600160a01b03161462000a375760405162461bcd60e51b8152600401620003c19062001be4565b600080546040516001600160a01b039091169060008051602062002732833981519152908390a3600080546001600160a01b0319169055565b600062000a838787878787873362000f85565b979650505050505050565b600062000a9b8262000ec9565b6001600160a01b03161592915050565b600062000ac086868660008787600062000f85565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000b0857600080fd5b505afa15801562000b1d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b47919081019062001960565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000b8557600080fd5b505afa15801562000b9a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000bc4919081019062001960565b905062000c306040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001304565b95945050505050565b600054600160a81b900460ff168062000c5c5750600054600160a01b900460ff16155b62000cc15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000cec576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005c2576000805460ff60a81b1916905550505050565b3362000d4e62000838565b6001600160a01b03161462000d775760405162461bcd60e51b8152600401620003c19062001be4565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000db8916001600160a01b0390911690849062001ab1565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000ded62000838565b6001600160a01b03161462000e165760405162461bcd60e51b8152600401620003c19062001be4565b6001600160a01b03811662000e7f5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200273283398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000f0557600080fd5b505afa15801562000f1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620008329190620016b1565b600062000832825490565b6001600160a01b038216600090815260056020526040812062000f6f90836200133b565b9392505050565b6000620008326003836200133b565b600080600062000f968a8a62001349565b6001546040519294509092506001600160a01b031690309062000fb990620015d5565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000ffc573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb9906200104e908690869060040162001ab1565b60006040518083038186803b1580156200106757600080fd5b505afa9250505080156200109f57506040513d6000823e601f3d908101601f191682016040526200109c919081019062001960565b60015b620010aa57620010ad565b90505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee829060640160206040518083038186803b1580156200112757600080fd5b505afa1580156200113c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011629190620016b1565b90506001600160a01b038116620011ba5760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b620011c781898962001418565b6200120c5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200124490859085908e908e908e908e9060040162001b6f565b600060405180830381600087803b1580156200125f57600080fd5b505af115801562001274573d6000803e3d6000fd5b505050506200128e336003620014d590919063ffffffff16565b50336000908152600560205260409020620012aa9086620014d5565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200132195949392919062001a28565b604051602081830303815290604052905095945050505050565b600062000f6f8383620014ec565b600080826001600160a01b0316846001600160a01b031614156200139d5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620013bf578284620013c2565b83835b90925090506001600160a01b038216620014115760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200145557600080fd5b505afa1580156200146a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001490919062001941565b90508260020b8460020b128015620014b45750620014af818562001d08565b60020b155b801562000c305750620014c8818462001d08565b60020b1595945050505050565b600062000f6f836001600160a01b03841662001583565b815460009082106200154c5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b8260000182815481106200157057634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b6000818152600183016020526040812054620015cc5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000832565b50600062000832565b6109a58062001d8d83390190565b600082601f830112620015f4578081fd5b813560206001600160401b0382111562001612576200161262001d4d565b8160051b6200162382820162001c6d565b8381528281019086840183880185018910156200163e578687fd5b8693505b858410156200166d578035620016588162001d63565b83526001939093019291840191840162001642565b50979650505050505050565b803562ffffff811681146200168d57600080fd5b919050565b600060208284031215620016a4578081fd5b813562000f6f8162001d63565b600060208284031215620016c3578081fd5b815162000f6f8162001d63565b60008060408385031215620016e3578081fd5b8235620016f08162001d63565b91506020830135620017028162001d63565b809150509250929050565b60008060006060848603121562001722578081fd5b83356200172f8162001d63565b92506020840135620017418162001d63565b91506040840135620017538162001d63565b809150509250925092565b600080600080600060a0868803121562001776578081fd5b8535620017838162001d63565b94506020860135620017958162001d63565b9350620017a56040870162001679565b92506060860135620017b78162001d7c565b91506080860135620017c98162001d7c565b809150509295509295909350565b60008060008060008060c08789031215620017f0578081fd5b8635620017fd8162001d63565b955060208701356200180f8162001d63565b94506200181f6040880162001679565b9350606087013561ffff8116811462001836578182fd5b92506080870135620018488162001d7c565b915060a08701356200185a8162001d7c565b809150509295509295509295565b6000602082840312156200187a578081fd5b81356001600160401b0381111562001890578182fd5b6200189e84828501620015e3565b949350505050565b600080600060408486031215620018bb578283fd5b83356001600160401b0380821115620018d2578485fd5b620018e087838801620015e3565b94506020860135915080821115620018f6578384fd5b818601915086601f8301126200190a578384fd5b81358181111562001919578485fd5b8760208260051b85010111156200192e578485fd5b6020830194508093505050509250925092565b60006020828403121562001953578081fd5b815162000f6f8162001d7c565b60006020828403121562001972578081fd5b81516001600160401b038082111562001989578283fd5b818401915084601f8301126200199d578283fd5b815181811115620019b257620019b262001d4d565b620019c7601f8201601f191660200162001c6d565b9150808252856020828501011115620019de578384fd5b620019f181602084016020860162001cbb565b50949350505050565b6000815180845262001a1481602086016020860162001cbb565b601f01601f19169290920160200192915050565b6000865162001a3c818460208b0162001cbb565b86519083019062001a52818360208b0162001cbb565b865191019062001a67818360208a0162001cbb565b855191019062001a7c81836020890162001cbb565b845191019062001a9181836020880162001cbb565b01979650505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b6020808252825182820181905260009190848201906040850190845b8181101562001b4e5783516001600160a01b03168352928401929184019160010162001b27565b50909695505050505050565b60208152600062000f6f6020830184620019fa565b60e08152600062001b8460e0830189620019fa565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6000808335601e1984360301811262001c3d578283fd5b8301803591506001600160401b0382111562001c57578283fd5b6020019150368190038213156200141157600080fd5b604051601f8201601f191681016001600160401b038111828210171562001c985762001c9862001d4d565b604052919050565b6000821982111562001cb65762001cb662001d37565b500190565b60005b8381101562001cd857818101518382015260200162001cbe565b83811115620005c25750506000910152565b600060001982141562001d015762001d0162001d37565b5060010190565b60008260020b8062001d2857634e487b7160e01b82526012600452602482fd5b808360020b0791505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811462001d7957600080fd5b50565b8060020b811462001d7957600080fdfe60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a26469706673582212202ef15d5eb8608deda17c4a20ff0ffe7ec85dfe0753d82e4255e1d8508bf6bf4064736f6c63430008040033", - "devdoc": { - "kind": "dev", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "managerFee": "proportion of earned fees that go to pool manager in Basis Points", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "createPool(address,address,uint24,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "getDeployers()": { - "returns": { - "_0": "deployers the list of deployer addresses" - } - }, - "getGelatoPools()": { - "returns": { - "_0": "list of Gelato managed G-UNI pool addresses" - } - }, - "getPools(address)": { - "params": { - "deployer": "address that has potentially deployed G-UNI pools (can return empty array)" - }, - "returns": { - "_0": "pools the list of G-UNI pool addresses deployed by `deployer`" - } - }, - "getProxyAdmin(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "address that controls the G-UNI implementation (has power to upgrade it)" - } - }, - "isPoolImmutable(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "bool signaling if pool is immutable (true) or not (false)" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "numDeployers()": { - "returns": { - "_0": "total number of G-UNI pool deployer addresses" - } - }, - "numPools()": { - "returns": { - "result": "total number of G-UNI pools deployed" - } - }, - "numPools(address)": { - "params": { - "deployer": "deployer address" - }, - "returns": { - "_0": "total number of G-UNI pools deployed by `deployer`" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "notice": "createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`" - }, - "createPool(address,address,uint24,int24,int24)": { - "notice": "createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`" - }, - "getDeployers()": { - "notice": "getDeployers fetches all addresses that have deployed a G-UNI pool" - }, - "getGelatoPools()": { - "notice": "getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)" - }, - "getPools(address)": { - "notice": "getPools fetches all the G-UNI pool addresses deployed by `deployer`" - }, - "getProxyAdmin(address)": { - "notice": "getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address)." - }, - "isPoolImmutable(address)": { - "notice": "isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded" - }, - "numDeployers()": { - "notice": "numDeployers counts the total number of G-UNI pool deployer addresses" - }, - "numPools()": { - "notice": "numPools counts the total number of G-UNI pools in existence" - }, - "numPools(address)": { - "notice": "numPools counts the total number of G-UNI pools deployed by `deployer`" - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6456, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_manager", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 5, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initialized", - "offset": 20, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initializing", - "offset": 21, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 5924, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "poolImplementation", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 5926, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "gelatoDeployer", - "offset": 0, - "slot": "2", - "type": "t_address" - }, - { - "astId": 5929, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_deployers", - "offset": 0, - "slot": "3", - "type": "t_struct(AddressSet)2045_storage" - }, - { - "astId": 5934, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_pools", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_struct(AddressSet)2045_storage)" - } - ], - "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_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(AddressSet)2045_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.AddressSet)", - "numberOfBytes": "32", - "value": "t_struct(AddressSet)2045_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(AddressSet)2045_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.AddressSet", - "members": [ - { - "astId": 2044, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1770_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Set)1770_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 1765, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 1769, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_indexes", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_uint256)" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} diff --git a/lib/g-uni-v1-core/deployments/mainnet/GUniFactory_Proxy.json b/lib/g-uni-v1-core/deployments/mainnet/GUniFactory_Proxy.json deleted file mode 100644 index 9a2ebb817..000000000 --- a/lib/g-uni-v1-core/deployments/mainnet/GUniFactory_Proxy.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "address": "0xEA1aFf9dbFfD1580F6b81A3ad3589E66652dB7D9", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x845de08ab82723d530606c666377f4960b66bc3a37ea59a00078f2189e2de986", - "receipt": { - "to": null, - "from": "0x88215a2794ddC031439C72922EC8983bDE831c78", - "contractAddress": "0xEA1aFf9dbFfD1580F6b81A3ad3589E66652dB7D9", - "transactionIndex": 56, - "gasUsed": "470944", - "logsBloom": "0x00100000000020000000000000000000000000000800000000000000000000000000000000080000000400000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000020000000000000000000800000000000000000000040000000000000000100000000000000010000000000000000000000000000000000000000000000000000004000000000000000200000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000004020000000000000000000000400000000000000000000000000000000000000000000", - "blockHash": "0xd2a7ece5edc706401ace68147ea0a4652824842dd92fbfbe7107b7700c62b948", - "transactionHash": "0x845de08ab82723d530606c666377f4960b66bc3a37ea59a00078f2189e2de986", - "logs": [ - { - "transactionIndex": 56, - "blockNumber": 12735383, - "transactionHash": "0x845de08ab82723d530606c666377f4960b66bc3a37ea59a00078f2189e2de986", - "address": "0xEA1aFf9dbFfD1580F6b81A3ad3589E66652dB7D9", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000c974763d2f3dafe8cc91a508a9f048b019065eaf" - ], - "data": "0x", - "logIndex": 124, - "blockHash": "0xd2a7ece5edc706401ace68147ea0a4652824842dd92fbfbe7107b7700c62b948" - }, - { - "transactionIndex": 56, - "blockNumber": 12735383, - "transactionHash": "0x845de08ab82723d530606c666377f4960b66bc3a37ea59a00078f2189e2de986", - "address": "0xEA1aFf9dbFfD1580F6b81A3ad3589E66652dB7D9", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000088215a2794ddc031439c72922ec8983bde831c78" - ], - "data": "0x", - "logIndex": 125, - "blockHash": "0xd2a7ece5edc706401ace68147ea0a4652824842dd92fbfbe7107b7700c62b948" - } - ], - "blockNumber": 12735383, - "cumulativeGasUsed": "5058164", - "status": 1, - "byzantium": true - }, - "args": [ - "0xC974763d2F3DAFe8cc91A508a9f048B019065eAF", - "0x88215a2794ddC031439C72922EC8983bDE831c78", - "0x" - ], - "solcInputHash": "07200b0d23a751835ce93ba1686cbb62", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management that accept ETH via receive\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173ProxyWithReceive.sol\":\"EIP173ProxyWithReceive\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x4ad41656a53bc38d766197d9974be4be70f506b1d1f78def2c3726e8d580a3f5\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173ProxyWithReceive.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./EIP173Proxy.sol\\\";\\n\\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\\ncontract EIP173ProxyWithReceive is EIP173Proxy {\\n constructor(\\n address implementationAddress,\\n address ownerAddress,\\n bytes memory data\\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\\n\\n receive() external payable override {}\\n}\\n\",\"keccak256\":\"0x7f0dea5e3cba284c86fe466d7f39ff6b8584c8134c69203a896410d679222414\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x00dbb59cf486ff9a2930fb588ef70d761dbf439aa05d48ef0001a0448769ec11\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610978380380610978833981016040819052610022916101aa565b82828261002f8382610043565b6100388261011f565b5050505050506102d4565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561011a576000836001600160a01b0316836040516100c49190610276565b600060405180830381855af49150503d80600081146100ff576040519150601f19603f3d011682016040523d82523d6000602084013e610104565b606091505b5050905080610118573d806000803e806000fd5b505b505050565b60006101376000805160206109588339815191525490565b90508160008051602061095883398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b03811681146101a557600080fd5b919050565b6000806000606084860312156101be578283fd5b6101c78461018e565b92506101d56020850161018e565b60408501519092506001600160401b03808211156101f1578283fd5b818601915086601f830112610204578283fd5b815181811115610216576102166102be565b604051601f8201601f19908116603f0116810190838211818310171561023e5761023e6102be565b81604052828152896020848701011115610256578586fd5b610267836020830160208801610292565b80955050505050509250925092565b60008251610288818460208701610292565b9190910192915050565b60005b838110156102ad578181015183820152602001610295565b838111156101185750506000910152565b634e487b7160e01b600052604160045260246000fd5b610675806102e36000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461005f5780633659cfe6146100945780633e47158c146100b45780634f1ef286146100e15780638356ca4f146100f457610055565b3661005557005b61005d610114565b005b34801561006b57600080fd5b5061007f61007a366004610576565b61014d565b60405190151581526020015b60405180910390f35b3480156100a057600080fd5b5061005d6100af3660046104bf565b610242565b3480156100c057600080fd5b506100c961029f565b6040516001600160a01b03909116815260200161008b565b61005d6100ef3660046104d9565b6102ae565b34801561010057600080fd5b5061005d61010f3660046104bf565b61032b565b6000805160206106208339815191525460003681823780813683855af491503d8082833e828015610143578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b03198316148061017e57506307f5828d60e41b6001600160e01b03198316145b1561018b57506001919050565b6001600160e01b031980831614156101a557506000919050565b600080516020610620833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b1580156101fe57600080fd5b505afa92505050801561022e575060408051601f3d908101601f1916820190925261022b91810190610556565b60015b61023b5750600092915050565b9392505050565b61024a61036c565b6001600160a01b0316336001600160a01b0316146102835760405162461bcd60e51b815260040161027a906105d7565b60405180910390fd5b61029c816040518060200160405280600081525061037f565b50565b60006102a961036c565b905090565b6102b661036c565b6001600160a01b0316336001600160a01b0316146102e65760405162461bcd60e51b815260040161027a906105d7565b6103268383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061037f92505050565b505050565b61033361036c565b6001600160a01b0316336001600160a01b0316146103635760405162461bcd60e51b815260040161027a906105d7565b61029c81610442565b6000805160206106008339815191525490565b6000805160206106208339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610326576000836001600160a01b0316836040516103ee919061059e565b600060405180830381855af49150503d8060008114610429576040519150601f19603f3d011682016040523d82523d6000602084013e61042e565b606091505b5050905080610147573d806000803e806000fd5b600061044c61036c565b90508160008051602061060083398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ba57600080fd5b919050565b6000602082840312156104d0578081fd5b61023b826104a3565b6000806000604084860312156104ed578182fd5b6104f6846104a3565b925060208401356001600160401b0380821115610511578384fd5b818601915086601f830112610524578384fd5b813581811115610532578485fd5b876020828501011115610543578485fd5b6020830194508093505050509250925092565b600060208284031215610567578081fd5b8151801515811461023b578182fd5b600060208284031215610587578081fd5b81356001600160e01b03198116811461023b578182fd5b60008251815b818110156105be57602081860181015185830152016105a4565b818111156105cc5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220b98e06a95fa86acb89692e6d911ca1aec63357dba2aa77647751548c0ff4a4b764736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461005f5780633659cfe6146100945780633e47158c146100b45780634f1ef286146100e15780638356ca4f146100f457610055565b3661005557005b61005d610114565b005b34801561006b57600080fd5b5061007f61007a366004610576565b61014d565b60405190151581526020015b60405180910390f35b3480156100a057600080fd5b5061005d6100af3660046104bf565b610242565b3480156100c057600080fd5b506100c961029f565b6040516001600160a01b03909116815260200161008b565b61005d6100ef3660046104d9565b6102ae565b34801561010057600080fd5b5061005d61010f3660046104bf565b61032b565b6000805160206106208339815191525460003681823780813683855af491503d8082833e828015610143578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b03198316148061017e57506307f5828d60e41b6001600160e01b03198316145b1561018b57506001919050565b6001600160e01b031980831614156101a557506000919050565b600080516020610620833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b1580156101fe57600080fd5b505afa92505050801561022e575060408051601f3d908101601f1916820190925261022b91810190610556565b60015b61023b5750600092915050565b9392505050565b61024a61036c565b6001600160a01b0316336001600160a01b0316146102835760405162461bcd60e51b815260040161027a906105d7565b60405180910390fd5b61029c816040518060200160405280600081525061037f565b50565b60006102a961036c565b905090565b6102b661036c565b6001600160a01b0316336001600160a01b0316146102e65760405162461bcd60e51b815260040161027a906105d7565b6103268383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061037f92505050565b505050565b61033361036c565b6001600160a01b0316336001600160a01b0316146103635760405162461bcd60e51b815260040161027a906105d7565b61029c81610442565b6000805160206106008339815191525490565b6000805160206106208339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610326576000836001600160a01b0316836040516103ee919061059e565b600060405180830381855af49150503d8060008114610429576040519150601f19603f3d011682016040523d82523d6000602084013e61042e565b606091505b5050905080610147573d806000803e806000fd5b600061044c61036c565b90508160008051602061060083398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ba57600080fd5b919050565b6000602082840312156104d0578081fd5b61023b826104a3565b6000806000604084860312156104ed578182fd5b6104f6846104a3565b925060208401356001600160401b0380821115610511578384fd5b818601915086601f830112610524578384fd5b813581811115610532578485fd5b876020828501011115610543578485fd5b6020830194508093505050509250925092565b600060208284031215610567578081fd5b8151801515811461023b578182fd5b600060208284031215610587578081fd5b81356001600160e01b03198116811461023b578182fd5b60008251815b818110156105be57602081860181015185830152016105a4565b818111156105cc5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220b98e06a95fa86acb89692e6d911ca1aec63357dba2aa77647751548c0ff4a4b764736f6c63430008040033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management that accept ETH via receive", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} diff --git a/lib/g-uni-v1-core/deployments/mainnet/GUniPool.json b/lib/g-uni-v1-core/deployments/mainnet/GUniPool.json deleted file mode 100644 index 762ab262e..000000000 --- a/lib/g-uni-v1-core/deployments/mainnet/GUniPool.json +++ /dev/null @@ -1,1639 +0,0 @@ -{ - "address": "0xB54613678c36DD51e75236060060A13D44597D82", - "abi": [ - { - "inputs": [ - { - "internalType": "address payable", - "name": "_gelato", - "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": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned0", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned1", - "type": "uint256" - } - ], - "name": "FeesEarned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int24", - "name": "lowerTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "int24", - "name": "upperTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBefore", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityAfter", - "type": "uint128" - } - ], - "name": "Rebalance", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - } - ], - "name": "SetManagerFee", - "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" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldAdminTreasury", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdminTreasury", - "type": "address" - } - ], - "name": "UpdateAdminTreasury", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoRebalanceBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoWithdrawBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoSlippageBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "gelatoSlippageInterval", - "type": "uint32" - } - ], - "name": "UpdateGelatoParams", - "type": "event" - }, - { - "inputs": [], - "name": "GELATO", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "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": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "burn", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "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": [ - { - "internalType": "int24", - "name": "newLowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "newUpperTick", - "type": "int24" - }, - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - } - ], - "name": "executiveRebalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoRebalanceBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageInterval", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoWithdrawBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Max", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Max", - "type": "uint256" - } - ], - "name": "getMintAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPositionID", - "outputs": [ - { - "internalType": "bytes32", - "name": "positionID", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUnderlyingBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "sqrtRatioX96", - "type": "uint160" - } - ], - "name": "getUnderlyingBalancesAtPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "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": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "address", - "name": "_pool", - "type": "address" - }, - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "_lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "_upperTick", - "type": "int24" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - } - ], - "name": "initializeManagerFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "lowerTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerTreasury", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pool", - "outputs": [ - { - "internalType": "contract IUniswapV3Pool", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "paymentToken", - "type": "address" - } - ], - "name": "rebalance", - "outputs": [], - "stateMutability": "nonpayable", - "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": "token0", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token1", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Owed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Owed", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3MintCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amount0Delta", - "type": "int256" - }, - { - "internalType": "int256", - "name": "amount1Delta", - "type": "int256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3SwapCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "newRebalanceBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newWithdrawBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newSlippageBPS", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "newSlippageInterval", - "type": "uint32" - }, - { - "internalType": "address", - "name": "newTreasury", - "type": "address" - } - ], - "name": "updateGelatoParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "upperTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawGelatoBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawManagerBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xd8e1b8273996f39c334f24c5f5605eb46efa1ac2ac90a046153b2c253e142e34", - "receipt": { - "to": null, - "from": "0x88215a2794ddC031439C72922EC8983bDE831c78", - "contractAddress": "0xB54613678c36DD51e75236060060A13D44597D82", - "transactionIndex": 111, - "gasUsed": "5359735", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf2b3af677c08e3e495798a2dae581586f5291b2eb4a4b891ddef923e3825741f", - "transactionHash": "0xd8e1b8273996f39c334f24c5f5605eb46efa1ac2ac90a046153b2c253e142e34", - "logs": [], - "blockNumber": 13626548, - "cumulativeGasUsed": "12066668", - "status": 1, - "byzantium": true - }, - "args": ["0x3CACa7b48D0573D793d3b0279b5F0029180E83b6"], - "solcInputHash": "5b7722421ca04d0a130cd8a2a08f9ec3", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_gelato\",\"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\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned1\",\"type\":\"uint256\"}],\"name\":\"FeesEarned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"lowerTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"upperTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBefore\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityAfter\",\"type\":\"uint128\"}],\"name\":\"Rebalance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"}],\"name\":\"SetManagerFee\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAdminTreasury\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdminTreasury\",\"type\":\"address\"}],\"name\":\"UpdateAdminTreasury\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoRebalanceBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoWithdrawBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoSlippageBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gelatoSlippageInterval\",\"type\":\"uint32\"}],\"name\":\"UpdateGelatoParams\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GELATO\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"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\":[{\"internalType\":\"int24\",\"name\":\"newLowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"newUpperTick\",\"type\":\"int24\"},{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"}],\"name\":\"executiveRebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoRebalanceBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageInterval\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoWithdrawBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Max\",\"type\":\"uint256\"}],\"name\":\"getMintAmounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPositionID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"positionID\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUnderlyingBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtRatioX96\",\"type\":\"uint160\"}],\"name\":\"getUnderlyingBalancesAtPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"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\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_pool\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"_lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"_upperTick\",\"type\":\"int24\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"}],\"name\":\"initializeManagerFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lowerTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pool\",\"outputs\":[{\"internalType\":\"contract IUniswapV3Pool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"}],\"name\":\"rebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"token0\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newRebalanceBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newWithdrawBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newSlippageBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"newSlippageInterval\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateGelatoParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upperTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawGelatoBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawManagerBalance\",\"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}.\"},\"burn(uint256,address)\":{\"params\":{\"burnAmount\":\"The number of G-UNI tokens to burn\",\"receiver\":\"The account to receive the underlying amounts of token0 and token1\"},\"returns\":{\"amount0\":\"amount of token0 transferred to receiver for burning `burnAmount`\",\"amount1\":\"amount of token1 transferred to receiver for burning `burnAmount`\",\"liquidityBurned\":\"amount of liquidity removed from the underlying Uniswap V3 position\"}},\"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 this function is overridden; 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`.\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"details\":\"When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.\",\"params\":{\"newLowerTick\":\"The new lower bound of the position's range\",\"newUpperTick\":\"The new upper bound of the position's range\",\"swapAmountBPS\":\"amount of token to swap as proportion of total. Pass 0 to ignore swap.\",\"swapThresholdPrice\":\"slippage parameter on the swap as a max or min sqrtPriceX96\",\"zeroForOne\":\"Which token to input into the swap (true = token0, false = token1)\"}},\"getMintAmounts(uint256,uint256)\":{\"params\":{\"amount0Max\":\"The maximum amount of token1 to forward on mint\"},\"returns\":{\"amount0\":\"actual amount of token0 to forward when minting `mintAmount`\",\"amount1\":\"actual amount of token1 to forward when minting `mintAmount`\",\"mintAmount\":\"maximum number of G-UNI tokens to mint\"}},\"getUnderlyingBalances()\":{\"returns\":{\"amount0Current\":\"current total underlying balance of token0\",\"amount1Current\":\"current total underlying balance of token1\"}},\"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.\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"params\":{\"_lowerTick\":\"initial upperTick (only changeable with executiveRebalance)\",\"_managerFeeBPS\":\"proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\",\"_manager_\":\"address of manager (ownership can be transferred)\",\"_name\":\"name of G-UNI token\",\"_pool\":\"address of Uniswap V3 pool\",\"_symbol\":\"symbol of G-UNI token\"}},\"initializeManagerFee(uint16)\":{\"params\":{\"_managerFeeBPS\":\"proportion of fees earned that are credited to manager in Basis Points\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"mint(uint256,address)\":{\"details\":\"to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\",\"params\":{\"mintAmount\":\"The number of G-UNI tokens to mint\",\"receiver\":\"The account to receive the minted tokens\"},\"returns\":{\"amount0\":\"amount of token0 transferred from msg.sender to mint `mintAmount`\",\"amount1\":\"amount of token1 transferred from msg.sender to mint `mintAmount`\",\"liquidityMinted\":\"amount of liquidity added to the underlying Uniswap V3 position\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"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 manager.\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"params\":{\"newRebalanceBPS\":\"controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\",\"newSlippageBPS\":\"maximum slippage on swaps during gelato rebalance\",\"newSlippageInterval\":\"length of time for TWAP used in computing slippage on swaps\",\"newTreasury\":\"address where managerFee withdrawals are sent\",\"newWithdrawBPS\":\"controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(uint256,address)\":{\"notice\":\"burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"notice\":\"Change the range of underlying UniswapV3 position, only manager can call\"},\"getMintAmounts(uint256,uint256)\":{\"notice\":\"compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\"},\"getUnderlyingBalances()\":{\"notice\":\"compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"notice\":\"initialize storage variables on a new G-UNI pool, only called once\"},\"initializeManagerFee(uint16)\":{\"notice\":\"initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\"},\"mint(uint256,address)\":{\"notice\":\"mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\"},\"rebalance(uint160,uint256,bool,uint256,address)\":{\"notice\":\"Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\"},\"uniswapV3MintCallback(uint256,uint256,bytes)\":{\"notice\":\"Uniswap V3 callback fn, called back on pool.mint\"},\"uniswapV3SwapCallback(int256,int256,bytes)\":{\"notice\":\"Uniswap v3 callback fn, called back on pool.swap\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"notice\":\"change configurable parameters, only manager can call\"},\"withdrawGelatoBalance(uint256,address)\":{\"notice\":\"withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"},\"withdrawManagerBalance(uint256,address)\":{\"notice\":\"withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniPool.sol\":\"GUniPool\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal initializer {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal initializer {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and make it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x89fa60d14355f7ae06af11e28fce2bb90c5c6186645d681a30e1b36234a4c210\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\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\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The defaut value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\\n __Context_init_unchained();\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override 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 override 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 this function is\\n * overridden;\\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 override returns (uint8) {\\n return 18;\\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\\n uint256 currentAllowance = _allowances[sender][_msgSender()];\\n require(currentAllowance >= amount, \\\"ERC20: transfer amount exceeds allowance\\\");\\n _approve(sender, _msgSender(), currentAllowance - amount);\\n\\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\\n\\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 uint256 senderBalance = _balances[sender];\\n require(senderBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n _balances[sender] = senderBalance - amount;\\n _balances[recipient] += amount;\\n\\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 += amount;\\n _balances[account] += 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 uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n _balances[account] = accountBalance - amount;\\n _totalSupply -= amount;\\n\\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 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 uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0x9c2d7425f3343ea340d6ea67e9d90109d4d846bb013c2572096ec88c9e74946b\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\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\":\"0x8d4a0f2b5b760b5e2c19ed3c108d83897a4dfd5bfed97a93867918df19191e5e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x6795c369a4eefa78468e38966f7851fbc2dda5e5b9ccd3fa2b45970e2e4d3abd\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../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 initializer {\\n __Context_init_unchained();\\n }\\n\\n function __Context_init_unchained() internal initializer {\\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x8e9eb503de1189f50c5f16fef327da310b11898d6b9ab3ca937df07c35233b9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.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 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) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\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\":\"0x99f5c21018d796db7833a2100bb0e7411999e248a3c950fb526eee5d2bf47cb7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0x069b2631bb5b5193a58ccf7a06266c7361bd2c20095667af4402817605627f45\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCast {\\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 require(value < 2**128, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return uint128(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 require(value < 2**64, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return uint64(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 require(value < 2**32, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return uint32(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 require(value < 2**16, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\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 require(value < 2**8, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\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 require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n return uint256(value);\\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 * _Available since v3.1._\\n */\\n function toInt128(int256 value) internal pure returns (int128) {\\n require(value >= -2**127 && value < 2**127, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return int128(value);\\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 * _Available since v3.1._\\n */\\n function toInt64(int256 value) internal pure returns (int64) {\\n require(value >= -2**63 && value < 2**63, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return int64(value);\\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 * _Available since v3.1._\\n */\\n function toInt32(int256 value) internal pure returns (int32) {\\n require(value >= -2**31 && value < 2**31, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return int32(value);\\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 * _Available since v3.1._\\n */\\n function toInt16(int256 value) internal pure returns (int16) {\\n require(value >= -2**15 && value < 2**15, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\n return int16(value);\\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 * _Available since v3.1._\\n */\\n function toInt8(int256 value) internal pure returns (int8) {\\n require(value >= -2**7 && value < 2**7, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\n return int8(value);\\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 require(value < 2**255, \\\"SafeCast: value doesn't fit in an int256\\\");\\n return int256(value);\\n }\\n}\\n\",\"keccak256\":\"0xc37d85b96c2a8d7bc09f25958e0a81394bf5780286444147ddf875fa628d53ce\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\nimport './pool/IUniswapV3PoolImmutables.sol';\\nimport './pool/IUniswapV3PoolState.sol';\\nimport './pool/IUniswapV3PoolDerivedState.sol';\\nimport './pool/IUniswapV3PoolActions.sol';\\nimport './pool/IUniswapV3PoolOwnerActions.sol';\\nimport './pool/IUniswapV3PoolEvents.sol';\\n\\n/// @title The interface for a Uniswap V3 Pool\\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\\n/// to the ERC20 specification\\n/// @dev The pool interface is broken up into many smaller pieces\\ninterface IUniswapV3Pool is\\n IUniswapV3PoolImmutables,\\n IUniswapV3PoolState,\\n IUniswapV3PoolDerivedState,\\n IUniswapV3PoolActions,\\n IUniswapV3PoolOwnerActions,\\n IUniswapV3PoolEvents\\n{\\n\\n}\\n\",\"keccak256\":\"0xfe6113d518466cd6652c85b111e01f33eb62157f49ae5ed7d5a3947a2044adb1\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#mint\\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\\ninterface IUniswapV3MintCallback {\\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x27a9725b8f831a92d16380860c3d348a0b926a7f01b34a54ea6eea78cbdbcd6a\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#swap\\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\\ninterface IUniswapV3SwapCallback {\\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x3f485fb1a44e8fbeadefb5da07d66edab3cfe809f0ac4074b1e54e3eb3c4cf69\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissionless pool actions\\n/// @notice Contains pool methods that can be called by anyone\\ninterface IUniswapV3PoolActions {\\n /// @notice Sets the initial price for the pool\\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\\n function initialize(uint160 sqrtPriceX96) external;\\n\\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\\n /// @param recipient The address for which the liquidity will be created\\n /// @param tickLower The lower tick of the position in which to add liquidity\\n /// @param tickUpper The upper tick of the position in which to add liquidity\\n /// @param amount The amount of liquidity to mint\\n /// @param data Any data that should be passed through to the callback\\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n function mint(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount,\\n bytes calldata data\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Collects tokens owed to a position\\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\\n /// @param recipient The address which should receive the fees collected\\n /// @param tickLower The lower tick of the position for which to collect fees\\n /// @param tickUpper The upper tick of the position for which to collect fees\\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\\n /// @return amount0 The amount of fees collected in token0\\n /// @return amount1 The amount of fees collected in token1\\n function collect(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n\\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\\n /// @dev Fees must be collected separately via a call to #collect\\n /// @param tickLower The lower tick of the position for which to burn liquidity\\n /// @param tickUpper The upper tick of the position for which to burn liquidity\\n /// @param amount How much liquidity to burn\\n /// @return amount0 The amount of token0 sent to the recipient\\n /// @return amount1 The amount of token1 sent to the recipient\\n function burn(\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Swap token0 for token1, or token1 for token0\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\\n /// @param recipient The address to receive the output of the swap\\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\\n /// @param data Any data to be passed through to the callback\\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\\n function swap(\\n address recipient,\\n bool zeroForOne,\\n int256 amountSpecified,\\n uint160 sqrtPriceLimitX96,\\n bytes calldata data\\n ) external returns (int256 amount0, int256 amount1);\\n\\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\\n /// @param recipient The address which will receive the token0 and token1 amounts\\n /// @param amount0 The amount of token0 to send\\n /// @param amount1 The amount of token1 to send\\n /// @param data Any data to be passed through to the callback\\n function flash(\\n address recipient,\\n uint256 amount0,\\n uint256 amount1,\\n bytes calldata data\\n ) external;\\n\\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\\n /// the input observationCardinalityNext.\\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0x9453dd0e7442188667d01d9b65de3f1e14e9511ff3e303179a15f6fc267f7634\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that is not stored\\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\\n/// blockchain. The functions here may have variable gas costs.\\ninterface IUniswapV3PoolDerivedState {\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\\n /// you must call it with secondsAgos = [3600, 0].\\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\\n /// timestamp\\n function observe(uint32[] calldata secondsAgos)\\n external\\n view\\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\\n\\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\\n /// snapshot is taken and the second snapshot is taken.\\n /// @param tickLower The lower tick of the range\\n /// @param tickUpper The upper tick of the range\\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\\n /// @return secondsInside The snapshot of seconds per liquidity for the range\\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\\n external\\n view\\n returns (\\n int56 tickCumulativeInside,\\n uint160 secondsPerLiquidityInsideX128,\\n uint32 secondsInside\\n );\\n}\\n\",\"keccak256\":\"0xe603ac5b17ecdee73ba2b27efdf386c257a19c14206e87eee77e2017b742d9e5\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Events emitted by a pool\\n/// @notice Contains all events emitted by the pool\\ninterface IUniswapV3PoolEvents {\\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\\n event Initialize(uint160 sqrtPriceX96, int24 tick);\\n\\n /// @notice Emitted when liquidity is minted for a given position\\n /// @param sender The address that minted the liquidity\\n /// @param owner The owner of the position and recipient of any minted liquidity\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity minted to the position range\\n /// @param amount0 How much token0 was required for the minted liquidity\\n /// @param amount1 How much token1 was required for the minted liquidity\\n event Mint(\\n address sender,\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted when fees are collected by the owner of a position\\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\\n /// @param owner The owner of the position for which fees are collected\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount0 The amount of token0 fees collected\\n /// @param amount1 The amount of token1 fees collected\\n event Collect(\\n address indexed owner,\\n address recipient,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount0,\\n uint128 amount1\\n );\\n\\n /// @notice Emitted when a position's liquidity is removed\\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\\n /// @param owner The owner of the position for which liquidity is removed\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity to remove\\n /// @param amount0 The amount of token0 withdrawn\\n /// @param amount1 The amount of token1 withdrawn\\n event Burn(\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted by the pool for any swaps between token0 and token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the output of the swap\\n /// @param amount0 The delta of the token0 balance of the pool\\n /// @param amount1 The delta of the token1 balance of the pool\\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param liquidity The liquidity of the pool after the swap\\n /// @param tick The log base 1.0001 of price of the pool after the swap\\n event Swap(\\n address indexed sender,\\n address indexed recipient,\\n int256 amount0,\\n int256 amount1,\\n uint160 sqrtPriceX96,\\n uint128 liquidity,\\n int24 tick\\n );\\n\\n /// @notice Emitted by the pool for any flashes of token0/token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the tokens from flash\\n /// @param amount0 The amount of token0 that was flashed\\n /// @param amount1 The amount of token1 that was flashed\\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\\n event Flash(\\n address indexed sender,\\n address indexed recipient,\\n uint256 amount0,\\n uint256 amount1,\\n uint256 paid0,\\n uint256 paid1\\n );\\n\\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\\n /// just before a mint/swap/burn.\\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(\\n uint16 observationCardinalityNextOld,\\n uint16 observationCardinalityNextNew\\n );\\n\\n /// @notice Emitted when the protocol fee is changed by the pool\\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\\n /// @param feeProtocol0New The updated value of the token0 protocol fee\\n /// @param feeProtocol1New The updated value of the token1 protocol fee\\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\\n\\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\\n /// @param sender The address that collects the protocol fees\\n /// @param recipient The address that receives the collected protocol fees\\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x8071514d0fe5d17d6fbd31c191cdfb703031c24e0ece3621d88ab10e871375cd\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that never changes\\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\\ninterface IUniswapV3PoolImmutables {\\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\\n /// @return The contract address\\n function factory() external view returns (address);\\n\\n /// @notice The first of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token0() external view returns (address);\\n\\n /// @notice The second of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token1() external view returns (address);\\n\\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\\n /// @return The fee\\n function fee() external view returns (uint24);\\n\\n /// @notice The pool tick spacing\\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\\n /// This value is an int24 to avoid casting even though it is always positive.\\n /// @return The tick spacing\\n function tickSpacing() external view returns (int24);\\n\\n /// @notice The maximum amount of position liquidity that can use any tick in the range\\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\\n /// @return The max amount of liquidity per tick\\n function maxLiquidityPerTick() external view returns (uint128);\\n}\\n\",\"keccak256\":\"0xf6e5d2cd1139c4c276bdbc8e1d2b256e456c866a91f1b868da265c6d2685c3f7\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissioned pool actions\\n/// @notice Contains pool methods that may only be called by the factory owner\\ninterface IUniswapV3PoolOwnerActions {\\n /// @notice Set the denominator of the protocol's % share of the fees\\n /// @param feeProtocol0 new protocol fee for token0 of the pool\\n /// @param feeProtocol1 new protocol fee for token1 of the pool\\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\\n\\n /// @notice Collect the protocol fee accrued to the pool\\n /// @param recipient The address to which collected protocol fees should be sent\\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\\n /// @return amount0 The protocol fee collected in token0\\n /// @return amount1 The protocol fee collected in token1\\n function collectProtocol(\\n address recipient,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x759b78a2918af9e99e246dc3af084f654e48ef32bb4e4cb8a966aa3dcaece235\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that can change\\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\\n/// per transaction\\ninterface IUniswapV3PoolState {\\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\\n /// when accessed externally.\\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\\n /// boundary.\\n /// observationIndex The index of the last oracle observation that was written,\\n /// observationCardinality The current maximum number of observations stored in the pool,\\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// feeProtocol The protocol fee for both tokens of the pool.\\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\\n /// unlocked Whether the pool is currently locked to reentrancy\\n function slot0()\\n external\\n view\\n returns (\\n uint160 sqrtPriceX96,\\n int24 tick,\\n uint16 observationIndex,\\n uint16 observationCardinality,\\n uint16 observationCardinalityNext,\\n uint8 feeProtocol,\\n bool unlocked\\n );\\n\\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal0X128() external view returns (uint256);\\n\\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal1X128() external view returns (uint256);\\n\\n /// @notice The amounts of token0 and token1 that are owed to the protocol\\n /// @dev Protocol fees will never exceed uint128 max in either token\\n function protocolFees() external view returns (uint128 token0, uint128 token1);\\n\\n /// @notice The currently in range liquidity available to the pool\\n /// @dev This value has no relationship to the total liquidity across all ticks\\n function liquidity() external view returns (uint128);\\n\\n /// @notice Look up information about a specific tick in the pool\\n /// @param tick The tick to look up\\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\\n /// tick upper,\\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\\n /// a specific position.\\n function ticks(int24 tick)\\n external\\n view\\n returns (\\n uint128 liquidityGross,\\n int128 liquidityNet,\\n uint256 feeGrowthOutside0X128,\\n uint256 feeGrowthOutside1X128,\\n int56 tickCumulativeOutside,\\n uint160 secondsPerLiquidityOutsideX128,\\n uint32 secondsOutside,\\n bool initialized\\n );\\n\\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\\n function tickBitmap(int16 wordPosition) external view returns (uint256);\\n\\n /// @notice Returns the information about a position by the position's key\\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\\n /// @return _liquidity The amount of liquidity in the position,\\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\\n function positions(bytes32 key)\\n external\\n view\\n returns (\\n uint128 _liquidity,\\n uint256 feeGrowthInside0LastX128,\\n uint256 feeGrowthInside1LastX128,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param index The element of the observations array to fetch\\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\\n /// ago, rather than at a specific index in the array.\\n /// @return blockTimestamp The timestamp of the observation,\\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// Returns initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 index)\\n external\\n view\\n returns (\\n uint32 blockTimestamp,\\n int56 tickCumulative,\\n uint160 secondsPerLiquidityCumulativeX128,\\n bool initialized\\n );\\n}\\n\",\"keccak256\":\"0x852dc1f5df7dcf7f11e7bb3eed79f0cea72ad4b25f6a9d2c35aafb48925fd49f\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.4.0;\\n\\n/// @title FixedPoint96\\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\\n/// @dev Used in SqrtPriceMath.sol\\nlibrary FixedPoint96 {\\n uint8 internal constant RESOLUTION = 96;\\n uint256 internal constant Q96 = 0x1000000000000000000000000;\\n}\\n\",\"keccak256\":\"0x0ba8a9b95a956a4050749c0158e928398c447c91469682ca8a7cc7e77a7fe032\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {\\n IUniswapV3MintCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\\\";\\nimport {\\n IUniswapV3SwapCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\\\";\\nimport {GUniPoolStorage} from \\\"./abstract/GUniPoolStorage.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {TickMath} from \\\"./vendor/uniswap/TickMath.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {SafeCast} from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport {\\n FullMath,\\n LiquidityAmounts\\n} from \\\"./vendor/uniswap/LiquidityAmounts.sol\\\";\\n\\ncontract GUniPool is\\n IUniswapV3MintCallback,\\n IUniswapV3SwapCallback,\\n GUniPoolStorage\\n{\\n using SafeERC20 for IERC20;\\n using TickMath for int24;\\n\\n event Minted(\\n address receiver,\\n uint256 mintAmount,\\n uint256 amount0In,\\n uint256 amount1In,\\n uint128 liquidityMinted\\n );\\n\\n event Burned(\\n address receiver,\\n uint256 burnAmount,\\n uint256 amount0Out,\\n uint256 amount1Out,\\n uint128 liquidityBurned\\n );\\n\\n event Rebalance(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidityBefore,\\n uint128 liquidityAfter\\n );\\n\\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice Uniswap V3 callback fn, called back on pool.mint\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata /*_data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\\n }\\n\\n /// @notice Uniswap v3 callback fn, called back on pool.swap\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata /*data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Delta > 0)\\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\\n else if (amount1Delta > 0)\\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\\n }\\n\\n // User functions => Should be called via a Router\\n\\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\\n /// @param mintAmount The number of G-UNI tokens to mint\\n /// @param receiver The account to receive the minted tokens\\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function mint(uint256 mintAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityMinted\\n )\\n {\\n require(mintAmount > 0, \\\"mint 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n\\n if (totalSupply > 0) {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n amount0 = FullMath.mulDivRoundingUp(\\n amount0Current,\\n mintAmount,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n amount1Current,\\n mintAmount,\\n totalSupply\\n );\\n } else {\\n // if supply is 0 mintAmount == liquidity to deposit\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n SafeCast.toUint128(mintAmount)\\n );\\n }\\n\\n // transfer amounts owed to contract\\n if (amount0 > 0) {\\n token0.safeTransferFrom(msg.sender, address(this), amount0);\\n }\\n if (amount1 > 0) {\\n token1.safeTransferFrom(msg.sender, address(this), amount1);\\n }\\n\\n // deposit as much new liquidity as possible\\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n\\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \\\"\\\");\\n\\n _mint(receiver, mintAmount);\\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\\n }\\n\\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\\n /// @param burnAmount The number of G-UNI tokens to burn\\n /// @param receiver The account to receive the underlying amounts of token0 and token1\\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines\\n function burn(uint256 burnAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityBurned\\n )\\n {\\n require(burnAmount > 0, \\\"burn 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n\\n _burn(msg.sender, burnAmount);\\n\\n uint256 liquidityBurned_ =\\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidityBurned);\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n\\n amount0 =\\n burn0 +\\n FullMath.mulDiv(\\n token0.balanceOf(address(this)) -\\n burn0 -\\n managerBalance0 -\\n gelatoBalance0,\\n burnAmount,\\n totalSupply\\n );\\n amount1 =\\n burn1 +\\n FullMath.mulDiv(\\n token1.balanceOf(address(this)) -\\n burn1 -\\n managerBalance1 -\\n gelatoBalance1,\\n burnAmount,\\n totalSupply\\n );\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(receiver, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(receiver, amount1);\\n }\\n\\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\\n }\\n\\n // Manager Functions => Called by Pool Manager\\n\\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\\n /// any leftover will be unused and sit idle until the next rebalance.\\n /// @param newLowerTick The new lower bound of the position's range\\n /// @param newUpperTick The new upper bound of the position's range\\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\\n // solhint-disable-next-line function-max-lines\\n function executiveRebalance(\\n int24 newLowerTick,\\n int24 newUpperTick,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) external onlyManager {\\n uint128 liquidity;\\n uint128 newLiquidity;\\n if (totalSupply() > 0) {\\n (liquidity, , , , ) = pool.positions(_getPositionID());\\n if (liquidity > 0) {\\n (, , uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n }\\n\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n\\n uint256 reinvest0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n uint256 reinvest1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n\\n _deposit(\\n newLowerTick,\\n newUpperTick,\\n reinvest0,\\n reinvest1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n\\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > 0, \\\"new position 0\\\");\\n } else {\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n }\\n\\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\\n }\\n\\n // Gelatofied functions => Automatically called by Gelato\\n\\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\\n function rebalance(\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) external gelatofy(feeAmount, paymentToken) {\\n if (swapAmountBPS > 0) {\\n _checkSlippage(swapThresholdPrice, zeroForOne);\\n }\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n _rebalance(\\n liquidity,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne,\\n feeAmount,\\n paymentToken\\n );\\n\\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > liquidity, \\\"liquidity must increase\\\");\\n\\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\\n }\\n\\n /// @notice withdraw manager fees accrued, only gelato executors can call.\\n /// Target account to receive fees is managerTreasury, alterable by manager.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n managerBalance0,\\n managerBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(managerTreasury, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(managerTreasury, amount1);\\n }\\n }\\n\\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n gelatoBalance0,\\n gelatoBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n gelatoBalance0 = 0;\\n gelatoBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(GELATO, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(GELATO, amount1);\\n }\\n }\\n\\n function _balancesToWithdraw(\\n uint256 balance0,\\n uint256 balance1,\\n uint256 feeAmount,\\n address feeToken\\n ) internal view returns (uint256 amount0, uint256 amount1) {\\n if (feeToken == address(token0)) {\\n require(\\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount0 = balance0 - feeAmount;\\n amount1 = balance1;\\n } else if (feeToken == address(token1)) {\\n require(\\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount1 = balance1 - feeAmount;\\n amount0 = balance0;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n }\\n\\n // View functions\\n\\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\\n /// @param amount0Max The maximum amount of token0 to forward on mint\\n /// @param amount0Max The maximum amount of token1 to forward on mint\\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\\n /// @return mintAmount maximum number of G-UNI tokens to mint\\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\\n external\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n uint256 totalSupply = totalSupply();\\n if (totalSupply > 0) {\\n (amount0, amount1, mintAmount) = _computeMintAmounts(\\n totalSupply,\\n amount0Max,\\n amount1Max\\n );\\n } else {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 newLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0Max,\\n amount1Max\\n );\\n mintAmount = uint256(newLiquidity);\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n newLiquidity\\n );\\n }\\n }\\n\\n /// @notice compute total underlying holdings of the G-UNI token supply\\n /// includes current liquidity invested in uniswap position, current fees earned\\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\\n /// @return amount0Current current total underlying balance of token0\\n /// @return amount1Current current total underlying balance of token1\\n function getUnderlyingBalances()\\n public\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\\n external\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\\n internal\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (\\n uint128 liquidity,\\n uint256 feeGrowthInside0Last,\\n uint256 feeGrowthInside1Last,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n ) = pool.positions(_getPositionID());\\n\\n // compute current holdings from liquidity\\n (amount0Current, amount1Current) = LiquidityAmounts\\n .getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n liquidity\\n );\\n\\n // compute current fees earned\\n uint256 fee0 =\\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\\n uint256(tokensOwed0);\\n uint256 fee1 =\\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\\n uint256(tokensOwed1);\\n\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n\\n // add any leftover in contract to current holdings\\n amount0Current +=\\n fee0 +\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n amount1Current +=\\n fee1 +\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n }\\n\\n // Private functions\\n\\n // solhint-disable-next-line function-max-lines\\n function _rebalance(\\n uint128 liquidity,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) private {\\n uint256 leftover0 =\\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\\n uint256 leftover1 =\\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\\n\\n (, , uint256 feesEarned0, uint256 feesEarned1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n _applyFees(feesEarned0, feesEarned1);\\n (feesEarned0, feesEarned1) = _subtractAdminFees(\\n feesEarned0,\\n feesEarned1\\n );\\n emit FeesEarned(feesEarned0, feesEarned1);\\n feesEarned0 += leftover0;\\n feesEarned1 += leftover1;\\n\\n if (paymentToken == address(token0)) {\\n require(\\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0 -\\n feeAmount;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n } else if (paymentToken == address(token1)) {\\n require(\\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1 -\\n feeAmount;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n\\n _deposit(\\n lowerTick,\\n upperTick,\\n leftover0,\\n leftover1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _withdraw(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidity\\n )\\n private\\n returns (\\n uint256 burn0,\\n uint256 burn1,\\n uint256 fee0,\\n uint256 fee1\\n )\\n {\\n uint256 preBalance0 = token0.balanceOf(address(this));\\n uint256 preBalance1 = token1.balanceOf(address(this));\\n\\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\\n\\n pool.collect(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n type(uint128).max,\\n type(uint128).max\\n );\\n\\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _deposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) private {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n // First, deposit as much as we can\\n uint128 baseLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n if (baseLiquidity > 0) {\\n (uint256 amountDeposited0, uint256 amountDeposited1) =\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n baseLiquidity,\\n \\\"\\\"\\n );\\n\\n amount0 -= amountDeposited0;\\n amount1 -= amountDeposited1;\\n }\\n int256 swapAmount =\\n SafeCast.toInt256(\\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\\n );\\n if (swapAmount > 0) {\\n _swapAndDeposit(\\n lowerTick_,\\n upperTick_,\\n amount0,\\n amount1,\\n swapAmount,\\n swapThresholdPrice,\\n zeroForOne\\n );\\n }\\n }\\n\\n function _swapAndDeposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n int256 swapAmount,\\n uint160 swapThresholdPrice,\\n bool zeroForOne\\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\\n (int256 amount0Delta, int256 amount1Delta) =\\n pool.swap(\\n address(this),\\n zeroForOne,\\n swapAmount,\\n swapThresholdPrice,\\n \\\"\\\"\\n );\\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\\n\\n // Add liquidity a second time\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 liquidityAfterSwap =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n finalAmount0,\\n finalAmount1\\n );\\n if (liquidityAfterSwap > 0) {\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n liquidityAfterSwap,\\n \\\"\\\"\\n );\\n }\\n }\\n\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function _computeMintAmounts(\\n uint256 totalSupply,\\n uint256 amount0Max,\\n uint256 amount1Max\\n )\\n private\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n // compute proportional amount of tokens to mint\\n if (amount0Current == 0 && amount1Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount1Max,\\n totalSupply,\\n amount1Current\\n );\\n } else if (amount1Current == 0 && amount0Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount0Max,\\n totalSupply,\\n amount0Current\\n );\\n } else if (amount0Current == 0 && amount1Current == 0) {\\n revert(\\\"\\\");\\n } else {\\n // only if both are non-zero\\n uint256 amount0Mint =\\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\\n uint256 amount1Mint =\\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\\n require(amount0Mint > 0 && amount1Mint > 0, \\\"mint 0\\\");\\n\\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\\n }\\n\\n // compute amounts owed to contract\\n amount0 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount0Current,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount1Current,\\n totalSupply\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _computeFeesEarned(\\n bool isZero,\\n uint256 feeGrowthInsideLast,\\n int24 tick,\\n uint128 liquidity\\n ) private view returns (uint256 fee) {\\n uint256 feeGrowthOutsideLower;\\n uint256 feeGrowthOutsideUpper;\\n uint256 feeGrowthGlobal;\\n if (isZero) {\\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\\n } else {\\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\\n }\\n\\n unchecked {\\n // calculate fee growth below\\n uint256 feeGrowthBelow;\\n if (tick >= lowerTick) {\\n feeGrowthBelow = feeGrowthOutsideLower;\\n } else {\\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\\n }\\n\\n // calculate fee growth above\\n uint256 feeGrowthAbove;\\n if (tick < upperTick) {\\n feeGrowthAbove = feeGrowthOutsideUpper;\\n } else {\\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\\n }\\n\\n uint256 feeGrowthInside =\\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\\n fee = FullMath.mulDiv(\\n liquidity,\\n feeGrowthInside - feeGrowthInsideLast,\\n 0x100000000000000000000000000000000\\n );\\n }\\n }\\n\\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\\n }\\n\\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\\n private\\n view\\n returns (uint256 fee0, uint256 fee1)\\n {\\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n fee0 = rawFee0 - deduct0;\\n fee1 = rawFee1 - deduct1;\\n }\\n\\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\\n private\\n view\\n {\\n uint32[] memory secondsAgo = new uint32[](2);\\n secondsAgo[0] = gelatoSlippageInterval;\\n secondsAgo[1] = 0;\\n\\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\\n\\n require(tickCumulatives.length == 2, \\\"array len\\\");\\n uint160 avgSqrtRatioX96;\\n unchecked {\\n int24 avgTick =\\n int24(\\n (tickCumulatives[1] - tickCumulatives[0]) /\\n int56(uint56(gelatoSlippageInterval))\\n );\\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\\n }\\n\\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\\n if (zeroForOne) {\\n require(\\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\\n \\\"high slippage\\\"\\n );\\n } else {\\n require(\\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\\n \\\"high slippage\\\"\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x57283d620777e122c97c6ca2c10a442c125cc72b07fd8b5c192104aa3279d1e3\",\"license\":\"GPL-3.0\"},\"contracts/abstract/GUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {Gelatofied} from \\\"./Gelatofied.sol\\\";\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {\\n ReentrancyGuardUpgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport {\\n ERC20Upgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\n\\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\\n/// @dev ERC20Upgradable Includes Initialize\\n// solhint-disable-next-line max-states-count\\nabstract contract GUniPoolStorage is\\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\\n ReentrancyGuardUpgradeable,\\n OwnableUninitialized,\\n Gelatofied\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n // solhint-disable-next-line const-name-snakecase\\n uint16 public constant gelatoFeeBPS = 250;\\n\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n int24 public lowerTick;\\n int24 public upperTick;\\n\\n uint16 public gelatoRebalanceBPS;\\n uint16 public gelatoWithdrawBPS;\\n uint16 public gelatoSlippageBPS;\\n uint32 public gelatoSlippageInterval;\\n\\n uint16 public managerFeeBPS;\\n address public managerTreasury;\\n\\n uint256 public managerBalance0;\\n uint256 public managerBalance1;\\n uint256 public gelatoBalance0;\\n uint256 public gelatoBalance1;\\n\\n IUniswapV3Pool public pool;\\n IERC20 public token0;\\n IERC20 public token1;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdateAdminTreasury(\\n address oldAdminTreasury,\\n address newAdminTreasury\\n );\\n\\n event UpdateGelatoParams(\\n uint16 gelatoRebalanceBPS,\\n uint16 gelatoWithdrawBPS,\\n uint16 gelatoSlippageBPS,\\n uint32 gelatoSlippageInterval\\n );\\n\\n event SetManagerFee(uint16 managerFee);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice initialize storage variables on a new G-UNI pool, only called once\\n /// @param _name name of G-UNI token\\n /// @param _symbol symbol of G-UNI token\\n /// @param _pool address of Uniswap V3 pool\\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\\n /// @param _manager_ address of manager (ownership can be transferred)\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external initializer {\\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \\\"mBPS\\\");\\n\\n // these variables are immutable after initialization\\n pool = IUniswapV3Pool(_pool);\\n token0 = IERC20(pool.token0());\\n token1 = IERC20(pool.token1());\\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\\n\\n // these variables can be udpated by the manager\\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\\n gelatoSlippageBPS = 500; // default: 5% slippage\\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\\n managerTreasury = _manager_; // default: treasury is admin\\n lowerTick = _lowerTick;\\n upperTick = _upperTick;\\n _manager = _manager_;\\n\\n // e.g. \\\"Gelato Uniswap V3 USDC/DAI LP\\\" and \\\"G-UNI\\\"\\n __ERC20_init(_name, _symbol);\\n __ReentrancyGuard_init();\\n }\\n\\n /// @notice change configurable parameters, only manager can call\\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\\n /// @param newTreasury address where managerFee withdrawals are sent\\n // solhint-disable-next-line code-complexity\\n function updateGelatoParams(\\n uint16 newRebalanceBPS,\\n uint16 newWithdrawBPS,\\n uint16 newSlippageBPS,\\n uint32 newSlippageInterval,\\n address newTreasury\\n ) external onlyManager {\\n require(newWithdrawBPS <= 10000, \\\"BPS\\\");\\n require(newRebalanceBPS <= 10000, \\\"BPS\\\");\\n require(newSlippageBPS <= 10000, \\\"BPS\\\");\\n emit UpdateGelatoParams(\\n newRebalanceBPS,\\n newWithdrawBPS,\\n newSlippageBPS,\\n newSlippageInterval\\n );\\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\\n if (newSlippageInterval != 0)\\n gelatoSlippageInterval = newSlippageInterval;\\n if (newTreasury != address(0)) managerTreasury = newTreasury;\\n }\\n\\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\\n /// If a manager fee was not set in the initialize function it can be set here\\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\\n require(managerFeeBPS == 0, \\\"fee\\\");\\n require(\\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\\n \\\"mBPS\\\"\\n );\\n emit SetManagerFee(_managerFeeBPS);\\n managerFeeBPS = _managerFeeBPS;\\n }\\n\\n function renounceOwnership() public virtual override onlyManager {\\n managerTreasury = address(0);\\n managerFeeBPS = 0;\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n super.renounceOwnership();\\n }\\n\\n function getPositionID() external view returns (bytes32 positionID) {\\n return _getPositionID();\\n }\\n\\n function _getPositionID() internal view returns (bytes32 positionID) {\\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\\n }\\n}\\n\",\"keccak256\":\"0xd641844e84406e827578ae316c8690b05db17ac84ee5a6b235228b3605ea46de\",\"license\":\"GPL-3.0\"},\"contracts/abstract/Gelatofied.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract Gelatofied {\\n using Address for address payable;\\n using SafeERC20 for IERC20;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n address payable public immutable GELATO;\\n\\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n constructor(address payable _gelato) {\\n GELATO = _gelato;\\n }\\n\\n modifier gelatofy(uint256 _amount, address _paymentToken) {\\n require(msg.sender == GELATO, \\\"Gelatofied: Only gelato\\\");\\n _;\\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x31ddffff0545c4342d3cea88f4d2af520057f467f5e550e4e7166d24cc911cf1\",\"license\":\"GPL-3.0\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.4;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x81d888640e2261ac5189e6061a0cf4a7f3cec5994be1859ba60ffeb961f70c01\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/FullMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.4;\\n\\n/// @title Contains 512-bit math functions\\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\\n/// @dev Handles \\\"phantom overflow\\\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\\nlibrary FullMath {\\n /// @notice Calculates floor(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\\n function mulDiv(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = a * b\\n // Compute the product mod 2**256 and mod 2**256 - 1\\n // then use the Chinese Remainder Theorem to reconstruct\\n // the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2**256 + prod0\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(a, b, not(0))\\n prod0 := mul(a, b)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division\\n if (prod1 == 0) {\\n require(denominator > 0);\\n assembly {\\n result := div(prod0, denominator)\\n }\\n return result;\\n }\\n\\n // Make sure the result is less than 2**256.\\n // Also prevents denominator == 0\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0]\\n // Compute remainder using mulmod\\n uint256 remainder;\\n assembly {\\n remainder := mulmod(a, b, denominator)\\n }\\n // Subtract 256 bit number from 512 bit number\\n assembly {\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator\\n // Compute largest power of two divisor of denominator.\\n // Always >= 1.\\n // EDIT for 0.8 compatibility:\\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\\n uint256 twos = denominator & (~denominator + 1);\\n\\n // Divide denominator by power of two\\n assembly {\\n denominator := div(denominator, twos)\\n }\\n\\n // Divide [prod1 prod0] by the factors of two\\n assembly {\\n prod0 := div(prod0, twos)\\n }\\n // Shift in bits from prod1 into prod0. For this we need\\n // to flip `twos` such that it is 2**256 / twos.\\n // If twos is zero, then it becomes one\\n assembly {\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2**256\\n // Now that denominator is an odd number, it has an inverse\\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\\n // Compute the inverse by starting with a seed that is correct\\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\\n uint256 inv = (3 * denominator) ^ 2;\\n // Now use Newton-Raphson iteration to improve the precision.\\n // Thanks to Hensel's lifting lemma, this also works in modular\\n // arithmetic, doubling the correct bits in each step.\\n inv *= 2 - denominator * inv; // inverse mod 2**8\\n inv *= 2 - denominator * inv; // inverse mod 2**16\\n inv *= 2 - denominator * inv; // inverse mod 2**32\\n inv *= 2 - denominator * inv; // inverse mod 2**64\\n inv *= 2 - denominator * inv; // inverse mod 2**128\\n inv *= 2 - denominator * inv; // inverse mod 2**256\\n\\n // Because the division is now exact we can divide by multiplying\\n // with the modular inverse of denominator. This will give us the\\n // correct result modulo 2**256. Since the precoditions guarantee\\n // that the outcome is less than 2**256, this is the final result.\\n // We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inv;\\n return result;\\n }\\n }\\n\\n /// @notice Calculates ceil(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n function mulDivRoundingUp(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n result = mulDiv(a, b, denominator);\\n if (mulmod(a, b, denominator) > 0) {\\n require(result < type(uint256).max);\\n result++;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3fa0efa3eea2a84bd6ab7e55badd61f97069a6c50780059b036c810427a9740c\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/LiquidityAmounts.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.5.0;\\n\\nimport {FullMath} from \\\"./FullMath.sol\\\";\\nimport \\\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\\\";\\n\\n/// @title Liquidity amount functions\\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\\nlibrary LiquidityAmounts {\\n function toUint128(uint256 x) private pure returns (uint128 y) {\\n require((y = uint128(x)) == x);\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount0 The amount0 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount0(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n uint256 intermediate =\\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount0,\\n intermediate,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount1 The amount1 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount1(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount1,\\n FixedPoint96.Q96,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\\n /// pool prices and the prices at the tick boundaries\\n function getLiquidityForAmounts(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n liquidity = getLiquidityForAmount0(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount0\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n uint128 liquidity0 =\\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\\n uint128 liquidity1 =\\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\\n\\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\\n } else {\\n liquidity = getLiquidityForAmount1(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount1\\n );\\n }\\n }\\n\\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount0 The amount0\\n function getAmount0ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n uint256(liquidity) << FixedPoint96.RESOLUTION,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n sqrtRatioBX96\\n ) / sqrtRatioAX96;\\n }\\n\\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount1 The amount1\\n function getAmount1ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n liquidity,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n FixedPoint96.Q96\\n );\\n }\\n\\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\\n /// pool prices and the prices at the tick boundaries\\n function getAmountsForLiquidity(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0, uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioX96,\\n liquidity\\n );\\n } else {\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x6205f6409d42fc9565530d2a69819bf8c4e4c66b7a4c61d0827e81c084df6832\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/TickMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\n/// prices between 2**-128 and 2**128\\nlibrary TickMath {\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\n int24 internal constant MIN_TICK = -887272;\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\n int24 internal constant MAX_TICK = -MIN_TICK;\\n\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\n uint160 internal constant MAX_SQRT_RATIO =\\n 1461446703485210103287273052203988822378723970342;\\n\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\n /// @dev Throws if |tick| > max tick\\n /// @param tick The input tick for the above formula\\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\n /// at the given tick\\n function getSqrtRatioAtTick(int24 tick)\\n internal\\n pure\\n returns (uint160 sqrtPriceX96)\\n {\\n uint256 absTick =\\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\\n\\n // EDIT: 0.8 compatibility\\n require(absTick <= uint256(int256(MAX_TICK)), \\\"T\\\");\\n\\n uint256 ratio =\\n absTick & 0x1 != 0\\n ? 0xfffcb933bd6fad37aa2d162d1a594001\\n : 0x100000000000000000000000000000000;\\n if (absTick & 0x2 != 0)\\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\\n if (absTick & 0x4 != 0)\\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\\n if (absTick & 0x8 != 0)\\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\\n if (absTick & 0x10 != 0)\\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\\n if (absTick & 0x20 != 0)\\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\\n if (absTick & 0x40 != 0)\\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\\n if (absTick & 0x80 != 0)\\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\\n if (absTick & 0x100 != 0)\\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\\n if (absTick & 0x200 != 0)\\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\\n if (absTick & 0x400 != 0)\\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\\n if (absTick & 0x800 != 0)\\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\\n if (absTick & 0x1000 != 0)\\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\\n if (absTick & 0x2000 != 0)\\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\\n if (absTick & 0x4000 != 0)\\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\\n if (absTick & 0x8000 != 0)\\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\\n if (absTick & 0x10000 != 0)\\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\\n if (absTick & 0x20000 != 0)\\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\\n if (absTick & 0x40000 != 0)\\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\\n if (absTick & 0x80000 != 0)\\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\\n\\n if (tick > 0) ratio = type(uint256).max / ratio;\\n\\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\n sqrtPriceX96 = uint160(\\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\\n );\\n }\\n\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\n /// ever return.\\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\\n internal\\n pure\\n returns (int24 tick)\\n {\\n // second inequality must be < because the price can never reach the price at the max tick\\n require(\\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\\n \\\"R\\\"\\n );\\n uint256 ratio = uint256(sqrtPriceX96) << 32;\\n\\n uint256 r = ratio;\\n uint256 msb = 0;\\n\\n assembly {\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(4, gt(r, 0xFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(3, gt(r, 0xFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(2, gt(r, 0xF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(1, gt(r, 0x3))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := gt(r, 0x1)\\n msb := or(msb, f)\\n }\\n\\n if (msb >= 128) r = ratio >> (msb - 127);\\n else r = ratio << (127 - msb);\\n\\n int256 log_2 = (int256(msb) - 128) << 64;\\n\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(63, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(62, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(61, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(60, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(59, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(58, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(57, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(56, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(55, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(54, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(53, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(52, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(51, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(50, f))\\n }\\n\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\n\\n int24 tickLow =\\n int24(\\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\\n );\\n int24 tickHi =\\n int24(\\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\\n );\\n\\n tick = tickLow == tickHi\\n ? tickLow\\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\\n ? tickHi\\n : tickLow;\\n }\\n}\\n\",\"keccak256\":\"0xc0faed28071dc68a5f4b03abbb6115759824980feb95a7fcf3b66ae7e1bab58f\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b50604051620060d1380380620060d183398101604081905262000034916200004a565b60601b6001600160601b0319166080526200007a565b6000602082840312156200005c578081fd5b81516001600160a01b038116811462000073578182fd5b9392505050565b60805160601c615ff9620000d8600039600081816105f801528181610d3f01528181610e2801528181610e620152818161154901528181611795015281816117cf015281816118b10152818161192801526119650152615ff96000f3fe608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190615a02565b61026e610269366004615353565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d91906158ef565b6102a66106fb565b60405161023d929190615bfa565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004615313565b6107a4565b6102f56102f036600461545d565b61085c565b005b6102ff60fa81565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004615353565b610c96565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610ccd565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b13660046152a3565b6001600160a01b031660009081526033602052604090205490565b6102f5610cdc565b6097546103e890600160b81b900460020b81565b60405161023d91906159c6565b6102f561040336600461588e565b610d32565b61041b61041636600461588e565b610e8d565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e611173565b61045a6104553660046158b2565b611182565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004615814565b6112d4565b6097546103e890600160a01b900460020b81565b61026e6104aa366004615353565b611494565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004615353565b61152f565b6102f56104e53660046157c4565b61153c565b610233609b5481565b6102a66105013660046152a3565b6117fd565b6102f561051436600461588e565b6118a4565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046154e7565b61198a565b6097546102ff90600160f01b900461ffff1681565b61023361059a3660046152db565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6102336119ee565b6102f56105db366004615537565b6119fd565b6102f56105ee366004615718565b611c9a565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f56106283660046152a3565b611da7565b6102f561063b3660046154e7565b611e87565b61041b61064e36600461588e565b611ef1565b60606036805461066290615e08565b80601f016020809104026020016040519081016040528092919081815260200182805461068e90615e08565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f233848461222a565b50600192915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190615734565b50505050509150915061079a828261234f565b9350935050509091565b60006107b1848484612600565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561083b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61084f853361084a8685615dc5565b61222a565b60019150505b9392505050565b33610865610ccd565b6001600160a01b03161461088b5760405162461bcd60e51b815260040161083290615b61565b600080600061089960355490565b1115610c1d57609d546001600160a01b031663514ea4bf6108b86127c6565b6040518263ffffffff1660e01b81526004016108d691815260200190565b60a06040518083038186803b1580156108ee57600080fd5b505afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092691906156c2565b5092945050506001600160801b0383161590506109af57609754600090819061096590600160a01b8104600290810b91600160b81b9004900b8661282c565b9350935050506109758282612bb9565b61097f8282612c92565b6040519193509150600080516020615fa4833981519152906109a49084908490615bfa565b60405180910390a150505b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a2c9030906004016158ef565b60206040518083038186803b158015610a4457600080fd5b505afa158015610a58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7c9190615876565b610a869190615dc5565b610a909190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610acc9030906004016158ef565b60206040518083038186803b158015610ae457600080fd5b505afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c9190615876565b610b269190615dc5565b610b309190615dc5565b9050610b41898984848b8b8b612d2d565b609d546001600160a01b031663514ea4bf610b5a6127c6565b6040518263ffffffff1660e01b8152600401610b7891815260200190565b60a06040518083038186803b158015610b9057600080fd5b505afa158015610ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc891906156c2565b509295505050506001600160801b038316610c165760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610832565b5050610c62565b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615f4483398151915287878484604051610c8594939291906159d4565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061084a908690615ca3565b6097546001600160a01b031690565b33610ce5610ccd565b6001600160a01b031614610d0b5760405162461bcd60e51b815260040161083290615b61565b60988054600160201b600160d01b031916905560006099819055609a55610d30612eec565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d7c5760405162461bcd60e51b815260040161083290615a35565b600080610d8f609954609a548888612f53565b60006099819055609a5590925090508115610dc957609854609e54610dc9916001600160a01b0391821691600160301b9091041684613077565b8015610df457609854609f54610df4916001600160a01b0391821691600160301b9091041683613077565b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610e5357610e4e6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b610e87565b610e876001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050565b600080600060026065541415610eb55760405162461bcd60e51b815260040161083290615bc3565b600260655584610ed75760405162461bcd60e51b815260040161083290615ba3565b6000610ee260355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610f3457600080fd5b505afa158015610f48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6c9190615734565b50505050505090506000821115610fad57600080610f886106fb565b91509150610f97828a866131f5565b9650610fa4818a866131f5565b95505050610ffa565b610ff481610fcc609760149054906101000a900460020b60020b61324c565b609754610fe690600160b81b9004600290810b900b61324c565b610fef8b61365e565b6136c7565b90955093505b841561101857609e54611018906001600160a01b0316333088613762565b831561103657609f54611036906001600160a01b0316333087613762565b61107681611055609760149054906101000a900460020b60020b61324c565b60975461106f90600160b81b9004600290810b900b61324c565b888861379a565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d916110c6913091600160a01b8104600290810b92600160b81b909204900b908990600401615903565b6040805180830381600087803b1580156110df57600080fd5b505af11580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111791906154c4565b5050611123868861385c565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e7868887878760405161115a959493929190615945565b60405180910390a1505060016065819055509250925092565b60606037805461066290615e08565b60008060008061119160355490565b905080156111b0576111a4818787613929565b919550935091506112cc565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b1580156111f557600080fd5b505afa158015611209573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122d9190615734565b5050505050509050600061127782611256609760149054906101000a900460020b60020b61324c565b60975461127090600160b81b9004600290810b900b61324c565b8b8b61379a565b9050806001600160801b031693506112c4826112a4609760149054906101000a900460020b60020b61324c565b6097546112be90600160b81b9004600290810b900b61324c565b846136c7565b909650945050505b509250925092565b336112dd610ccd565b6001600160a01b0316146113035760405162461bcd60e51b815260040161083290615b61565b6127108461ffff1611156113295760405162461bcd60e51b815260040161083290615b44565b6127108561ffff16111561134f5760405162461bcd60e51b815260040161083290615b44565b6127108361ffff1611156113755760405162461bcd60e51b815260040161083290615b44565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff8516156113ec576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff841615611411576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561143757609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff821615611459576098805463ffffffff191663ffffffff84161790555b6001600160a01b0381161561148d5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156115165760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610832565b611525338561084a8685615dc5565b5060019392505050565b60006106f2338484612600565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146115865760405162461bcd60e51b815260040161083290615a35565b8515611596576115968786613a38565b609d546000906001600160a01b031663514ea4bf6115b26127c6565b6040518263ffffffff1660e01b81526004016115d091815260200190565b60a06040518083038186803b1580156115e857600080fd5b505afa1580156115fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162091906156c2565b505050509050611634818989898989613ce6565b609d546000906001600160a01b031663514ea4bf6116506127c6565b6040518263ffffffff1660e01b815260040161166e91815260200190565b60a06040518083038186803b15801561168657600080fd5b505afa15801561169a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116be91906156c2565b505050509050816001600160801b0316816001600160801b03161161171f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610832565b609754604051600080516020615f448339815191529161175991600160a01b8204600290810b92600160b81b9004900b90869086906159d4565b60405180910390a150506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156117c0576117bb6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b6117f4565b6117f46001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561185057600080fd5b505afa158015611864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118889190615734565b505050505091505061189a848261234f565b9250925050915091565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118ee5760405162461bcd60e51b815260040161083290615a35565b600080611901609b54609c548888612f53565b6000609b819055609c559092509050811561194d57609e5461194d906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084613077565b8015610df457609f54610df4906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083613077565b609d546001600160a01b031633146119b45760405162461bcd60e51b815260040161083290615a84565b83156119d157609e546119d1906001600160a01b03163386613077565b8215610e8757609f54610e87906001600160a01b03163385613077565b60006119f86127c6565b905090565b600054610100900460ff1680611a16575060005460ff16155b611a325760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015611a54576000805461ffff19166101011790555b611a6160fa612710615d82565b61ffff168561ffff161115611a885760405162461bcd60e51b815260040161083290615a66565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe168191600480820192602092909190829003018186803b158015611adc57600080fd5b505afa158015611af0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1491906152bf565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611b6d57600080fd5b505afa158015611b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba591906152bf565b609f80546001600160a01b03199081166001600160a01b0393841617909155609880546097805461012c65ffffffffffff19909316600160201b61ffff8d160263ffffffff19161792909217600160301b600160d01b031916600160301b95881695860217909255643e800c801960d31b600165ffffff00000160a01b03909116600160a01b60028a810b62ffffff908116929092029290921792909217600165ffffff00000160a01b031916600160b81b9189900b9290921602909216919091179091179055611c768888614208565b611c7e614287565b8015611c90576000805461ff00191690555b5050505050505050565b33611ca3610ccd565b6001600160a01b031614611cc95760405162461bcd60e51b815260040161083290615b61565b609854600160201b900461ffff1615611d0a5760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610832565b60008161ffff16118015611d325750611d2660fa612710615d82565b61ffff168161ffff1611155b611d4e5760405162461bcd60e51b815260040161083290615a66565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611db0610ccd565b6001600160a01b031614611dd65760405162461bcd60e51b815260040161083290615b61565b6001600160a01b038116611e3d5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610832565b6097546040516001600160a01b03808416921690600080516020615f6483398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611eb15760405162461bcd60e51b815260040161083290615a84565b6000841315611ed157609e54610e4e906001600160a01b03163386613077565b6000831315610e8757609f54610e87906001600160a01b03163385613077565b600080600060026065541415611f195760405162461bcd60e51b815260040161083290615bc3565b600260655584611f545760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610832565b6000611f5f60355490565b609d549091506000906001600160a01b031663514ea4bf611f7e6127c6565b6040518263ffffffff1660e01b8152600401611f9c91815260200190565b60a06040518083038186803b158015611fb457600080fd5b505afa158015611fc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fec91906156c2565b505050509050611ffc33886142fb565b600061201288836001600160801b031685614438565b905061201d8161365e565b60975490945060009081908190819061204c90600160a01b8104600290810b91600160b81b9004900b8a61282c565b935093509350935061205e8282612bb9565b6120688282612c92565b6040519193509150600080516020615fa48339815191529061208d9084908490615bfa565b60405180910390a1609b54609954609e546040516370a0823160e01b815261214893929188916001600160a01b03909116906370a08231906120d39030906004016158ef565b60206040518083038186803b1580156120eb57600080fd5b505afa1580156120ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121239190615876565b61212d9190615dc5565b6121379190615dc5565b6121419190615dc5565b8d89614438565b6121529085615ca3565b609c54609a54609f546040516370a0823160e01b8152939d5061218f9387916001600160a01b0316906370a08231906120d39030906004016158ef565b6121999084615ca3565b985089156121b857609e546121b8906001600160a01b03168c8c613077565b88156121d557609f546121d5906001600160a01b03168c8b613077565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c60405161220c959493929190615945565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b03831661228c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610832565b6001600160a01b0382166122ed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610832565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf6123776127c6565b6040518263ffffffff1660e01b815260040161239591815260200190565b60a06040518083038186803b1580156123ad57600080fd5b505afa1580156123c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e591906156c2565b9450945094509450945061242e8961240e609760149054906101000a900460020b60020b61324c565b60975461242890600160b81b9004600290810b900b61324c565b886136c7565b909750955060006001600160801b03831661244c6001878c8a6144e7565b6124569190615ca3565b90506000826001600160801b03166124716000878d8b6144e7565b61247b9190615ca3565b90506124878282612c92565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a08231906124c59030906004016158ef565b60206040518083038186803b1580156124dd57600080fd5b505afa1580156124f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125159190615876565b61251f9085615ca3565b6125299190615dc5565b6125339190615dc5565b61253d908a615ca3565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a08231906125789030906004016158ef565b60206040518083038186803b15801561259057600080fd5b505afa1580156125a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c89190615876565b6125d29084615ca3565b6125dc9190615dc5565b6125e69190615dc5565b6125f09089615ca3565b9750505050505050509250929050565b6001600160a01b0383166126645760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610832565b6001600160a01b0382166126c65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610832565b6001600160a01b0383166000908152603360205260409020548181101561273e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610832565b6127488282615dc5565b6001600160a01b03808616600090815260336020526040808220939093559085168152908120805484929061277e908490615ca3565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615f84833981519152846040516127b891815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b8204600290810b810b60e890811b6034840152600160b81b909304810b900b90911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a08231906128659030906004016158ef565b60206040518083038186803b15801561287d57600080fd5b505afa158015612891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b59190615876565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a08231906128eb9030906004016158ef565b60206040518083038186803b15801561290357600080fd5b505afa158015612917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293b9190615876565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a7906064016040805180830381600087803b15801561299b57600080fd5b505af11580156129af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d391906154c4565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a4016040805180830381600087803b158015612a4157600080fd5b505af1158015612a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a799190615690565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612aaf9030906004016158ef565b60206040518083038186803b158015612ac757600080fd5b505afa158015612adb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aff9190615876565b612b099190615dc5565b612b139190615dc5565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a0823190612b489030906004016158ef565b60206040518083038186803b158015612b6057600080fd5b505afa158015612b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b989190615876565b612ba29190615dc5565b612bac9190615dc5565b9250505093509350935093565b612710612bc760fa84615d24565b612bd19190615ce1565b609b6000828254612be29190615ca3565b909155506127109050612bf660fa83615d24565b612c009190615ce1565b609c6000828254612c119190615ca3565b909155505060985461271090612c3290600160201b900461ffff1684615d24565b612c3c9190615ce1565b60996000828254612c4d9190615ca3565b909155505060985461271090612c6e90600160201b900461ffff1683615d24565b612c789190615ce1565b609a6000828254612c899190615ca3565b90915550505050565b6000806000612710609860049054906101000a900461ffff1660fa612cb79190615c5b565b612cc59061ffff1687615d24565b612ccf9190615ce1565b60985490915060009061271090612cf290600160201b900461ffff1660fa615c5b565b612d009061ffff1687615d24565b612d0a9190615ce1565b9050612d168287615dc5565b9350612d228186615dc5565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b158015612d7257600080fd5b505afa158015612d86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612daa9190615734565b50505050505090506000612dd782612dc48b60020b61324c565b612dd08b60020b61324c565b8a8a61379a565b90506001600160801b03811615612e9457609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612e239030908f908f908990600401615903565b6040805180830381600087803b158015612e3c57600080fd5b505af1158015612e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7491906154c4565b9092509050612e83828a615dc5565b9850612e8f8189615dc5565b975050505b6000612ec36127108686612ea85789612eaa565b8a5b612eb49190615d24565b612ebe9190615ce1565b6148f3565b90506000811315612ee057612edd8a8a8a8a858b8a614959565b50505b50505050505050505050565b33612ef5610ccd565b6001600160a01b031614612f1b5760405162461bcd60e51b815260040161083290615b61565b6097546040516000916001600160a01b031690600080516020615f64833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0384811691161415612fc857609754849061271090612f8c90600160e01b900461ffff1689615d24565b612f969190615ce1565b1015612fb45760405162461bcd60e51b815260040161083290615afb565b612fbe8487615dc5565b915084905061306e565b609f546001600160a01b038481169116141561303857609754849061271090612ffc90600160e01b900461ffff1688615d24565b6130069190615ce1565b10156130245760405162461bcd60e51b815260040161083290615afb565b61302e8486615dc5565b905085915061306e565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610832565b94509492505050565b6040516001600160a01b0383166024820152604481018290526130da90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614ba2565b505050565b8047101561312f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610832565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461317c576040519150601f19603f3d011682016040523d82523d6000602084013e613181565b606091505b50509050806130da5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610832565b6000613202848484614438565b90506000828061322257634e487b7160e01b600052601260045260246000fd5b848609111561085557600019811061323957600080fd5b8061324381615e43565b95945050505050565b60008060008360020b12613263578260020b613270565b8260020b61327090615e93565b905061327f620d89e719615e72565b60020b8111156132b55760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610832565b6000600182166132c957600160801b6132db565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561331057608061330b826ffff97272373d413259a46990580e213a615d24565b901c90505b600482161561333a576080613335826ffff2e50f5f656932ef12357cf3c7fdcc615d24565b901c90505b600882161561336457608061335f826fffe5caca7e10e4e61c3624eaa0941cd0615d24565b901c90505b601082161561338e576080613389826fffcb9843d60f6159c9db58835c926644615d24565b901c90505b60208216156133b85760806133b3826fff973b41fa98c081472e6896dfb254c0615d24565b901c90505b60408216156133e25760806133dd826fff2ea16466c96a3843ec78b326b52861615d24565b901c90505b608082161561340c576080613407826ffe5dee046a99a2a811c461f1969c3053615d24565b901c90505b610100821615613437576080613432826ffcbe86c7900a88aedcffc83b479aa3a4615d24565b901c90505b61020082161561346257608061345d826ff987a7253ac413176f2b074cf7815e54615d24565b901c90505b61040082161561348d576080613488826ff3392b0822b70005940c7a398e4b70f3615d24565b901c90505b6108008216156134b85760806134b3826fe7159475a2c29b7443b29c7fa6e889d9615d24565b901c90505b6110008216156134e35760806134de826fd097f3bdfd2022b8845ad8f792aa5825615d24565b901c90505b61200082161561350e576080613509826fa9f746462d870fdf8a65dc1f90e061e5615d24565b901c90505b614000821615613539576080613534826f70d869a156d2a1b890bb3df62baf32f7615d24565b901c90505b61800082161561356457608061355f826f31be135f97d08fd981231505542fcfa6615d24565b901c90505b6201000082161561359057608061358b826f09aa508b5b7a84e1c677de54f3e99bc9615d24565b901c90505b620200008216156135bb5760806135b6826e5d6af8dedb81196699c329225ee604615d24565b901c90505b620400008216156135e55760806135e0826d2216e584f5fa1ea926041bedfe98615d24565b901c90505b6208000082161561360d576080613608826b048a170391f7dc42444e8fa2615d24565b901c90505b60008460020b13156136285761362581600019615ce1565b90505b613636600160201b82615e5e565b15613642576001613645565b60005b6136569060ff16602083901c615ca3565b949350505050565b6000600160801b82106136c35760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610832565b5090565b600080836001600160a01b0316856001600160a01b031611156136e8579293925b846001600160a01b0316866001600160a01b0316116137135761370c858585614c74565b915061306e565b836001600160a01b0316866001600160a01b0316101561374c57613738868585614c74565b9150613745858785614cde565b905061306e565b613757858585614cde565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e879085906323b872dd60e01b906084016130a3565b6000836001600160a01b0316856001600160a01b031611156137ba579293925b846001600160a01b0316866001600160a01b0316116137e5576137de858585614d28565b9050613243565b836001600160a01b0316866001600160a01b0316101561384757600061380c878686614d28565b9050600061381b878986614d92565b9050806001600160801b0316826001600160801b03161061383c578061383e565b815b92505050613243565b613852858584614d92565b9695505050505050565b6001600160a01b0382166138b25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610832565b80603560008282546138c49190615ca3565b90915550506001600160a01b038216600090815260336020526040812080548392906138f1908490615ca3565b90915550506040518181526001600160a01b03831690600090600080516020615f848339815191529060200160405180910390a35050565b60008060008060006139396106fb565b9150915081600014801561394d5750600081115b156139645761395d868983614438565b9250613a13565b801580156139725750600082115b156139825761395d878984614438565b8115801561398e575080155b156139b55760405162461bcd60e51b81526020600482015260006024820152604401610832565b60006139c2888a85614438565b905060006139d1888b85614438565b90506000821180156139e35750600081115b6139ff5760405162461bcd60e51b815260040161083290615ba3565b808210613a0c5780613a0e565b815b945050505b613a1e83838a6131f5565b9450613a2b83828a6131f5565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff1691839150600090613a8457634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110613ac157634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613b0790859060040161597c565b60006040518083038186803b158015613b1f57600080fd5b505afa158015613b33573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613b5b919081019061537e565b5090508051600214613b9b5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610832565b6098548151600091829163ffffffff90911660060b9084908390613bcf57634e487b7160e01b600052603260045260246000fd5b602002602001015184600181518110613bf857634e487b7160e01b600052603260045260246000fd5b60200260200101510360060b81613c1f57634e487b7160e01b600052601260045260246000fd5b059050613c2e8160020b61324c565b6097549092506000915061271090613c5190600160f01b900461ffff1684615cf5565b613c5b9190615cbb565b90508415613ca357613c6d8183615da5565b6001600160a01b0316866001600160a01b03161015613c9e5760405162461bcd60e51b815260040161083290615b1d565b613cde565b613cad8183615c81565b6001600160a01b0316866001600160a01b03161115613cde5760405162461bcd60e51b815260040161083290615b1d565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613d1f9030906004016158ef565b60206040518083038186803b158015613d3757600080fd5b505afa158015613d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d6f9190615876565b613d799190615dc5565b613d839190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613dbf9030906004016158ef565b60206040518083038186803b158015613dd757600080fd5b505afa158015613deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0f9190615876565b613e199190615dc5565b613e239190615dc5565b6097549091506000908190613e4e90600160a01b8104600290810b91600160b81b9004900b8c61282c565b935093505050613e5e8282612bb9565b613e688282612c92565b6040519193509150600080516020615fa483398151915290613e8d9084908490615bfa565b60405180910390a1613e9f8483615ca3565b9150613eab8382615ca3565b609e549091506001600160a01b038681169116141561405657609754869061271090613ee290600160d01b900461ffff1685615d24565b613eec9190615ce1565b1015613f0a5760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613f429030906004016158ef565b60206040518083038186803b158015613f5a57600080fd5b505afa158015613f6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f929190615876565b613f9c9190615dc5565b613fa69190615dc5565b613fb09190615dc5565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613feb9030906004016158ef565b60206040518083038186803b15801561400357600080fd5b505afa158015614017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061403b9190615876565b6140459190615dc5565b61404f9190615dc5565b92506141e1565b609f546001600160a01b03868116911614156130385760975486906127109061408a90600160d01b900461ffff1684615d24565b6140949190615ce1565b10156140b25760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a08231906140e89030906004016158ef565b60206040518083038186803b15801561410057600080fd5b505afa158015614114573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141389190615876565b6141429190615dc5565b61414c9190615dc5565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a08231906141879030906004016158ef565b60206040518083038186803b15801561419f57600080fd5b505afa1580156141b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141d79190615876565b61403b9190615dc5565b609754612ee090600160a01b8104600290810b91600160b81b9004900b86868d8d8d612d2d565b600054610100900460ff1680614221575060005460ff16155b61423d5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff1615801561425f576000805461ffff19166101011790555b614267614dc8565b6142718383614e32565b80156130da576000805461ff0019169055505050565b600054610100900460ff16806142a0575060005460ff16155b6142bc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142de576000805461ffff19166101011790555b6142e6614ec7565b80156142f8576000805461ff00191690555b50565b6001600160a01b03821661435b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610832565b6001600160a01b038216600090815260336020526040902054818110156143cf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610832565b6143d98282615dc5565b6001600160a01b03841660009081526033602052604081209190915560358054849290614407908490615dc5565b90915550506040518281526000906001600160a01b03851690600080516020615f8483398151915290602001612342565b600080806000198587098587029250828110838203039150508060001415614472576000841161446757600080fd5b508290049050610855565b80841161447e57600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b60008060008087156146b457609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b815260040160206040518083038186803b15801561454157600080fd5b505afa158015614555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145799190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916145b991600160a01b90910460020b906004016159c6565b6101006040518083038186803b1580156145d257600080fd5b505afa1580156145e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061460a91906155f6565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba93955061465394600160b81b90910460020b935060040191506159c69050565b6101006040518083038186803b15801561466c57600080fd5b505afa158015614680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146a491906155f6565b5093975061486f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b815260040160206040518083038186803b15801561470257600080fd5b505afa158015614716573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061473a9190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161477a91600160a01b90910460020b906004016159c6565b6101006040518083038186803b15801561479357600080fd5b505afa1580156147a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147cb91906155f6565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506148139450600160b81b900460020b9260040191506159c69050565b6101006040518083038186803b15801561482c57600080fd5b505afa158015614840573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061486491906155f6565b509297505050505050505b6000609760149054906101000a900460020b60020b8760020b12614894575082614899565b508281035b6000609760179054906101000a900460020b60020b8860020b12156148bf5750826148c4565b508282035b8183038190036148e46001600160801b0389168b8303600160801b614438565b9b9a5050505050505050505050565b6000600160ff1b82106136c35760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610832565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c4016040805180830381600087803b1580156149c957600080fd5b505af11580156149dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a0191906154c4565b9150915081614a0f8a6148f3565b614a199190615d43565b935080614a25896148f3565b614a2f9190615d43565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015614a8157600080fd5b505afa158015614a95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ab99190615734565b50505050505090506000614ae682614ad38f60020b61324c565b614adf8f60020b61324c565b898961379a565b90506001600160801b03811615614b9257609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b8152600401614b3e9493929190615903565b6040805180830381600087803b158015614b5757600080fd5b505af1158015614b6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b8f91906154c4565b50505b5050505097509795505050505050565b6000614bf7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614f379092919063ffffffff16565b8051909150156130da5780806020019051810190614c159190615441565b6130da5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610832565b6000826001600160a01b0316846001600160a01b03161115614c94579192915b6001600160a01b038416614cd4600160601b600160e01b03606085901b16614cbc8787615da5565b6001600160a01b0316866001600160a01b0316614438565b6136569190615ce1565b6000826001600160a01b0316846001600160a01b03161115614cfe579192915b6136566001600160801b038316614d158686615da5565b6001600160a01b0316600160601b614438565b6000826001600160a01b0316846001600160a01b03161115614d48579192915b6000614d6b856001600160a01b0316856001600160a01b0316600160601b614438565b9050613243614d8d8483614d7f8989615da5565b6001600160a01b0316614438565b614f46565b6000826001600160a01b0316846001600160a01b03161115614db2579192915b613656614d8d83600160601b614d7f8888615da5565b600054610100900460ff1680614de1575060005460ff16155b614dfd5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142e6576000805461ffff191661010117905580156142f8576000805461ff001916905550565b600054610100900460ff1680614e4b575060005460ff16155b614e675760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614e89576000805461ffff19166101011790555b8251614e9c9060369060208601906150c2565b508151614eb09060379060208501906150c2565b5080156130da576000805461ff0019169055505050565b600054610100900460ff1680614ee0575060005460ff16155b614efc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614f1e576000805461ffff19166101011790555b600160655580156142f8576000805461ff001916905550565b60606136568484600085614f61565b806001600160801b0381168114614f5c57600080fd5b919050565b606082471015614fc25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610832565b843b6150105760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610832565b600080866001600160a01b0316858760405161502c91906158d3565b60006040518083038185875af1925050503d8060008114615069576040519150601f19603f3d011682016040523d82523d6000602084013e61506e565b606091505b509150915061507e828286615089565b979650505050505050565b60608315615098575081610855565b8251156150a85782518084602001fd5b8160405162461bcd60e51b81526004016108329190615a02565b8280546150ce90615e08565b90600052602060002090601f0160209004810192826150f05760008555615136565b82601f1061510957805160ff1916838001178555615136565b82800160010185558215615136579182015b8281111561513657825182559160200191906001019061511b565b506136c39291505b808211156136c3576000815560010161513e565b600082601f830112615162578081fd5b8151602061517761517283615c38565b615c08565b80838252828201915082860187848660051b8901011115615196578586fd5b855b858110156151bd5781516151ab81615eef565b84529284019290840190600101615198565b5090979650505050505050565b60008083601f8401126151db578182fd5b5081356001600160401b038111156151f1578182fd5b60208301915083602082850101111561520957600080fd5b9250929050565b8051600681900b8114614f5c57600080fd5b600082601f830112615232578081fd5b81356001600160401b0381111561524b5761524b615ed9565b61525e601f8201601f1916602001615c08565b818152846020838601011115615272578283fd5b816020850160208301379081016020019190915292915050565b80516001600160801b0381168114614f5c57600080fd5b6000602082840312156152b4578081fd5b813561085581615eef565b6000602082840312156152d0578081fd5b815161085581615eef565b600080604083850312156152ed578081fd5b82356152f881615eef565b9150602083013561530881615eef565b809150509250929050565b600080600060608486031215615327578081fd5b833561533281615eef565b9250602084013561534281615eef565b929592945050506040919091013590565b60008060408385031215615365578182fd5b823561537081615eef565b946020939093013593505050565b60008060408385031215615390578182fd5b82516001600160401b03808211156153a6578384fd5b818501915085601f8301126153b9578384fd5b815160206153c961517283615c38565b8083825282820191508286018a848660051b89010111156153e8578889fd5b8896505b84871015615411576153fd81615210565b8352600196909601959183019183016153ec565b509188015191965090935050508082111561542a578283fd5b5061543785828601615152565b9150509250929050565b600060208284031215615452578081fd5b815161085581615f04565b600080600080600060a08688031215615474578283fd5b853561547f81615f12565b9450602086013561548f81615f12565b9350604086013561549f81615eef565b92506060860135915060808601356154b681615f04565b809150509295509295909350565b600080604083850312156154d6578182fd5b505080516020909101519092909150565b600080600080606085870312156154fc578182fd5b843593506020850135925060408501356001600160401b0381111561551f578283fd5b61552b878288016151ca565b95989497509550505050565b600080600080600080600060e0888a031215615551578485fd5b87356001600160401b0380821115615567578687fd5b6155738b838c01615222565b985060208a0135915080821115615588578687fd5b506155958a828b01615222565b96505060408801356155a681615eef565b945060608801356155b681615f21565b935060808801356155c681615f12565b925060a08801356155d681615f12565b915060c08801356155e681615eef565b8091505092959891949750929550565b600080600080600080600080610100898b031215615612578182fd5b61561b8961528c565b9750602089015180600f0b8114615630578283fd5b60408a015160608b01519198509650945061564d60808a01615210565b935060a089015161565d81615eef565b60c08a015190935061566e81615f31565b60e08a015190925061567f81615f04565b809150509295985092959890939650565b600080604083850312156156a2578182fd5b6156ab8361528c565b91506156b96020840161528c565b90509250929050565b600080600080600060a086880312156156d9578283fd5b6156e28661528c565b945060208601519350604086015192506156fe6060870161528c565b915061570c6080870161528c565b90509295509295909350565b600060208284031215615729578081fd5b813561085581615f21565b600080600080600080600060e0888a03121561574e578081fd5b875161575981615eef565b602089015190975061576a81615f12565b604089015190965061577b81615f21565b606089015190955061578c81615f21565b608089015190945061579d81615f21565b60a089015190935060ff811681146157b3578182fd5b60c08901519092506155e681615f04565b600080600080600060a086880312156157db578283fd5b85356157e681615eef565b94506020860135935060408601356157fd81615f04565b92506060860135915060808601356154b681615eef565b600080600080600060a0868803121561582b578283fd5b853561583681615f21565b9450602086013561584681615f21565b9350604086013561585681615f21565b9250606086013561586681615f31565b915060808601356154b681615eef565b600060208284031215615887578081fd5b5051919050565b600080604083850312156158a0578182fd5b82359150602083013561530881615eef565b600080604083850312156158c4578182fd5b50508035926020909101359150565b600082516158e5818460208701615ddc565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b6020808252825182820181905260009190848201906040850190845b818110156159ba57835163ffffffff1683529284019291840191600101615998565b50909695505050505050565b60029190910b815260200190565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b6020815260008251806020840152615a21816040850160208701615ddc565b601f01601f19169190910160400192915050565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252600490820152636d42505360e01b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260089082015267686967682066656560c01b604082015260600190565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b60208082526003908201526242505360e81b604082015260600190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b918252602082015260400190565b604051601f8201601f191681016001600160401b0381118282101715615c3057615c30615ed9565b604052919050565b60006001600160401b03821115615c5157615c51615ed9565b5060051b60200190565b600061ffff808316818516808303821115615c7857615c78615ead565b01949350505050565b60006001600160a01b03828116848216808303821115615c7857615c78615ead565b60008219821115615cb657615cb6615ead565b500190565b60006001600160a01b0383811680615cd557615cd5615ec3565b92169190910492915050565b600082615cf057615cf0615ec3565b500490565b60006001600160a01b0382811684821681151582840482111615615d1b57615d1b615ead565b02949350505050565b6000816000190483118215151615615d3e57615d3e615ead565b500290565b60008083128015600160ff1b850184121615615d6157615d61615ead565b6001600160ff1b0384018313811615615d7c57615d7c615ead565b50500390565b600061ffff83811690831681811015615d9d57615d9d615ead565b039392505050565b60006001600160a01b0383811690831681811015615d9d57615d9d615ead565b600082821015615dd757615dd7615ead565b500390565b60005b83811015615df7578181015183820152602001615ddf565b83811115610e875750506000910152565b600181811c90821680615e1c57607f821691505b60208210811415615e3d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615e5757615e57615ead565b5060010190565b600082615e6d57615e6d615ec3565b500690565b60008160020b627fffff19811415615e8c57615e8c615ead565b9003919050565b6000600160ff1b821415615ea957615ea9615ead565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146142f857600080fd5b80151581146142f857600080fd5b8060020b81146142f857600080fd5b61ffff811681146142f857600080fd5b63ffffffff811681146142f857600080fdfec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a26469706673582212200d68bbc56177fb98dc03b8435a294744f29eb4d74dbc9371fa03141fd2efac7464736f6c63430008040033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190615a02565b61026e610269366004615353565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d91906158ef565b6102a66106fb565b60405161023d929190615bfa565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004615313565b6107a4565b6102f56102f036600461545d565b61085c565b005b6102ff60fa81565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004615353565b610c96565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610ccd565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b13660046152a3565b6001600160a01b031660009081526033602052604090205490565b6102f5610cdc565b6097546103e890600160b81b900460020b81565b60405161023d91906159c6565b6102f561040336600461588e565b610d32565b61041b61041636600461588e565b610e8d565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e611173565b61045a6104553660046158b2565b611182565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004615814565b6112d4565b6097546103e890600160a01b900460020b81565b61026e6104aa366004615353565b611494565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004615353565b61152f565b6102f56104e53660046157c4565b61153c565b610233609b5481565b6102a66105013660046152a3565b6117fd565b6102f561051436600461588e565b6118a4565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046154e7565b61198a565b6097546102ff90600160f01b900461ffff1681565b61023361059a3660046152db565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6102336119ee565b6102f56105db366004615537565b6119fd565b6102f56105ee366004615718565b611c9a565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f56106283660046152a3565b611da7565b6102f561063b3660046154e7565b611e87565b61041b61064e36600461588e565b611ef1565b60606036805461066290615e08565b80601f016020809104026020016040519081016040528092919081815260200182805461068e90615e08565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f233848461222a565b50600192915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190615734565b50505050509150915061079a828261234f565b9350935050509091565b60006107b1848484612600565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561083b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61084f853361084a8685615dc5565b61222a565b60019150505b9392505050565b33610865610ccd565b6001600160a01b03161461088b5760405162461bcd60e51b815260040161083290615b61565b600080600061089960355490565b1115610c1d57609d546001600160a01b031663514ea4bf6108b86127c6565b6040518263ffffffff1660e01b81526004016108d691815260200190565b60a06040518083038186803b1580156108ee57600080fd5b505afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092691906156c2565b5092945050506001600160801b0383161590506109af57609754600090819061096590600160a01b8104600290810b91600160b81b9004900b8661282c565b9350935050506109758282612bb9565b61097f8282612c92565b6040519193509150600080516020615fa4833981519152906109a49084908490615bfa565b60405180910390a150505b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a2c9030906004016158ef565b60206040518083038186803b158015610a4457600080fd5b505afa158015610a58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7c9190615876565b610a869190615dc5565b610a909190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610acc9030906004016158ef565b60206040518083038186803b158015610ae457600080fd5b505afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c9190615876565b610b269190615dc5565b610b309190615dc5565b9050610b41898984848b8b8b612d2d565b609d546001600160a01b031663514ea4bf610b5a6127c6565b6040518263ffffffff1660e01b8152600401610b7891815260200190565b60a06040518083038186803b158015610b9057600080fd5b505afa158015610ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc891906156c2565b509295505050506001600160801b038316610c165760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610832565b5050610c62565b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615f4483398151915287878484604051610c8594939291906159d4565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061084a908690615ca3565b6097546001600160a01b031690565b33610ce5610ccd565b6001600160a01b031614610d0b5760405162461bcd60e51b815260040161083290615b61565b60988054600160201b600160d01b031916905560006099819055609a55610d30612eec565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d7c5760405162461bcd60e51b815260040161083290615a35565b600080610d8f609954609a548888612f53565b60006099819055609a5590925090508115610dc957609854609e54610dc9916001600160a01b0391821691600160301b9091041684613077565b8015610df457609854609f54610df4916001600160a01b0391821691600160301b9091041683613077565b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610e5357610e4e6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b610e87565b610e876001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050565b600080600060026065541415610eb55760405162461bcd60e51b815260040161083290615bc3565b600260655584610ed75760405162461bcd60e51b815260040161083290615ba3565b6000610ee260355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610f3457600080fd5b505afa158015610f48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6c9190615734565b50505050505090506000821115610fad57600080610f886106fb565b91509150610f97828a866131f5565b9650610fa4818a866131f5565b95505050610ffa565b610ff481610fcc609760149054906101000a900460020b60020b61324c565b609754610fe690600160b81b9004600290810b900b61324c565b610fef8b61365e565b6136c7565b90955093505b841561101857609e54611018906001600160a01b0316333088613762565b831561103657609f54611036906001600160a01b0316333087613762565b61107681611055609760149054906101000a900460020b60020b61324c565b60975461106f90600160b81b9004600290810b900b61324c565b888861379a565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d916110c6913091600160a01b8104600290810b92600160b81b909204900b908990600401615903565b6040805180830381600087803b1580156110df57600080fd5b505af11580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111791906154c4565b5050611123868861385c565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e7868887878760405161115a959493929190615945565b60405180910390a1505060016065819055509250925092565b60606037805461066290615e08565b60008060008061119160355490565b905080156111b0576111a4818787613929565b919550935091506112cc565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b1580156111f557600080fd5b505afa158015611209573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122d9190615734565b5050505050509050600061127782611256609760149054906101000a900460020b60020b61324c565b60975461127090600160b81b9004600290810b900b61324c565b8b8b61379a565b9050806001600160801b031693506112c4826112a4609760149054906101000a900460020b60020b61324c565b6097546112be90600160b81b9004600290810b900b61324c565b846136c7565b909650945050505b509250925092565b336112dd610ccd565b6001600160a01b0316146113035760405162461bcd60e51b815260040161083290615b61565b6127108461ffff1611156113295760405162461bcd60e51b815260040161083290615b44565b6127108561ffff16111561134f5760405162461bcd60e51b815260040161083290615b44565b6127108361ffff1611156113755760405162461bcd60e51b815260040161083290615b44565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff8516156113ec576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff841615611411576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561143757609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff821615611459576098805463ffffffff191663ffffffff84161790555b6001600160a01b0381161561148d5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156115165760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610832565b611525338561084a8685615dc5565b5060019392505050565b60006106f2338484612600565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146115865760405162461bcd60e51b815260040161083290615a35565b8515611596576115968786613a38565b609d546000906001600160a01b031663514ea4bf6115b26127c6565b6040518263ffffffff1660e01b81526004016115d091815260200190565b60a06040518083038186803b1580156115e857600080fd5b505afa1580156115fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162091906156c2565b505050509050611634818989898989613ce6565b609d546000906001600160a01b031663514ea4bf6116506127c6565b6040518263ffffffff1660e01b815260040161166e91815260200190565b60a06040518083038186803b15801561168657600080fd5b505afa15801561169a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116be91906156c2565b505050509050816001600160801b0316816001600160801b03161161171f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610832565b609754604051600080516020615f448339815191529161175991600160a01b8204600290810b92600160b81b9004900b90869086906159d4565b60405180910390a150506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156117c0576117bb6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b6117f4565b6117f46001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561185057600080fd5b505afa158015611864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118889190615734565b505050505091505061189a848261234f565b9250925050915091565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118ee5760405162461bcd60e51b815260040161083290615a35565b600080611901609b54609c548888612f53565b6000609b819055609c559092509050811561194d57609e5461194d906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084613077565b8015610df457609f54610df4906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083613077565b609d546001600160a01b031633146119b45760405162461bcd60e51b815260040161083290615a84565b83156119d157609e546119d1906001600160a01b03163386613077565b8215610e8757609f54610e87906001600160a01b03163385613077565b60006119f86127c6565b905090565b600054610100900460ff1680611a16575060005460ff16155b611a325760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015611a54576000805461ffff19166101011790555b611a6160fa612710615d82565b61ffff168561ffff161115611a885760405162461bcd60e51b815260040161083290615a66565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe168191600480820192602092909190829003018186803b158015611adc57600080fd5b505afa158015611af0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1491906152bf565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611b6d57600080fd5b505afa158015611b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba591906152bf565b609f80546001600160a01b03199081166001600160a01b0393841617909155609880546097805461012c65ffffffffffff19909316600160201b61ffff8d160263ffffffff19161792909217600160301b600160d01b031916600160301b95881695860217909255643e800c801960d31b600165ffffff00000160a01b03909116600160a01b60028a810b62ffffff908116929092029290921792909217600165ffffff00000160a01b031916600160b81b9189900b9290921602909216919091179091179055611c768888614208565b611c7e614287565b8015611c90576000805461ff00191690555b5050505050505050565b33611ca3610ccd565b6001600160a01b031614611cc95760405162461bcd60e51b815260040161083290615b61565b609854600160201b900461ffff1615611d0a5760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610832565b60008161ffff16118015611d325750611d2660fa612710615d82565b61ffff168161ffff1611155b611d4e5760405162461bcd60e51b815260040161083290615a66565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611db0610ccd565b6001600160a01b031614611dd65760405162461bcd60e51b815260040161083290615b61565b6001600160a01b038116611e3d5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610832565b6097546040516001600160a01b03808416921690600080516020615f6483398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611eb15760405162461bcd60e51b815260040161083290615a84565b6000841315611ed157609e54610e4e906001600160a01b03163386613077565b6000831315610e8757609f54610e87906001600160a01b03163385613077565b600080600060026065541415611f195760405162461bcd60e51b815260040161083290615bc3565b600260655584611f545760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610832565b6000611f5f60355490565b609d549091506000906001600160a01b031663514ea4bf611f7e6127c6565b6040518263ffffffff1660e01b8152600401611f9c91815260200190565b60a06040518083038186803b158015611fb457600080fd5b505afa158015611fc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fec91906156c2565b505050509050611ffc33886142fb565b600061201288836001600160801b031685614438565b905061201d8161365e565b60975490945060009081908190819061204c90600160a01b8104600290810b91600160b81b9004900b8a61282c565b935093509350935061205e8282612bb9565b6120688282612c92565b6040519193509150600080516020615fa48339815191529061208d9084908490615bfa565b60405180910390a1609b54609954609e546040516370a0823160e01b815261214893929188916001600160a01b03909116906370a08231906120d39030906004016158ef565b60206040518083038186803b1580156120eb57600080fd5b505afa1580156120ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121239190615876565b61212d9190615dc5565b6121379190615dc5565b6121419190615dc5565b8d89614438565b6121529085615ca3565b609c54609a54609f546040516370a0823160e01b8152939d5061218f9387916001600160a01b0316906370a08231906120d39030906004016158ef565b6121999084615ca3565b985089156121b857609e546121b8906001600160a01b03168c8c613077565b88156121d557609f546121d5906001600160a01b03168c8b613077565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c60405161220c959493929190615945565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b03831661228c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610832565b6001600160a01b0382166122ed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610832565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf6123776127c6565b6040518263ffffffff1660e01b815260040161239591815260200190565b60a06040518083038186803b1580156123ad57600080fd5b505afa1580156123c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e591906156c2565b9450945094509450945061242e8961240e609760149054906101000a900460020b60020b61324c565b60975461242890600160b81b9004600290810b900b61324c565b886136c7565b909750955060006001600160801b03831661244c6001878c8a6144e7565b6124569190615ca3565b90506000826001600160801b03166124716000878d8b6144e7565b61247b9190615ca3565b90506124878282612c92565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a08231906124c59030906004016158ef565b60206040518083038186803b1580156124dd57600080fd5b505afa1580156124f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125159190615876565b61251f9085615ca3565b6125299190615dc5565b6125339190615dc5565b61253d908a615ca3565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a08231906125789030906004016158ef565b60206040518083038186803b15801561259057600080fd5b505afa1580156125a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c89190615876565b6125d29084615ca3565b6125dc9190615dc5565b6125e69190615dc5565b6125f09089615ca3565b9750505050505050509250929050565b6001600160a01b0383166126645760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610832565b6001600160a01b0382166126c65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610832565b6001600160a01b0383166000908152603360205260409020548181101561273e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610832565b6127488282615dc5565b6001600160a01b03808616600090815260336020526040808220939093559085168152908120805484929061277e908490615ca3565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615f84833981519152846040516127b891815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b8204600290810b810b60e890811b6034840152600160b81b909304810b900b90911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a08231906128659030906004016158ef565b60206040518083038186803b15801561287d57600080fd5b505afa158015612891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b59190615876565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a08231906128eb9030906004016158ef565b60206040518083038186803b15801561290357600080fd5b505afa158015612917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293b9190615876565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a7906064016040805180830381600087803b15801561299b57600080fd5b505af11580156129af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d391906154c4565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a4016040805180830381600087803b158015612a4157600080fd5b505af1158015612a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a799190615690565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612aaf9030906004016158ef565b60206040518083038186803b158015612ac757600080fd5b505afa158015612adb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aff9190615876565b612b099190615dc5565b612b139190615dc5565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a0823190612b489030906004016158ef565b60206040518083038186803b158015612b6057600080fd5b505afa158015612b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b989190615876565b612ba29190615dc5565b612bac9190615dc5565b9250505093509350935093565b612710612bc760fa84615d24565b612bd19190615ce1565b609b6000828254612be29190615ca3565b909155506127109050612bf660fa83615d24565b612c009190615ce1565b609c6000828254612c119190615ca3565b909155505060985461271090612c3290600160201b900461ffff1684615d24565b612c3c9190615ce1565b60996000828254612c4d9190615ca3565b909155505060985461271090612c6e90600160201b900461ffff1683615d24565b612c789190615ce1565b609a6000828254612c899190615ca3565b90915550505050565b6000806000612710609860049054906101000a900461ffff1660fa612cb79190615c5b565b612cc59061ffff1687615d24565b612ccf9190615ce1565b60985490915060009061271090612cf290600160201b900461ffff1660fa615c5b565b612d009061ffff1687615d24565b612d0a9190615ce1565b9050612d168287615dc5565b9350612d228186615dc5565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b158015612d7257600080fd5b505afa158015612d86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612daa9190615734565b50505050505090506000612dd782612dc48b60020b61324c565b612dd08b60020b61324c565b8a8a61379a565b90506001600160801b03811615612e9457609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612e239030908f908f908990600401615903565b6040805180830381600087803b158015612e3c57600080fd5b505af1158015612e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7491906154c4565b9092509050612e83828a615dc5565b9850612e8f8189615dc5565b975050505b6000612ec36127108686612ea85789612eaa565b8a5b612eb49190615d24565b612ebe9190615ce1565b6148f3565b90506000811315612ee057612edd8a8a8a8a858b8a614959565b50505b50505050505050505050565b33612ef5610ccd565b6001600160a01b031614612f1b5760405162461bcd60e51b815260040161083290615b61565b6097546040516000916001600160a01b031690600080516020615f64833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0384811691161415612fc857609754849061271090612f8c90600160e01b900461ffff1689615d24565b612f969190615ce1565b1015612fb45760405162461bcd60e51b815260040161083290615afb565b612fbe8487615dc5565b915084905061306e565b609f546001600160a01b038481169116141561303857609754849061271090612ffc90600160e01b900461ffff1688615d24565b6130069190615ce1565b10156130245760405162461bcd60e51b815260040161083290615afb565b61302e8486615dc5565b905085915061306e565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610832565b94509492505050565b6040516001600160a01b0383166024820152604481018290526130da90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614ba2565b505050565b8047101561312f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610832565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461317c576040519150601f19603f3d011682016040523d82523d6000602084013e613181565b606091505b50509050806130da5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610832565b6000613202848484614438565b90506000828061322257634e487b7160e01b600052601260045260246000fd5b848609111561085557600019811061323957600080fd5b8061324381615e43565b95945050505050565b60008060008360020b12613263578260020b613270565b8260020b61327090615e93565b905061327f620d89e719615e72565b60020b8111156132b55760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610832565b6000600182166132c957600160801b6132db565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561331057608061330b826ffff97272373d413259a46990580e213a615d24565b901c90505b600482161561333a576080613335826ffff2e50f5f656932ef12357cf3c7fdcc615d24565b901c90505b600882161561336457608061335f826fffe5caca7e10e4e61c3624eaa0941cd0615d24565b901c90505b601082161561338e576080613389826fffcb9843d60f6159c9db58835c926644615d24565b901c90505b60208216156133b85760806133b3826fff973b41fa98c081472e6896dfb254c0615d24565b901c90505b60408216156133e25760806133dd826fff2ea16466c96a3843ec78b326b52861615d24565b901c90505b608082161561340c576080613407826ffe5dee046a99a2a811c461f1969c3053615d24565b901c90505b610100821615613437576080613432826ffcbe86c7900a88aedcffc83b479aa3a4615d24565b901c90505b61020082161561346257608061345d826ff987a7253ac413176f2b074cf7815e54615d24565b901c90505b61040082161561348d576080613488826ff3392b0822b70005940c7a398e4b70f3615d24565b901c90505b6108008216156134b85760806134b3826fe7159475a2c29b7443b29c7fa6e889d9615d24565b901c90505b6110008216156134e35760806134de826fd097f3bdfd2022b8845ad8f792aa5825615d24565b901c90505b61200082161561350e576080613509826fa9f746462d870fdf8a65dc1f90e061e5615d24565b901c90505b614000821615613539576080613534826f70d869a156d2a1b890bb3df62baf32f7615d24565b901c90505b61800082161561356457608061355f826f31be135f97d08fd981231505542fcfa6615d24565b901c90505b6201000082161561359057608061358b826f09aa508b5b7a84e1c677de54f3e99bc9615d24565b901c90505b620200008216156135bb5760806135b6826e5d6af8dedb81196699c329225ee604615d24565b901c90505b620400008216156135e55760806135e0826d2216e584f5fa1ea926041bedfe98615d24565b901c90505b6208000082161561360d576080613608826b048a170391f7dc42444e8fa2615d24565b901c90505b60008460020b13156136285761362581600019615ce1565b90505b613636600160201b82615e5e565b15613642576001613645565b60005b6136569060ff16602083901c615ca3565b949350505050565b6000600160801b82106136c35760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610832565b5090565b600080836001600160a01b0316856001600160a01b031611156136e8579293925b846001600160a01b0316866001600160a01b0316116137135761370c858585614c74565b915061306e565b836001600160a01b0316866001600160a01b0316101561374c57613738868585614c74565b9150613745858785614cde565b905061306e565b613757858585614cde565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e879085906323b872dd60e01b906084016130a3565b6000836001600160a01b0316856001600160a01b031611156137ba579293925b846001600160a01b0316866001600160a01b0316116137e5576137de858585614d28565b9050613243565b836001600160a01b0316866001600160a01b0316101561384757600061380c878686614d28565b9050600061381b878986614d92565b9050806001600160801b0316826001600160801b03161061383c578061383e565b815b92505050613243565b613852858584614d92565b9695505050505050565b6001600160a01b0382166138b25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610832565b80603560008282546138c49190615ca3565b90915550506001600160a01b038216600090815260336020526040812080548392906138f1908490615ca3565b90915550506040518181526001600160a01b03831690600090600080516020615f848339815191529060200160405180910390a35050565b60008060008060006139396106fb565b9150915081600014801561394d5750600081115b156139645761395d868983614438565b9250613a13565b801580156139725750600082115b156139825761395d878984614438565b8115801561398e575080155b156139b55760405162461bcd60e51b81526020600482015260006024820152604401610832565b60006139c2888a85614438565b905060006139d1888b85614438565b90506000821180156139e35750600081115b6139ff5760405162461bcd60e51b815260040161083290615ba3565b808210613a0c5780613a0e565b815b945050505b613a1e83838a6131f5565b9450613a2b83828a6131f5565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff1691839150600090613a8457634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110613ac157634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613b0790859060040161597c565b60006040518083038186803b158015613b1f57600080fd5b505afa158015613b33573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613b5b919081019061537e565b5090508051600214613b9b5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610832565b6098548151600091829163ffffffff90911660060b9084908390613bcf57634e487b7160e01b600052603260045260246000fd5b602002602001015184600181518110613bf857634e487b7160e01b600052603260045260246000fd5b60200260200101510360060b81613c1f57634e487b7160e01b600052601260045260246000fd5b059050613c2e8160020b61324c565b6097549092506000915061271090613c5190600160f01b900461ffff1684615cf5565b613c5b9190615cbb565b90508415613ca357613c6d8183615da5565b6001600160a01b0316866001600160a01b03161015613c9e5760405162461bcd60e51b815260040161083290615b1d565b613cde565b613cad8183615c81565b6001600160a01b0316866001600160a01b03161115613cde5760405162461bcd60e51b815260040161083290615b1d565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613d1f9030906004016158ef565b60206040518083038186803b158015613d3757600080fd5b505afa158015613d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d6f9190615876565b613d799190615dc5565b613d839190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613dbf9030906004016158ef565b60206040518083038186803b158015613dd757600080fd5b505afa158015613deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0f9190615876565b613e199190615dc5565b613e239190615dc5565b6097549091506000908190613e4e90600160a01b8104600290810b91600160b81b9004900b8c61282c565b935093505050613e5e8282612bb9565b613e688282612c92565b6040519193509150600080516020615fa483398151915290613e8d9084908490615bfa565b60405180910390a1613e9f8483615ca3565b9150613eab8382615ca3565b609e549091506001600160a01b038681169116141561405657609754869061271090613ee290600160d01b900461ffff1685615d24565b613eec9190615ce1565b1015613f0a5760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613f429030906004016158ef565b60206040518083038186803b158015613f5a57600080fd5b505afa158015613f6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f929190615876565b613f9c9190615dc5565b613fa69190615dc5565b613fb09190615dc5565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613feb9030906004016158ef565b60206040518083038186803b15801561400357600080fd5b505afa158015614017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061403b9190615876565b6140459190615dc5565b61404f9190615dc5565b92506141e1565b609f546001600160a01b03868116911614156130385760975486906127109061408a90600160d01b900461ffff1684615d24565b6140949190615ce1565b10156140b25760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a08231906140e89030906004016158ef565b60206040518083038186803b15801561410057600080fd5b505afa158015614114573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141389190615876565b6141429190615dc5565b61414c9190615dc5565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a08231906141879030906004016158ef565b60206040518083038186803b15801561419f57600080fd5b505afa1580156141b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141d79190615876565b61403b9190615dc5565b609754612ee090600160a01b8104600290810b91600160b81b9004900b86868d8d8d612d2d565b600054610100900460ff1680614221575060005460ff16155b61423d5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff1615801561425f576000805461ffff19166101011790555b614267614dc8565b6142718383614e32565b80156130da576000805461ff0019169055505050565b600054610100900460ff16806142a0575060005460ff16155b6142bc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142de576000805461ffff19166101011790555b6142e6614ec7565b80156142f8576000805461ff00191690555b50565b6001600160a01b03821661435b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610832565b6001600160a01b038216600090815260336020526040902054818110156143cf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610832565b6143d98282615dc5565b6001600160a01b03841660009081526033602052604081209190915560358054849290614407908490615dc5565b90915550506040518281526000906001600160a01b03851690600080516020615f8483398151915290602001612342565b600080806000198587098587029250828110838203039150508060001415614472576000841161446757600080fd5b508290049050610855565b80841161447e57600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b60008060008087156146b457609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b815260040160206040518083038186803b15801561454157600080fd5b505afa158015614555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145799190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916145b991600160a01b90910460020b906004016159c6565b6101006040518083038186803b1580156145d257600080fd5b505afa1580156145e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061460a91906155f6565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba93955061465394600160b81b90910460020b935060040191506159c69050565b6101006040518083038186803b15801561466c57600080fd5b505afa158015614680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146a491906155f6565b5093975061486f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b815260040160206040518083038186803b15801561470257600080fd5b505afa158015614716573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061473a9190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161477a91600160a01b90910460020b906004016159c6565b6101006040518083038186803b15801561479357600080fd5b505afa1580156147a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147cb91906155f6565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506148139450600160b81b900460020b9260040191506159c69050565b6101006040518083038186803b15801561482c57600080fd5b505afa158015614840573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061486491906155f6565b509297505050505050505b6000609760149054906101000a900460020b60020b8760020b12614894575082614899565b508281035b6000609760179054906101000a900460020b60020b8860020b12156148bf5750826148c4565b508282035b8183038190036148e46001600160801b0389168b8303600160801b614438565b9b9a5050505050505050505050565b6000600160ff1b82106136c35760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610832565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c4016040805180830381600087803b1580156149c957600080fd5b505af11580156149dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a0191906154c4565b9150915081614a0f8a6148f3565b614a199190615d43565b935080614a25896148f3565b614a2f9190615d43565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015614a8157600080fd5b505afa158015614a95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ab99190615734565b50505050505090506000614ae682614ad38f60020b61324c565b614adf8f60020b61324c565b898961379a565b90506001600160801b03811615614b9257609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b8152600401614b3e9493929190615903565b6040805180830381600087803b158015614b5757600080fd5b505af1158015614b6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b8f91906154c4565b50505b5050505097509795505050505050565b6000614bf7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614f379092919063ffffffff16565b8051909150156130da5780806020019051810190614c159190615441565b6130da5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610832565b6000826001600160a01b0316846001600160a01b03161115614c94579192915b6001600160a01b038416614cd4600160601b600160e01b03606085901b16614cbc8787615da5565b6001600160a01b0316866001600160a01b0316614438565b6136569190615ce1565b6000826001600160a01b0316846001600160a01b03161115614cfe579192915b6136566001600160801b038316614d158686615da5565b6001600160a01b0316600160601b614438565b6000826001600160a01b0316846001600160a01b03161115614d48579192915b6000614d6b856001600160a01b0316856001600160a01b0316600160601b614438565b9050613243614d8d8483614d7f8989615da5565b6001600160a01b0316614438565b614f46565b6000826001600160a01b0316846001600160a01b03161115614db2579192915b613656614d8d83600160601b614d7f8888615da5565b600054610100900460ff1680614de1575060005460ff16155b614dfd5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142e6576000805461ffff191661010117905580156142f8576000805461ff001916905550565b600054610100900460ff1680614e4b575060005460ff16155b614e675760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614e89576000805461ffff19166101011790555b8251614e9c9060369060208601906150c2565b508151614eb09060379060208501906150c2565b5080156130da576000805461ff0019169055505050565b600054610100900460ff1680614ee0575060005460ff16155b614efc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614f1e576000805461ffff19166101011790555b600160655580156142f8576000805461ff001916905550565b60606136568484600085614f61565b806001600160801b0381168114614f5c57600080fd5b919050565b606082471015614fc25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610832565b843b6150105760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610832565b600080866001600160a01b0316858760405161502c91906158d3565b60006040518083038185875af1925050503d8060008114615069576040519150601f19603f3d011682016040523d82523d6000602084013e61506e565b606091505b509150915061507e828286615089565b979650505050505050565b60608315615098575081610855565b8251156150a85782518084602001fd5b8160405162461bcd60e51b81526004016108329190615a02565b8280546150ce90615e08565b90600052602060002090601f0160209004810192826150f05760008555615136565b82601f1061510957805160ff1916838001178555615136565b82800160010185558215615136579182015b8281111561513657825182559160200191906001019061511b565b506136c39291505b808211156136c3576000815560010161513e565b600082601f830112615162578081fd5b8151602061517761517283615c38565b615c08565b80838252828201915082860187848660051b8901011115615196578586fd5b855b858110156151bd5781516151ab81615eef565b84529284019290840190600101615198565b5090979650505050505050565b60008083601f8401126151db578182fd5b5081356001600160401b038111156151f1578182fd5b60208301915083602082850101111561520957600080fd5b9250929050565b8051600681900b8114614f5c57600080fd5b600082601f830112615232578081fd5b81356001600160401b0381111561524b5761524b615ed9565b61525e601f8201601f1916602001615c08565b818152846020838601011115615272578283fd5b816020850160208301379081016020019190915292915050565b80516001600160801b0381168114614f5c57600080fd5b6000602082840312156152b4578081fd5b813561085581615eef565b6000602082840312156152d0578081fd5b815161085581615eef565b600080604083850312156152ed578081fd5b82356152f881615eef565b9150602083013561530881615eef565b809150509250929050565b600080600060608486031215615327578081fd5b833561533281615eef565b9250602084013561534281615eef565b929592945050506040919091013590565b60008060408385031215615365578182fd5b823561537081615eef565b946020939093013593505050565b60008060408385031215615390578182fd5b82516001600160401b03808211156153a6578384fd5b818501915085601f8301126153b9578384fd5b815160206153c961517283615c38565b8083825282820191508286018a848660051b89010111156153e8578889fd5b8896505b84871015615411576153fd81615210565b8352600196909601959183019183016153ec565b509188015191965090935050508082111561542a578283fd5b5061543785828601615152565b9150509250929050565b600060208284031215615452578081fd5b815161085581615f04565b600080600080600060a08688031215615474578283fd5b853561547f81615f12565b9450602086013561548f81615f12565b9350604086013561549f81615eef565b92506060860135915060808601356154b681615f04565b809150509295509295909350565b600080604083850312156154d6578182fd5b505080516020909101519092909150565b600080600080606085870312156154fc578182fd5b843593506020850135925060408501356001600160401b0381111561551f578283fd5b61552b878288016151ca565b95989497509550505050565b600080600080600080600060e0888a031215615551578485fd5b87356001600160401b0380821115615567578687fd5b6155738b838c01615222565b985060208a0135915080821115615588578687fd5b506155958a828b01615222565b96505060408801356155a681615eef565b945060608801356155b681615f21565b935060808801356155c681615f12565b925060a08801356155d681615f12565b915060c08801356155e681615eef565b8091505092959891949750929550565b600080600080600080600080610100898b031215615612578182fd5b61561b8961528c565b9750602089015180600f0b8114615630578283fd5b60408a015160608b01519198509650945061564d60808a01615210565b935060a089015161565d81615eef565b60c08a015190935061566e81615f31565b60e08a015190925061567f81615f04565b809150509295985092959890939650565b600080604083850312156156a2578182fd5b6156ab8361528c565b91506156b96020840161528c565b90509250929050565b600080600080600060a086880312156156d9578283fd5b6156e28661528c565b945060208601519350604086015192506156fe6060870161528c565b915061570c6080870161528c565b90509295509295909350565b600060208284031215615729578081fd5b813561085581615f21565b600080600080600080600060e0888a03121561574e578081fd5b875161575981615eef565b602089015190975061576a81615f12565b604089015190965061577b81615f21565b606089015190955061578c81615f21565b608089015190945061579d81615f21565b60a089015190935060ff811681146157b3578182fd5b60c08901519092506155e681615f04565b600080600080600060a086880312156157db578283fd5b85356157e681615eef565b94506020860135935060408601356157fd81615f04565b92506060860135915060808601356154b681615eef565b600080600080600060a0868803121561582b578283fd5b853561583681615f21565b9450602086013561584681615f21565b9350604086013561585681615f21565b9250606086013561586681615f31565b915060808601356154b681615eef565b600060208284031215615887578081fd5b5051919050565b600080604083850312156158a0578182fd5b82359150602083013561530881615eef565b600080604083850312156158c4578182fd5b50508035926020909101359150565b600082516158e5818460208701615ddc565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b6020808252825182820181905260009190848201906040850190845b818110156159ba57835163ffffffff1683529284019291840191600101615998565b50909695505050505050565b60029190910b815260200190565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b6020815260008251806020840152615a21816040850160208701615ddc565b601f01601f19169190910160400192915050565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252600490820152636d42505360e01b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260089082015267686967682066656560c01b604082015260600190565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b60208082526003908201526242505360e81b604082015260600190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b918252602082015260400190565b604051601f8201601f191681016001600160401b0381118282101715615c3057615c30615ed9565b604052919050565b60006001600160401b03821115615c5157615c51615ed9565b5060051b60200190565b600061ffff808316818516808303821115615c7857615c78615ead565b01949350505050565b60006001600160a01b03828116848216808303821115615c7857615c78615ead565b60008219821115615cb657615cb6615ead565b500190565b60006001600160a01b0383811680615cd557615cd5615ec3565b92169190910492915050565b600082615cf057615cf0615ec3565b500490565b60006001600160a01b0382811684821681151582840482111615615d1b57615d1b615ead565b02949350505050565b6000816000190483118215151615615d3e57615d3e615ead565b500290565b60008083128015600160ff1b850184121615615d6157615d61615ead565b6001600160ff1b0384018313811615615d7c57615d7c615ead565b50500390565b600061ffff83811690831681811015615d9d57615d9d615ead565b039392505050565b60006001600160a01b0383811690831681811015615d9d57615d9d615ead565b600082821015615dd757615dd7615ead565b500390565b60005b83811015615df7578181015183820152602001615ddf565b83811115610e875750506000910152565b600181811c90821680615e1c57607f821691505b60208210811415615e3d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615e5757615e57615ead565b5060010190565b600082615e6d57615e6d615ec3565b500690565b60008160020b627fffff19811415615e8c57615e8c615ead565b9003919050565b6000600160ff1b821415615ea957615ea9615ead565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146142f857600080fd5b80151581146142f857600080fd5b8060020b81146142f857600080fd5b61ffff811681146142f857600080fd5b63ffffffff811681146142f857600080fdfec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a26469706673582212200d68bbc56177fb98dc03b8435a294744f29eb4d74dbc9371fa03141fd2efac7464736f6c63430008040033", - "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}." - }, - "burn(uint256,address)": { - "params": { - "burnAmount": "The number of G-UNI tokens to burn", - "receiver": "The account to receive the underlying amounts of token0 and token1" - }, - "returns": { - "amount0": "amount of token0 transferred to receiver for burning `burnAmount`", - "amount1": "amount of token1 transferred to receiver for burning `burnAmount`", - "liquidityBurned": "amount of liquidity removed from the underlying Uniswap V3 position" - } - }, - "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 this function is overridden; 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`." - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "details": "When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.", - "params": { - "newLowerTick": "The new lower bound of the position's range", - "newUpperTick": "The new upper bound of the position's range", - "swapAmountBPS": "amount of token to swap as proportion of total. Pass 0 to ignore swap.", - "swapThresholdPrice": "slippage parameter on the swap as a max or min sqrtPriceX96", - "zeroForOne": "Which token to input into the swap (true = token0, false = token1)" - } - }, - "getMintAmounts(uint256,uint256)": { - "params": { - "amount0Max": "The maximum amount of token1 to forward on mint" - }, - "returns": { - "amount0": "actual amount of token0 to forward when minting `mintAmount`", - "amount1": "actual amount of token1 to forward when minting `mintAmount`", - "mintAmount": "maximum number of G-UNI tokens to mint" - } - }, - "getUnderlyingBalances()": { - "returns": { - "amount0Current": "current total underlying balance of token0", - "amount1Current": "current total underlying balance of token1" - } - }, - "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." - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "params": { - "_lowerTick": "initial upperTick (only changeable with executiveRebalance)", - "_managerFeeBPS": "proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION", - "_manager_": "address of manager (ownership can be transferred)", - "_name": "name of G-UNI token", - "_pool": "address of Uniswap V3 pool", - "_symbol": "symbol of G-UNI token" - } - }, - "initializeManagerFee(uint16)": { - "params": { - "_managerFeeBPS": "proportion of fees earned that are credited to manager in Basis Points" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "mint(uint256,address)": { - "details": "to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts", - "params": { - "mintAmount": "The number of G-UNI tokens to mint", - "receiver": "The account to receive the minted tokens" - }, - "returns": { - "amount0": "amount of token0 transferred from msg.sender to mint `mintAmount`", - "amount1": "amount of token1 transferred from msg.sender to mint `mintAmount`", - "liquidityMinted": "amount of liquidity added to the underlying Uniswap V3 position" - } - }, - "name()": { - "details": "Returns the name of the token." - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "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 manager." - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "params": { - "newRebalanceBPS": "controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance", - "newSlippageBPS": "maximum slippage on swaps during gelato rebalance", - "newSlippageInterval": "length of time for TWAP used in computing slippage on swaps", - "newTreasury": "address where managerFee withdrawals are sent", - "newWithdrawBPS": "controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "burn(uint256,address)": { - "notice": "burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens" - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "notice": "Change the range of underlying UniswapV3 position, only manager can call" - }, - "getMintAmounts(uint256,uint256)": { - "notice": "compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`" - }, - "getUnderlyingBalances()": { - "notice": "compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)" - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "notice": "initialize storage variables on a new G-UNI pool, only called once" - }, - "initializeManagerFee(uint16)": { - "notice": "initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again." - }, - "mint(uint256,address)": { - "notice": "mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position" - }, - "rebalance(uint160,uint256,bool,uint256,address)": { - "notice": "Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager." - }, - "uniswapV3MintCallback(uint256,uint256,bytes)": { - "notice": "Uniswap V3 callback fn, called back on pool.mint" - }, - "uniswapV3SwapCallback(int256,int256,bytes)": { - "notice": "Uniswap v3 callback fn, called back on pool.swap" - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "notice": "change configurable parameters, only manager can call" - }, - "withdrawGelatoBalance(uint256,address)": { - "notice": "withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - }, - "withdrawManagerBalance(uint256,address)": { - "notice": "withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 5, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 784, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage" - }, - { - "astId": 122, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_balances", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 128, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_allowances", - "offset": 0, - "slot": "52", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 130, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_totalSupply", - "offset": 0, - "slot": "53", - "type": "t_uint256" - }, - { - "astId": 132, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_name", - "offset": 0, - "slot": "54", - "type": "t_string_storage" - }, - { - "astId": 134, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_symbol", - "offset": 0, - "slot": "55", - "type": "t_string_storage" - }, - { - "astId": 636, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "56", - "type": "t_array(t_uint256)45_storage" - }, - { - "astId": 59, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_status", - "offset": 0, - "slot": "101", - "type": "t_uint256" - }, - { - "astId": 102, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "102", - "type": "t_array(t_uint256)49_storage" - }, - { - "astId": 6441, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_manager", - "offset": 0, - "slot": "151", - "type": "t_address" - }, - { - "astId": 6031, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "lowerTick", - "offset": 20, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6033, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "upperTick", - "offset": 23, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6035, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoRebalanceBPS", - "offset": 26, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6037, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoWithdrawBPS", - "offset": 28, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6039, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageBPS", - "offset": 30, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6041, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageInterval", - "offset": 0, - "slot": "152", - "type": "t_uint32" - }, - { - "astId": 6043, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerFeeBPS", - "offset": 4, - "slot": "152", - "type": "t_uint16" - }, - { - "astId": 6045, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerTreasury", - "offset": 6, - "slot": "152", - "type": "t_address" - }, - { - "astId": 6047, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance0", - "offset": 0, - "slot": "153", - "type": "t_uint256" - }, - { - "astId": 6049, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance1", - "offset": 0, - "slot": "154", - "type": "t_uint256" - }, - { - "astId": 6051, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance0", - "offset": 0, - "slot": "155", - "type": "t_uint256" - }, - { - "astId": 6053, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance1", - "offset": 0, - "slot": "156", - "type": "t_uint256" - }, - { - "astId": 6056, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "pool", - "offset": 0, - "slot": "157", - "type": "t_contract(IUniswapV3Pool)2339" - }, - { - "astId": 6059, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token0", - "offset": 0, - "slot": "158", - "type": "t_contract(IERC20)863" - }, - { - "astId": 6062, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token1", - "offset": 0, - "slot": "159", - "type": "t_contract(IERC20)863" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)45_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)49_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "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)863": { - "encoding": "inplace", - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_contract(IUniswapV3Pool)2339": { - "encoding": "inplace", - "label": "contract IUniswapV3Pool", - "numberOfBytes": "20" - }, - "t_int24": { - "encoding": "inplace", - "label": "int24", - "numberOfBytes": "3" - }, - "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_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} diff --git a/lib/g-uni-v1-core/deployments/mainnet/solcInputs/07200b0d23a751835ce93ba1686cbb62.json b/lib/g-uni-v1-core/deployments/mainnet/solcInputs/07200b0d23a751835ce93ba1686cbb62.json deleted file mode 100644 index 0b5a9bde9..000000000 --- a/lib/g-uni-v1-core/deployments/mainnet/solcInputs/07200b0d23a751835ce93ba1686cbb62.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 100;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.4;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(int24 lowerTick_, int24 upperTick_);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool));\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool));\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n require(mintAmount <= type(uint128).max);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n uint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0,\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1\n );\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 _liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n require(_liquidityBurned_ < type(uint128).max);\n liquidityBurned = uint128(_liquidityBurned_);\n\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n uint256 leftoverShare0 =\n FullMath.mulDiv(\n burnAmount,\n preBalance0 - managerBalance0 - gelatoBalance0,\n totalSupply\n );\n uint256 leftoverShare1 =\n FullMath.mulDiv(\n burnAmount,\n preBalance1 - managerBalance1 - gelatoBalance1,\n totalSupply\n );\n\n _withdrawExact(\n lowerTick,\n upperTick,\n burnAmount,\n totalSupply,\n liquidityBurned\n );\n\n amount0 =\n (token0.balanceOf(address(this)) - preBalance0) +\n leftoverShare0;\n amount1 =\n (token1.balanceOf(address(this)) - preBalance1) +\n leftoverShare1;\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n (uint128 _liquidity, , , , ) = pool.positions(_getPositionID());\n (uint256 feesEarned0, uint256 feesEarned1) =\n _withdrawAll(lowerTick, upperTick, _liquidity);\n\n managerBalance0 += (feesEarned0 * managerFeeBPS) / 10000;\n managerBalance1 += (feesEarned1 * managerFeeBPS) / 10000;\n gelatoBalance0 += (feesEarned0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (feesEarned1 * gelatoFeeBPS) / 10000;\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n emit Rebalance(newLowerTick, newUpperTick);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n _rebalance(\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n emit Rebalance(lowerTick, upperTick);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n // solhint-disable-next-line function-max-lines\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 _liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n _liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, _liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, _liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n (uint128 _liquidity, , , , ) = pool.positions(_getPositionID());\n\n (uint256 feesEarned0, uint256 feesEarned1) =\n _withdrawAll(lowerTick, upperTick, _liquidity);\n\n uint256 reinvest0;\n uint256 reinvest1;\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n managerBalance0 +=\n ((feesEarned0 - feeAmount) * managerFeeBPS) /\n 10000;\n managerBalance1 += (feesEarned1 * managerFeeBPS) / 10000;\n gelatoBalance0 +=\n ((feesEarned0 - feeAmount) * gelatoFeeBPS) /\n 10000;\n gelatoBalance1 += (feesEarned1 * gelatoFeeBPS) / 10000;\n reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n managerBalance0 += (feesEarned0 * managerFeeBPS) / 10000;\n managerBalance1 +=\n ((feesEarned1 - feeAmount) * managerFeeBPS) /\n 10000;\n gelatoBalance0 += (feesEarned0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 +=\n ((feesEarned1 - feeAmount) * gelatoFeeBPS) /\n 10000;\n reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdrawAll(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n ) private returns (uint256 amountEarned0, uint256 amountEarned1) {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (uint256 amount0Burned, uint256 amount1Burned) =\n pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n amountEarned0 =\n token0.balanceOf(address(this)) -\n preBalance0 -\n amount0Burned;\n amountEarned1 =\n token1.balanceOf(address(this)) -\n preBalance1 -\n amount1Burned;\n }\n\n function _withdrawExact(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 burnAmount,\n uint256 supply,\n uint128 liquidityBurned\n ) private {\n (uint256 burn0, uint256 burn1) =\n pool.burn(lowerTick_, upperTick_, liquidityBurned);\n\n (, , , uint128 tokensOwed0, uint128 tokensOwed1) =\n pool.positions(_getPositionID());\n uint256 fee0 = uint256(tokensOwed0) - burn0;\n uint256 fee1 = uint256(tokensOwed1) - burn1;\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n burn0 += FullMath.mulDiv(burnAmount, fee0, supply);\n burn1 += FullMath.mulDiv(burnAmount, fee1, supply);\n\n // Withdraw tokens to user\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n uint128(burn0), // cast can't overflow\n uint128(burn1) // cast can't overflow\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n int256(((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000);\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(int256(amount0) - amount0Delta);\n finalAmount1 = uint256(int256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array length\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"unacceptable slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"unacceptable slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 < sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 < sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3 pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n // solhint-disable-next-line function-max-lines\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory symbol0 = \"?\";\n string memory symbol1 = \"?\";\n try IERC20Metadata(token0).symbol() returns (string memory sym0) {\n symbol0 = sym0;\n } catch {} // solhint-disable-line no-empty-blocks\n try IERC20Metadata(token1).symbol() returns (string memory sym1) {\n symbol1 = sym1;\n } catch {} // solhint-disable-line no-empty-blocks\n\n string memory name =\n _append(\n \"Gelato Uniswap \",\n symbol0,\n \"/\",\n symbol1,\n \" LP\"\n );\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n\n require(uniPool != address(0), \"uniswap pool does not exist\");\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, msg.sender, pool);\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": ["ast"] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} diff --git a/lib/g-uni-v1-core/deployments/mainnet/solcInputs/0cce3fad8f3de16d15d2c077c292658d.json b/lib/g-uni-v1-core/deployments/mainnet/solcInputs/0cce3fad8f3de16d15d2c077c292658d.json deleted file mode 100644 index 32e8cae83..000000000 --- a/lib/g-uni-v1-core/deployments/mainnet/solcInputs/0cce3fad8f3de16d15d2c077c292658d.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 100;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.4;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(int24 lowerTick_, int24 upperTick_);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool));\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool));\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n require(mintAmount <= type(uint128).max);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n uint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0,\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1\n );\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 _liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n require(_liquidityBurned_ < type(uint128).max);\n liquidityBurned = uint128(_liquidityBurned_);\n\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n uint256 leftoverShare0 =\n FullMath.mulDiv(\n burnAmount,\n preBalance0 - managerBalance0 - gelatoBalance0,\n totalSupply\n );\n uint256 leftoverShare1 =\n FullMath.mulDiv(\n burnAmount,\n preBalance1 - managerBalance1 - gelatoBalance1,\n totalSupply\n );\n\n _withdrawExact(\n lowerTick,\n upperTick,\n burnAmount,\n totalSupply,\n liquidityBurned\n );\n\n amount0 =\n (token0.balanceOf(address(this)) - preBalance0) +\n leftoverShare0;\n amount1 =\n (token1.balanceOf(address(this)) - preBalance1) +\n leftoverShare1;\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n (uint128 _liquidity, , , , ) = pool.positions(_getPositionID());\n (uint256 feesEarned0, uint256 feesEarned1) =\n _withdrawAll(lowerTick, upperTick, _liquidity);\n\n managerBalance0 += (feesEarned0 * managerFeeBPS) / 10000;\n managerBalance1 += (feesEarned1 * managerFeeBPS) / 10000;\n gelatoBalance0 += (feesEarned0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (feesEarned1 * gelatoFeeBPS) / 10000;\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n emit Rebalance(newLowerTick, newUpperTick);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n _rebalance(\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n emit Rebalance(lowerTick, upperTick);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n // solhint-disable-next-line function-max-lines\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 _liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n _liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, _liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, _liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n (uint128 _liquidity, , , , ) = pool.positions(_getPositionID());\n\n (uint256 feesEarned0, uint256 feesEarned1) =\n _withdrawAll(lowerTick, upperTick, _liquidity);\n\n uint256 reinvest0;\n uint256 reinvest1;\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n managerBalance0 +=\n ((feesEarned0 - feeAmount) * managerFeeBPS) /\n 10000;\n managerBalance1 += (feesEarned1 * managerFeeBPS) / 10000;\n gelatoBalance0 +=\n ((feesEarned0 - feeAmount) * gelatoFeeBPS) /\n 10000;\n gelatoBalance1 += (feesEarned1 * gelatoFeeBPS) / 10000;\n reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n managerBalance0 += (feesEarned0 * managerFeeBPS) / 10000;\n managerBalance1 +=\n ((feesEarned1 - feeAmount) * managerFeeBPS) /\n 10000;\n gelatoBalance0 += (feesEarned0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 +=\n ((feesEarned1 - feeAmount) * gelatoFeeBPS) /\n 10000;\n reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdrawAll(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n ) private returns (uint256 amountEarned0, uint256 amountEarned1) {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (uint256 amount0Burned, uint256 amount1Burned) =\n pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n amountEarned0 =\n token0.balanceOf(address(this)) -\n preBalance0 -\n amount0Burned;\n amountEarned1 =\n token1.balanceOf(address(this)) -\n preBalance1 -\n amount1Burned;\n }\n\n function _withdrawExact(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 burnAmount,\n uint256 supply,\n uint128 liquidityBurned\n ) private {\n (uint256 burn0, uint256 burn1) =\n pool.burn(lowerTick_, upperTick_, liquidityBurned);\n\n (, , , uint128 tokensOwed0, uint128 tokensOwed1) =\n pool.positions(_getPositionID());\n uint256 fee0 = uint256(tokensOwed0) - burn0;\n uint256 fee1 = uint256(tokensOwed1) - burn1;\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n burn0 += FullMath.mulDiv(burnAmount, fee0, supply);\n burn1 += FullMath.mulDiv(burnAmount, fee1, supply);\n\n // Withdraw tokens to user\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n uint128(burn0), // cast can't overflow\n uint128(burn1) // cast can't overflow\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n int256(((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000);\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(int256(amount0) - amount0Delta);\n finalAmount1 = uint256(int256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array length\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"unacceptable slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"unacceptable slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 < sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 < sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3 pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @param tokenIdentifier string appended to token name to uniquely identify token instance\n /// tokenIdentifier is just for convenience but not trustworthy (can easily be spoofed)\n /// @return pool the address of the newly created G-UNI pool (proxy)\n // solhint-disable-next-line function-max-lines\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n string memory tokenIdentifier\n ) external override returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory symbol0 = \"?\";\n string memory symbol1 = \"?\";\n try IERC20Metadata(token0).symbol() returns (string memory sym0) {\n symbol0 = sym0;\n } catch {} // solhint-disable-line no-empty-blocks\n try IERC20Metadata(token1).symbol() returns (string memory sym1) {\n symbol1 = sym1;\n } catch {} // solhint-disable-line no-empty-blocks\n\n string memory name =\n _append(\n \"Gelato Uniswap \",\n symbol0,\n \"/\",\n symbol1,\n \" LP \",\n tokenIdentifier\n );\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n\n require(uniPool != address(0), \"uniswap pool does not exist\");\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, msg.sender, pool);\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e,\n string memory f\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e, f));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n string memory tokenIdentifier\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": ["ast"] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} diff --git a/lib/g-uni-v1-core/deployments/mainnet/solcInputs/493646f17088f1465f203a02d910145c.json b/lib/g-uni-v1-core/deployments/mainnet/solcInputs/493646f17088f1465f203a02d910145c.json deleted file mode 100644 index 7ecb4f954..000000000 --- a/lib/g-uni-v1-core/deployments/mainnet/solcInputs/493646f17088f1465f203a02d910145c.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * 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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `sender` to `recipient`.\n *\n * This 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(\n address sender,\n address recipient,\n uint256 amount\n ) 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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n\n _afterTokenTransfer(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 * - `account` 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 += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(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(\n address owner,\n address spender,\n uint256 amount\n ) 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 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 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(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after 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 * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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(\n address sender,\n address recipient,\n uint256 amount\n ) 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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\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 {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 */\nabstract contract Initializable {\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 100;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n event SetManagerFee(uint16 managerFee);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n emit SetManagerFee(_managerFeeBPS);\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.4;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidityBefore,\n uint128 liquidityAfter\n );\n\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n SafeCast.toUint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidityBurned);\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n\n amount0 =\n burn0 +\n FullMath.mulDiv(\n token0.balanceOf(address(this)) -\n burn0 -\n managerBalance0 -\n gelatoBalance0,\n burnAmount,\n totalSupply\n );\n amount1 =\n burn1 +\n FullMath.mulDiv(\n token1.balanceOf(address(this)) -\n burn1 -\n managerBalance1 -\n gelatoBalance1,\n burnAmount,\n totalSupply\n );\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n if (liquidity > 0) {\n (, , uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n }\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > 0, \"new position 0\");\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n _rebalance(\n liquidity,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity >= liquidity, \"liquidity decrease\");\n\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\n external\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n // solhint-disable-next-line function-max-lines\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\n internal\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint128 liquidity,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n uint256 leftover0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 leftover1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n (, , uint256 feesEarned0, uint256 feesEarned1) =\n _withdraw(lowerTick, upperTick, liquidity);\n _applyFees(feesEarned0, feesEarned1);\n (feesEarned0, feesEarned1) = _subtractAdminFees(\n feesEarned0,\n feesEarned1\n );\n emit FeesEarned(feesEarned0, feesEarned1);\n feesEarned0 += leftover0;\n feesEarned1 += leftover1;\n\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n leftover0,\n leftover1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdraw(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n )\n private\n returns (\n uint256 burn0,\n uint256 burn1,\n uint256 fee0,\n uint256 fee1\n )\n {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n SafeCast.toInt256(\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\n );\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array len\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"high slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"high slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\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 require(value < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return uint128(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 require(value < 2**64, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return uint64(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 require(value < 2**32, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return uint32(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 require(value < 2**16, \"SafeCast: value doesn\\'t fit in 16 bits\");\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 require(value < 2**8, \"SafeCast: value doesn\\'t fit in 8 bits\");\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 require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= -2**127 && value < 2**127, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return int128(value);\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= -2**63 && value < 2**63, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return int64(value);\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= -2**31 && value < 2**31, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return int32(value);\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= -2**15 && value < 2**15, \"SafeCast: value doesn\\'t fit in 16 bits\");\n return int16(value);\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= -2**7 && value < 2**7, \"SafeCast: value doesn\\'t fit in 8 bits\");\n return int8(value);\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 require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IUniswapV3TickSpacing} from \"./interfaces/IUniswapV3TickSpacing.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n }\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n 0,\n lowerTick,\n upperTick,\n address(0)\n );\n }\n\n function _createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n address manager\n ) internal returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory name = \"Gelato Uniswap LP\";\n try this.getTokenName(token0, token1) returns (string memory result) {\n name = result;\n } catch {} // solhint-disable-line no-empty-blocks\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n require(uniPool != address(0), \"uniswap pool does not exist\");\n require(\n _validateTickSpacing(uniPool, lowerTick, upperTick),\n \"tickSpacing mismatch\"\n );\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n manager\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, manager, pool);\n }\n\n function _validateTickSpacing(\n address uniPool,\n int24 lowerTick,\n int24 upperTick\n ) internal view returns (bool) {\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\n return\n lowerTick < upperTick &&\n lowerTick % spacing == 0 &&\n upperTick % spacing == 0;\n }\n\n function getTokenName(address token0, address token1)\n external\n view\n returns (string memory)\n {\n string memory symbol0 = IERC20Metadata(token0).symbol();\n string memory symbol1 = IERC20Metadata(token1).symbol();\n\n return _append(\"Gelato Uniswap \", symbol0, \"/\", symbol1, \" LP\");\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IUniswapV3TickSpacing.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IUniswapV3TickSpacing {\n function tickSpacing() external view returns (int24);\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": ["ast"] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} diff --git a/lib/g-uni-v1-core/deployments/mainnet/solcInputs/5b7722421ca04d0a130cd8a2a08f9ec3.json b/lib/g-uni-v1-core/deployments/mainnet/solcInputs/5b7722421ca04d0a130cd8a2a08f9ec3.json deleted file mode 100644 index fe2c0f2c9..000000000 --- a/lib/g-uni-v1-core/deployments/mainnet/solcInputs/5b7722421ca04d0a130cd8a2a08f9ec3.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 250;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n event SetManagerFee(uint16 managerFee);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n emit SetManagerFee(_managerFeeBPS);\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.4;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidityBefore,\n uint128 liquidityAfter\n );\n\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n SafeCast.toUint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidityBurned);\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n\n amount0 =\n burn0 +\n FullMath.mulDiv(\n token0.balanceOf(address(this)) -\n burn0 -\n managerBalance0 -\n gelatoBalance0,\n burnAmount,\n totalSupply\n );\n amount1 =\n burn1 +\n FullMath.mulDiv(\n token1.balanceOf(address(this)) -\n burn1 -\n managerBalance1 -\n gelatoBalance1,\n burnAmount,\n totalSupply\n );\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n // solhint-disable-next-line function-max-lines\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n uint128 liquidity;\n uint128 newLiquidity;\n if (totalSupply() > 0) {\n (liquidity, , , , ) = pool.positions(_getPositionID());\n if (liquidity > 0) {\n (, , uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n }\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > 0, \"new position 0\");\n } else {\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n }\n\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n _rebalance(\n liquidity,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > liquidity, \"liquidity must increase\");\n\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\n external\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n // solhint-disable-next-line function-max-lines\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\n internal\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint128 liquidity,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n uint256 leftover0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 leftover1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n (, , uint256 feesEarned0, uint256 feesEarned1) =\n _withdraw(lowerTick, upperTick, liquidity);\n _applyFees(feesEarned0, feesEarned1);\n (feesEarned0, feesEarned1) = _subtractAdminFees(\n feesEarned0,\n feesEarned1\n );\n emit FeesEarned(feesEarned0, feesEarned1);\n feesEarned0 += leftover0;\n feesEarned1 += leftover1;\n\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n leftover0,\n leftover1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdraw(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n )\n private\n returns (\n uint256 burn0,\n uint256 burn1,\n uint256 fee0,\n uint256 fee1\n )\n {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n SafeCast.toInt256(\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\n );\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array len\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"high slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"high slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\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 require(value < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return uint128(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 require(value < 2**64, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return uint64(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 require(value < 2**32, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return uint32(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 require(value < 2**16, \"SafeCast: value doesn\\'t fit in 16 bits\");\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 require(value < 2**8, \"SafeCast: value doesn\\'t fit in 8 bits\");\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 require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= -2**127 && value < 2**127, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return int128(value);\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= -2**63 && value < 2**63, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return int64(value);\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= -2**31 && value < 2**31, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return int32(value);\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= -2**15 && value < 2**15, \"SafeCast: value doesn\\'t fit in 16 bits\");\n return int16(value);\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= -2**7 && value < 2**7, \"SafeCast: value doesn\\'t fit in 8 bits\");\n return int8(value);\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 require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IUniswapV3TickSpacing} from \"./interfaces/IUniswapV3TickSpacing.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n }\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n 0,\n lowerTick,\n upperTick,\n address(0)\n );\n }\n\n function _createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n address manager\n ) internal returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory name = \"Gelato Uniswap LP\";\n try this.getTokenName(token0, token1) returns (string memory result) {\n name = result;\n } catch {} // solhint-disable-line no-empty-blocks\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n require(uniPool != address(0), \"uniswap pool does not exist\");\n require(\n _validateTickSpacing(uniPool, lowerTick, upperTick),\n \"tickSpacing mismatch\"\n );\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n manager\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, manager, pool);\n }\n\n function _validateTickSpacing(\n address uniPool,\n int24 lowerTick,\n int24 upperTick\n ) internal view returns (bool) {\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\n return\n lowerTick < upperTick &&\n lowerTick % spacing == 0 &&\n upperTick % spacing == 0;\n }\n\n function getTokenName(address token0, address token1)\n external\n view\n returns (string memory)\n {\n string memory symbol0 = IERC20Metadata(token0).symbol();\n string memory symbol1 = IERC20Metadata(token1).symbol();\n\n return _append(\"Gelato Uniswap \", symbol0, \"/\", symbol1, \" LP\");\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IUniswapV3TickSpacing.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IUniswapV3TickSpacing {\n function tickSpacing() external view returns (int24);\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": ["ast"] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} diff --git a/lib/g-uni-v1-core/deployments/mainnet/solcInputs/6b2dad73aed487b1c5900386166f028e.json b/lib/g-uni-v1-core/deployments/mainnet/solcInputs/6b2dad73aed487b1c5900386166f028e.json deleted file mode 100644 index 65cd40c99..000000000 --- a/lib/g-uni-v1-core/deployments/mainnet/solcInputs/6b2dad73aed487b1c5900386166f028e.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 100;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n event SetManagerFee(uint16 managerFee);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n emit SetManagerFee(_managerFeeBPS);\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.4;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidityBefore,\n uint128 liquidityAfter\n );\n\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n SafeCast.toUint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\n _withdraw(\n lowerTick,\n upperTick,\n SafeCast.toUint128(liquidityBurned_)\n );\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n amount0 =\n burn0 +\n FullMath.mulDiv(\n token0.balanceOf(address(this)) -\n burn0 -\n managerBalance0 -\n gelatoBalance0,\n burnAmount,\n totalSupply\n );\n amount1 =\n burn1 +\n FullMath.mulDiv(\n token1.balanceOf(address(this)) -\n burn1 -\n managerBalance1 -\n gelatoBalance1,\n burnAmount,\n totalSupply\n );\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n (, , uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n _rebalance(\n liquidity,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity >= liquidity, \"liquidity decrease\");\n\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\n external\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n // solhint-disable-next-line function-max-lines\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\n internal\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint128 liquidity,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n uint256 leftover0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 leftover1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n (, , uint256 feesEarned0, uint256 feesEarned1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(feesEarned0, feesEarned1);\n\n (feesEarned0, feesEarned1) = _subtractAdminFees(\n feesEarned0,\n feesEarned1\n );\n emit FeesEarned(feesEarned0, feesEarned1);\n feesEarned0 += leftover0;\n feesEarned1 += leftover1;\n\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n leftover0,\n leftover1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdraw(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n )\n private\n returns (\n uint256 burn0,\n uint256 burn1,\n uint256 fee0,\n uint256 fee1\n )\n {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n SafeCast.toInt256(\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\n );\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array len\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"high slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"high slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\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 require(value < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return uint128(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 require(value < 2**64, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return uint64(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 require(value < 2**32, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return uint32(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 require(value < 2**16, \"SafeCast: value doesn\\'t fit in 16 bits\");\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 require(value < 2**8, \"SafeCast: value doesn\\'t fit in 8 bits\");\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 require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= -2**127 && value < 2**127, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return int128(value);\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= -2**63 && value < 2**63, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return int64(value);\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= -2**31 && value < 2**31, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return int32(value);\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= -2**15 && value < 2**15, \"SafeCast: value doesn\\'t fit in 16 bits\");\n return int16(value);\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= -2**7 && value < 2**7, \"SafeCast: value doesn\\'t fit in 8 bits\");\n return int8(value);\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 require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3 pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n // solhint-disable-next-line function-max-lines\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory name = \"Gelato Uniswap LP\";\n try this.getTokenName(token0, token1) returns (string memory result) {\n name = result;\n } catch {} // solhint-disable-line no-empty-blocks\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n\n require(uniPool != address(0), \"uniswap pool does not exist\");\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, msg.sender, pool);\n }\n\n function getTokenName(address token0, address token1)\n external\n view\n returns (string memory)\n {\n string memory symbol0 = IERC20Metadata(token0).symbol();\n string memory symbol1 = IERC20Metadata(token1).symbol();\n\n return _append(\"Gelato Uniswap \", symbol0, \"/\", symbol1, \" LP\");\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": ["ast"] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} diff --git a/lib/g-uni-v1-core/deployments/mainnet/solcInputs/909947c294c27d0046fbb5dc308bfe1d.json b/lib/g-uni-v1-core/deployments/mainnet/solcInputs/909947c294c27d0046fbb5dc308bfe1d.json deleted file mode 100644 index 7fc6060f2..000000000 --- a/lib/g-uni-v1-core/deployments/mainnet/solcInputs/909947c294c27d0046fbb5dc308bfe1d.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 100;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.4;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidityBefore,\n uint128 liquidityAfter\n );\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool));\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool));\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n SafeCast.toUint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\n _withdraw(\n lowerTick,\n upperTick,\n SafeCast.toUint128(liquidityBurned_)\n );\n _applyFees(fee0, fee1);\n amount0 =\n burn0 +\n FullMath.mulDiv(\n token0.balanceOf(address(this)) -\n burn0 -\n managerBalance0 -\n gelatoBalance0,\n burnAmount,\n totalSupply\n );\n amount1 =\n burn1 +\n FullMath.mulDiv(\n token1.balanceOf(address(this)) -\n burn1 -\n managerBalance1 -\n gelatoBalance1,\n burnAmount,\n totalSupply\n );\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n (, , uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(fee0, fee1);\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n _rebalance(\n liquidity,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity >= liquidity, \"liquidity decrease\");\n\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n // solhint-disable-next-line function-max-lines\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint128 liquidity,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n uint256 leftover0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 leftover1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n (, , uint256 feesEarned0, uint256 feesEarned1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(feesEarned0, feesEarned1);\n\n (feesEarned0, feesEarned1) = _subtractAdminFees(\n feesEarned0,\n feesEarned1\n );\n feesEarned0 += leftover0;\n feesEarned1 += leftover1;\n\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n leftover0,\n leftover1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdraw(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n )\n private\n returns (\n uint256 burn0,\n uint256 burn1,\n uint256 fee0,\n uint256 fee1\n )\n {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n SafeCast.toInt256(\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\n );\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array len\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"high slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"high slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\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 require(value < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return uint128(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 require(value < 2**64, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return uint64(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 require(value < 2**32, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return uint32(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 require(value < 2**16, \"SafeCast: value doesn\\'t fit in 16 bits\");\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 require(value < 2**8, \"SafeCast: value doesn\\'t fit in 8 bits\");\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 require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= -2**127 && value < 2**127, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return int128(value);\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= -2**63 && value < 2**63, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return int64(value);\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= -2**31 && value < 2**31, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return int32(value);\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= -2**15 && value < 2**15, \"SafeCast: value doesn\\'t fit in 16 bits\");\n return int16(value);\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= -2**7 && value < 2**7, \"SafeCast: value doesn\\'t fit in 8 bits\");\n return int8(value);\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 require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 < sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 < sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3 pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n // solhint-disable-next-line function-max-lines\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory name = \"Gelato Uniswap LP\";\n try this.getTokenName(token0, token1) returns (string memory result) {\n name = result;\n } catch {} // solhint-disable-line no-empty-blocks\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n\n require(uniPool != address(0), \"uniswap pool does not exist\");\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, msg.sender, pool);\n }\n\n function getTokenName(address token0, address token1)\n external\n view\n returns (string memory)\n {\n string memory symbol0 = IERC20Metadata(token0).symbol();\n string memory symbol1 = IERC20Metadata(token1).symbol();\n\n return _append(\"Gelato Uniswap \", symbol0, \"/\", symbol1, \" LP\");\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": ["ast"] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} diff --git a/lib/g-uni-v1-core/deployments/mantleSepolia/.chainId b/lib/g-uni-v1-core/deployments/mantleSepolia/.chainId deleted file mode 100644 index d119e5e7c..000000000 --- a/lib/g-uni-v1-core/deployments/mantleSepolia/.chainId +++ /dev/null @@ -1 +0,0 @@ -5003 \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory.json b/lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory.json deleted file mode 100644 index 24c002659..000000000 --- a/lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory.json +++ /dev/null @@ -1,721 +0,0 @@ -{ - "address": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - } - ], - "transactionHash": "0xfa9a97a23c9b357c5ed6cbec1086e7e7a45c2a7a2bebb1b2350f5f25bd261547", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "transactionIndex": 1, - "gasUsed": "2844305716", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000200000200000000020000000000400000000800000000002000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000800000000000000000000000200100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000000400000000000000000000000000000000000000000000", - "blockHash": "0xc7aedb82e69ebaeec6d1960310d596ff8ed3eb68da9d1e75a89ae47aff41adda", - "transactionHash": "0xfa9a97a23c9b357c5ed6cbec1086e7e7a45c2a7a2bebb1b2350f5f25bd261547", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 9248224, - "transactionHash": "0xfa9a97a23c9b357c5ed6cbec1086e7e7a45c2a7a2bebb1b2350f5f25bd261547", - "address": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000087fe34053bfbf5b278988bd150e9f8da72ca1bc3" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0xc7aedb82e69ebaeec6d1960310d596ff8ed3eb68da9d1e75a89ae47aff41adda" - }, - { - "transactionIndex": 1, - "blockNumber": 9248224, - "transactionHash": "0xfa9a97a23c9b357c5ed6cbec1086e7e7a45c2a7a2bebb1b2350f5f25bd261547", - "address": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0xc7aedb82e69ebaeec6d1960310d596ff8ed3eb68da9d1e75a89ae47aff41adda" - } - ], - "blockNumber": 9248224, - "cumulativeGasUsed": "2844352605", - "status": 1, - "byzantium": true - }, - "args": [ - "0x87fe34053bfBF5B278988bd150e9F8da72ca1bC3", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b000000000000000000000000e292cf4e316191cbfebd74909356df3cd9455e96000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033", - "execute": { - "methodName": "initialize", - "args": [ - "0xE292cF4e316191CbFEbD74909356DF3cd9455e96", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - ] - }, - "implementation": "0x87fe34053bfBF5B278988bd150e9F8da72ca1bC3", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory_Implementation.json b/lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory_Implementation.json deleted file mode 100644 index 736585083..000000000 --- a/lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory_Implementation.json +++ /dev/null @@ -1,802 +0,0 @@ -{ - "address": "0x87fe34053bfBF5B278988bd150e9F8da72ca1bC3", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_uniswapV3Factory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x9ba3abf929facef4dd22dec9d30163162dbda0474ad2910c906f498d34216850", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x87fe34053bfBF5B278988bd150e9F8da72ca1bC3", - "transactionIndex": 1, - "gasUsed": "10871098430", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x6f212b38f801e0fe6aaed7ebab1156e93d7666e592b0d2c560f9e16db8a6f682", - "transactionHash": "0x9ba3abf929facef4dd22dec9d30163162dbda0474ad2910c906f498d34216850", - "logs": [], - "blockNumber": 9248085, - "cumulativeGasUsed": "10871162407", - "status": 1, - "byzantium": true - }, - "args": [ - "0xE292cF4e316191CbFEbD74909356DF3cd9455e96" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_uniswapV3Factory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"uniPool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previosGelatoDeployer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newGelatoDeployer\",\"type\":\"address\"}],\"name\":\"UpdateGelatoDeployer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"UpdatePoolImplementation\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createManagedPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDeployers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGelatoPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"getTokenName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gelatoDeployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isPoolImmutable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"makePoolsImmutable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numDeployers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextGelatoDeployer\",\"type\":\"address\"}],\"name\":\"setGelatoDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextImplementation\",\"type\":\"address\"}],\"name\":\"setPoolImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"upgradePools\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"bytes[]\",\"name\":\"datas\",\"type\":\"bytes[]\"}],\"name\":\"upgradePoolsAndCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"managerFee\":\"proportion of earned fees that go to pool manager in Basis Points\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"createPool(address,address,uint24,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"getDeployers()\":{\"returns\":{\"_0\":\"deployers the list of deployer addresses\"}},\"getGelatoPools()\":{\"returns\":{\"_0\":\"list of Gelato managed G-UNI pool addresses\"}},\"getPools(address)\":{\"params\":{\"deployer\":\"address that has potentially deployed G-UNI pools (can return empty array)\"},\"returns\":{\"_0\":\"pools the list of G-UNI pool addresses deployed by `deployer`\"}},\"getProxyAdmin(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"address that controls the G-UNI implementation (has power to upgrade it)\"}},\"isPoolImmutable(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"bool signaling if pool is immutable (true) or not (false)\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"numDeployers()\":{\"returns\":{\"_0\":\"total number of G-UNI pool deployer addresses\"}},\"numPools()\":{\"returns\":{\"result\":\"total number of G-UNI pools deployed\"}},\"numPools(address)\":{\"params\":{\"deployer\":\"deployer address\"},\"returns\":{\"_0\":\"total number of G-UNI pools deployed by `deployer`\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"notice\":\"createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`\"},\"createPool(address,address,uint24,int24,int24)\":{\"notice\":\"createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`\"},\"getDeployers()\":{\"notice\":\"getDeployers fetches all addresses that have deployed a G-UNI pool\"},\"getGelatoPools()\":{\"notice\":\"getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)\"},\"getPools(address)\":{\"notice\":\"getPools fetches all the G-UNI pool addresses deployed by `deployer`\"},\"getProxyAdmin(address)\":{\"notice\":\"getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address).\"},\"isPoolImmutable(address)\":{\"notice\":\"isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\"},\"numDeployers()\":{\"notice\":\"numDeployers counts the total number of G-UNI pool deployer addresses\"},\"numPools()\":{\"notice\":\"numPools counts the total number of G-UNI pools in existence\"},\"numPools(address)\":{\"notice\":\"numPools counts the total number of G-UNI pools deployed by `deployer`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniFactory.sol\":\"GUniFactory\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\\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\":\"0x4878ef6c288f4cef3c2a288d32cc548c648831cc55503ad3d9a581ed3b93aad9\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title The interface for the Uniswap V3 Factory\\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\\ninterface IUniswapV3Factory {\\n /// @notice Emitted when the owner of the factory is changed\\n /// @param oldOwner The owner before the owner was changed\\n /// @param newOwner The owner after the owner was changed\\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\\n\\n /// @notice Emitted when a pool is created\\n /// @param token0 The first token of the pool by address sort order\\n /// @param token1 The second token of the pool by address sort order\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks\\n /// @param pool The address of the created pool\\n event PoolCreated(\\n address indexed token0,\\n address indexed token1,\\n uint24 indexed fee,\\n int24 tickSpacing,\\n address pool\\n );\\n\\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\\n /// @param fee The enabled fee, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\\n\\n /// @notice Returns the current owner of the factory\\n /// @dev Can be changed by the current owner via setOwner\\n /// @return The address of the factory owner\\n function owner() external view returns (address);\\n\\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\\n /// @return The tick spacing\\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\\n\\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\\n /// @param tokenA The contract address of either token0 or token1\\n /// @param tokenB The contract address of the other token\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @return pool The pool address\\n function getPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external view returns (address pool);\\n\\n /// @notice Creates a pool for the given two tokens and fee\\n /// @param tokenA One of the two tokens in the desired pool\\n /// @param tokenB The other of the two tokens in the desired pool\\n /// @param fee The desired fee for the pool\\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\\n /// are invalid.\\n /// @return pool The address of the newly created pool\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external returns (address pool);\\n\\n /// @notice Updates the owner of the factory\\n /// @dev Must be called by the current owner\\n /// @param _owner The new owner of the factory\\n function setOwner(address _owner) external;\\n\\n /// @notice Enables a fee amount with the given tickSpacing\\n /// @dev Fee amounts may never be removed once enabled\\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\\n}\\n\",\"keccak256\":\"0xcc3d0c93fc9ac0febbe09f941b465b57f750bcf3b48432da0b97dc289cfdc489\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {\\n IUniswapV3Factory\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\\\";\\nimport {IUniswapV3TickSpacing} from \\\"./interfaces/IUniswapV3TickSpacing.sol\\\";\\nimport {IGUniFactory} from \\\"./interfaces/IGUniFactory.sol\\\";\\nimport {IGUniPoolStorage} from \\\"./interfaces/IGUniPoolStorage.sol\\\";\\nimport {GUniFactoryStorage} from \\\"./abstract/GUniFactoryStorage.sol\\\";\\nimport {EIP173Proxy} from \\\"./vendor/proxy/EIP173Proxy.sol\\\";\\nimport {IEIP173Proxy} from \\\"./interfaces/IEIP173Proxy.sol\\\";\\nimport {\\n IERC20Metadata\\n} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n constructor(address _uniswapV3Factory)\\n GUniFactoryStorage(_uniswapV3Factory)\\n {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n managerFee,\\n lowerTick,\\n upperTick,\\n msg.sender\\n );\\n }\\n\\n /// @notice createPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n 0,\\n lowerTick,\\n upperTick,\\n address(0)\\n );\\n }\\n\\n function _createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick,\\n address manager\\n ) internal returns (address pool) {\\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\\n\\n pool = address(new EIP173Proxy(poolImplementation, address(this), \\\"\\\"));\\n\\n string memory name = \\\"Gelato Uniswap LP\\\";\\n try this.getTokenName(token0, token1) returns (string memory result) {\\n name = result;\\n } catch {} // solhint-disable-line no-empty-blocks\\n\\n address uniPool =\\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\\n require(uniPool != address(0), \\\"uniswap pool does not exist\\\");\\n require(\\n _validateTickSpacing(uniPool, lowerTick, upperTick),\\n \\\"tickSpacing mismatch\\\"\\n );\\n\\n IGUniPoolStorage(pool).initialize(\\n name,\\n \\\"G-UNI\\\",\\n uniPool,\\n managerFee,\\n lowerTick,\\n upperTick,\\n manager\\n );\\n _deployers.add(msg.sender);\\n _pools[msg.sender].add(pool);\\n emit PoolCreated(uniPool, manager, pool);\\n }\\n\\n function _validateTickSpacing(\\n address uniPool,\\n int24 lowerTick,\\n int24 upperTick\\n ) internal view returns (bool) {\\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\\n return\\n lowerTick < upperTick &&\\n lowerTick % spacing == 0 &&\\n upperTick % spacing == 0;\\n }\\n\\n function getTokenName(address token0, address token1)\\n external\\n view\\n returns (string memory)\\n {\\n string memory symbol0 = IERC20Metadata(token0).symbol();\\n string memory symbol1 = IERC20Metadata(token1).symbol();\\n\\n return _append(\\\"Gelato Uniswap \\\", symbol0, \\\"/\\\", symbol1, \\\" LP\\\");\\n }\\n\\n function upgradePools(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\\n }\\n }\\n\\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\\n external\\n onlyManager\\n {\\n require(pools.length == datas.length, \\\"mismatching array length\\\");\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeToAndCall(\\n poolImplementation,\\n datas[i]\\n );\\n }\\n }\\n\\n function makePoolsImmutable(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\\n }\\n }\\n\\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the\\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\\n /// @param pool address of the G-UNI pool\\n /// @return bool signaling if pool is immutable (true) or not (false)\\n function isPoolImmutable(address pool) external view returns (bool) {\\n return address(0) == getProxyAdmin(pool);\\n }\\n\\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\\n /// @return list of Gelato managed G-UNI pool addresses\\n function getGelatoPools() external view returns (address[] memory) {\\n return getPools(gelatoDeployer);\\n }\\n\\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\\n /// @return deployers the list of deployer addresses\\n function getDeployers() public view returns (address[] memory) {\\n uint256 length = numDeployers();\\n address[] memory deployers = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n deployers[i] = _getDeployer(i);\\n }\\n\\n return deployers;\\n }\\n\\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\\n function getPools(address deployer) public view returns (address[] memory) {\\n uint256 length = numPools(deployer);\\n address[] memory pools = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n pools[i] = _getPool(deployer, i);\\n }\\n\\n return pools;\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools in existence\\n /// @return result total number of G-UNI pools deployed\\n function numPools() public view returns (uint256 result) {\\n address[] memory deployers = getDeployers();\\n for (uint256 i = 0; i < deployers.length; i++) {\\n result += numPools(deployers[i]);\\n }\\n }\\n\\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\\n /// @return total number of G-UNI pool deployer addresses\\n function numDeployers() public view returns (uint256) {\\n return _deployers.length();\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\\n /// @param deployer deployer address\\n /// @return total number of G-UNI pools deployed by `deployer`\\n function numPools(address deployer) public view returns (uint256) {\\n return _pools[deployer].length();\\n }\\n\\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\\n /// no longer upgradable (no one owns the zero address).\\n /// @param pool address of the G-UNI pool\\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\\n function getProxyAdmin(address pool) public view returns (address) {\\n return IEIP173Proxy(pool).proxyAdmin();\\n }\\n\\n function _getDeployer(uint256 index) internal view returns (address) {\\n return _deployers.at(index);\\n }\\n\\n function _getPool(address deployer, uint256 index)\\n internal\\n view\\n returns (address)\\n {\\n return _pools[deployer].at(index);\\n }\\n\\n function _getTokenOrder(address tokenA, address tokenB)\\n internal\\n pure\\n returns (address token0, address token1)\\n {\\n require(tokenA != tokenB, \\\"same token\\\");\\n (token0, token1) = tokenA < tokenB\\n ? (tokenA, tokenB)\\n : (tokenB, tokenA);\\n require(token0 != address(0), \\\"no address zero\\\");\\n }\\n\\n function _append(\\n string memory a,\\n string memory b,\\n string memory c,\\n string memory d,\\n string memory e\\n ) internal pure returns (string memory) {\\n return string(abi.encodePacked(a, b, c, d, e));\\n }\\n}\\n\",\"keccak256\":\"0x41d2d6a42321eed641468824c4d0ba4fbe40040895304388315ece96132011d6\",\"license\":\"MIT\"},\"contracts/abstract/GUniFactoryStorage.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n Initializable\\n} from \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\n// solhint-disable-next-line max-states-count\\ncontract GUniFactoryStorage is\\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\\n Initializable\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n address public immutable factory;\\n address public poolImplementation;\\n address public gelatoDeployer;\\n EnumerableSet.AddressSet internal _deployers;\\n mapping(address => EnumerableSet.AddressSet) internal _pools;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdatePoolImplementation(\\n address previousImplementation,\\n address newImplementation\\n );\\n\\n event UpdateGelatoDeployer(\\n address previosGelatoDeployer,\\n address newGelatoDeployer\\n );\\n\\n constructor(address _uniswapV3Factory) {\\n factory = _uniswapV3Factory;\\n }\\n\\n function initialize(\\n address _implementation,\\n address _gelatoDeployer,\\n address _manager_\\n ) external initializer {\\n poolImplementation = _implementation;\\n gelatoDeployer = _gelatoDeployer;\\n _manager = _manager_;\\n }\\n\\n function setPoolImplementation(address nextImplementation)\\n external\\n onlyManager\\n {\\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\\n poolImplementation = nextImplementation;\\n }\\n\\n function setGelatoDeployer(address nextGelatoDeployer)\\n external\\n onlyManager\\n {\\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\\n gelatoDeployer = nextGelatoDeployer;\\n }\\n}\\n\",\"keccak256\":\"0xb0e3a7e77ab8aecf8997593526451e64dd8e8aa07882c210c9aa38d4f7168755\",\"license\":\"MIT\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xb6016d5611f38fbd516a84ea2e56794cb76a8d61c40f6716d5f0133f195759bd\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IEIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IEIP173Proxy {\\n function proxyAdmin() external view returns (address);\\n\\n function transferProxyAdmin(address newAdmin) external;\\n\\n function upgradeTo(address newImplementation) external;\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable;\\n}\\n\",\"keccak256\":\"0xae9996ea370d97cb5fd1934394aca615bee0e46c9a0c161d728490264e83eda5\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IGUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\ninterface IGUniFactory {\\n event PoolCreated(\\n address indexed uniPool,\\n address indexed manager,\\n address indexed pool\\n );\\n\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n}\\n\",\"keccak256\":\"0xe06f79e9b1e6351fc4f40c9f25630f0fbfabae9d2ae2bb642ef1f03d4c2195c1\",\"license\":\"MIT\"},\"contracts/interfaces/IGUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IGUniPoolStorage {\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external;\\n}\\n\",\"keccak256\":\"0x52a3f83a23917772f1eb242cecdfa8b45d7b357a615383628c1ac1f26259dd3f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IUniswapV3TickSpacing.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IUniswapV3TickSpacing {\\n function tickSpacing() external view returns (int24);\\n}\\n\",\"keccak256\":\"0xa6f22651f7e49c6eecf584d8e829d31336de7c43eec3c4c4df3b309db27bd355\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b5060405161273838038061273883398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516126a661009260003960008181610312015261103101526126a66000f3fe60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e620001583660046200151e565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e3660046200160f565b62000448565b6200015e620001a5366004620016b0565b620005b0565b6200016a6200068a565b6200015e620001c6366004620016b0565b620006f5565b6200016a620001dd3660046200151e565b620007d3565b620001ed620007fc565b604051620001749190620016f0565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001758565b6200023a6200080b565b6040516200017491906200176d565b6200023a6200025a3660046200151e565b62000820565b6200023a620008dd565b6200015e62000997565b620001ed62000285366004620017e5565b62000a04565b600254620001ed906001600160a01b031681565b620002b6620002b03660046200151e565b62000a22565b604051901515815260200162000174565b620001ed620002d836600462001878565b62000a3f565b62000221620002ef366004620018f2565b62000a5e565b6200015e6200030636600462001930565b62000bad565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e620003593660046200151e565b62000cb7565b6200015e620003703660046200151e565b62000d56565b620001ed620003873660046200151e565b62000e3d565b3362000398620007fc565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001982565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b03909116908490620019c4565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000ea4565b905090565b3362000453620007fc565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001982565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005aa57838181518110620004eb57620004eb620019de565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052c576200052c620019de565b9050602002810190620005409190620019f4565b6040518463ffffffff1660e01b8152600401620005609392919062001a3d565b600060405180830381600087803b1580156200057b57600080fd5b505af115801562000590573d6000803e3d6000fd5b505050508080620005a19062001a93565b915050620004cc565b50505050565b33620005bb620007fc565b6001600160a01b031614620005e45760405162461bcd60e51b8152600401620003c19062001982565b60005b81518110156200068657818181518110620006065762000606620019de565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063c9190620016f0565b600060405180830381600087803b1580156200065757600080fd5b505af11580156200066c573d6000803e3d6000fd5b5050505080806200067d9062001a93565b915050620005e7565b5050565b60008062000697620008dd565b905060005b8151811015620006f057620006cd828281518110620006bf57620006bf620019de565b6020026020010151620007d3565b620006d9908462001aaf565b925080620006e78162001a93565b9150506200069c565b505090565b3362000700620007fc565b6001600160a01b031614620007295760405162461bcd60e51b8152600401620003c19062001982565b60005b815181101562000686578181815181106200074b576200074b620019de565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200078992911690600401620016f0565b600060405180830381600087803b158015620007a457600080fd5b505af1158015620007b9573d6000803e3d6000fd5b505050508080620007ca9062001a93565b9150506200072c565b6001600160a01b0381166000908152600560205260408120620007f69062000ea4565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200082f83620007d3565b90506000816001600160401b038111156200084e576200084e6200153e565b60405190808252806020026020018201604052801562000878578160200160208202803683370190505b50905060005b82811015620008d55762000893858262000eaf565b828281518110620008a857620008a8620019de565b6001600160a01b039092166020928302919091019091015280620008cc8162001a93565b9150506200087e565b509392505050565b60606000620008eb62000435565b90506000816001600160401b038111156200090a576200090a6200153e565b60405190808252806020026020018201604052801562000934578160200160208202803683370190505b50905060005b8281101562000990576200094e8162000eda565b828281518110620009635762000963620019de565b6001600160a01b039092166020928302919091019091015280620009878162001a93565b9150506200093a565b5092915050565b33620009a2620007fc565b6001600160a01b031614620009cb5760405162461bcd60e51b8152600401620003c19062001982565b600080546040516001600160a01b039091169060008051602062002651833981519152908390a3600080546001600160a01b0319169055565b600062000a178787878787873362000ee9565b979650505050505050565b600062000a2f8262000e3d565b6001600160a01b03161592915050565b600062000a5486868660008787600062000ee9565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000aa1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000acb919081019062001ac5565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000b0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b38919081019062001ac5565b905062000ba46040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001243565b95945050505050565b600054600160a81b900460ff168062000bd05750600054600160a01b900460ff16155b62000c355760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000c60576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005aa576000805460ff60a81b1916905550505050565b3362000cc2620007fc565b6001600160a01b03161462000ceb5760405162461bcd60e51b8152600401620003c19062001982565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000d2c916001600160a01b03909116908490620019c4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000d61620007fc565b6001600160a01b03161462000d8a5760405162461bcd60e51b8152600401620003c19062001982565b6001600160a01b03811662000df35760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200265183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007f6919062001b63565b6000620007f6825490565b6001600160a01b038216600090815260056020526040812062000ed390836200127a565b9392505050565b6000620007f66003836200127a565b600080600062000efa8a8a62001288565b6001546040519294509092506001600160a01b031690309062000f1d90620014f7565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000f60573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb99062000fb29086908690600401620019c4565b600060405180830381865afa92505050801562000ff357506040513d6000823e601f3d908101601f1916820160405262000ff0919081019062001ac5565b60015b1562000ffc5790505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee8290606401602060405180830381865afa1580156200107b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010a1919062001b63565b90506001600160a01b038116620010f95760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b6200110681898962001356565b6200114b5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200118390859085908e908e908e908e9060040162001b83565b600060405180830381600087803b1580156200119e57600080fd5b505af1158015620011b3573d6000803e3d6000fd5b50505050620011cd3360036200140390919063ffffffff16565b50336000908152600560205260409020620011e9908662001403565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200126095949392919062001bf8565b604051602081830303815290604052905095945050505050565b600062000ed383836200141a565b600080826001600160a01b0316846001600160a01b031603620012db5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620012fd57828462001300565b83835b90925090506001600160a01b0382166200134f5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001398573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013be919062001c6d565b90508260020b8460020b128015620013e25750620013dd818562001c8d565b60020b155b801562000ba45750620013f6818462001c8d565b60020b1595945050505050565b600062000ed3836001600160a01b038416620014a5565b815460009082106200147a5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b826000018281548110620014925762001492620019de565b9060005260206000200154905092915050565b6000818152600183016020526040812054620014ee57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007f6565b506000620007f6565b6109928062001cbf83390190565b6001600160a01b03811681146200151b57600080fd5b50565b6000602082840312156200153157600080fd5b813562000ed38162001505565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200157f576200157f6200153e565b604052919050565b600082601f8301126200159957600080fd5b813560206001600160401b03821115620015b757620015b76200153e565b8160051b620015c882820162001554565b9283528481018201928281019087851115620015e357600080fd5b83870192505b8483101562000a17578235620015ff8162001505565b82529183019190830190620015e9565b6000806000604084860312156200162557600080fd5b83356001600160401b03808211156200163d57600080fd5b6200164b8783880162001587565b945060208601359150808211156200166257600080fd5b818601915086601f8301126200167757600080fd5b8135818111156200168757600080fd5b8760208260051b85010111156200169d57600080fd5b6020830194508093505050509250925092565b600060208284031215620016c357600080fd5b81356001600160401b03811115620016da57600080fd5b620016e88482850162001587565b949350505050565b6001600160a01b0391909116815260200190565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b60208152600062000ed360208301846200172a565b6020808252825182820181905260009190848201906040850190845b81811015620017b05783516001600160a01b03168352928401929184019160010162001789565b50909695505050505050565b803562ffffff81168114620017d057600080fd5b919050565b8060020b81146200151b57600080fd5b60008060008060008060c08789031215620017ff57600080fd5b86356200180c8162001505565b955060208701356200181e8162001505565b94506200182e60408801620017bc565b9350606087013561ffff811681146200184657600080fd5b925060808701356200185881620017d5565b915060a08701356200186a81620017d5565b809150509295509295509295565b600080600080600060a086880312156200189157600080fd5b85356200189e8162001505565b94506020860135620018b08162001505565b9350620018c060408701620017bc565b92506060860135620018d281620017d5565b91506080860135620018e481620017d5565b809150509295509295909350565b600080604083850312156200190657600080fd5b8235620019138162001505565b91506020830135620019258162001505565b809150509250929050565b6000806000606084860312156200194657600080fd5b8335620019538162001505565b92506020840135620019658162001505565b91506040840135620019778162001505565b809150509250925092565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811262001a0c57600080fd5b8301803591506001600160401b0382111562001a2757600080fd5b6020019150368190038213156200134f57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001aa85762001aa862001a7d565b5060010190565b80820180821115620007f657620007f662001a7d565b60006020828403121562001ad857600080fd5b81516001600160401b038082111562001af057600080fd5b818401915084601f83011262001b0557600080fd5b81518181111562001b1a5762001b1a6200153e565b62001b2f601f8201601f191660200162001554565b915080825285602082850101111562001b4757600080fd5b62001b5a81602084016020860162001704565b50949350505050565b60006020828403121562001b7657600080fd5b815162000ed38162001505565b60e08152600062001b9860e08301896200172a565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001c0c818460208b0162001704565b86519083019062001c22818360208b0162001704565b865191019062001c37818360208a0162001704565b855191019062001c4c81836020890162001704565b845191019062001c6181836020880162001704565b01979650505050505050565b60006020828403121562001c8057600080fd5b815162000ed381620017d5565b60008260020b8062001caf57634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220bab4dc364f42f8e82ed2983d450c7f7b787f86ecc2b056c62a10271dfd59e29364736f6c63430008130033", - "deployedBytecode": "0x60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e620001583660046200151e565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e3660046200160f565b62000448565b6200015e620001a5366004620016b0565b620005b0565b6200016a6200068a565b6200015e620001c6366004620016b0565b620006f5565b6200016a620001dd3660046200151e565b620007d3565b620001ed620007fc565b604051620001749190620016f0565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001758565b6200023a6200080b565b6040516200017491906200176d565b6200023a6200025a3660046200151e565b62000820565b6200023a620008dd565b6200015e62000997565b620001ed62000285366004620017e5565b62000a04565b600254620001ed906001600160a01b031681565b620002b6620002b03660046200151e565b62000a22565b604051901515815260200162000174565b620001ed620002d836600462001878565b62000a3f565b62000221620002ef366004620018f2565b62000a5e565b6200015e6200030636600462001930565b62000bad565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e620003593660046200151e565b62000cb7565b6200015e620003703660046200151e565b62000d56565b620001ed620003873660046200151e565b62000e3d565b3362000398620007fc565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001982565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b03909116908490620019c4565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000ea4565b905090565b3362000453620007fc565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001982565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005aa57838181518110620004eb57620004eb620019de565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052c576200052c620019de565b9050602002810190620005409190620019f4565b6040518463ffffffff1660e01b8152600401620005609392919062001a3d565b600060405180830381600087803b1580156200057b57600080fd5b505af115801562000590573d6000803e3d6000fd5b505050508080620005a19062001a93565b915050620004cc565b50505050565b33620005bb620007fc565b6001600160a01b031614620005e45760405162461bcd60e51b8152600401620003c19062001982565b60005b81518110156200068657818181518110620006065762000606620019de565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063c9190620016f0565b600060405180830381600087803b1580156200065757600080fd5b505af11580156200066c573d6000803e3d6000fd5b5050505080806200067d9062001a93565b915050620005e7565b5050565b60008062000697620008dd565b905060005b8151811015620006f057620006cd828281518110620006bf57620006bf620019de565b6020026020010151620007d3565b620006d9908462001aaf565b925080620006e78162001a93565b9150506200069c565b505090565b3362000700620007fc565b6001600160a01b031614620007295760405162461bcd60e51b8152600401620003c19062001982565b60005b815181101562000686578181815181106200074b576200074b620019de565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200078992911690600401620016f0565b600060405180830381600087803b158015620007a457600080fd5b505af1158015620007b9573d6000803e3d6000fd5b505050508080620007ca9062001a93565b9150506200072c565b6001600160a01b0381166000908152600560205260408120620007f69062000ea4565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200082f83620007d3565b90506000816001600160401b038111156200084e576200084e6200153e565b60405190808252806020026020018201604052801562000878578160200160208202803683370190505b50905060005b82811015620008d55762000893858262000eaf565b828281518110620008a857620008a8620019de565b6001600160a01b039092166020928302919091019091015280620008cc8162001a93565b9150506200087e565b509392505050565b60606000620008eb62000435565b90506000816001600160401b038111156200090a576200090a6200153e565b60405190808252806020026020018201604052801562000934578160200160208202803683370190505b50905060005b8281101562000990576200094e8162000eda565b828281518110620009635762000963620019de565b6001600160a01b039092166020928302919091019091015280620009878162001a93565b9150506200093a565b5092915050565b33620009a2620007fc565b6001600160a01b031614620009cb5760405162461bcd60e51b8152600401620003c19062001982565b600080546040516001600160a01b039091169060008051602062002651833981519152908390a3600080546001600160a01b0319169055565b600062000a178787878787873362000ee9565b979650505050505050565b600062000a2f8262000e3d565b6001600160a01b03161592915050565b600062000a5486868660008787600062000ee9565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000aa1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000acb919081019062001ac5565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000b0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b38919081019062001ac5565b905062000ba46040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001243565b95945050505050565b600054600160a81b900460ff168062000bd05750600054600160a01b900460ff16155b62000c355760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000c60576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005aa576000805460ff60a81b1916905550505050565b3362000cc2620007fc565b6001600160a01b03161462000ceb5760405162461bcd60e51b8152600401620003c19062001982565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000d2c916001600160a01b03909116908490620019c4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000d61620007fc565b6001600160a01b03161462000d8a5760405162461bcd60e51b8152600401620003c19062001982565b6001600160a01b03811662000df35760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200265183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007f6919062001b63565b6000620007f6825490565b6001600160a01b038216600090815260056020526040812062000ed390836200127a565b9392505050565b6000620007f66003836200127a565b600080600062000efa8a8a62001288565b6001546040519294509092506001600160a01b031690309062000f1d90620014f7565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000f60573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb99062000fb29086908690600401620019c4565b600060405180830381865afa92505050801562000ff357506040513d6000823e601f3d908101601f1916820160405262000ff0919081019062001ac5565b60015b1562000ffc5790505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee8290606401602060405180830381865afa1580156200107b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010a1919062001b63565b90506001600160a01b038116620010f95760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b6200110681898962001356565b6200114b5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200118390859085908e908e908e908e9060040162001b83565b600060405180830381600087803b1580156200119e57600080fd5b505af1158015620011b3573d6000803e3d6000fd5b50505050620011cd3360036200140390919063ffffffff16565b50336000908152600560205260409020620011e9908662001403565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200126095949392919062001bf8565b604051602081830303815290604052905095945050505050565b600062000ed383836200141a565b600080826001600160a01b0316846001600160a01b031603620012db5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620012fd57828462001300565b83835b90925090506001600160a01b0382166200134f5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001398573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013be919062001c6d565b90508260020b8460020b128015620013e25750620013dd818562001c8d565b60020b155b801562000ba45750620013f6818462001c8d565b60020b1595945050505050565b600062000ed3836001600160a01b038416620014a5565b815460009082106200147a5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b826000018281548110620014925762001492620019de565b9060005260206000200154905092915050565b6000818152600183016020526040812054620014ee57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007f6565b506000620007f6565b6109928062001cbf83390190565b6001600160a01b03811681146200151b57600080fd5b50565b6000602082840312156200153157600080fd5b813562000ed38162001505565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200157f576200157f6200153e565b604052919050565b600082601f8301126200159957600080fd5b813560206001600160401b03821115620015b757620015b76200153e565b8160051b620015c882820162001554565b9283528481018201928281019087851115620015e357600080fd5b83870192505b8483101562000a17578235620015ff8162001505565b82529183019190830190620015e9565b6000806000604084860312156200162557600080fd5b83356001600160401b03808211156200163d57600080fd5b6200164b8783880162001587565b945060208601359150808211156200166257600080fd5b818601915086601f8301126200167757600080fd5b8135818111156200168757600080fd5b8760208260051b85010111156200169d57600080fd5b6020830194508093505050509250925092565b600060208284031215620016c357600080fd5b81356001600160401b03811115620016da57600080fd5b620016e88482850162001587565b949350505050565b6001600160a01b0391909116815260200190565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b60208152600062000ed360208301846200172a565b6020808252825182820181905260009190848201906040850190845b81811015620017b05783516001600160a01b03168352928401929184019160010162001789565b50909695505050505050565b803562ffffff81168114620017d057600080fd5b919050565b8060020b81146200151b57600080fd5b60008060008060008060c08789031215620017ff57600080fd5b86356200180c8162001505565b955060208701356200181e8162001505565b94506200182e60408801620017bc565b9350606087013561ffff811681146200184657600080fd5b925060808701356200185881620017d5565b915060a08701356200186a81620017d5565b809150509295509295509295565b600080600080600060a086880312156200189157600080fd5b85356200189e8162001505565b94506020860135620018b08162001505565b9350620018c060408701620017bc565b92506060860135620018d281620017d5565b91506080860135620018e481620017d5565b809150509295509295909350565b600080604083850312156200190657600080fd5b8235620019138162001505565b91506020830135620019258162001505565b809150509250929050565b6000806000606084860312156200194657600080fd5b8335620019538162001505565b92506020840135620019658162001505565b91506040840135620019778162001505565b809150509250925092565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811262001a0c57600080fd5b8301803591506001600160401b0382111562001a2757600080fd5b6020019150368190038213156200134f57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001aa85762001aa862001a7d565b5060010190565b80820180821115620007f657620007f662001a7d565b60006020828403121562001ad857600080fd5b81516001600160401b038082111562001af057600080fd5b818401915084601f83011262001b0557600080fd5b81518181111562001b1a5762001b1a6200153e565b62001b2f601f8201601f191660200162001554565b915080825285602082850101111562001b4757600080fd5b62001b5a81602084016020860162001704565b50949350505050565b60006020828403121562001b7657600080fd5b815162000ed38162001505565b60e08152600062001b9860e08301896200172a565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001c0c818460208b0162001704565b86519083019062001c22818360208b0162001704565b865191019062001c37818360208a0162001704565b855191019062001c4c81836020890162001704565b845191019062001c6181836020880162001704565b01979650505050505050565b60006020828403121562001c8057600080fd5b815162000ed381620017d5565b60008260020b8062001caf57634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220bab4dc364f42f8e82ed2983d450c7f7b787f86ecc2b056c62a10271dfd59e29364736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "managerFee": "proportion of earned fees that go to pool manager in Basis Points", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "createPool(address,address,uint24,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "getDeployers()": { - "returns": { - "_0": "deployers the list of deployer addresses" - } - }, - "getGelatoPools()": { - "returns": { - "_0": "list of Gelato managed G-UNI pool addresses" - } - }, - "getPools(address)": { - "params": { - "deployer": "address that has potentially deployed G-UNI pools (can return empty array)" - }, - "returns": { - "_0": "pools the list of G-UNI pool addresses deployed by `deployer`" - } - }, - "getProxyAdmin(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "address that controls the G-UNI implementation (has power to upgrade it)" - } - }, - "isPoolImmutable(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "bool signaling if pool is immutable (true) or not (false)" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "numDeployers()": { - "returns": { - "_0": "total number of G-UNI pool deployer addresses" - } - }, - "numPools()": { - "returns": { - "result": "total number of G-UNI pools deployed" - } - }, - "numPools(address)": { - "params": { - "deployer": "deployer address" - }, - "returns": { - "_0": "total number of G-UNI pools deployed by `deployer`" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "notice": "createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`" - }, - "createPool(address,address,uint24,int24,int24)": { - "notice": "createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`" - }, - "getDeployers()": { - "notice": "getDeployers fetches all addresses that have deployed a G-UNI pool" - }, - "getGelatoPools()": { - "notice": "getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)" - }, - "getPools(address)": { - "notice": "getPools fetches all the G-UNI pool addresses deployed by `deployer`" - }, - "getProxyAdmin(address)": { - "notice": "getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address)." - }, - "isPoolImmutable(address)": { - "notice": "isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded" - }, - "numDeployers()": { - "notice": "numDeployers counts the total number of G-UNI pool deployer addresses" - }, - "numPools()": { - "notice": "numPools counts the total number of G-UNI pools in existence" - }, - "numPools(address)": { - "notice": "numPools counts the total number of G-UNI pools deployed by `deployer`" - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6441, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_manager", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 5, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initialized", - "offset": 20, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initializing", - "offset": 21, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 5909, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "poolImplementation", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 5911, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "gelatoDeployer", - "offset": 0, - "slot": "2", - "type": "t_address" - }, - { - "astId": 5914, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_deployers", - "offset": 0, - "slot": "3", - "type": "t_struct(AddressSet)2007_storage" - }, - { - "astId": 5919, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_pools", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_struct(AddressSet)2007_storage)" - } - ], - "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_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(AddressSet)2007_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.AddressSet)", - "numberOfBytes": "32", - "value": "t_struct(AddressSet)2007_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(AddressSet)2007_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.AddressSet", - "members": [ - { - "astId": 2006, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1732_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Set)1732_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 1727, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 1731, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "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/lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory_Proxy.json b/lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory_Proxy.json deleted file mode 100644 index 457bcc9de..000000000 --- a/lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory_Proxy.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "address": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xfa9a97a23c9b357c5ed6cbec1086e7e7a45c2a7a2bebb1b2350f5f25bd261547", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "transactionIndex": 1, - "gasUsed": "2844305716", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000200000200000000020000000000400000000800000000002000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000800000000000000000000000200100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000000400000000000000000000000000000000000000000000", - "blockHash": "0xc7aedb82e69ebaeec6d1960310d596ff8ed3eb68da9d1e75a89ae47aff41adda", - "transactionHash": "0xfa9a97a23c9b357c5ed6cbec1086e7e7a45c2a7a2bebb1b2350f5f25bd261547", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 9248224, - "transactionHash": "0xfa9a97a23c9b357c5ed6cbec1086e7e7a45c2a7a2bebb1b2350f5f25bd261547", - "address": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000087fe34053bfbf5b278988bd150e9f8da72ca1bc3" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0xc7aedb82e69ebaeec6d1960310d596ff8ed3eb68da9d1e75a89ae47aff41adda" - }, - { - "transactionIndex": 1, - "blockNumber": 9248224, - "transactionHash": "0xfa9a97a23c9b357c5ed6cbec1086e7e7a45c2a7a2bebb1b2350f5f25bd261547", - "address": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0xc7aedb82e69ebaeec6d1960310d596ff8ed3eb68da9d1e75a89ae47aff41adda" - } - ], - "blockNumber": 9248224, - "cumulativeGasUsed": "2844352605", - "status": 1, - "byzantium": true - }, - "args": [ - "0x87fe34053bfBF5B278988bd150e9F8da72ca1bC3", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b000000000000000000000000e292cf4e316191cbfebd74909356df3cd9455e96000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/mantleSepolia/GUniPool.json b/lib/g-uni-v1-core/deployments/mantleSepolia/GUniPool.json deleted file mode 100644 index 50c3ee82f..000000000 --- a/lib/g-uni-v1-core/deployments/mantleSepolia/GUniPool.json +++ /dev/null @@ -1,1649 +0,0 @@ -{ - "address": "0xE292cF4e316191CbFEbD74909356DF3cd9455e96", - "abi": [ - { - "inputs": [ - { - "internalType": "address payable", - "name": "_gelato", - "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": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned0", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned1", - "type": "uint256" - } - ], - "name": "FeesEarned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int24", - "name": "lowerTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "int24", - "name": "upperTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBefore", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityAfter", - "type": "uint128" - } - ], - "name": "Rebalance", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - } - ], - "name": "SetManagerFee", - "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" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldAdminTreasury", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdminTreasury", - "type": "address" - } - ], - "name": "UpdateAdminTreasury", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoRebalanceBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoWithdrawBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoSlippageBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "gelatoSlippageInterval", - "type": "uint32" - } - ], - "name": "UpdateGelatoParams", - "type": "event" - }, - { - "inputs": [], - "name": "GELATO", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "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": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "burn", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "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": [ - { - "internalType": "int24", - "name": "newLowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "newUpperTick", - "type": "int24" - }, - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - } - ], - "name": "executiveRebalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoRebalanceBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageInterval", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoWithdrawBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Max", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Max", - "type": "uint256" - } - ], - "name": "getMintAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPositionID", - "outputs": [ - { - "internalType": "bytes32", - "name": "positionID", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUnderlyingBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "sqrtRatioX96", - "type": "uint160" - } - ], - "name": "getUnderlyingBalancesAtPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "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": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "address", - "name": "_pool", - "type": "address" - }, - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "_lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "_upperTick", - "type": "int24" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - } - ], - "name": "initializeManagerFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "lowerTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerTreasury", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pool", - "outputs": [ - { - "internalType": "contract IUniswapV3Pool", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "paymentToken", - "type": "address" - } - ], - "name": "rebalance", - "outputs": [], - "stateMutability": "nonpayable", - "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": "token0", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token1", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Owed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Owed", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3MintCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amount0Delta", - "type": "int256" - }, - { - "internalType": "int256", - "name": "amount1Delta", - "type": "int256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3SwapCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "newRebalanceBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newWithdrawBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newSlippageBPS", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "newSlippageInterval", - "type": "uint32" - }, - { - "internalType": "address", - "name": "newTreasury", - "type": "address" - } - ], - "name": "updateGelatoParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "upperTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawGelatoBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawManagerBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xe29b82d3f720f651bdb337916ad603e2660e93bb727073a556289583d936d43d", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0xE292cF4e316191CbFEbD74909356DF3cd9455e96", - "transactionIndex": 1, - "gasUsed": "26229449018", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x61ce06d3ef98d210fc7b04a0360e2a7470c0d4b6980f5d2e2692458526f029e1", - "transactionHash": "0xe29b82d3f720f651bdb337916ad603e2660e93bb727073a556289583d936d43d", - "logs": [], - "blockNumber": 9248188, - "cumulativeGasUsed": "26229495895", - "status": 1, - "byzantium": true - }, - "args": [ - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_gelato\",\"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\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned1\",\"type\":\"uint256\"}],\"name\":\"FeesEarned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"lowerTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"upperTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBefore\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityAfter\",\"type\":\"uint128\"}],\"name\":\"Rebalance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"}],\"name\":\"SetManagerFee\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAdminTreasury\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdminTreasury\",\"type\":\"address\"}],\"name\":\"UpdateAdminTreasury\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoRebalanceBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoWithdrawBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoSlippageBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gelatoSlippageInterval\",\"type\":\"uint32\"}],\"name\":\"UpdateGelatoParams\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GELATO\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"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\":[{\"internalType\":\"int24\",\"name\":\"newLowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"newUpperTick\",\"type\":\"int24\"},{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"}],\"name\":\"executiveRebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoRebalanceBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageInterval\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoWithdrawBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Max\",\"type\":\"uint256\"}],\"name\":\"getMintAmounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPositionID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"positionID\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUnderlyingBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtRatioX96\",\"type\":\"uint160\"}],\"name\":\"getUnderlyingBalancesAtPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"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\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_pool\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"_lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"_upperTick\",\"type\":\"int24\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"}],\"name\":\"initializeManagerFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lowerTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pool\",\"outputs\":[{\"internalType\":\"contract IUniswapV3Pool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"}],\"name\":\"rebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"token0\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newRebalanceBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newWithdrawBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newSlippageBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"newSlippageInterval\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateGelatoParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upperTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawGelatoBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawManagerBalance\",\"outputs\":[],\"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\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"burn(uint256,address)\":{\"params\":{\"burnAmount\":\"The number of G-UNI tokens to burn\",\"receiver\":\"The account to receive the underlying amounts of token0 and token1\"},\"returns\":{\"amount0\":\"amount of token0 transferred to receiver for burning `burnAmount`\",\"amount1\":\"amount of token1 transferred to receiver for burning `burnAmount`\",\"liquidityBurned\":\"amount of liquidity removed from the underlying Uniswap V3 position\"}},\"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 this function is overridden; 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`.\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"details\":\"When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.\",\"params\":{\"newLowerTick\":\"The new lower bound of the position's range\",\"newUpperTick\":\"The new upper bound of the position's range\",\"swapAmountBPS\":\"amount of token to swap as proportion of total. Pass 0 to ignore swap.\",\"swapThresholdPrice\":\"slippage parameter on the swap as a max or min sqrtPriceX96\",\"zeroForOne\":\"Which token to input into the swap (true = token0, false = token1)\"}},\"getMintAmounts(uint256,uint256)\":{\"params\":{\"amount0Max\":\"The maximum amount of token1 to forward on mint\"},\"returns\":{\"amount0\":\"actual amount of token0 to forward when minting `mintAmount`\",\"amount1\":\"actual amount of token1 to forward when minting `mintAmount`\",\"mintAmount\":\"maximum number of G-UNI tokens to mint\"}},\"getUnderlyingBalances()\":{\"returns\":{\"amount0Current\":\"current total underlying balance of token0\",\"amount1Current\":\"current total underlying balance of token1\"}},\"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.\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"params\":{\"_lowerTick\":\"initial upperTick (only changeable with executiveRebalance)\",\"_managerFeeBPS\":\"proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\",\"_manager_\":\"address of manager (ownership can be transferred)\",\"_name\":\"name of G-UNI token\",\"_pool\":\"address of Uniswap V3 pool\",\"_symbol\":\"symbol of G-UNI token\"}},\"initializeManagerFee(uint16)\":{\"params\":{\"_managerFeeBPS\":\"proportion of fees earned that are credited to manager in Basis Points\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"mint(uint256,address)\":{\"details\":\"to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\",\"params\":{\"mintAmount\":\"The number of G-UNI tokens to mint\",\"receiver\":\"The account to receive the minted tokens\"},\"returns\":{\"amount0\":\"amount of token0 transferred from msg.sender to mint `mintAmount`\",\"amount1\":\"amount of token1 transferred from msg.sender to mint `mintAmount`\",\"liquidityMinted\":\"amount of liquidity added to the underlying Uniswap V3 position\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"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 manager.\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"params\":{\"newRebalanceBPS\":\"controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\",\"newSlippageBPS\":\"maximum slippage on swaps during gelato rebalance\",\"newSlippageInterval\":\"length of time for TWAP used in computing slippage on swaps\",\"newTreasury\":\"address where managerFee withdrawals are sent\",\"newWithdrawBPS\":\"controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(uint256,address)\":{\"notice\":\"burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"notice\":\"Change the range of underlying UniswapV3 position, only manager can call\"},\"getMintAmounts(uint256,uint256)\":{\"notice\":\"compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\"},\"getUnderlyingBalances()\":{\"notice\":\"compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"notice\":\"initialize storage variables on a new G-UNI pool, only called once\"},\"initializeManagerFee(uint16)\":{\"notice\":\"initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\"},\"mint(uint256,address)\":{\"notice\":\"mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\"},\"rebalance(uint160,uint256,bool,uint256,address)\":{\"notice\":\"Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\"},\"uniswapV3MintCallback(uint256,uint256,bytes)\":{\"notice\":\"Uniswap V3 callback fn, called back on pool.mint\"},\"uniswapV3SwapCallback(int256,int256,bytes)\":{\"notice\":\"Uniswap v3 callback fn, called back on pool.swap\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"notice\":\"change configurable parameters, only manager can call\"},\"withdrawGelatoBalance(uint256,address)\":{\"notice\":\"withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"},\"withdrawManagerBalance(uint256,address)\":{\"notice\":\"withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniPool.sol\":\"GUniPool\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal initializer {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal initializer {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and make it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x89fa60d14355f7ae06af11e28fce2bb90c5c6186645d681a30e1b36234a4c210\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\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\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The defaut value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\\n __Context_init_unchained();\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override 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 override 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 this function is\\n * overridden;\\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 override returns (uint8) {\\n return 18;\\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\\n uint256 currentAllowance = _allowances[sender][_msgSender()];\\n require(currentAllowance >= amount, \\\"ERC20: transfer amount exceeds allowance\\\");\\n _approve(sender, _msgSender(), currentAllowance - amount);\\n\\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\\n\\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 uint256 senderBalance = _balances[sender];\\n require(senderBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n _balances[sender] = senderBalance - amount;\\n _balances[recipient] += amount;\\n\\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 += amount;\\n _balances[account] += 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 uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n _balances[account] = accountBalance - amount;\\n _totalSupply -= amount;\\n\\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 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 uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0x9c2d7425f3343ea340d6ea67e9d90109d4d846bb013c2572096ec88c9e74946b\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\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\":\"0x8d4a0f2b5b760b5e2c19ed3c108d83897a4dfd5bfed97a93867918df19191e5e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x6795c369a4eefa78468e38966f7851fbc2dda5e5b9ccd3fa2b45970e2e4d3abd\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../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 initializer {\\n __Context_init_unchained();\\n }\\n\\n function __Context_init_unchained() internal initializer {\\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x8e9eb503de1189f50c5f16fef327da310b11898d6b9ab3ca937df07c35233b9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.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 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) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\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\":\"0x99f5c21018d796db7833a2100bb0e7411999e248a3c950fb526eee5d2bf47cb7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0x069b2631bb5b5193a58ccf7a06266c7361bd2c20095667af4402817605627f45\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCast {\\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 require(value < 2**128, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return uint128(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 require(value < 2**64, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return uint64(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 require(value < 2**32, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return uint32(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 require(value < 2**16, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\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 require(value < 2**8, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\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 require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n return uint256(value);\\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 * _Available since v3.1._\\n */\\n function toInt128(int256 value) internal pure returns (int128) {\\n require(value >= -2**127 && value < 2**127, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return int128(value);\\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 * _Available since v3.1._\\n */\\n function toInt64(int256 value) internal pure returns (int64) {\\n require(value >= -2**63 && value < 2**63, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return int64(value);\\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 * _Available since v3.1._\\n */\\n function toInt32(int256 value) internal pure returns (int32) {\\n require(value >= -2**31 && value < 2**31, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return int32(value);\\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 * _Available since v3.1._\\n */\\n function toInt16(int256 value) internal pure returns (int16) {\\n require(value >= -2**15 && value < 2**15, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\n return int16(value);\\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 * _Available since v3.1._\\n */\\n function toInt8(int256 value) internal pure returns (int8) {\\n require(value >= -2**7 && value < 2**7, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\n return int8(value);\\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 require(value < 2**255, \\\"SafeCast: value doesn't fit in an int256\\\");\\n return int256(value);\\n }\\n}\\n\",\"keccak256\":\"0xc37d85b96c2a8d7bc09f25958e0a81394bf5780286444147ddf875fa628d53ce\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\nimport './pool/IUniswapV3PoolImmutables.sol';\\nimport './pool/IUniswapV3PoolState.sol';\\nimport './pool/IUniswapV3PoolDerivedState.sol';\\nimport './pool/IUniswapV3PoolActions.sol';\\nimport './pool/IUniswapV3PoolOwnerActions.sol';\\nimport './pool/IUniswapV3PoolEvents.sol';\\n\\n/// @title The interface for a Uniswap V3 Pool\\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\\n/// to the ERC20 specification\\n/// @dev The pool interface is broken up into many smaller pieces\\ninterface IUniswapV3Pool is\\n IUniswapV3PoolImmutables,\\n IUniswapV3PoolState,\\n IUniswapV3PoolDerivedState,\\n IUniswapV3PoolActions,\\n IUniswapV3PoolOwnerActions,\\n IUniswapV3PoolEvents\\n{\\n\\n}\\n\",\"keccak256\":\"0xfe6113d518466cd6652c85b111e01f33eb62157f49ae5ed7d5a3947a2044adb1\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#mint\\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\\ninterface IUniswapV3MintCallback {\\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x27a9725b8f831a92d16380860c3d348a0b926a7f01b34a54ea6eea78cbdbcd6a\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#swap\\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\\ninterface IUniswapV3SwapCallback {\\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x3f485fb1a44e8fbeadefb5da07d66edab3cfe809f0ac4074b1e54e3eb3c4cf69\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissionless pool actions\\n/// @notice Contains pool methods that can be called by anyone\\ninterface IUniswapV3PoolActions {\\n /// @notice Sets the initial price for the pool\\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\\n function initialize(uint160 sqrtPriceX96) external;\\n\\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\\n /// @param recipient The address for which the liquidity will be created\\n /// @param tickLower The lower tick of the position in which to add liquidity\\n /// @param tickUpper The upper tick of the position in which to add liquidity\\n /// @param amount The amount of liquidity to mint\\n /// @param data Any data that should be passed through to the callback\\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n function mint(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount,\\n bytes calldata data\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Collects tokens owed to a position\\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\\n /// @param recipient The address which should receive the fees collected\\n /// @param tickLower The lower tick of the position for which to collect fees\\n /// @param tickUpper The upper tick of the position for which to collect fees\\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\\n /// @return amount0 The amount of fees collected in token0\\n /// @return amount1 The amount of fees collected in token1\\n function collect(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n\\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\\n /// @dev Fees must be collected separately via a call to #collect\\n /// @param tickLower The lower tick of the position for which to burn liquidity\\n /// @param tickUpper The upper tick of the position for which to burn liquidity\\n /// @param amount How much liquidity to burn\\n /// @return amount0 The amount of token0 sent to the recipient\\n /// @return amount1 The amount of token1 sent to the recipient\\n function burn(\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Swap token0 for token1, or token1 for token0\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\\n /// @param recipient The address to receive the output of the swap\\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\\n /// @param data Any data to be passed through to the callback\\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\\n function swap(\\n address recipient,\\n bool zeroForOne,\\n int256 amountSpecified,\\n uint160 sqrtPriceLimitX96,\\n bytes calldata data\\n ) external returns (int256 amount0, int256 amount1);\\n\\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\\n /// @param recipient The address which will receive the token0 and token1 amounts\\n /// @param amount0 The amount of token0 to send\\n /// @param amount1 The amount of token1 to send\\n /// @param data Any data to be passed through to the callback\\n function flash(\\n address recipient,\\n uint256 amount0,\\n uint256 amount1,\\n bytes calldata data\\n ) external;\\n\\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\\n /// the input observationCardinalityNext.\\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0x9453dd0e7442188667d01d9b65de3f1e14e9511ff3e303179a15f6fc267f7634\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that is not stored\\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\\n/// blockchain. The functions here may have variable gas costs.\\ninterface IUniswapV3PoolDerivedState {\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\\n /// you must call it with secondsAgos = [3600, 0].\\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\\n /// timestamp\\n function observe(uint32[] calldata secondsAgos)\\n external\\n view\\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\\n\\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\\n /// snapshot is taken and the second snapshot is taken.\\n /// @param tickLower The lower tick of the range\\n /// @param tickUpper The upper tick of the range\\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\\n /// @return secondsInside The snapshot of seconds per liquidity for the range\\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\\n external\\n view\\n returns (\\n int56 tickCumulativeInside,\\n uint160 secondsPerLiquidityInsideX128,\\n uint32 secondsInside\\n );\\n}\\n\",\"keccak256\":\"0xe603ac5b17ecdee73ba2b27efdf386c257a19c14206e87eee77e2017b742d9e5\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Events emitted by a pool\\n/// @notice Contains all events emitted by the pool\\ninterface IUniswapV3PoolEvents {\\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\\n event Initialize(uint160 sqrtPriceX96, int24 tick);\\n\\n /// @notice Emitted when liquidity is minted for a given position\\n /// @param sender The address that minted the liquidity\\n /// @param owner The owner of the position and recipient of any minted liquidity\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity minted to the position range\\n /// @param amount0 How much token0 was required for the minted liquidity\\n /// @param amount1 How much token1 was required for the minted liquidity\\n event Mint(\\n address sender,\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted when fees are collected by the owner of a position\\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\\n /// @param owner The owner of the position for which fees are collected\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount0 The amount of token0 fees collected\\n /// @param amount1 The amount of token1 fees collected\\n event Collect(\\n address indexed owner,\\n address recipient,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount0,\\n uint128 amount1\\n );\\n\\n /// @notice Emitted when a position's liquidity is removed\\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\\n /// @param owner The owner of the position for which liquidity is removed\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity to remove\\n /// @param amount0 The amount of token0 withdrawn\\n /// @param amount1 The amount of token1 withdrawn\\n event Burn(\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted by the pool for any swaps between token0 and token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the output of the swap\\n /// @param amount0 The delta of the token0 balance of the pool\\n /// @param amount1 The delta of the token1 balance of the pool\\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param liquidity The liquidity of the pool after the swap\\n /// @param tick The log base 1.0001 of price of the pool after the swap\\n event Swap(\\n address indexed sender,\\n address indexed recipient,\\n int256 amount0,\\n int256 amount1,\\n uint160 sqrtPriceX96,\\n uint128 liquidity,\\n int24 tick\\n );\\n\\n /// @notice Emitted by the pool for any flashes of token0/token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the tokens from flash\\n /// @param amount0 The amount of token0 that was flashed\\n /// @param amount1 The amount of token1 that was flashed\\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\\n event Flash(\\n address indexed sender,\\n address indexed recipient,\\n uint256 amount0,\\n uint256 amount1,\\n uint256 paid0,\\n uint256 paid1\\n );\\n\\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\\n /// just before a mint/swap/burn.\\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(\\n uint16 observationCardinalityNextOld,\\n uint16 observationCardinalityNextNew\\n );\\n\\n /// @notice Emitted when the protocol fee is changed by the pool\\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\\n /// @param feeProtocol0New The updated value of the token0 protocol fee\\n /// @param feeProtocol1New The updated value of the token1 protocol fee\\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\\n\\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\\n /// @param sender The address that collects the protocol fees\\n /// @param recipient The address that receives the collected protocol fees\\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x8071514d0fe5d17d6fbd31c191cdfb703031c24e0ece3621d88ab10e871375cd\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that never changes\\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\\ninterface IUniswapV3PoolImmutables {\\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\\n /// @return The contract address\\n function factory() external view returns (address);\\n\\n /// @notice The first of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token0() external view returns (address);\\n\\n /// @notice The second of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token1() external view returns (address);\\n\\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\\n /// @return The fee\\n function fee() external view returns (uint24);\\n\\n /// @notice The pool tick spacing\\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\\n /// This value is an int24 to avoid casting even though it is always positive.\\n /// @return The tick spacing\\n function tickSpacing() external view returns (int24);\\n\\n /// @notice The maximum amount of position liquidity that can use any tick in the range\\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\\n /// @return The max amount of liquidity per tick\\n function maxLiquidityPerTick() external view returns (uint128);\\n}\\n\",\"keccak256\":\"0xf6e5d2cd1139c4c276bdbc8e1d2b256e456c866a91f1b868da265c6d2685c3f7\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissioned pool actions\\n/// @notice Contains pool methods that may only be called by the factory owner\\ninterface IUniswapV3PoolOwnerActions {\\n /// @notice Set the denominator of the protocol's % share of the fees\\n /// @param feeProtocol0 new protocol fee for token0 of the pool\\n /// @param feeProtocol1 new protocol fee for token1 of the pool\\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\\n\\n /// @notice Collect the protocol fee accrued to the pool\\n /// @param recipient The address to which collected protocol fees should be sent\\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\\n /// @return amount0 The protocol fee collected in token0\\n /// @return amount1 The protocol fee collected in token1\\n function collectProtocol(\\n address recipient,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x759b78a2918af9e99e246dc3af084f654e48ef32bb4e4cb8a966aa3dcaece235\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that can change\\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\\n/// per transaction\\ninterface IUniswapV3PoolState {\\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\\n /// when accessed externally.\\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\\n /// boundary.\\n /// observationIndex The index of the last oracle observation that was written,\\n /// observationCardinality The current maximum number of observations stored in the pool,\\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// feeProtocol The protocol fee for both tokens of the pool.\\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\\n /// unlocked Whether the pool is currently locked to reentrancy\\n function slot0()\\n external\\n view\\n returns (\\n uint160 sqrtPriceX96,\\n int24 tick,\\n uint16 observationIndex,\\n uint16 observationCardinality,\\n uint16 observationCardinalityNext,\\n uint8 feeProtocol,\\n bool unlocked\\n );\\n\\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal0X128() external view returns (uint256);\\n\\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal1X128() external view returns (uint256);\\n\\n /// @notice The amounts of token0 and token1 that are owed to the protocol\\n /// @dev Protocol fees will never exceed uint128 max in either token\\n function protocolFees() external view returns (uint128 token0, uint128 token1);\\n\\n /// @notice The currently in range liquidity available to the pool\\n /// @dev This value has no relationship to the total liquidity across all ticks\\n function liquidity() external view returns (uint128);\\n\\n /// @notice Look up information about a specific tick in the pool\\n /// @param tick The tick to look up\\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\\n /// tick upper,\\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\\n /// a specific position.\\n function ticks(int24 tick)\\n external\\n view\\n returns (\\n uint128 liquidityGross,\\n int128 liquidityNet,\\n uint256 feeGrowthOutside0X128,\\n uint256 feeGrowthOutside1X128,\\n int56 tickCumulativeOutside,\\n uint160 secondsPerLiquidityOutsideX128,\\n uint32 secondsOutside,\\n bool initialized\\n );\\n\\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\\n function tickBitmap(int16 wordPosition) external view returns (uint256);\\n\\n /// @notice Returns the information about a position by the position's key\\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\\n /// @return _liquidity The amount of liquidity in the position,\\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\\n function positions(bytes32 key)\\n external\\n view\\n returns (\\n uint128 _liquidity,\\n uint256 feeGrowthInside0LastX128,\\n uint256 feeGrowthInside1LastX128,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param index The element of the observations array to fetch\\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\\n /// ago, rather than at a specific index in the array.\\n /// @return blockTimestamp The timestamp of the observation,\\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// Returns initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 index)\\n external\\n view\\n returns (\\n uint32 blockTimestamp,\\n int56 tickCumulative,\\n uint160 secondsPerLiquidityCumulativeX128,\\n bool initialized\\n );\\n}\\n\",\"keccak256\":\"0x852dc1f5df7dcf7f11e7bb3eed79f0cea72ad4b25f6a9d2c35aafb48925fd49f\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.4.0;\\n\\n/// @title FixedPoint96\\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\\n/// @dev Used in SqrtPriceMath.sol\\nlibrary FixedPoint96 {\\n uint8 internal constant RESOLUTION = 96;\\n uint256 internal constant Q96 = 0x1000000000000000000000000;\\n}\\n\",\"keccak256\":\"0x0ba8a9b95a956a4050749c0158e928398c447c91469682ca8a7cc7e77a7fe032\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {\\n IUniswapV3MintCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\\\";\\nimport {\\n IUniswapV3SwapCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\\\";\\nimport {GUniPoolStorage} from \\\"./abstract/GUniPoolStorage.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {TickMath} from \\\"./vendor/uniswap/TickMath.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {SafeCast} from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport {\\n FullMath,\\n LiquidityAmounts\\n} from \\\"./vendor/uniswap/LiquidityAmounts.sol\\\";\\n\\ncontract GUniPool is\\n IUniswapV3MintCallback,\\n IUniswapV3SwapCallback,\\n GUniPoolStorage\\n{\\n using SafeERC20 for IERC20;\\n using TickMath for int24;\\n\\n event Minted(\\n address receiver,\\n uint256 mintAmount,\\n uint256 amount0In,\\n uint256 amount1In,\\n uint128 liquidityMinted\\n );\\n\\n event Burned(\\n address receiver,\\n uint256 burnAmount,\\n uint256 amount0Out,\\n uint256 amount1Out,\\n uint128 liquidityBurned\\n );\\n\\n event Rebalance(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidityBefore,\\n uint128 liquidityAfter\\n );\\n\\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice Uniswap V3 callback fn, called back on pool.mint\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata /*_data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\\n }\\n\\n /// @notice Uniswap v3 callback fn, called back on pool.swap\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata /*data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Delta > 0)\\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\\n else if (amount1Delta > 0)\\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\\n }\\n\\n // User functions => Should be called via a Router\\n\\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\\n /// @param mintAmount The number of G-UNI tokens to mint\\n /// @param receiver The account to receive the minted tokens\\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function mint(uint256 mintAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityMinted\\n )\\n {\\n require(mintAmount > 0, \\\"mint 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n\\n if (totalSupply > 0) {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n amount0 = FullMath.mulDivRoundingUp(\\n amount0Current,\\n mintAmount,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n amount1Current,\\n mintAmount,\\n totalSupply\\n );\\n } else {\\n // if supply is 0 mintAmount == liquidity to deposit\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n SafeCast.toUint128(mintAmount)\\n );\\n }\\n\\n // transfer amounts owed to contract\\n if (amount0 > 0) {\\n token0.safeTransferFrom(msg.sender, address(this), amount0);\\n }\\n if (amount1 > 0) {\\n token1.safeTransferFrom(msg.sender, address(this), amount1);\\n }\\n\\n // deposit as much new liquidity as possible\\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n\\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \\\"\\\");\\n\\n _mint(receiver, mintAmount);\\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\\n }\\n\\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\\n /// @param burnAmount The number of G-UNI tokens to burn\\n /// @param receiver The account to receive the underlying amounts of token0 and token1\\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines\\n function burn(uint256 burnAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityBurned\\n )\\n {\\n require(burnAmount > 0, \\\"burn 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n\\n _burn(msg.sender, burnAmount);\\n\\n uint256 liquidityBurned_ =\\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidityBurned);\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n\\n amount0 =\\n burn0 +\\n FullMath.mulDiv(\\n token0.balanceOf(address(this)) -\\n burn0 -\\n managerBalance0 -\\n gelatoBalance0,\\n burnAmount,\\n totalSupply\\n );\\n amount1 =\\n burn1 +\\n FullMath.mulDiv(\\n token1.balanceOf(address(this)) -\\n burn1 -\\n managerBalance1 -\\n gelatoBalance1,\\n burnAmount,\\n totalSupply\\n );\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(receiver, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(receiver, amount1);\\n }\\n\\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\\n }\\n\\n // Manager Functions => Called by Pool Manager\\n\\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\\n /// any leftover will be unused and sit idle until the next rebalance.\\n /// @param newLowerTick The new lower bound of the position's range\\n /// @param newUpperTick The new upper bound of the position's range\\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\\n // solhint-disable-next-line function-max-lines\\n function executiveRebalance(\\n int24 newLowerTick,\\n int24 newUpperTick,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) external onlyManager {\\n uint128 liquidity;\\n uint128 newLiquidity;\\n if (totalSupply() > 0) {\\n (liquidity, , , , ) = pool.positions(_getPositionID());\\n if (liquidity > 0) {\\n (, , uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n }\\n\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n\\n uint256 reinvest0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n uint256 reinvest1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n\\n _deposit(\\n newLowerTick,\\n newUpperTick,\\n reinvest0,\\n reinvest1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n\\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > 0, \\\"new position 0\\\");\\n } else {\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n }\\n\\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\\n }\\n\\n // Gelatofied functions => Automatically called by Gelato\\n\\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\\n function rebalance(\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) external gelatofy(feeAmount, paymentToken) {\\n if (swapAmountBPS > 0) {\\n _checkSlippage(swapThresholdPrice, zeroForOne);\\n }\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n _rebalance(\\n liquidity,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne,\\n feeAmount,\\n paymentToken\\n );\\n\\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > liquidity, \\\"liquidity must increase\\\");\\n\\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\\n }\\n\\n /// @notice withdraw manager fees accrued, only gelato executors can call.\\n /// Target account to receive fees is managerTreasury, alterable by manager.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n managerBalance0,\\n managerBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(managerTreasury, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(managerTreasury, amount1);\\n }\\n }\\n\\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n gelatoBalance0,\\n gelatoBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n gelatoBalance0 = 0;\\n gelatoBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(GELATO, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(GELATO, amount1);\\n }\\n }\\n\\n function _balancesToWithdraw(\\n uint256 balance0,\\n uint256 balance1,\\n uint256 feeAmount,\\n address feeToken\\n ) internal view returns (uint256 amount0, uint256 amount1) {\\n if (feeToken == address(token0)) {\\n require(\\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount0 = balance0 - feeAmount;\\n amount1 = balance1;\\n } else if (feeToken == address(token1)) {\\n require(\\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount1 = balance1 - feeAmount;\\n amount0 = balance0;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n }\\n\\n // View functions\\n\\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\\n /// @param amount0Max The maximum amount of token0 to forward on mint\\n /// @param amount0Max The maximum amount of token1 to forward on mint\\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\\n /// @return mintAmount maximum number of G-UNI tokens to mint\\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\\n external\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n uint256 totalSupply = totalSupply();\\n if (totalSupply > 0) {\\n (amount0, amount1, mintAmount) = _computeMintAmounts(\\n totalSupply,\\n amount0Max,\\n amount1Max\\n );\\n } else {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 newLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0Max,\\n amount1Max\\n );\\n mintAmount = uint256(newLiquidity);\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n newLiquidity\\n );\\n }\\n }\\n\\n /// @notice compute total underlying holdings of the G-UNI token supply\\n /// includes current liquidity invested in uniswap position, current fees earned\\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\\n /// @return amount0Current current total underlying balance of token0\\n /// @return amount1Current current total underlying balance of token1\\n function getUnderlyingBalances()\\n public\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\\n external\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\\n internal\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (\\n uint128 liquidity,\\n uint256 feeGrowthInside0Last,\\n uint256 feeGrowthInside1Last,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n ) = pool.positions(_getPositionID());\\n\\n // compute current holdings from liquidity\\n (amount0Current, amount1Current) = LiquidityAmounts\\n .getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n liquidity\\n );\\n\\n // compute current fees earned\\n uint256 fee0 =\\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\\n uint256(tokensOwed0);\\n uint256 fee1 =\\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\\n uint256(tokensOwed1);\\n\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n\\n // add any leftover in contract to current holdings\\n amount0Current +=\\n fee0 +\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n amount1Current +=\\n fee1 +\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n }\\n\\n // Private functions\\n\\n // solhint-disable-next-line function-max-lines\\n function _rebalance(\\n uint128 liquidity,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) private {\\n uint256 leftover0 =\\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\\n uint256 leftover1 =\\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\\n\\n (, , uint256 feesEarned0, uint256 feesEarned1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n _applyFees(feesEarned0, feesEarned1);\\n (feesEarned0, feesEarned1) = _subtractAdminFees(\\n feesEarned0,\\n feesEarned1\\n );\\n emit FeesEarned(feesEarned0, feesEarned1);\\n feesEarned0 += leftover0;\\n feesEarned1 += leftover1;\\n\\n if (paymentToken == address(token0)) {\\n require(\\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0 -\\n feeAmount;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n } else if (paymentToken == address(token1)) {\\n require(\\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1 -\\n feeAmount;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n\\n _deposit(\\n lowerTick,\\n upperTick,\\n leftover0,\\n leftover1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _withdraw(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidity\\n )\\n private\\n returns (\\n uint256 burn0,\\n uint256 burn1,\\n uint256 fee0,\\n uint256 fee1\\n )\\n {\\n uint256 preBalance0 = token0.balanceOf(address(this));\\n uint256 preBalance1 = token1.balanceOf(address(this));\\n\\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\\n\\n pool.collect(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n type(uint128).max,\\n type(uint128).max\\n );\\n\\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _deposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) private {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n // First, deposit as much as we can\\n uint128 baseLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n if (baseLiquidity > 0) {\\n (uint256 amountDeposited0, uint256 amountDeposited1) =\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n baseLiquidity,\\n \\\"\\\"\\n );\\n\\n amount0 -= amountDeposited0;\\n amount1 -= amountDeposited1;\\n }\\n int256 swapAmount =\\n SafeCast.toInt256(\\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\\n );\\n if (swapAmount > 0) {\\n _swapAndDeposit(\\n lowerTick_,\\n upperTick_,\\n amount0,\\n amount1,\\n swapAmount,\\n swapThresholdPrice,\\n zeroForOne\\n );\\n }\\n }\\n\\n function _swapAndDeposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n int256 swapAmount,\\n uint160 swapThresholdPrice,\\n bool zeroForOne\\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\\n (int256 amount0Delta, int256 amount1Delta) =\\n pool.swap(\\n address(this),\\n zeroForOne,\\n swapAmount,\\n swapThresholdPrice,\\n \\\"\\\"\\n );\\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\\n\\n // Add liquidity a second time\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 liquidityAfterSwap =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n finalAmount0,\\n finalAmount1\\n );\\n if (liquidityAfterSwap > 0) {\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n liquidityAfterSwap,\\n \\\"\\\"\\n );\\n }\\n }\\n\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function _computeMintAmounts(\\n uint256 totalSupply,\\n uint256 amount0Max,\\n uint256 amount1Max\\n )\\n private\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n // compute proportional amount of tokens to mint\\n if (amount0Current == 0 && amount1Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount1Max,\\n totalSupply,\\n amount1Current\\n );\\n } else if (amount1Current == 0 && amount0Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount0Max,\\n totalSupply,\\n amount0Current\\n );\\n } else if (amount0Current == 0 && amount1Current == 0) {\\n revert(\\\"\\\");\\n } else {\\n // only if both are non-zero\\n uint256 amount0Mint =\\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\\n uint256 amount1Mint =\\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\\n require(amount0Mint > 0 && amount1Mint > 0, \\\"mint 0\\\");\\n\\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\\n }\\n\\n // compute amounts owed to contract\\n amount0 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount0Current,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount1Current,\\n totalSupply\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _computeFeesEarned(\\n bool isZero,\\n uint256 feeGrowthInsideLast,\\n int24 tick,\\n uint128 liquidity\\n ) private view returns (uint256 fee) {\\n uint256 feeGrowthOutsideLower;\\n uint256 feeGrowthOutsideUpper;\\n uint256 feeGrowthGlobal;\\n if (isZero) {\\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\\n } else {\\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\\n }\\n\\n unchecked {\\n // calculate fee growth below\\n uint256 feeGrowthBelow;\\n if (tick >= lowerTick) {\\n feeGrowthBelow = feeGrowthOutsideLower;\\n } else {\\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\\n }\\n\\n // calculate fee growth above\\n uint256 feeGrowthAbove;\\n if (tick < upperTick) {\\n feeGrowthAbove = feeGrowthOutsideUpper;\\n } else {\\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\\n }\\n\\n uint256 feeGrowthInside =\\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\\n fee = FullMath.mulDiv(\\n liquidity,\\n feeGrowthInside - feeGrowthInsideLast,\\n 0x100000000000000000000000000000000\\n );\\n }\\n }\\n\\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\\n }\\n\\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\\n private\\n view\\n returns (uint256 fee0, uint256 fee1)\\n {\\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n fee0 = rawFee0 - deduct0;\\n fee1 = rawFee1 - deduct1;\\n }\\n\\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\\n private\\n view\\n {\\n uint32[] memory secondsAgo = new uint32[](2);\\n secondsAgo[0] = gelatoSlippageInterval;\\n secondsAgo[1] = 0;\\n\\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\\n\\n require(tickCumulatives.length == 2, \\\"array len\\\");\\n uint160 avgSqrtRatioX96;\\n unchecked {\\n int24 avgTick =\\n int24(\\n (tickCumulatives[1] - tickCumulatives[0]) /\\n int56(uint56(gelatoSlippageInterval))\\n );\\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\\n }\\n\\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\\n if (zeroForOne) {\\n require(\\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\\n \\\"high slippage\\\"\\n );\\n } else {\\n require(\\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\\n \\\"high slippage\\\"\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdd382818c81f34c434bb3d4235ac9ff39034cb68e1b87244837d9250878d9fa0\",\"license\":\"GPL-3.0\"},\"contracts/abstract/GUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {Gelatofied} from \\\"./Gelatofied.sol\\\";\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {\\n ReentrancyGuardUpgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport {\\n ERC20Upgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\n\\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\\n/// @dev ERC20Upgradable Includes Initialize\\n// solhint-disable-next-line max-states-count\\n/// @dev Modified to support 0.8.19\\n/// @dev Modified to set the gelatoFeeBPS to 0\\nabstract contract GUniPoolStorage is\\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\\n ReentrancyGuardUpgradeable,\\n OwnableUninitialized,\\n Gelatofied\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n // solhint-disable-next-line const-name-snakecase\\n uint16 public constant gelatoFeeBPS = 0;\\n\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n int24 public lowerTick;\\n int24 public upperTick;\\n\\n uint16 public gelatoRebalanceBPS;\\n uint16 public gelatoWithdrawBPS;\\n uint16 public gelatoSlippageBPS;\\n uint32 public gelatoSlippageInterval;\\n\\n uint16 public managerFeeBPS;\\n address public managerTreasury;\\n\\n uint256 public managerBalance0;\\n uint256 public managerBalance1;\\n uint256 public gelatoBalance0;\\n uint256 public gelatoBalance1;\\n\\n IUniswapV3Pool public pool;\\n IERC20 public token0;\\n IERC20 public token1;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdateAdminTreasury(\\n address oldAdminTreasury,\\n address newAdminTreasury\\n );\\n\\n event UpdateGelatoParams(\\n uint16 gelatoRebalanceBPS,\\n uint16 gelatoWithdrawBPS,\\n uint16 gelatoSlippageBPS,\\n uint32 gelatoSlippageInterval\\n );\\n\\n event SetManagerFee(uint16 managerFee);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice initialize storage variables on a new G-UNI pool, only called once\\n /// @param _name name of G-UNI token\\n /// @param _symbol symbol of G-UNI token\\n /// @param _pool address of Uniswap V3 pool\\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\\n /// @param _manager_ address of manager (ownership can be transferred)\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external initializer {\\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \\\"mBPS\\\");\\n\\n // these variables are immutable after initialization\\n pool = IUniswapV3Pool(_pool);\\n token0 = IERC20(pool.token0());\\n token1 = IERC20(pool.token1());\\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\\n\\n // these variables can be udpated by the manager\\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\\n gelatoSlippageBPS = 500; // default: 5% slippage\\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\\n managerTreasury = _manager_; // default: treasury is admin\\n lowerTick = _lowerTick;\\n upperTick = _upperTick;\\n _manager = _manager_;\\n\\n // e.g. \\\"Gelato Uniswap V3 USDC/DAI LP\\\" and \\\"G-UNI\\\"\\n __ERC20_init(_name, _symbol);\\n __ReentrancyGuard_init();\\n }\\n\\n /// @notice change configurable parameters, only manager can call\\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\\n /// @param newTreasury address where managerFee withdrawals are sent\\n // solhint-disable-next-line code-complexity\\n function updateGelatoParams(\\n uint16 newRebalanceBPS,\\n uint16 newWithdrawBPS,\\n uint16 newSlippageBPS,\\n uint32 newSlippageInterval,\\n address newTreasury\\n ) external onlyManager {\\n require(newWithdrawBPS <= 10000, \\\"BPS\\\");\\n require(newRebalanceBPS <= 10000, \\\"BPS\\\");\\n require(newSlippageBPS <= 10000, \\\"BPS\\\");\\n emit UpdateGelatoParams(\\n newRebalanceBPS,\\n newWithdrawBPS,\\n newSlippageBPS,\\n newSlippageInterval\\n );\\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\\n if (newSlippageInterval != 0)\\n gelatoSlippageInterval = newSlippageInterval;\\n if (newTreasury != address(0)) managerTreasury = newTreasury;\\n }\\n\\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\\n /// If a manager fee was not set in the initialize function it can be set here\\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\\n require(managerFeeBPS == 0, \\\"fee\\\");\\n require(\\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\\n \\\"mBPS\\\"\\n );\\n emit SetManagerFee(_managerFeeBPS);\\n managerFeeBPS = _managerFeeBPS;\\n }\\n\\n function renounceOwnership() public virtual override onlyManager {\\n managerTreasury = address(0);\\n managerFeeBPS = 0;\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n super.renounceOwnership();\\n }\\n\\n function getPositionID() external view returns (bytes32 positionID) {\\n return _getPositionID();\\n }\\n\\n function _getPositionID() internal view returns (bytes32 positionID) {\\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\\n }\\n}\\n\",\"keccak256\":\"0xd1ad805a13c7cd73554b1e3cc3735f3f369d759f8e0b9188977b85295456d033\",\"license\":\"GPL-3.0\"},\"contracts/abstract/Gelatofied.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract Gelatofied {\\n using Address for address payable;\\n using SafeERC20 for IERC20;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n address payable public immutable GELATO;\\n\\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n constructor(address payable _gelato) {\\n GELATO = _gelato;\\n }\\n\\n modifier gelatofy(uint256 _amount, address _paymentToken) {\\n require(msg.sender == GELATO, \\\"Gelatofied: Only gelato\\\");\\n _;\\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x264bc07e6e1b80c454c311ecf4b56afe245ddde31151ed9bcc4cb9ad25bec46a\",\"license\":\"GPL-3.0\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xb6016d5611f38fbd516a84ea2e56794cb76a8d61c40f6716d5f0133f195759bd\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/FullMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.4;\\n\\n/// @title Contains 512-bit math functions\\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\\n/// @dev Handles \\\"phantom overflow\\\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\\nlibrary FullMath {\\n /// @notice Calculates floor(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\\n function mulDiv(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = a * b\\n // Compute the product mod 2**256 and mod 2**256 - 1\\n // then use the Chinese Remainder Theorem to reconstruct\\n // the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2**256 + prod0\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(a, b, not(0))\\n prod0 := mul(a, b)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division\\n if (prod1 == 0) {\\n require(denominator > 0);\\n assembly {\\n result := div(prod0, denominator)\\n }\\n return result;\\n }\\n\\n // Make sure the result is less than 2**256.\\n // Also prevents denominator == 0\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0]\\n // Compute remainder using mulmod\\n uint256 remainder;\\n assembly {\\n remainder := mulmod(a, b, denominator)\\n }\\n // Subtract 256 bit number from 512 bit number\\n assembly {\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator\\n // Compute largest power of two divisor of denominator.\\n // Always >= 1.\\n // EDIT for 0.8 compatibility:\\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\\n uint256 twos = denominator & (~denominator + 1);\\n\\n // Divide denominator by power of two\\n assembly {\\n denominator := div(denominator, twos)\\n }\\n\\n // Divide [prod1 prod0] by the factors of two\\n assembly {\\n prod0 := div(prod0, twos)\\n }\\n // Shift in bits from prod1 into prod0. For this we need\\n // to flip `twos` such that it is 2**256 / twos.\\n // If twos is zero, then it becomes one\\n assembly {\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2**256\\n // Now that denominator is an odd number, it has an inverse\\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\\n // Compute the inverse by starting with a seed that is correct\\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\\n uint256 inv = (3 * denominator) ^ 2;\\n // Now use Newton-Raphson iteration to improve the precision.\\n // Thanks to Hensel's lifting lemma, this also works in modular\\n // arithmetic, doubling the correct bits in each step.\\n inv *= 2 - denominator * inv; // inverse mod 2**8\\n inv *= 2 - denominator * inv; // inverse mod 2**16\\n inv *= 2 - denominator * inv; // inverse mod 2**32\\n inv *= 2 - denominator * inv; // inverse mod 2**64\\n inv *= 2 - denominator * inv; // inverse mod 2**128\\n inv *= 2 - denominator * inv; // inverse mod 2**256\\n\\n // Because the division is now exact we can divide by multiplying\\n // with the modular inverse of denominator. This will give us the\\n // correct result modulo 2**256. Since the precoditions guarantee\\n // that the outcome is less than 2**256, this is the final result.\\n // We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inv;\\n return result;\\n }\\n }\\n\\n /// @notice Calculates ceil(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n function mulDivRoundingUp(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n result = mulDiv(a, b, denominator);\\n if (mulmod(a, b, denominator) > 0) {\\n require(result < type(uint256).max);\\n result++;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3fa0efa3eea2a84bd6ab7e55badd61f97069a6c50780059b036c810427a9740c\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/LiquidityAmounts.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.5.0;\\n\\nimport {FullMath} from \\\"./FullMath.sol\\\";\\nimport \\\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\\\";\\n\\n/// @title Liquidity amount functions\\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\\nlibrary LiquidityAmounts {\\n function toUint128(uint256 x) private pure returns (uint128 y) {\\n require((y = uint128(x)) == x);\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount0 The amount0 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount0(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n uint256 intermediate =\\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount0,\\n intermediate,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount1 The amount1 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount1(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount1,\\n FixedPoint96.Q96,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\\n /// pool prices and the prices at the tick boundaries\\n function getLiquidityForAmounts(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n liquidity = getLiquidityForAmount0(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount0\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n uint128 liquidity0 =\\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\\n uint128 liquidity1 =\\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\\n\\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\\n } else {\\n liquidity = getLiquidityForAmount1(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount1\\n );\\n }\\n }\\n\\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount0 The amount0\\n function getAmount0ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n uint256(liquidity) << FixedPoint96.RESOLUTION,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n sqrtRatioBX96\\n ) / sqrtRatioAX96;\\n }\\n\\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount1 The amount1\\n function getAmount1ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n liquidity,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n FixedPoint96.Q96\\n );\\n }\\n\\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\\n /// pool prices and the prices at the tick boundaries\\n function getAmountsForLiquidity(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0, uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioX96,\\n liquidity\\n );\\n } else {\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x6205f6409d42fc9565530d2a69819bf8c4e4c66b7a4c61d0827e81c084df6832\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/TickMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\n/// prices between 2**-128 and 2**128\\nlibrary TickMath {\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\n int24 internal constant MIN_TICK = -887272;\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\n int24 internal constant MAX_TICK = -MIN_TICK;\\n\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\n uint160 internal constant MAX_SQRT_RATIO =\\n 1461446703485210103287273052203988822378723970342;\\n\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\n /// @dev Throws if |tick| > max tick\\n /// @param tick The input tick for the above formula\\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\n /// at the given tick\\n function getSqrtRatioAtTick(int24 tick)\\n internal\\n pure\\n returns (uint160 sqrtPriceX96)\\n {\\n uint256 absTick =\\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\\n\\n // EDIT: 0.8 compatibility\\n require(absTick <= uint256(int256(MAX_TICK)), \\\"T\\\");\\n\\n uint256 ratio =\\n absTick & 0x1 != 0\\n ? 0xfffcb933bd6fad37aa2d162d1a594001\\n : 0x100000000000000000000000000000000;\\n if (absTick & 0x2 != 0)\\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\\n if (absTick & 0x4 != 0)\\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\\n if (absTick & 0x8 != 0)\\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\\n if (absTick & 0x10 != 0)\\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\\n if (absTick & 0x20 != 0)\\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\\n if (absTick & 0x40 != 0)\\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\\n if (absTick & 0x80 != 0)\\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\\n if (absTick & 0x100 != 0)\\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\\n if (absTick & 0x200 != 0)\\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\\n if (absTick & 0x400 != 0)\\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\\n if (absTick & 0x800 != 0)\\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\\n if (absTick & 0x1000 != 0)\\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\\n if (absTick & 0x2000 != 0)\\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\\n if (absTick & 0x4000 != 0)\\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\\n if (absTick & 0x8000 != 0)\\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\\n if (absTick & 0x10000 != 0)\\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\\n if (absTick & 0x20000 != 0)\\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\\n if (absTick & 0x40000 != 0)\\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\\n if (absTick & 0x80000 != 0)\\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\\n\\n if (tick > 0) ratio = type(uint256).max / ratio;\\n\\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\n sqrtPriceX96 = uint160(\\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\\n );\\n }\\n\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\n /// ever return.\\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\\n internal\\n pure\\n returns (int24 tick)\\n {\\n // second inequality must be < because the price can never reach the price at the max tick\\n require(\\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\\n \\\"R\\\"\\n );\\n uint256 ratio = uint256(sqrtPriceX96) << 32;\\n\\n uint256 r = ratio;\\n uint256 msb = 0;\\n\\n assembly {\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(4, gt(r, 0xFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(3, gt(r, 0xFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(2, gt(r, 0xF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(1, gt(r, 0x3))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := gt(r, 0x1)\\n msb := or(msb, f)\\n }\\n\\n if (msb >= 128) r = ratio >> (msb - 127);\\n else r = ratio << (127 - msb);\\n\\n int256 log_2 = (int256(msb) - 128) << 64;\\n\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(63, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(62, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(61, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(60, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(59, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(58, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(57, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(56, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(55, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(54, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(53, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(52, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(51, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(50, f))\\n }\\n\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\n\\n int24 tickLow =\\n int24(\\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\\n );\\n int24 tickHi =\\n int24(\\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\\n );\\n\\n tick = tickLow == tickHi\\n ? tickLow\\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\\n ? tickHi\\n : tickLow;\\n }\\n}\\n\",\"keccak256\":\"0x589b6104fd07d2e56e5b52edcfa53e6e47e2c38cace38025c16278ca73413f2d\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b5060405162005e0e38038062005e0e833981016040819052620000349162000046565b6001600160a01b031660805262000078565b6000602082840312156200005957600080fd5b81516001600160a01b03811681146200007157600080fd5b9392505050565b608051615d3b620000d3600039600081816105f801528181610ce301528181610dcc01528181610e06015281816114a7015281816116d50152818161170f015281816117e20152818161185901526118960152615d3b6000f3fe608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190614dc5565b61026e610269366004614e0d565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d9190614e39565b6102a66106fc565b60405161023d929190614e4d565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004614e5b565b610796565b6102f56102f0366004614eb9565b61084e565b005b6102ff600081565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004614e0d565b610c3a565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610c71565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b1366004614f21565b6001600160a01b031660009081526033602052604090205490565b6102f5610c80565b6097546103e890600160b81b900460020b81565b60405161023d9190614f3e565b6102f5610403366004614f4c565b610cd6565b61041b610416366004614f4c565b610e31565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e6110ea565b61045a610455366004614f7c565b6110f9565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004614fc0565b611232565b6097546103e890600160a01b900460020b81565b61026e6104aa366004614e0d565b6113f2565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004614e0d565b61148d565b6102f56104e5366004615023565b61149a565b610233609b5481565b6102a6610501366004614f21565b61173d565b6102f5610514366004614f4c565b6117d5565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046150bc565b6118bb565b6097546102ff90600160f01b900461ffff1681565b61023361059a36600461510e565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b61023361191f565b6102f56105db3660046151f1565b61192e565b6102f56105ee3660046152b3565b611ba3565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f5610628366004614f21565b611cb0565b6102f561063b3660046150bc565b611d90565b61041b61064e366004614f4c565b611dfa565b606060368054610662906152d0565b80601f016020809104026020016040519081016040528092919081815260200182805461068e906152d0565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f2338484612114565b5060015b92915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610779919061530a565b50505050509150915061078c8282612239565b9350935050509091565b60006107a38484846124b9565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561082d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610841853361083c86856153b2565b612114565b60019150505b9392505050565b33610857610c71565b6001600160a01b03161461087d5760405162461bcd60e51b8152600401610824906153c5565b600080600061088b60355490565b1115610bca57609d546001600160a01b031663514ea4bf6108aa61267f565b6040518263ffffffff1660e01b81526004016108c891815260200190565b60a060405180830381865afa1580156108e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610909919061541e565b5092945050506001600160801b03831615905061099257609754600090819061094890600160a01b8104600290810b91600160b81b9004900b866126da565b9350935050506109588282612a0d565b6109628282612ae6565b6040519193509150600080516020615ce6833981519152906109879084908490614e4d565b60405180910390a150505b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a06903090600401614e39565b602060405180830381865afa158015610a23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a479190615475565b610a5191906153b2565b610a5b91906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610a97903090600401614e39565b602060405180830381865afa158015610ab4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad89190615475565b610ae291906153b2565b610aec91906153b2565b9050610afd898984848b8b8b612b80565b609d546001600160a01b031663514ea4bf610b1661267f565b6040518263ffffffff1660e01b8152600401610b3491815260200190565b60a060405180830381865afa158015610b51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b75919061541e565b509295505050506001600160801b038316610bc35760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610824565b5050610c06565b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615c8683398151915287878484604051610c29949392919061548e565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061083c9086906154bc565b6097546001600160a01b031690565b33610c89610c71565b6001600160a01b031614610caf5760405162461bcd60e51b8152600401610824906153c5565b60988054600160201b600160d01b031916905560006099819055609a55610cd4612d21565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d205760405162461bcd60e51b8152600401610824906154cf565b600080610d33609954609a548888612d88565b60006099819055609a5590925090508115610d6d57609854609e54610d6d916001600160a01b0391821691600160301b9091041684612eac565b8015610d9857609854609f54610d98916001600160a01b0391821691600160301b9091041683612eac565b505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601610df757610df26001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b610e2b565b610e2b6001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050565b6000806000600260655403610e585760405162461bcd60e51b815260040161082490615500565b600260655584610e7a5760405162461bcd60e51b815260040161082490615537565b6000610e8560355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610edc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f00919061530a565b50505050505090506000821115610f4157600080610f1c6106fc565b91509150610f2b828a8661302a565b9650610f38818a8661302a565b95505050610f87565b609754610f81908290610f5d90600160a01b900460020b613073565b609754610f7390600160b81b900460020b613073565b610f7c8b613488565b6134f1565b90955093505b8415610fa557609e54610fa5906001600160a01b031633308861358c565b8315610fc357609f54610fc3906001600160a01b031633308761358c565b609754610ffc908290610fdf90600160a01b900460020b613073565b609754610ff590600160b81b900460020b613073565b88886135c4565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d9161104c913091600160a01b8104600290810b92600160b81b909204900b908990600401615557565b60408051808303816000875af115801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190615599565b505061109a8688613686565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e786888787876040516110d19594939291906155bd565b60405180910390a1505060016065819055509250925092565b606060378054610662906152d0565b60008060008061110860355490565b905080156111275761111b818787613753565b9195509350915061122a565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611195919061530a565b505050505050905060006111db826111be609760149054906101000a900460020b60020b613073565b6097546111d490600160b81b900460020b613073565b8b8b6135c4565b6097546001600160801b038216955090915061122290839061120690600160a01b900460020b613073565b60975461121c90600160b81b900460020b613073565b846134f1565b909650945050505b509250925092565b3361123b610c71565b6001600160a01b0316146112615760405162461bcd60e51b8152600401610824906153c5565b6127108461ffff1611156112875760405162461bcd60e51b8152600401610824906155f4565b6127108561ffff1611156112ad5760405162461bcd60e51b8152600401610824906155f4565b6127108361ffff1611156112d35760405162461bcd60e51b8152600401610824906155f4565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff85161561134a576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff84161561136f576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561139557609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff8216156113b7576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156113eb5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156114745760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610824565b611483338561083c86856153b2565b5060019392505050565b60006106f23384846124b9565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114e45760405162461bcd60e51b8152600401610824906154cf565b85156114f4576114f48786613862565b609d546000906001600160a01b031663514ea4bf61151061267f565b6040518263ffffffff1660e01b815260040161152e91815260200190565b60a060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f919061541e565b505050509050611583818989898989613abb565b609d546000906001600160a01b031663514ea4bf61159f61267f565b6040518263ffffffff1660e01b81526004016115bd91815260200190565b60a060405180830381865afa1580156115da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fe919061541e565b505050509050816001600160801b0316816001600160801b03161161165f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610824565b609754604051600080516020615c868339815191529161169991600160a01b8204600290810b92600160b81b9004900b908690869061548e565b60405180910390a1505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601611700576116fb6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b611734565b6117346001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b9919061530a565b50505050509150506117cb8482612239565b9250925050915091565b8181336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461181f5760405162461bcd60e51b8152600401610824906154cf565b600080611832609b54609c548888612d88565b6000609b819055609c559092509050811561187e57609e5461187e906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084612eac565b8015610d9857609f54610d98906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083612eac565b609d546001600160a01b031633146118e55760405162461bcd60e51b815260040161082490615611565b831561190257609e54611902906001600160a01b03163386612eac565b8215610e2b57609f54610e2b906001600160a01b03163385612eac565b600061192961267f565b905090565b600054610100900460ff1680611947575060005460ff16155b6119635760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015611985576000805461ffff19166101011790555b6119926000612710615688565b61ffff168561ffff1611156119b95760405162461bcd60e51b8152600401610824906156aa565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe1681916004808201926020929091908290030181865afa158015611a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3691906156c8565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a79160048083019260209291908290030181865afa158015611a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab891906156c8565b609f80546001600160a01b039283166001600160a01b0319918216179091556098805460978054948716600160301b8102600160301b600160d01b031963ffffffff1961ffff8e16600160201b021665ffffffffffff199095169490941761012c17939093169290921790925562ffffff878116600160b81b02909316600165ffffff00000160a01b0319938916600160a01b02600165ffffff00000160a01b0390951694909417643e800c801960d31b179290921692909217179055611b7f8888613f83565b611b87614002565b8015611b99576000805461ff00191690555b5050505050505050565b33611bac610c71565b6001600160a01b031614611bd25760405162461bcd60e51b8152600401610824906153c5565b609854600160201b900461ffff1615611c135760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610824565b60008161ffff16118015611c3b5750611c2f6000612710615688565b61ffff168161ffff1611155b611c575760405162461bcd60e51b8152600401610824906156aa565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611cb9610c71565b6001600160a01b031614611cdf5760405162461bcd60e51b8152600401610824906153c5565b6001600160a01b038116611d465760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610824565b6097546040516001600160a01b03808416921690600080516020615ca683398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611dba5760405162461bcd60e51b815260040161082490615611565b6000841315611dda57609e54610df2906001600160a01b03163386612eac565b6000831315610e2b57609f54610e2b906001600160a01b03163385612eac565b6000806000600260655403611e215760405162461bcd60e51b815260040161082490615500565b600260655584611e5c5760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610824565b6000611e6760355490565b609d549091506000906001600160a01b031663514ea4bf611e8661267f565b6040518263ffffffff1660e01b8152600401611ea491815260200190565b60a060405180830381865afa158015611ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee5919061541e565b505050509050611ef53388614076565b6000611f0b88836001600160801b0316856141b3565b9050611f1681613488565b609754909450600090819081908190611f4590600160a01b8104600290810b91600160b81b9004900b8a6126da565b9350935093509350611f578282612a0d565b611f618282612ae6565b6040519193509150600080516020615ce683398151915290611f869084908490614e4d565b60405180910390a1609b54609954609e546040516370a0823160e01b815261203293929188916001600160a01b03909116906370a0823190611fcc903090600401614e39565b602060405180830381865afa158015611fe9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200d9190615475565b61201791906153b2565b61202191906153b2565b61202b91906153b2565b8d896141b3565b61203c90856154bc565b609c54609a54609f546040516370a0823160e01b8152939d506120799387916001600160a01b0316906370a0823190611fcc903090600401614e39565b61208390846154bc565b985089156120a257609e546120a2906001600160a01b03168c8c612eac565b88156120bf57609f546120bf906001600160a01b03168c8b612eac565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516120f69594939291906155bd565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166121765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610824565b6001600160a01b0382166121d75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610824565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61226161267f565b6040518263ffffffff1660e01b815260040161227f91815260200190565b60a060405180830381865afa15801561229c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c0919061541e565b94509450945094509450612305896122e9609760149054906101000a900460020b60020b613073565b6097546122ff90600160b81b900460020b613073565b886134f1565b909750955060006001600160801b0383166123236001878c8a614261565b61232d91906154bc565b90506000826001600160801b03166123486000878d8b614261565b61235291906154bc565b905061235e8282612ae6565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a082319061239c903090600401614e39565b602060405180830381865afa1580156123b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dd9190615475565b6123e790856154bc565b6123f191906153b2565b6123fb91906153b2565b612405908a6154bc565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a0823190612440903090600401614e39565b602060405180830381865afa15801561245d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124819190615475565b61248b90846154bc565b61249591906153b2565b61249f91906153b2565b6124a990896154bc565b9750505050505050509250929050565b6001600160a01b03831661251d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610824565b6001600160a01b03821661257f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610824565b6001600160a01b038316600090815260336020526040902054818110156125f75760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610824565b61260182826153b2565b6001600160a01b0380861660009081526033602052604080822093909355908516815290812080548492906126379084906154bc565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615cc68339815191528460405161267191815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b820460e890811b6034830152600160b81b90920490911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a0823190612713903090600401614e39565b602060405180830381865afa158015612730573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127549190615475565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061278a903090600401614e39565b602060405180830381865afa1580156127a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cb9190615475565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a79060640160408051808303816000875af1158015612830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128549190615599565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a40160408051808303816000875af11580156128c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128eb91906156e5565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612921903090600401614e39565b602060405180830381865afa15801561293e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129629190615475565b61296c91906153b2565b61297691906153b2565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a08231906129ab903090600401614e39565b602060405180830381865afa1580156129c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ec9190615475565b6129f691906153b2565b612a0091906153b2565b9250505093509350935093565b612710612a1b600084615718565b612a259190615745565b609b6000828254612a3691906154bc565b909155506127109050612a4a600083615718565b612a549190615745565b609c6000828254612a6591906154bc565b909155505060985461271090612a8690600160201b900461ffff1684615718565b612a909190615745565b60996000828254612aa191906154bc565b909155505060985461271090612ac290600160201b900461ffff1683615718565b612acc9190615745565b609a6000828254612add91906154bc565b90915550505050565b6000806000612710609860049054906101000a900461ffff166000612b0b9190615759565b612b199061ffff1687615718565b612b239190615745565b60985490915060009061271090612b4590600160201b900461ffff1683615759565b612b539061ffff1687615718565b612b5d9190615745565b9050612b6982876153b2565b9350612b7581866153b2565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015612bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bee919061530a565b50505050505090506000612c1b82612c088b60020b613073565b612c148b60020b613073565b8a8a6135c4565b90506001600160801b03811615612cc957609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612c679030908f908f908990600401615557565b60408051808303816000875af1158015612c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ca99190615599565b9092509050612cb8828a6153b2565b9850612cc481896153b2565b975050505b6000612cf86127108686612cdd5789612cdf565b8a5b612ce99190615718565b612cf39190615745565b61460d565b90506000811315612d1557612d128a8a8a8a858b8a614673565b50505b50505050505050505050565b33612d2a610c71565b6001600160a01b031614612d505760405162461bcd60e51b8152600401610824906153c5565b6097546040516000916001600160a01b031690600080516020615ca6833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0390811690841603612dfd57609754849061271090612dc190600160e01b900461ffff1689615718565b612dcb9190615745565b1015612de95760405162461bcd60e51b815260040161082490615774565b612df384876153b2565b9150849050612ea3565b609f546001600160a01b0390811690841603612e6d57609754849061271090612e3190600160e01b900461ffff1688615718565b612e3b9190615745565b1015612e595760405162461bcd60e51b815260040161082490615774565b612e6384866153b2565b9050859150612ea3565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610824565b94509492505050565b6040516001600160a01b038316602482015260448101829052612f0f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261488f565b505050565b80471015612f645760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610824565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612fb1576040519150601f19603f3d011682016040523d82523d6000602084013e612fb6565b606091505b5050905080612f0f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610824565b60006130378484846141b3565b9050600082806130495761304961572f565b848609111561084757600019811061306057600080fd5b8061306a81615796565b95945050505050565b60008060008360020b1261308a578260020b613097565b8260020b613097906157af565b90506130a6620d89e7196157cb565b60020b8111156130dc5760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610824565b6000816001166000036130f357600160801b613105565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561313a576080613135826ffff97272373d413259a46990580e213a615718565b901c90505b600482161561316457608061315f826ffff2e50f5f656932ef12357cf3c7fdcc615718565b901c90505b600882161561318e576080613189826fffe5caca7e10e4e61c3624eaa0941cd0615718565b901c90505b60108216156131b85760806131b3826fffcb9843d60f6159c9db58835c926644615718565b901c90505b60208216156131e25760806131dd826fff973b41fa98c081472e6896dfb254c0615718565b901c90505b604082161561320c576080613207826fff2ea16466c96a3843ec78b326b52861615718565b901c90505b6080821615613236576080613231826ffe5dee046a99a2a811c461f1969c3053615718565b901c90505b61010082161561326157608061325c826ffcbe86c7900a88aedcffc83b479aa3a4615718565b901c90505b61020082161561328c576080613287826ff987a7253ac413176f2b074cf7815e54615718565b901c90505b6104008216156132b75760806132b2826ff3392b0822b70005940c7a398e4b70f3615718565b901c90505b6108008216156132e25760806132dd826fe7159475a2c29b7443b29c7fa6e889d9615718565b901c90505b61100082161561330d576080613308826fd097f3bdfd2022b8845ad8f792aa5825615718565b901c90505b612000821615613338576080613333826fa9f746462d870fdf8a65dc1f90e061e5615718565b901c90505b61400082161561336357608061335e826f70d869a156d2a1b890bb3df62baf32f7615718565b901c90505b61800082161561338e576080613389826f31be135f97d08fd981231505542fcfa6615718565b901c90505b620100008216156133ba5760806133b5826f09aa508b5b7a84e1c677de54f3e99bc9615718565b901c90505b620200008216156133e55760806133e0826e5d6af8dedb81196699c329225ee604615718565b901c90505b6204000082161561340f57608061340a826d2216e584f5fa1ea926041bedfe98615718565b901c90505b62080000821615613437576080613432826b048a170391f7dc42444e8fa2615718565b901c90505b60008460020b13156134525761344f81600019615745565b90505b613460600160201b826157ed565b1561346c57600161346f565b60005b6134809060ff16602083901c6154bc565b949350505050565b6000600160801b82106134ed5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610824565b5090565b600080836001600160a01b0316856001600160a01b03161115613512579293925b846001600160a01b0316866001600160a01b03161161353d57613536858585614961565b9150612ea3565b836001600160a01b0316866001600160a01b0316101561357657613562868585614961565b915061356f8587856149cb565b9050612ea3565b6135818585856149cb565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e2b9085906323b872dd60e01b90608401612ed8565b6000836001600160a01b0316856001600160a01b031611156135e4579293925b846001600160a01b0316866001600160a01b03161161360f57613608858585614a15565b905061306a565b836001600160a01b0316866001600160a01b03161015613671576000613636878686614a15565b90506000613645878986614a7f565b9050806001600160801b0316826001600160801b0316106136665780613668565b815b9250505061306a565b61367c858584614a7f565b9695505050505050565b6001600160a01b0382166136dc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610824565b80603560008282546136ee91906154bc565b90915550506001600160a01b0382166000908152603360205260408120805483929061371b9084906154bc565b90915550506040518181526001600160a01b03831690600090600080516020615cc68339815191529060200160405180910390a35050565b60008060008060006137636106fc565b915091508160001480156137775750600081115b1561378e576137878689836141b3565b925061383d565b8015801561379c5750600082115b156137ac576137878789846141b3565b811580156137b8575080155b156137df5760405162461bcd60e51b81526020600482015260006024820152604401610824565b60006137ec888a856141b3565b905060006137fb888b856141b3565b905060008211801561380d5750600081115b6138295760405162461bcd60e51b815260040161082490615537565b8082106138365780613838565b815b945050505b61384883838a61302a565b945061385583828a61302a565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff16918391506000906138a0576138a0615801565b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106138cf576138cf615801565b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613915908590600401615817565b600060405180830381865afa158015613932573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261395a919081019061590a565b509050805160021461399a5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610824565b6098548151600091829163ffffffff90911660060b90849083906139c0576139c0615801565b6020026020010151846001815181106139db576139db615801565b60200260200101510360060b816139f4576139f461572f565b059050613a038160020b613073565b6097549092506000915061271090613a2690600160f01b900461ffff16846159cc565b613a3091906159fe565b90508415613a7857613a428183615a24565b6001600160a01b0316866001600160a01b03161015613a735760405162461bcd60e51b815260040161082490615a44565b613ab3565b613a828183615a6b565b6001600160a01b0316866001600160a01b03161115613ab35760405162461bcd60e51b815260040161082490615a44565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613af4903090600401614e39565b602060405180830381865afa158015613b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b359190615475565b613b3f91906153b2565b613b4991906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613b85903090600401614e39565b602060405180830381865afa158015613ba2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bc69190615475565b613bd091906153b2565b613bda91906153b2565b6097549091506000908190613c0590600160a01b8104600290810b91600160b81b9004900b8c6126da565b935093505050613c158282612a0d565b613c1f8282612ae6565b6040519193509150600080516020615ce683398151915290613c449084908490614e4d565b60405180910390a1613c5684836154bc565b9150613c6283826154bc565b609e549091506001600160a01b0390811690861603613def57609754869061271090613c9990600160d01b900461ffff1685615718565b613ca39190615745565b1015613cc15760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613cf9903090600401614e39565b602060405180830381865afa158015613d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d3a9190615475565b613d4491906153b2565b613d4e91906153b2565b613d5891906153b2565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613d93903090600401614e39565b602060405180830381865afa158015613db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dd49190615475565b613dde91906153b2565b613de891906153b2565b9250613f5c565b609f546001600160a01b0390811690861603612e6d57609754869061271090613e2390600160d01b900461ffff1684615718565b613e2d9190615745565b1015613e4b5760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a0823190613e81903090600401614e39565b602060405180830381865afa158015613e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ec29190615475565b613ecc91906153b2565b613ed691906153b2565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a0823190613f11903090600401614e39565b602060405180830381865afa158015613f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f529190615475565b613dd491906153b2565b609754612d1590600160a01b8104600290810b91600160b81b9004900b86868d8d8d612b80565b600054610100900460ff1680613f9c575060005460ff16155b613fb85760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015613fda576000805461ffff19166101011790555b613fe2614ab5565b613fec8383614b1f565b8015612f0f576000805461ff0019169055505050565b600054610100900460ff168061401b575060005460ff16155b6140375760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614059576000805461ffff19166101011790555b614061614ba6565b8015614073576000805461ff00191690555b50565b6001600160a01b0382166140d65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610824565b6001600160a01b0382166000908152603360205260409020548181101561414a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610824565b61415482826153b2565b6001600160a01b038416600090815260336020526040812091909155603580548492906141829084906153b2565b90915550506040518281526000906001600160a01b03851690600080516020615cc68339815191529060200161222c565b60008080600019858709858702925082811083820303915050806000036141ec57600084116141e157600080fd5b508290049050610847565b8084116141f857600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600080871561440157609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b8152600401602060405180830381865afa1580156142c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142e49190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161432491600160a01b90910460020b90600401614f3e565b61010060405180830381865afa158015614342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143669190615a8b565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba9395506143af94600160b81b90910460020b93506004019150614f3e9050565b61010060405180830381865afa1580156143cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143f19190615a8b565b5093975061458f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b8152600401602060405180830381865afa158015614454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144789190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916144b891600160a01b90910460020b90600401614f3e565b61010060405180830381865afa1580156144d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144fa9190615a8b565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506145429450600160b81b900460020b926004019150614f3e9050565b61010060405180830381865afa158015614560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145849190615a8b565b509297505050505050505b609754600090600160a01b9004600290810b9088900b126145b15750826145b6565b508281035b609754600090600160b81b9004600290810b9089900b12156145d95750826145de565b508282035b8183038190036145fe6001600160801b0389168b8303600160801b6141b3565b9b9a5050505050505050505050565b6000600160ff1b82106134ed5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610824565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c40160408051808303816000875af11580156146e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061470c9190615599565b915091508161471a8a61460d565b6147249190615b27565b9350806147308961460d565b61473a9190615b27565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015614791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b5919061530a565b505050505050905060006147e2826147cf8f60020b613073565b6147db8f60020b613073565b89896135c4565b90506001600160801b0381161561487f57609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b815260040161483a9493929190615557565b60408051808303816000875af1158015614858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061487c9190615599565b50505b5050505097509795505050505050565b60006148e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c169092919063ffffffff16565b805190915015612f0f57808060200190518101906149029190615b47565b612f0f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610824565b6000826001600160a01b0316846001600160a01b03161115614981579192915b6001600160a01b0384166149c1600160601b600160e01b03606085901b166149a98787615a24565b6001600160a01b0316866001600160a01b03166141b3565b6134809190615745565b6000826001600160a01b0316846001600160a01b031611156149eb579192915b6134806001600160801b038316614a028686615a24565b6001600160a01b0316600160601b6141b3565b6000826001600160a01b0316846001600160a01b03161115614a35579192915b6000614a58856001600160a01b0316856001600160a01b0316600160601b6141b3565b905061306a614a7a8483614a6c8989615a24565b6001600160a01b03166141b3565b614c25565b6000826001600160a01b0316846001600160a01b03161115614a9f579192915b613480614a7a83600160601b614a6c8888615a24565b600054610100900460ff1680614ace575060005460ff16155b614aea5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614061576000805461ffff19166101011790558015614073576000805461ff001916905550565b600054610100900460ff1680614b38575060005460ff16155b614b545760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614b76576000805461ffff19166101011790555b6036614b828482615baa565b506037614b8f8382615baa565b508015612f0f576000805461ff0019169055505050565b600054610100900460ff1680614bbf575060005460ff16155b614bdb5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614bfd576000805461ffff19166101011790555b60016065558015614073576000805461ff001916905550565b60606134808484600085614c40565b806001600160801b0381168114614c3b57600080fd5b919050565b606082471015614ca15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610824565b843b614cef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610824565b600080866001600160a01b03168587604051614d0b9190615c69565b60006040518083038185875af1925050503d8060008114614d48576040519150601f19603f3d011682016040523d82523d6000602084013e614d4d565b606091505b5091509150614d5d828286614d68565b979650505050505050565b60608315614d77575081610847565b825115614d875782518084602001fd5b8160405162461bcd60e51b81526004016108249190614dc5565b60005b83811015614dbc578181015183820152602001614da4565b50506000910152565b6020815260008251806020840152614de4816040850160208701614da1565b601f01601f19169190910160400192915050565b6001600160a01b038116811461407357600080fd5b60008060408385031215614e2057600080fd5b8235614e2b81614df8565b946020939093013593505050565b6001600160a01b0391909116815260200190565b918252602082015260400190565b600080600060608486031215614e7057600080fd5b8335614e7b81614df8565b92506020840135614e8b81614df8565b929592945050506040919091013590565b8060020b811461407357600080fd5b801515811461407357600080fd5b600080600080600060a08688031215614ed157600080fd5b8535614edc81614e9c565b94506020860135614eec81614e9c565b93506040860135614efc81614df8565b9250606086013591506080860135614f1381614eab565b809150509295509295909350565b600060208284031215614f3357600080fd5b813561084781614df8565b60029190910b815260200190565b60008060408385031215614f5f57600080fd5b823591506020830135614f7181614df8565b809150509250929050565b60008060408385031215614f8f57600080fd5b50508035926020909101359150565b61ffff8116811461407357600080fd5b63ffffffff8116811461407357600080fd5b600080600080600060a08688031215614fd857600080fd5b8535614fe381614f9e565b94506020860135614ff381614f9e565b9350604086013561500381614f9e565b9250606086013561501381614fae565b91506080860135614f1381614df8565b600080600080600060a0868803121561503b57600080fd5b853561504681614df8565b945060208601359350604086013561505d81614eab565b9250606086013591506080860135614f1381614df8565b60008083601f84011261508657600080fd5b5081356001600160401b0381111561509d57600080fd5b6020830191508360208285010111156150b557600080fd5b9250929050565b600080600080606085870312156150d257600080fd5b843593506020850135925060408501356001600160401b038111156150f657600080fd5b61510287828801615074565b95989497509550505050565b6000806040838503121561512157600080fd5b823561512c81614df8565b91506020830135614f7181614df8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561517a5761517a61513c565b604052919050565b600082601f83011261519357600080fd5b81356001600160401b038111156151ac576151ac61513c565b6151bf601f8201601f1916602001615152565b8181528460208386010111156151d457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060e0888a03121561520c57600080fd5b87356001600160401b038082111561522357600080fd5b61522f8b838c01615182565b985060208a013591508082111561524557600080fd5b506152528a828b01615182565b965050604088013561526381614df8565b9450606088013561527381614f9e565b9350608088013561528381614e9c565b925060a088013561529381614e9c565b915060c08801356152a381614df8565b8091505092959891949750929550565b6000602082840312156152c557600080fd5b813561084781614f9e565b600181811c908216806152e457607f821691505b60208210810361530457634e487b7160e01b600052602260045260246000fd5b50919050565b600080600080600080600060e0888a03121561532557600080fd5b875161533081614df8565b602089015190975061534181614e9c565b604089015190965061535281614f9e565b606089015190955061536381614f9e565b608089015190945061537481614f9e565b60a089015190935060ff8116811461538b57600080fd5b60c08901519092506152a381614eab565b634e487b7160e01b600052601160045260246000fd5b818103818111156106f6576106f661539c565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b80516001600160801b0381168114614c3b57600080fd5b600080600080600060a0868803121561543657600080fd5b61543f86615407565b9450602086015193506040860151925061545b60608701615407565b915061546960808701615407565b90509295509295909350565b60006020828403121561548757600080fd5b5051919050565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b808201808211156106f6576106f661539c565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b600080604083850312156155ac57600080fd5b505080516020909101519092909150565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b60208082526003908201526242505360e81b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b61ffff8281168282160390808211156156a3576156a361539c565b5092915050565b6020808252600490820152636d42505360e01b604082015260600190565b6000602082840312156156da57600080fd5b815161084781614df8565b600080604083850312156156f857600080fd5b61570183615407565b915061570f60208401615407565b90509250929050565b80820281158282048414176106f6576106f661539c565b634e487b7160e01b600052601260045260246000fd5b6000826157545761575461572f565b500490565b61ffff8181168382160190808211156156a3576156a361539c565b602080825260089082015267686967682066656560c01b604082015260600190565b6000600182016157a8576157a861539c565b5060010190565b6000600160ff1b82016157c4576157c461539c565b5060000390565b60008160020b627fffff1981036157e4576157e461539c565b60000392915050565b6000826157fc576157fc61572f565b500690565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561585557835163ffffffff1683529284019291840191600101615833565b50909695505050505050565b60006001600160401b0382111561587a5761587a61513c565b5060051b60200190565b8051600681900b8114614c3b57600080fd5b600082601f8301126158a757600080fd5b815160206158bc6158b783615861565b615152565b82815260059290921b840181019181810190868411156158db57600080fd5b8286015b848110156158ff5780516158f281614df8565b83529183019183016158df565b509695505050505050565b6000806040838503121561591d57600080fd5b82516001600160401b038082111561593457600080fd5b818501915085601f83011261594857600080fd5b815160206159586158b783615861565b82815260059290921b8401810191818101908984111561597757600080fd5b948201945b8386101561599c5761598d86615884565b8252948201949082019061597c565b918801519196509093505050808211156159b557600080fd5b506159c285828601615896565b9150509250929050565b6001600160a01b038281168282168181028316929181158285048214176159f5576159f561539c565b50505092915050565b60006001600160a01b0383811680615a1857615a1861572f565b92169190910492915050565b6001600160a01b038281168282160390808211156156a3576156a361539c565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b6001600160a01b038181168382160190808211156156a3576156a361539c565b600080600080600080600080610100898b031215615aa857600080fd5b615ab189615407565b9750602089015180600f0b8114615ac757600080fd5b60408a015160608b015191985096509450615ae460808a01615884565b935060a0890151615af481614df8565b60c08a0151909350615b0581614fae565b60e08a0151909250615b1681614eab565b809150509295985092959890939650565b81810360008312801583831316838312821617156156a3576156a361539c565b600060208284031215615b5957600080fd5b815161084781614eab565b601f821115612f0f57600081815260208120601f850160051c81016020861015615b8b5750805b601f850160051c820191505b81811015613ab357828155600101615b97565b81516001600160401b03811115615bc357615bc361513c565b615bd781615bd184546152d0565b84615b64565b602080601f831160018114615c0c5760008415615bf45750858301515b600019600386901b1c1916600185901b178555613ab3565b600085815260208120601f198616915b82811015615c3b57888601518255948401946001909101908401615c1c565b5085821015615c595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251615c7b818460208701614da1565b919091019291505056fec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a2646970667358221220a11bde499516b0a2e8e737821292815fcefc66549a9729f24ea128d34ed6027364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190614dc5565b61026e610269366004614e0d565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d9190614e39565b6102a66106fc565b60405161023d929190614e4d565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004614e5b565b610796565b6102f56102f0366004614eb9565b61084e565b005b6102ff600081565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004614e0d565b610c3a565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610c71565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b1366004614f21565b6001600160a01b031660009081526033602052604090205490565b6102f5610c80565b6097546103e890600160b81b900460020b81565b60405161023d9190614f3e565b6102f5610403366004614f4c565b610cd6565b61041b610416366004614f4c565b610e31565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e6110ea565b61045a610455366004614f7c565b6110f9565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004614fc0565b611232565b6097546103e890600160a01b900460020b81565b61026e6104aa366004614e0d565b6113f2565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004614e0d565b61148d565b6102f56104e5366004615023565b61149a565b610233609b5481565b6102a6610501366004614f21565b61173d565b6102f5610514366004614f4c565b6117d5565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046150bc565b6118bb565b6097546102ff90600160f01b900461ffff1681565b61023361059a36600461510e565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b61023361191f565b6102f56105db3660046151f1565b61192e565b6102f56105ee3660046152b3565b611ba3565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f5610628366004614f21565b611cb0565b6102f561063b3660046150bc565b611d90565b61041b61064e366004614f4c565b611dfa565b606060368054610662906152d0565b80601f016020809104026020016040519081016040528092919081815260200182805461068e906152d0565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f2338484612114565b5060015b92915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610779919061530a565b50505050509150915061078c8282612239565b9350935050509091565b60006107a38484846124b9565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561082d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610841853361083c86856153b2565b612114565b60019150505b9392505050565b33610857610c71565b6001600160a01b03161461087d5760405162461bcd60e51b8152600401610824906153c5565b600080600061088b60355490565b1115610bca57609d546001600160a01b031663514ea4bf6108aa61267f565b6040518263ffffffff1660e01b81526004016108c891815260200190565b60a060405180830381865afa1580156108e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610909919061541e565b5092945050506001600160801b03831615905061099257609754600090819061094890600160a01b8104600290810b91600160b81b9004900b866126da565b9350935050506109588282612a0d565b6109628282612ae6565b6040519193509150600080516020615ce6833981519152906109879084908490614e4d565b60405180910390a150505b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a06903090600401614e39565b602060405180830381865afa158015610a23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a479190615475565b610a5191906153b2565b610a5b91906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610a97903090600401614e39565b602060405180830381865afa158015610ab4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad89190615475565b610ae291906153b2565b610aec91906153b2565b9050610afd898984848b8b8b612b80565b609d546001600160a01b031663514ea4bf610b1661267f565b6040518263ffffffff1660e01b8152600401610b3491815260200190565b60a060405180830381865afa158015610b51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b75919061541e565b509295505050506001600160801b038316610bc35760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610824565b5050610c06565b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615c8683398151915287878484604051610c29949392919061548e565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061083c9086906154bc565b6097546001600160a01b031690565b33610c89610c71565b6001600160a01b031614610caf5760405162461bcd60e51b8152600401610824906153c5565b60988054600160201b600160d01b031916905560006099819055609a55610cd4612d21565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d205760405162461bcd60e51b8152600401610824906154cf565b600080610d33609954609a548888612d88565b60006099819055609a5590925090508115610d6d57609854609e54610d6d916001600160a01b0391821691600160301b9091041684612eac565b8015610d9857609854609f54610d98916001600160a01b0391821691600160301b9091041683612eac565b505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601610df757610df26001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b610e2b565b610e2b6001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050565b6000806000600260655403610e585760405162461bcd60e51b815260040161082490615500565b600260655584610e7a5760405162461bcd60e51b815260040161082490615537565b6000610e8560355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610edc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f00919061530a565b50505050505090506000821115610f4157600080610f1c6106fc565b91509150610f2b828a8661302a565b9650610f38818a8661302a565b95505050610f87565b609754610f81908290610f5d90600160a01b900460020b613073565b609754610f7390600160b81b900460020b613073565b610f7c8b613488565b6134f1565b90955093505b8415610fa557609e54610fa5906001600160a01b031633308861358c565b8315610fc357609f54610fc3906001600160a01b031633308761358c565b609754610ffc908290610fdf90600160a01b900460020b613073565b609754610ff590600160b81b900460020b613073565b88886135c4565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d9161104c913091600160a01b8104600290810b92600160b81b909204900b908990600401615557565b60408051808303816000875af115801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190615599565b505061109a8688613686565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e786888787876040516110d19594939291906155bd565b60405180910390a1505060016065819055509250925092565b606060378054610662906152d0565b60008060008061110860355490565b905080156111275761111b818787613753565b9195509350915061122a565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611195919061530a565b505050505050905060006111db826111be609760149054906101000a900460020b60020b613073565b6097546111d490600160b81b900460020b613073565b8b8b6135c4565b6097546001600160801b038216955090915061122290839061120690600160a01b900460020b613073565b60975461121c90600160b81b900460020b613073565b846134f1565b909650945050505b509250925092565b3361123b610c71565b6001600160a01b0316146112615760405162461bcd60e51b8152600401610824906153c5565b6127108461ffff1611156112875760405162461bcd60e51b8152600401610824906155f4565b6127108561ffff1611156112ad5760405162461bcd60e51b8152600401610824906155f4565b6127108361ffff1611156112d35760405162461bcd60e51b8152600401610824906155f4565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff85161561134a576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff84161561136f576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561139557609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff8216156113b7576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156113eb5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156114745760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610824565b611483338561083c86856153b2565b5060019392505050565b60006106f23384846124b9565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114e45760405162461bcd60e51b8152600401610824906154cf565b85156114f4576114f48786613862565b609d546000906001600160a01b031663514ea4bf61151061267f565b6040518263ffffffff1660e01b815260040161152e91815260200190565b60a060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f919061541e565b505050509050611583818989898989613abb565b609d546000906001600160a01b031663514ea4bf61159f61267f565b6040518263ffffffff1660e01b81526004016115bd91815260200190565b60a060405180830381865afa1580156115da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fe919061541e565b505050509050816001600160801b0316816001600160801b03161161165f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610824565b609754604051600080516020615c868339815191529161169991600160a01b8204600290810b92600160b81b9004900b908690869061548e565b60405180910390a1505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601611700576116fb6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b611734565b6117346001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b9919061530a565b50505050509150506117cb8482612239565b9250925050915091565b8181336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461181f5760405162461bcd60e51b8152600401610824906154cf565b600080611832609b54609c548888612d88565b6000609b819055609c559092509050811561187e57609e5461187e906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084612eac565b8015610d9857609f54610d98906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083612eac565b609d546001600160a01b031633146118e55760405162461bcd60e51b815260040161082490615611565b831561190257609e54611902906001600160a01b03163386612eac565b8215610e2b57609f54610e2b906001600160a01b03163385612eac565b600061192961267f565b905090565b600054610100900460ff1680611947575060005460ff16155b6119635760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015611985576000805461ffff19166101011790555b6119926000612710615688565b61ffff168561ffff1611156119b95760405162461bcd60e51b8152600401610824906156aa565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe1681916004808201926020929091908290030181865afa158015611a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3691906156c8565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a79160048083019260209291908290030181865afa158015611a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab891906156c8565b609f80546001600160a01b039283166001600160a01b0319918216179091556098805460978054948716600160301b8102600160301b600160d01b031963ffffffff1961ffff8e16600160201b021665ffffffffffff199095169490941761012c17939093169290921790925562ffffff878116600160b81b02909316600165ffffff00000160a01b0319938916600160a01b02600165ffffff00000160a01b0390951694909417643e800c801960d31b179290921692909217179055611b7f8888613f83565b611b87614002565b8015611b99576000805461ff00191690555b5050505050505050565b33611bac610c71565b6001600160a01b031614611bd25760405162461bcd60e51b8152600401610824906153c5565b609854600160201b900461ffff1615611c135760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610824565b60008161ffff16118015611c3b5750611c2f6000612710615688565b61ffff168161ffff1611155b611c575760405162461bcd60e51b8152600401610824906156aa565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611cb9610c71565b6001600160a01b031614611cdf5760405162461bcd60e51b8152600401610824906153c5565b6001600160a01b038116611d465760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610824565b6097546040516001600160a01b03808416921690600080516020615ca683398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611dba5760405162461bcd60e51b815260040161082490615611565b6000841315611dda57609e54610df2906001600160a01b03163386612eac565b6000831315610e2b57609f54610e2b906001600160a01b03163385612eac565b6000806000600260655403611e215760405162461bcd60e51b815260040161082490615500565b600260655584611e5c5760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610824565b6000611e6760355490565b609d549091506000906001600160a01b031663514ea4bf611e8661267f565b6040518263ffffffff1660e01b8152600401611ea491815260200190565b60a060405180830381865afa158015611ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee5919061541e565b505050509050611ef53388614076565b6000611f0b88836001600160801b0316856141b3565b9050611f1681613488565b609754909450600090819081908190611f4590600160a01b8104600290810b91600160b81b9004900b8a6126da565b9350935093509350611f578282612a0d565b611f618282612ae6565b6040519193509150600080516020615ce683398151915290611f869084908490614e4d565b60405180910390a1609b54609954609e546040516370a0823160e01b815261203293929188916001600160a01b03909116906370a0823190611fcc903090600401614e39565b602060405180830381865afa158015611fe9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200d9190615475565b61201791906153b2565b61202191906153b2565b61202b91906153b2565b8d896141b3565b61203c90856154bc565b609c54609a54609f546040516370a0823160e01b8152939d506120799387916001600160a01b0316906370a0823190611fcc903090600401614e39565b61208390846154bc565b985089156120a257609e546120a2906001600160a01b03168c8c612eac565b88156120bf57609f546120bf906001600160a01b03168c8b612eac565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516120f69594939291906155bd565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166121765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610824565b6001600160a01b0382166121d75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610824565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61226161267f565b6040518263ffffffff1660e01b815260040161227f91815260200190565b60a060405180830381865afa15801561229c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c0919061541e565b94509450945094509450612305896122e9609760149054906101000a900460020b60020b613073565b6097546122ff90600160b81b900460020b613073565b886134f1565b909750955060006001600160801b0383166123236001878c8a614261565b61232d91906154bc565b90506000826001600160801b03166123486000878d8b614261565b61235291906154bc565b905061235e8282612ae6565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a082319061239c903090600401614e39565b602060405180830381865afa1580156123b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dd9190615475565b6123e790856154bc565b6123f191906153b2565b6123fb91906153b2565b612405908a6154bc565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a0823190612440903090600401614e39565b602060405180830381865afa15801561245d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124819190615475565b61248b90846154bc565b61249591906153b2565b61249f91906153b2565b6124a990896154bc565b9750505050505050509250929050565b6001600160a01b03831661251d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610824565b6001600160a01b03821661257f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610824565b6001600160a01b038316600090815260336020526040902054818110156125f75760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610824565b61260182826153b2565b6001600160a01b0380861660009081526033602052604080822093909355908516815290812080548492906126379084906154bc565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615cc68339815191528460405161267191815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b820460e890811b6034830152600160b81b90920490911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a0823190612713903090600401614e39565b602060405180830381865afa158015612730573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127549190615475565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061278a903090600401614e39565b602060405180830381865afa1580156127a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cb9190615475565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a79060640160408051808303816000875af1158015612830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128549190615599565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a40160408051808303816000875af11580156128c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128eb91906156e5565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612921903090600401614e39565b602060405180830381865afa15801561293e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129629190615475565b61296c91906153b2565b61297691906153b2565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a08231906129ab903090600401614e39565b602060405180830381865afa1580156129c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ec9190615475565b6129f691906153b2565b612a0091906153b2565b9250505093509350935093565b612710612a1b600084615718565b612a259190615745565b609b6000828254612a3691906154bc565b909155506127109050612a4a600083615718565b612a549190615745565b609c6000828254612a6591906154bc565b909155505060985461271090612a8690600160201b900461ffff1684615718565b612a909190615745565b60996000828254612aa191906154bc565b909155505060985461271090612ac290600160201b900461ffff1683615718565b612acc9190615745565b609a6000828254612add91906154bc565b90915550505050565b6000806000612710609860049054906101000a900461ffff166000612b0b9190615759565b612b199061ffff1687615718565b612b239190615745565b60985490915060009061271090612b4590600160201b900461ffff1683615759565b612b539061ffff1687615718565b612b5d9190615745565b9050612b6982876153b2565b9350612b7581866153b2565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015612bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bee919061530a565b50505050505090506000612c1b82612c088b60020b613073565b612c148b60020b613073565b8a8a6135c4565b90506001600160801b03811615612cc957609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612c679030908f908f908990600401615557565b60408051808303816000875af1158015612c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ca99190615599565b9092509050612cb8828a6153b2565b9850612cc481896153b2565b975050505b6000612cf86127108686612cdd5789612cdf565b8a5b612ce99190615718565b612cf39190615745565b61460d565b90506000811315612d1557612d128a8a8a8a858b8a614673565b50505b50505050505050505050565b33612d2a610c71565b6001600160a01b031614612d505760405162461bcd60e51b8152600401610824906153c5565b6097546040516000916001600160a01b031690600080516020615ca6833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0390811690841603612dfd57609754849061271090612dc190600160e01b900461ffff1689615718565b612dcb9190615745565b1015612de95760405162461bcd60e51b815260040161082490615774565b612df384876153b2565b9150849050612ea3565b609f546001600160a01b0390811690841603612e6d57609754849061271090612e3190600160e01b900461ffff1688615718565b612e3b9190615745565b1015612e595760405162461bcd60e51b815260040161082490615774565b612e6384866153b2565b9050859150612ea3565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610824565b94509492505050565b6040516001600160a01b038316602482015260448101829052612f0f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261488f565b505050565b80471015612f645760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610824565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612fb1576040519150601f19603f3d011682016040523d82523d6000602084013e612fb6565b606091505b5050905080612f0f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610824565b60006130378484846141b3565b9050600082806130495761304961572f565b848609111561084757600019811061306057600080fd5b8061306a81615796565b95945050505050565b60008060008360020b1261308a578260020b613097565b8260020b613097906157af565b90506130a6620d89e7196157cb565b60020b8111156130dc5760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610824565b6000816001166000036130f357600160801b613105565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561313a576080613135826ffff97272373d413259a46990580e213a615718565b901c90505b600482161561316457608061315f826ffff2e50f5f656932ef12357cf3c7fdcc615718565b901c90505b600882161561318e576080613189826fffe5caca7e10e4e61c3624eaa0941cd0615718565b901c90505b60108216156131b85760806131b3826fffcb9843d60f6159c9db58835c926644615718565b901c90505b60208216156131e25760806131dd826fff973b41fa98c081472e6896dfb254c0615718565b901c90505b604082161561320c576080613207826fff2ea16466c96a3843ec78b326b52861615718565b901c90505b6080821615613236576080613231826ffe5dee046a99a2a811c461f1969c3053615718565b901c90505b61010082161561326157608061325c826ffcbe86c7900a88aedcffc83b479aa3a4615718565b901c90505b61020082161561328c576080613287826ff987a7253ac413176f2b074cf7815e54615718565b901c90505b6104008216156132b75760806132b2826ff3392b0822b70005940c7a398e4b70f3615718565b901c90505b6108008216156132e25760806132dd826fe7159475a2c29b7443b29c7fa6e889d9615718565b901c90505b61100082161561330d576080613308826fd097f3bdfd2022b8845ad8f792aa5825615718565b901c90505b612000821615613338576080613333826fa9f746462d870fdf8a65dc1f90e061e5615718565b901c90505b61400082161561336357608061335e826f70d869a156d2a1b890bb3df62baf32f7615718565b901c90505b61800082161561338e576080613389826f31be135f97d08fd981231505542fcfa6615718565b901c90505b620100008216156133ba5760806133b5826f09aa508b5b7a84e1c677de54f3e99bc9615718565b901c90505b620200008216156133e55760806133e0826e5d6af8dedb81196699c329225ee604615718565b901c90505b6204000082161561340f57608061340a826d2216e584f5fa1ea926041bedfe98615718565b901c90505b62080000821615613437576080613432826b048a170391f7dc42444e8fa2615718565b901c90505b60008460020b13156134525761344f81600019615745565b90505b613460600160201b826157ed565b1561346c57600161346f565b60005b6134809060ff16602083901c6154bc565b949350505050565b6000600160801b82106134ed5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610824565b5090565b600080836001600160a01b0316856001600160a01b03161115613512579293925b846001600160a01b0316866001600160a01b03161161353d57613536858585614961565b9150612ea3565b836001600160a01b0316866001600160a01b0316101561357657613562868585614961565b915061356f8587856149cb565b9050612ea3565b6135818585856149cb565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e2b9085906323b872dd60e01b90608401612ed8565b6000836001600160a01b0316856001600160a01b031611156135e4579293925b846001600160a01b0316866001600160a01b03161161360f57613608858585614a15565b905061306a565b836001600160a01b0316866001600160a01b03161015613671576000613636878686614a15565b90506000613645878986614a7f565b9050806001600160801b0316826001600160801b0316106136665780613668565b815b9250505061306a565b61367c858584614a7f565b9695505050505050565b6001600160a01b0382166136dc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610824565b80603560008282546136ee91906154bc565b90915550506001600160a01b0382166000908152603360205260408120805483929061371b9084906154bc565b90915550506040518181526001600160a01b03831690600090600080516020615cc68339815191529060200160405180910390a35050565b60008060008060006137636106fc565b915091508160001480156137775750600081115b1561378e576137878689836141b3565b925061383d565b8015801561379c5750600082115b156137ac576137878789846141b3565b811580156137b8575080155b156137df5760405162461bcd60e51b81526020600482015260006024820152604401610824565b60006137ec888a856141b3565b905060006137fb888b856141b3565b905060008211801561380d5750600081115b6138295760405162461bcd60e51b815260040161082490615537565b8082106138365780613838565b815b945050505b61384883838a61302a565b945061385583828a61302a565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff16918391506000906138a0576138a0615801565b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106138cf576138cf615801565b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613915908590600401615817565b600060405180830381865afa158015613932573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261395a919081019061590a565b509050805160021461399a5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610824565b6098548151600091829163ffffffff90911660060b90849083906139c0576139c0615801565b6020026020010151846001815181106139db576139db615801565b60200260200101510360060b816139f4576139f461572f565b059050613a038160020b613073565b6097549092506000915061271090613a2690600160f01b900461ffff16846159cc565b613a3091906159fe565b90508415613a7857613a428183615a24565b6001600160a01b0316866001600160a01b03161015613a735760405162461bcd60e51b815260040161082490615a44565b613ab3565b613a828183615a6b565b6001600160a01b0316866001600160a01b03161115613ab35760405162461bcd60e51b815260040161082490615a44565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613af4903090600401614e39565b602060405180830381865afa158015613b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b359190615475565b613b3f91906153b2565b613b4991906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613b85903090600401614e39565b602060405180830381865afa158015613ba2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bc69190615475565b613bd091906153b2565b613bda91906153b2565b6097549091506000908190613c0590600160a01b8104600290810b91600160b81b9004900b8c6126da565b935093505050613c158282612a0d565b613c1f8282612ae6565b6040519193509150600080516020615ce683398151915290613c449084908490614e4d565b60405180910390a1613c5684836154bc565b9150613c6283826154bc565b609e549091506001600160a01b0390811690861603613def57609754869061271090613c9990600160d01b900461ffff1685615718565b613ca39190615745565b1015613cc15760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613cf9903090600401614e39565b602060405180830381865afa158015613d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d3a9190615475565b613d4491906153b2565b613d4e91906153b2565b613d5891906153b2565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613d93903090600401614e39565b602060405180830381865afa158015613db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dd49190615475565b613dde91906153b2565b613de891906153b2565b9250613f5c565b609f546001600160a01b0390811690861603612e6d57609754869061271090613e2390600160d01b900461ffff1684615718565b613e2d9190615745565b1015613e4b5760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a0823190613e81903090600401614e39565b602060405180830381865afa158015613e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ec29190615475565b613ecc91906153b2565b613ed691906153b2565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a0823190613f11903090600401614e39565b602060405180830381865afa158015613f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f529190615475565b613dd491906153b2565b609754612d1590600160a01b8104600290810b91600160b81b9004900b86868d8d8d612b80565b600054610100900460ff1680613f9c575060005460ff16155b613fb85760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015613fda576000805461ffff19166101011790555b613fe2614ab5565b613fec8383614b1f565b8015612f0f576000805461ff0019169055505050565b600054610100900460ff168061401b575060005460ff16155b6140375760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614059576000805461ffff19166101011790555b614061614ba6565b8015614073576000805461ff00191690555b50565b6001600160a01b0382166140d65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610824565b6001600160a01b0382166000908152603360205260409020548181101561414a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610824565b61415482826153b2565b6001600160a01b038416600090815260336020526040812091909155603580548492906141829084906153b2565b90915550506040518281526000906001600160a01b03851690600080516020615cc68339815191529060200161222c565b60008080600019858709858702925082811083820303915050806000036141ec57600084116141e157600080fd5b508290049050610847565b8084116141f857600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600080871561440157609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b8152600401602060405180830381865afa1580156142c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142e49190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161432491600160a01b90910460020b90600401614f3e565b61010060405180830381865afa158015614342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143669190615a8b565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba9395506143af94600160b81b90910460020b93506004019150614f3e9050565b61010060405180830381865afa1580156143cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143f19190615a8b565b5093975061458f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b8152600401602060405180830381865afa158015614454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144789190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916144b891600160a01b90910460020b90600401614f3e565b61010060405180830381865afa1580156144d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144fa9190615a8b565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506145429450600160b81b900460020b926004019150614f3e9050565b61010060405180830381865afa158015614560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145849190615a8b565b509297505050505050505b609754600090600160a01b9004600290810b9088900b126145b15750826145b6565b508281035b609754600090600160b81b9004600290810b9089900b12156145d95750826145de565b508282035b8183038190036145fe6001600160801b0389168b8303600160801b6141b3565b9b9a5050505050505050505050565b6000600160ff1b82106134ed5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610824565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c40160408051808303816000875af11580156146e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061470c9190615599565b915091508161471a8a61460d565b6147249190615b27565b9350806147308961460d565b61473a9190615b27565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015614791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b5919061530a565b505050505050905060006147e2826147cf8f60020b613073565b6147db8f60020b613073565b89896135c4565b90506001600160801b0381161561487f57609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b815260040161483a9493929190615557565b60408051808303816000875af1158015614858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061487c9190615599565b50505b5050505097509795505050505050565b60006148e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c169092919063ffffffff16565b805190915015612f0f57808060200190518101906149029190615b47565b612f0f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610824565b6000826001600160a01b0316846001600160a01b03161115614981579192915b6001600160a01b0384166149c1600160601b600160e01b03606085901b166149a98787615a24565b6001600160a01b0316866001600160a01b03166141b3565b6134809190615745565b6000826001600160a01b0316846001600160a01b031611156149eb579192915b6134806001600160801b038316614a028686615a24565b6001600160a01b0316600160601b6141b3565b6000826001600160a01b0316846001600160a01b03161115614a35579192915b6000614a58856001600160a01b0316856001600160a01b0316600160601b6141b3565b905061306a614a7a8483614a6c8989615a24565b6001600160a01b03166141b3565b614c25565b6000826001600160a01b0316846001600160a01b03161115614a9f579192915b613480614a7a83600160601b614a6c8888615a24565b600054610100900460ff1680614ace575060005460ff16155b614aea5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614061576000805461ffff19166101011790558015614073576000805461ff001916905550565b600054610100900460ff1680614b38575060005460ff16155b614b545760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614b76576000805461ffff19166101011790555b6036614b828482615baa565b506037614b8f8382615baa565b508015612f0f576000805461ff0019169055505050565b600054610100900460ff1680614bbf575060005460ff16155b614bdb5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614bfd576000805461ffff19166101011790555b60016065558015614073576000805461ff001916905550565b60606134808484600085614c40565b806001600160801b0381168114614c3b57600080fd5b919050565b606082471015614ca15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610824565b843b614cef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610824565b600080866001600160a01b03168587604051614d0b9190615c69565b60006040518083038185875af1925050503d8060008114614d48576040519150601f19603f3d011682016040523d82523d6000602084013e614d4d565b606091505b5091509150614d5d828286614d68565b979650505050505050565b60608315614d77575081610847565b825115614d875782518084602001fd5b8160405162461bcd60e51b81526004016108249190614dc5565b60005b83811015614dbc578181015183820152602001614da4565b50506000910152565b6020815260008251806020840152614de4816040850160208701614da1565b601f01601f19169190910160400192915050565b6001600160a01b038116811461407357600080fd5b60008060408385031215614e2057600080fd5b8235614e2b81614df8565b946020939093013593505050565b6001600160a01b0391909116815260200190565b918252602082015260400190565b600080600060608486031215614e7057600080fd5b8335614e7b81614df8565b92506020840135614e8b81614df8565b929592945050506040919091013590565b8060020b811461407357600080fd5b801515811461407357600080fd5b600080600080600060a08688031215614ed157600080fd5b8535614edc81614e9c565b94506020860135614eec81614e9c565b93506040860135614efc81614df8565b9250606086013591506080860135614f1381614eab565b809150509295509295909350565b600060208284031215614f3357600080fd5b813561084781614df8565b60029190910b815260200190565b60008060408385031215614f5f57600080fd5b823591506020830135614f7181614df8565b809150509250929050565b60008060408385031215614f8f57600080fd5b50508035926020909101359150565b61ffff8116811461407357600080fd5b63ffffffff8116811461407357600080fd5b600080600080600060a08688031215614fd857600080fd5b8535614fe381614f9e565b94506020860135614ff381614f9e565b9350604086013561500381614f9e565b9250606086013561501381614fae565b91506080860135614f1381614df8565b600080600080600060a0868803121561503b57600080fd5b853561504681614df8565b945060208601359350604086013561505d81614eab565b9250606086013591506080860135614f1381614df8565b60008083601f84011261508657600080fd5b5081356001600160401b0381111561509d57600080fd5b6020830191508360208285010111156150b557600080fd5b9250929050565b600080600080606085870312156150d257600080fd5b843593506020850135925060408501356001600160401b038111156150f657600080fd5b61510287828801615074565b95989497509550505050565b6000806040838503121561512157600080fd5b823561512c81614df8565b91506020830135614f7181614df8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561517a5761517a61513c565b604052919050565b600082601f83011261519357600080fd5b81356001600160401b038111156151ac576151ac61513c565b6151bf601f8201601f1916602001615152565b8181528460208386010111156151d457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060e0888a03121561520c57600080fd5b87356001600160401b038082111561522357600080fd5b61522f8b838c01615182565b985060208a013591508082111561524557600080fd5b506152528a828b01615182565b965050604088013561526381614df8565b9450606088013561527381614f9e565b9350608088013561528381614e9c565b925060a088013561529381614e9c565b915060c08801356152a381614df8565b8091505092959891949750929550565b6000602082840312156152c557600080fd5b813561084781614f9e565b600181811c908216806152e457607f821691505b60208210810361530457634e487b7160e01b600052602260045260246000fd5b50919050565b600080600080600080600060e0888a03121561532557600080fd5b875161533081614df8565b602089015190975061534181614e9c565b604089015190965061535281614f9e565b606089015190955061536381614f9e565b608089015190945061537481614f9e565b60a089015190935060ff8116811461538b57600080fd5b60c08901519092506152a381614eab565b634e487b7160e01b600052601160045260246000fd5b818103818111156106f6576106f661539c565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b80516001600160801b0381168114614c3b57600080fd5b600080600080600060a0868803121561543657600080fd5b61543f86615407565b9450602086015193506040860151925061545b60608701615407565b915061546960808701615407565b90509295509295909350565b60006020828403121561548757600080fd5b5051919050565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b808201808211156106f6576106f661539c565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b600080604083850312156155ac57600080fd5b505080516020909101519092909150565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b60208082526003908201526242505360e81b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b61ffff8281168282160390808211156156a3576156a361539c565b5092915050565b6020808252600490820152636d42505360e01b604082015260600190565b6000602082840312156156da57600080fd5b815161084781614df8565b600080604083850312156156f857600080fd5b61570183615407565b915061570f60208401615407565b90509250929050565b80820281158282048414176106f6576106f661539c565b634e487b7160e01b600052601260045260246000fd5b6000826157545761575461572f565b500490565b61ffff8181168382160190808211156156a3576156a361539c565b602080825260089082015267686967682066656560c01b604082015260600190565b6000600182016157a8576157a861539c565b5060010190565b6000600160ff1b82016157c4576157c461539c565b5060000390565b60008160020b627fffff1981036157e4576157e461539c565b60000392915050565b6000826157fc576157fc61572f565b500690565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561585557835163ffffffff1683529284019291840191600101615833565b50909695505050505050565b60006001600160401b0382111561587a5761587a61513c565b5060051b60200190565b8051600681900b8114614c3b57600080fd5b600082601f8301126158a757600080fd5b815160206158bc6158b783615861565b615152565b82815260059290921b840181019181810190868411156158db57600080fd5b8286015b848110156158ff5780516158f281614df8565b83529183019183016158df565b509695505050505050565b6000806040838503121561591d57600080fd5b82516001600160401b038082111561593457600080fd5b818501915085601f83011261594857600080fd5b815160206159586158b783615861565b82815260059290921b8401810191818101908984111561597757600080fd5b948201945b8386101561599c5761598d86615884565b8252948201949082019061597c565b918801519196509093505050808211156159b557600080fd5b506159c285828601615896565b9150509250929050565b6001600160a01b038281168282168181028316929181158285048214176159f5576159f561539c565b50505092915050565b60006001600160a01b0383811680615a1857615a1861572f565b92169190910492915050565b6001600160a01b038281168282160390808211156156a3576156a361539c565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b6001600160a01b038181168382160190808211156156a3576156a361539c565b600080600080600080600080610100898b031215615aa857600080fd5b615ab189615407565b9750602089015180600f0b8114615ac757600080fd5b60408a015160608b015191985096509450615ae460808a01615884565b935060a0890151615af481614df8565b60c08a0151909350615b0581614fae565b60e08a0151909250615b1681614eab565b809150509295985092959890939650565b81810360008312801583831316838312821617156156a3576156a361539c565b600060208284031215615b5957600080fd5b815161084781614eab565b601f821115612f0f57600081815260208120601f850160051c81016020861015615b8b5750805b601f850160051c820191505b81811015613ab357828155600101615b97565b81516001600160401b03811115615bc357615bc361513c565b615bd781615bd184546152d0565b84615b64565b602080601f831160018114615c0c5760008415615bf45750858301515b600019600386901b1c1916600185901b178555613ab3565b600085815260208120601f198616915b82811015615c3b57888601518255948401946001909101908401615c1c565b5085821015615c595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251615c7b818460208701614da1565b919091019291505056fec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a2646970667358221220a11bde499516b0a2e8e737821292815fcefc66549a9729f24ea128d34ed6027364736f6c63430008130033", - "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": "See {IERC20-allowance}." - }, - "approve(address,uint256)": { - "details": "See {IERC20-approve}. Requirements: - `spender` cannot be the zero address." - }, - "balanceOf(address)": { - "details": "See {IERC20-balanceOf}." - }, - "burn(uint256,address)": { - "params": { - "burnAmount": "The number of G-UNI tokens to burn", - "receiver": "The account to receive the underlying amounts of token0 and token1" - }, - "returns": { - "amount0": "amount of token0 transferred to receiver for burning `burnAmount`", - "amount1": "amount of token1 transferred to receiver for burning `burnAmount`", - "liquidityBurned": "amount of liquidity removed from the underlying Uniswap V3 position" - } - }, - "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 this function is overridden; 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`." - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "details": "When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.", - "params": { - "newLowerTick": "The new lower bound of the position's range", - "newUpperTick": "The new upper bound of the position's range", - "swapAmountBPS": "amount of token to swap as proportion of total. Pass 0 to ignore swap.", - "swapThresholdPrice": "slippage parameter on the swap as a max or min sqrtPriceX96", - "zeroForOne": "Which token to input into the swap (true = token0, false = token1)" - } - }, - "getMintAmounts(uint256,uint256)": { - "params": { - "amount0Max": "The maximum amount of token1 to forward on mint" - }, - "returns": { - "amount0": "actual amount of token0 to forward when minting `mintAmount`", - "amount1": "actual amount of token1 to forward when minting `mintAmount`", - "mintAmount": "maximum number of G-UNI tokens to mint" - } - }, - "getUnderlyingBalances()": { - "returns": { - "amount0Current": "current total underlying balance of token0", - "amount1Current": "current total underlying balance of token1" - } - }, - "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." - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "params": { - "_lowerTick": "initial upperTick (only changeable with executiveRebalance)", - "_managerFeeBPS": "proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION", - "_manager_": "address of manager (ownership can be transferred)", - "_name": "name of G-UNI token", - "_pool": "address of Uniswap V3 pool", - "_symbol": "symbol of G-UNI token" - } - }, - "initializeManagerFee(uint16)": { - "params": { - "_managerFeeBPS": "proportion of fees earned that are credited to manager in Basis Points" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "mint(uint256,address)": { - "details": "to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts", - "params": { - "mintAmount": "The number of G-UNI tokens to mint", - "receiver": "The account to receive the minted tokens" - }, - "returns": { - "amount0": "amount of token0 transferred from msg.sender to mint `mintAmount`", - "amount1": "amount of token1 transferred from msg.sender to mint `mintAmount`", - "liquidityMinted": "amount of liquidity added to the underlying Uniswap V3 position" - } - }, - "name()": { - "details": "Returns the name of the token." - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "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 manager." - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "params": { - "newRebalanceBPS": "controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance", - "newSlippageBPS": "maximum slippage on swaps during gelato rebalance", - "newSlippageInterval": "length of time for TWAP used in computing slippage on swaps", - "newTreasury": "address where managerFee withdrawals are sent", - "newWithdrawBPS": "controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "burn(uint256,address)": { - "notice": "burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens" - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "notice": "Change the range of underlying UniswapV3 position, only manager can call" - }, - "getMintAmounts(uint256,uint256)": { - "notice": "compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`" - }, - "getUnderlyingBalances()": { - "notice": "compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)" - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "notice": "initialize storage variables on a new G-UNI pool, only called once" - }, - "initializeManagerFee(uint16)": { - "notice": "initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again." - }, - "mint(uint256,address)": { - "notice": "mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position" - }, - "rebalance(uint160,uint256,bool,uint256,address)": { - "notice": "Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager." - }, - "uniswapV3MintCallback(uint256,uint256,bytes)": { - "notice": "Uniswap V3 callback fn, called back on pool.mint" - }, - "uniswapV3SwapCallback(int256,int256,bytes)": { - "notice": "Uniswap v3 callback fn, called back on pool.swap" - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "notice": "change configurable parameters, only manager can call" - }, - "withdrawGelatoBalance(uint256,address)": { - "notice": "withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - }, - "withdrawManagerBalance(uint256,address)": { - "notice": "withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 5, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 784, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage" - }, - { - "astId": 122, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_balances", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 128, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_allowances", - "offset": 0, - "slot": "52", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 130, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_totalSupply", - "offset": 0, - "slot": "53", - "type": "t_uint256" - }, - { - "astId": 132, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_name", - "offset": 0, - "slot": "54", - "type": "t_string_storage" - }, - { - "astId": 134, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_symbol", - "offset": 0, - "slot": "55", - "type": "t_string_storage" - }, - { - "astId": 636, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "56", - "type": "t_array(t_uint256)45_storage" - }, - { - "astId": 59, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_status", - "offset": 0, - "slot": "101", - "type": "t_uint256" - }, - { - "astId": 102, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "102", - "type": "t_array(t_uint256)49_storage" - }, - { - "astId": 6441, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_manager", - "offset": 0, - "slot": "151", - "type": "t_address" - }, - { - "astId": 6031, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "lowerTick", - "offset": 20, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6033, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "upperTick", - "offset": 23, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6035, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoRebalanceBPS", - "offset": 26, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6037, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoWithdrawBPS", - "offset": 28, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6039, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageBPS", - "offset": 30, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6041, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageInterval", - "offset": 0, - "slot": "152", - "type": "t_uint32" - }, - { - "astId": 6043, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerFeeBPS", - "offset": 4, - "slot": "152", - "type": "t_uint16" - }, - { - "astId": 6045, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerTreasury", - "offset": 6, - "slot": "152", - "type": "t_address" - }, - { - "astId": 6047, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance0", - "offset": 0, - "slot": "153", - "type": "t_uint256" - }, - { - "astId": 6049, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance1", - "offset": 0, - "slot": "154", - "type": "t_uint256" - }, - { - "astId": 6051, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance0", - "offset": 0, - "slot": "155", - "type": "t_uint256" - }, - { - "astId": 6053, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance1", - "offset": 0, - "slot": "156", - "type": "t_uint256" - }, - { - "astId": 6056, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "pool", - "offset": 0, - "slot": "157", - "type": "t_contract(IUniswapV3Pool)2339" - }, - { - "astId": 6059, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token0", - "offset": 0, - "slot": "158", - "type": "t_contract(IERC20)863" - }, - { - "astId": 6062, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token1", - "offset": 0, - "slot": "159", - "type": "t_contract(IERC20)863" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)45_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)49_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "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)863": { - "encoding": "inplace", - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_contract(IUniswapV3Pool)2339": { - "encoding": "inplace", - "label": "contract IUniswapV3Pool", - "numberOfBytes": "20" - }, - "t_int24": { - "encoding": "inplace", - "label": "int24", - "numberOfBytes": "3" - }, - "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_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/mantleSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json b/lib/g-uni-v1-core/deployments/mantleSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json deleted file mode 100644 index 371127af2..000000000 --- a/lib/g-uni-v1-core/deployments/mantleSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\n/// @dev Modified to support 0.8.19\n/// @dev Modified to set the gelatoFeeBPS to 0\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 0;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n event SetManagerFee(uint16 managerFee);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n emit SetManagerFee(_managerFeeBPS);\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidityBefore,\n uint128 liquidityAfter\n );\n\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n SafeCast.toUint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidityBurned);\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n\n amount0 =\n burn0 +\n FullMath.mulDiv(\n token0.balanceOf(address(this)) -\n burn0 -\n managerBalance0 -\n gelatoBalance0,\n burnAmount,\n totalSupply\n );\n amount1 =\n burn1 +\n FullMath.mulDiv(\n token1.balanceOf(address(this)) -\n burn1 -\n managerBalance1 -\n gelatoBalance1,\n burnAmount,\n totalSupply\n );\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n // solhint-disable-next-line function-max-lines\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n uint128 liquidity;\n uint128 newLiquidity;\n if (totalSupply() > 0) {\n (liquidity, , , , ) = pool.positions(_getPositionID());\n if (liquidity > 0) {\n (, , uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n }\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > 0, \"new position 0\");\n } else {\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n }\n\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n _rebalance(\n liquidity,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > liquidity, \"liquidity must increase\");\n\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\n external\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n // solhint-disable-next-line function-max-lines\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\n internal\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint128 liquidity,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n uint256 leftover0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 leftover1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n (, , uint256 feesEarned0, uint256 feesEarned1) =\n _withdraw(lowerTick, upperTick, liquidity);\n _applyFees(feesEarned0, feesEarned1);\n (feesEarned0, feesEarned1) = _subtractAdminFees(\n feesEarned0,\n feesEarned1\n );\n emit FeesEarned(feesEarned0, feesEarned1);\n feesEarned0 += leftover0;\n feesEarned1 += leftover1;\n\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n leftover0,\n leftover1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdraw(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n )\n private\n returns (\n uint256 burn0,\n uint256 burn1,\n uint256 fee0,\n uint256 fee1\n )\n {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n SafeCast.toInt256(\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\n );\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array len\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"high slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"high slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\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 require(value < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return uint128(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 require(value < 2**64, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return uint64(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 require(value < 2**32, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return uint32(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 require(value < 2**16, \"SafeCast: value doesn\\'t fit in 16 bits\");\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 require(value < 2**8, \"SafeCast: value doesn\\'t fit in 8 bits\");\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 require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= -2**127 && value < 2**127, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return int128(value);\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= -2**63 && value < 2**63, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return int64(value);\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= -2**31 && value < 2**31, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return int32(value);\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= -2**15 && value < 2**15, \"SafeCast: value doesn\\'t fit in 16 bits\");\n return int16(value);\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= -2**7 && value < 2**7, \"SafeCast: value doesn\\'t fit in 8 bits\");\n return int8(value);\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 require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IUniswapV3TickSpacing} from \"./interfaces/IUniswapV3TickSpacing.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n }\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n 0,\n lowerTick,\n upperTick,\n address(0)\n );\n }\n\n function _createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n address manager\n ) internal returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory name = \"Gelato Uniswap LP\";\n try this.getTokenName(token0, token1) returns (string memory result) {\n name = result;\n } catch {} // solhint-disable-line no-empty-blocks\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n require(uniPool != address(0), \"uniswap pool does not exist\");\n require(\n _validateTickSpacing(uniPool, lowerTick, upperTick),\n \"tickSpacing mismatch\"\n );\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n manager\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, manager, pool);\n }\n\n function _validateTickSpacing(\n address uniPool,\n int24 lowerTick,\n int24 upperTick\n ) internal view returns (bool) {\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\n return\n lowerTick < upperTick &&\n lowerTick % spacing == 0 &&\n upperTick % spacing == 0;\n }\n\n function getTokenName(address token0, address token1)\n external\n view\n returns (string memory)\n {\n string memory symbol0 = IERC20Metadata(token0).symbol();\n string memory symbol1 = IERC20Metadata(token1).symbol();\n\n return _append(\"Gelato Uniswap \", symbol0, \"/\", symbol1, \" LP\");\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IUniswapV3TickSpacing.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IUniswapV3TickSpacing {\n function tickSpacing() external view returns (int24);\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "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/lib/g-uni-v1-core/deployments/modeSepolia/.chainId b/lib/g-uni-v1-core/deployments/modeSepolia/.chainId deleted file mode 100644 index 8cef75946..000000000 --- a/lib/g-uni-v1-core/deployments/modeSepolia/.chainId +++ /dev/null @@ -1 +0,0 @@ -919 \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/modeSepolia/GUniFactory.json b/lib/g-uni-v1-core/deployments/modeSepolia/GUniFactory.json deleted file mode 100644 index 38449a8d8..000000000 --- a/lib/g-uni-v1-core/deployments/modeSepolia/GUniFactory.json +++ /dev/null @@ -1,721 +0,0 @@ -{ - "address": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - } - ], - "transactionHash": "0x9e92b7b419cc62dde1aadd2fa750de298ef790070620569671994356527bd4a8", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F", - "transactionIndex": 1, - "gasUsed": "551510", - "logsBloom": "0x00100000800020000000000000000000000000000000000000000080000000000000000000000000010400000000000000000000000000000000000000000000000040000000000000000000000008000000000000000000000000000200000000000000020000000000000000008800000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000000400000000001000000000000000000000000000000000", - "blockHash": "0xf829ad2b3e67b2623fddc236797a247dd11794e41416c1fc4d1e1030e753f06e", - "transactionHash": "0x9e92b7b419cc62dde1aadd2fa750de298ef790070620569671994356527bd4a8", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 15086476, - "transactionHash": "0x9e92b7b419cc62dde1aadd2fa750de298ef790070620569671994356527bd4a8", - "address": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000909f26919989167d051312fbb0a1df4cd93bf70b" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0xf829ad2b3e67b2623fddc236797a247dd11794e41416c1fc4d1e1030e753f06e" - }, - { - "transactionIndex": 1, - "blockNumber": 15086476, - "transactionHash": "0x9e92b7b419cc62dde1aadd2fa750de298ef790070620569671994356527bd4a8", - "address": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0xf829ad2b3e67b2623fddc236797a247dd11794e41416c1fc4d1e1030e753f06e" - } - ], - "blockNumber": 15086476, - "cumulativeGasUsed": "603737", - "status": 1, - "byzantium": true - }, - "args": [ - "0x909F26919989167d051312fBB0a1Df4CD93Bf70b", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b000000000000000000000000909f26919989167d051312fbb0a1df4cd93bf70b000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033", - "execute": { - "methodName": "initialize", - "args": [ - "0x909F26919989167d051312fBB0a1Df4CD93Bf70b", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - ] - }, - "implementation": "0x909F26919989167d051312fBB0a1Df4CD93Bf70b", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/modeSepolia/GUniFactory_Implementation.json b/lib/g-uni-v1-core/deployments/modeSepolia/GUniFactory_Implementation.json deleted file mode 100644 index dce93dbba..000000000 --- a/lib/g-uni-v1-core/deployments/modeSepolia/GUniFactory_Implementation.json +++ /dev/null @@ -1,802 +0,0 @@ -{ - "address": "0x909F26919989167d051312fBB0a1Df4CD93Bf70b", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_uniswapV3Factory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xb83e6685330701ac68bf3cc587213e49ce4404743f92581e26059e2e2dea331b", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x909F26919989167d051312fBB0a1Df4CD93Bf70b", - "transactionIndex": 1, - "gasUsed": "2186401", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x77c66cfcdd8c2cadae2526f7e662bb8a685e9841e7eef8e7172e83dc14d23516", - "transactionHash": "0xb83e6685330701ac68bf3cc587213e49ce4404743f92581e26059e2e2dea331b", - "logs": [], - "blockNumber": 15086411, - "cumulativeGasUsed": "2230240", - "status": 1, - "byzantium": true - }, - "args": [ - "0x0f88f3f5108eB3BD1A2D411E9a1fD41997811D88" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_uniswapV3Factory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"uniPool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previosGelatoDeployer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newGelatoDeployer\",\"type\":\"address\"}],\"name\":\"UpdateGelatoDeployer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"UpdatePoolImplementation\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createManagedPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDeployers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGelatoPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"getTokenName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gelatoDeployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isPoolImmutable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"makePoolsImmutable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numDeployers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextGelatoDeployer\",\"type\":\"address\"}],\"name\":\"setGelatoDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextImplementation\",\"type\":\"address\"}],\"name\":\"setPoolImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"upgradePools\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"bytes[]\",\"name\":\"datas\",\"type\":\"bytes[]\"}],\"name\":\"upgradePoolsAndCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"managerFee\":\"proportion of earned fees that go to pool manager in Basis Points\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"createPool(address,address,uint24,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"getDeployers()\":{\"returns\":{\"_0\":\"deployers the list of deployer addresses\"}},\"getGelatoPools()\":{\"returns\":{\"_0\":\"list of Gelato managed G-UNI pool addresses\"}},\"getPools(address)\":{\"params\":{\"deployer\":\"address that has potentially deployed G-UNI pools (can return empty array)\"},\"returns\":{\"_0\":\"pools the list of G-UNI pool addresses deployed by `deployer`\"}},\"getProxyAdmin(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"address that controls the G-UNI implementation (has power to upgrade it)\"}},\"isPoolImmutable(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"bool signaling if pool is immutable (true) or not (false)\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"numDeployers()\":{\"returns\":{\"_0\":\"total number of G-UNI pool deployer addresses\"}},\"numPools()\":{\"returns\":{\"result\":\"total number of G-UNI pools deployed\"}},\"numPools(address)\":{\"params\":{\"deployer\":\"deployer address\"},\"returns\":{\"_0\":\"total number of G-UNI pools deployed by `deployer`\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"notice\":\"createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`\"},\"createPool(address,address,uint24,int24,int24)\":{\"notice\":\"createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`\"},\"getDeployers()\":{\"notice\":\"getDeployers fetches all addresses that have deployed a G-UNI pool\"},\"getGelatoPools()\":{\"notice\":\"getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)\"},\"getPools(address)\":{\"notice\":\"getPools fetches all the G-UNI pool addresses deployed by `deployer`\"},\"getProxyAdmin(address)\":{\"notice\":\"getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address).\"},\"isPoolImmutable(address)\":{\"notice\":\"isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\"},\"numDeployers()\":{\"notice\":\"numDeployers counts the total number of G-UNI pool deployer addresses\"},\"numPools()\":{\"notice\":\"numPools counts the total number of G-UNI pools in existence\"},\"numPools(address)\":{\"notice\":\"numPools counts the total number of G-UNI pools deployed by `deployer`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniFactory.sol\":\"GUniFactory\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\\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\":\"0x4878ef6c288f4cef3c2a288d32cc548c648831cc55503ad3d9a581ed3b93aad9\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title The interface for the Uniswap V3 Factory\\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\\ninterface IUniswapV3Factory {\\n /// @notice Emitted when the owner of the factory is changed\\n /// @param oldOwner The owner before the owner was changed\\n /// @param newOwner The owner after the owner was changed\\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\\n\\n /// @notice Emitted when a pool is created\\n /// @param token0 The first token of the pool by address sort order\\n /// @param token1 The second token of the pool by address sort order\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks\\n /// @param pool The address of the created pool\\n event PoolCreated(\\n address indexed token0,\\n address indexed token1,\\n uint24 indexed fee,\\n int24 tickSpacing,\\n address pool\\n );\\n\\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\\n /// @param fee The enabled fee, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\\n\\n /// @notice Returns the current owner of the factory\\n /// @dev Can be changed by the current owner via setOwner\\n /// @return The address of the factory owner\\n function owner() external view returns (address);\\n\\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\\n /// @return The tick spacing\\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\\n\\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\\n /// @param tokenA The contract address of either token0 or token1\\n /// @param tokenB The contract address of the other token\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @return pool The pool address\\n function getPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external view returns (address pool);\\n\\n /// @notice Creates a pool for the given two tokens and fee\\n /// @param tokenA One of the two tokens in the desired pool\\n /// @param tokenB The other of the two tokens in the desired pool\\n /// @param fee The desired fee for the pool\\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\\n /// are invalid.\\n /// @return pool The address of the newly created pool\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external returns (address pool);\\n\\n /// @notice Updates the owner of the factory\\n /// @dev Must be called by the current owner\\n /// @param _owner The new owner of the factory\\n function setOwner(address _owner) external;\\n\\n /// @notice Enables a fee amount with the given tickSpacing\\n /// @dev Fee amounts may never be removed once enabled\\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\\n}\\n\",\"keccak256\":\"0xcc3d0c93fc9ac0febbe09f941b465b57f750bcf3b48432da0b97dc289cfdc489\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {\\n IUniswapV3Factory\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\\\";\\nimport {IUniswapV3TickSpacing} from \\\"./interfaces/IUniswapV3TickSpacing.sol\\\";\\nimport {IGUniFactory} from \\\"./interfaces/IGUniFactory.sol\\\";\\nimport {IGUniPoolStorage} from \\\"./interfaces/IGUniPoolStorage.sol\\\";\\nimport {GUniFactoryStorage} from \\\"./abstract/GUniFactoryStorage.sol\\\";\\nimport {EIP173Proxy} from \\\"./vendor/proxy/EIP173Proxy.sol\\\";\\nimport {IEIP173Proxy} from \\\"./interfaces/IEIP173Proxy.sol\\\";\\nimport {\\n IERC20Metadata\\n} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n constructor(address _uniswapV3Factory)\\n GUniFactoryStorage(_uniswapV3Factory)\\n {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n managerFee,\\n lowerTick,\\n upperTick,\\n msg.sender\\n );\\n }\\n\\n /// @notice createPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n 0,\\n lowerTick,\\n upperTick,\\n address(0)\\n );\\n }\\n\\n function _createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick,\\n address manager\\n ) internal returns (address pool) {\\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\\n\\n pool = address(new EIP173Proxy(poolImplementation, address(this), \\\"\\\"));\\n\\n string memory name = \\\"Gelato Uniswap LP\\\";\\n try this.getTokenName(token0, token1) returns (string memory result) {\\n name = result;\\n } catch {} // solhint-disable-line no-empty-blocks\\n\\n address uniPool =\\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\\n require(uniPool != address(0), \\\"uniswap pool does not exist\\\");\\n require(\\n _validateTickSpacing(uniPool, lowerTick, upperTick),\\n \\\"tickSpacing mismatch\\\"\\n );\\n\\n IGUniPoolStorage(pool).initialize(\\n name,\\n \\\"G-UNI\\\",\\n uniPool,\\n managerFee,\\n lowerTick,\\n upperTick,\\n manager\\n );\\n _deployers.add(msg.sender);\\n _pools[msg.sender].add(pool);\\n emit PoolCreated(uniPool, manager, pool);\\n }\\n\\n function _validateTickSpacing(\\n address uniPool,\\n int24 lowerTick,\\n int24 upperTick\\n ) internal view returns (bool) {\\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\\n return\\n lowerTick < upperTick &&\\n lowerTick % spacing == 0 &&\\n upperTick % spacing == 0;\\n }\\n\\n function getTokenName(address token0, address token1)\\n external\\n view\\n returns (string memory)\\n {\\n string memory symbol0 = IERC20Metadata(token0).symbol();\\n string memory symbol1 = IERC20Metadata(token1).symbol();\\n\\n return _append(\\\"Gelato Uniswap \\\", symbol0, \\\"/\\\", symbol1, \\\" LP\\\");\\n }\\n\\n function upgradePools(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\\n }\\n }\\n\\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\\n external\\n onlyManager\\n {\\n require(pools.length == datas.length, \\\"mismatching array length\\\");\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeToAndCall(\\n poolImplementation,\\n datas[i]\\n );\\n }\\n }\\n\\n function makePoolsImmutable(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\\n }\\n }\\n\\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the\\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\\n /// @param pool address of the G-UNI pool\\n /// @return bool signaling if pool is immutable (true) or not (false)\\n function isPoolImmutable(address pool) external view returns (bool) {\\n return address(0) == getProxyAdmin(pool);\\n }\\n\\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\\n /// @return list of Gelato managed G-UNI pool addresses\\n function getGelatoPools() external view returns (address[] memory) {\\n return getPools(gelatoDeployer);\\n }\\n\\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\\n /// @return deployers the list of deployer addresses\\n function getDeployers() public view returns (address[] memory) {\\n uint256 length = numDeployers();\\n address[] memory deployers = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n deployers[i] = _getDeployer(i);\\n }\\n\\n return deployers;\\n }\\n\\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\\n function getPools(address deployer) public view returns (address[] memory) {\\n uint256 length = numPools(deployer);\\n address[] memory pools = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n pools[i] = _getPool(deployer, i);\\n }\\n\\n return pools;\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools in existence\\n /// @return result total number of G-UNI pools deployed\\n function numPools() public view returns (uint256 result) {\\n address[] memory deployers = getDeployers();\\n for (uint256 i = 0; i < deployers.length; i++) {\\n result += numPools(deployers[i]);\\n }\\n }\\n\\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\\n /// @return total number of G-UNI pool deployer addresses\\n function numDeployers() public view returns (uint256) {\\n return _deployers.length();\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\\n /// @param deployer deployer address\\n /// @return total number of G-UNI pools deployed by `deployer`\\n function numPools(address deployer) public view returns (uint256) {\\n return _pools[deployer].length();\\n }\\n\\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\\n /// no longer upgradable (no one owns the zero address).\\n /// @param pool address of the G-UNI pool\\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\\n function getProxyAdmin(address pool) public view returns (address) {\\n return IEIP173Proxy(pool).proxyAdmin();\\n }\\n\\n function _getDeployer(uint256 index) internal view returns (address) {\\n return _deployers.at(index);\\n }\\n\\n function _getPool(address deployer, uint256 index)\\n internal\\n view\\n returns (address)\\n {\\n return _pools[deployer].at(index);\\n }\\n\\n function _getTokenOrder(address tokenA, address tokenB)\\n internal\\n pure\\n returns (address token0, address token1)\\n {\\n require(tokenA != tokenB, \\\"same token\\\");\\n (token0, token1) = tokenA < tokenB\\n ? (tokenA, tokenB)\\n : (tokenB, tokenA);\\n require(token0 != address(0), \\\"no address zero\\\");\\n }\\n\\n function _append(\\n string memory a,\\n string memory b,\\n string memory c,\\n string memory d,\\n string memory e\\n ) internal pure returns (string memory) {\\n return string(abi.encodePacked(a, b, c, d, e));\\n }\\n}\\n\",\"keccak256\":\"0x41d2d6a42321eed641468824c4d0ba4fbe40040895304388315ece96132011d6\",\"license\":\"MIT\"},\"contracts/abstract/GUniFactoryStorage.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n Initializable\\n} from \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\n// solhint-disable-next-line max-states-count\\ncontract GUniFactoryStorage is\\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\\n Initializable\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n address public immutable factory;\\n address public poolImplementation;\\n address public gelatoDeployer;\\n EnumerableSet.AddressSet internal _deployers;\\n mapping(address => EnumerableSet.AddressSet) internal _pools;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdatePoolImplementation(\\n address previousImplementation,\\n address newImplementation\\n );\\n\\n event UpdateGelatoDeployer(\\n address previosGelatoDeployer,\\n address newGelatoDeployer\\n );\\n\\n constructor(address _uniswapV3Factory) {\\n factory = _uniswapV3Factory;\\n }\\n\\n function initialize(\\n address _implementation,\\n address _gelatoDeployer,\\n address _manager_\\n ) external initializer {\\n poolImplementation = _implementation;\\n gelatoDeployer = _gelatoDeployer;\\n _manager = _manager_;\\n }\\n\\n function setPoolImplementation(address nextImplementation)\\n external\\n onlyManager\\n {\\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\\n poolImplementation = nextImplementation;\\n }\\n\\n function setGelatoDeployer(address nextGelatoDeployer)\\n external\\n onlyManager\\n {\\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\\n gelatoDeployer = nextGelatoDeployer;\\n }\\n}\\n\",\"keccak256\":\"0xb0e3a7e77ab8aecf8997593526451e64dd8e8aa07882c210c9aa38d4f7168755\",\"license\":\"MIT\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xb6016d5611f38fbd516a84ea2e56794cb76a8d61c40f6716d5f0133f195759bd\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IEIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IEIP173Proxy {\\n function proxyAdmin() external view returns (address);\\n\\n function transferProxyAdmin(address newAdmin) external;\\n\\n function upgradeTo(address newImplementation) external;\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable;\\n}\\n\",\"keccak256\":\"0xae9996ea370d97cb5fd1934394aca615bee0e46c9a0c161d728490264e83eda5\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IGUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\ninterface IGUniFactory {\\n event PoolCreated(\\n address indexed uniPool,\\n address indexed manager,\\n address indexed pool\\n );\\n\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n}\\n\",\"keccak256\":\"0xe06f79e9b1e6351fc4f40c9f25630f0fbfabae9d2ae2bb642ef1f03d4c2195c1\",\"license\":\"MIT\"},\"contracts/interfaces/IGUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IGUniPoolStorage {\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external;\\n}\\n\",\"keccak256\":\"0x52a3f83a23917772f1eb242cecdfa8b45d7b357a615383628c1ac1f26259dd3f\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IUniswapV3TickSpacing.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\ninterface IUniswapV3TickSpacing {\\n function tickSpacing() external view returns (int24);\\n}\\n\",\"keccak256\":\"0xa6f22651f7e49c6eecf584d8e829d31336de7c43eec3c4c4df3b309db27bd355\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b5060405161273838038061273883398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516126a661009260003960008181610312015261103101526126a66000f3fe60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e620001583660046200151e565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e3660046200160f565b62000448565b6200015e620001a5366004620016b0565b620005b0565b6200016a6200068a565b6200015e620001c6366004620016b0565b620006f5565b6200016a620001dd3660046200151e565b620007d3565b620001ed620007fc565b604051620001749190620016f0565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001758565b6200023a6200080b565b6040516200017491906200176d565b6200023a6200025a3660046200151e565b62000820565b6200023a620008dd565b6200015e62000997565b620001ed62000285366004620017e5565b62000a04565b600254620001ed906001600160a01b031681565b620002b6620002b03660046200151e565b62000a22565b604051901515815260200162000174565b620001ed620002d836600462001878565b62000a3f565b62000221620002ef366004620018f2565b62000a5e565b6200015e6200030636600462001930565b62000bad565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e620003593660046200151e565b62000cb7565b6200015e620003703660046200151e565b62000d56565b620001ed620003873660046200151e565b62000e3d565b3362000398620007fc565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001982565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b03909116908490620019c4565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000ea4565b905090565b3362000453620007fc565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001982565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005aa57838181518110620004eb57620004eb620019de565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052c576200052c620019de565b9050602002810190620005409190620019f4565b6040518463ffffffff1660e01b8152600401620005609392919062001a3d565b600060405180830381600087803b1580156200057b57600080fd5b505af115801562000590573d6000803e3d6000fd5b505050508080620005a19062001a93565b915050620004cc565b50505050565b33620005bb620007fc565b6001600160a01b031614620005e45760405162461bcd60e51b8152600401620003c19062001982565b60005b81518110156200068657818181518110620006065762000606620019de565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063c9190620016f0565b600060405180830381600087803b1580156200065757600080fd5b505af11580156200066c573d6000803e3d6000fd5b5050505080806200067d9062001a93565b915050620005e7565b5050565b60008062000697620008dd565b905060005b8151811015620006f057620006cd828281518110620006bf57620006bf620019de565b6020026020010151620007d3565b620006d9908462001aaf565b925080620006e78162001a93565b9150506200069c565b505090565b3362000700620007fc565b6001600160a01b031614620007295760405162461bcd60e51b8152600401620003c19062001982565b60005b815181101562000686578181815181106200074b576200074b620019de565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200078992911690600401620016f0565b600060405180830381600087803b158015620007a457600080fd5b505af1158015620007b9573d6000803e3d6000fd5b505050508080620007ca9062001a93565b9150506200072c565b6001600160a01b0381166000908152600560205260408120620007f69062000ea4565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200082f83620007d3565b90506000816001600160401b038111156200084e576200084e6200153e565b60405190808252806020026020018201604052801562000878578160200160208202803683370190505b50905060005b82811015620008d55762000893858262000eaf565b828281518110620008a857620008a8620019de565b6001600160a01b039092166020928302919091019091015280620008cc8162001a93565b9150506200087e565b509392505050565b60606000620008eb62000435565b90506000816001600160401b038111156200090a576200090a6200153e565b60405190808252806020026020018201604052801562000934578160200160208202803683370190505b50905060005b8281101562000990576200094e8162000eda565b828281518110620009635762000963620019de565b6001600160a01b039092166020928302919091019091015280620009878162001a93565b9150506200093a565b5092915050565b33620009a2620007fc565b6001600160a01b031614620009cb5760405162461bcd60e51b8152600401620003c19062001982565b600080546040516001600160a01b039091169060008051602062002651833981519152908390a3600080546001600160a01b0319169055565b600062000a178787878787873362000ee9565b979650505050505050565b600062000a2f8262000e3d565b6001600160a01b03161592915050565b600062000a5486868660008787600062000ee9565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000aa1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000acb919081019062001ac5565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000b0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b38919081019062001ac5565b905062000ba46040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001243565b95945050505050565b600054600160a81b900460ff168062000bd05750600054600160a01b900460ff16155b62000c355760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000c60576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005aa576000805460ff60a81b1916905550505050565b3362000cc2620007fc565b6001600160a01b03161462000ceb5760405162461bcd60e51b8152600401620003c19062001982565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000d2c916001600160a01b03909116908490620019c4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000d61620007fc565b6001600160a01b03161462000d8a5760405162461bcd60e51b8152600401620003c19062001982565b6001600160a01b03811662000df35760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200265183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007f6919062001b63565b6000620007f6825490565b6001600160a01b038216600090815260056020526040812062000ed390836200127a565b9392505050565b6000620007f66003836200127a565b600080600062000efa8a8a62001288565b6001546040519294509092506001600160a01b031690309062000f1d90620014f7565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000f60573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb99062000fb29086908690600401620019c4565b600060405180830381865afa92505050801562000ff357506040513d6000823e601f3d908101601f1916820160405262000ff0919081019062001ac5565b60015b1562000ffc5790505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee8290606401602060405180830381865afa1580156200107b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010a1919062001b63565b90506001600160a01b038116620010f95760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b6200110681898962001356565b6200114b5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200118390859085908e908e908e908e9060040162001b83565b600060405180830381600087803b1580156200119e57600080fd5b505af1158015620011b3573d6000803e3d6000fd5b50505050620011cd3360036200140390919063ffffffff16565b50336000908152600560205260409020620011e9908662001403565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200126095949392919062001bf8565b604051602081830303815290604052905095945050505050565b600062000ed383836200141a565b600080826001600160a01b0316846001600160a01b031603620012db5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620012fd57828462001300565b83835b90925090506001600160a01b0382166200134f5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001398573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013be919062001c6d565b90508260020b8460020b128015620013e25750620013dd818562001c8d565b60020b155b801562000ba45750620013f6818462001c8d565b60020b1595945050505050565b600062000ed3836001600160a01b038416620014a5565b815460009082106200147a5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b826000018281548110620014925762001492620019de565b9060005260206000200154905092915050565b6000818152600183016020526040812054620014ee57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007f6565b506000620007f6565b6109928062001cbf83390190565b6001600160a01b03811681146200151b57600080fd5b50565b6000602082840312156200153157600080fd5b813562000ed38162001505565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200157f576200157f6200153e565b604052919050565b600082601f8301126200159957600080fd5b813560206001600160401b03821115620015b757620015b76200153e565b8160051b620015c882820162001554565b9283528481018201928281019087851115620015e357600080fd5b83870192505b8483101562000a17578235620015ff8162001505565b82529183019190830190620015e9565b6000806000604084860312156200162557600080fd5b83356001600160401b03808211156200163d57600080fd5b6200164b8783880162001587565b945060208601359150808211156200166257600080fd5b818601915086601f8301126200167757600080fd5b8135818111156200168757600080fd5b8760208260051b85010111156200169d57600080fd5b6020830194508093505050509250925092565b600060208284031215620016c357600080fd5b81356001600160401b03811115620016da57600080fd5b620016e88482850162001587565b949350505050565b6001600160a01b0391909116815260200190565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b60208152600062000ed360208301846200172a565b6020808252825182820181905260009190848201906040850190845b81811015620017b05783516001600160a01b03168352928401929184019160010162001789565b50909695505050505050565b803562ffffff81168114620017d057600080fd5b919050565b8060020b81146200151b57600080fd5b60008060008060008060c08789031215620017ff57600080fd5b86356200180c8162001505565b955060208701356200181e8162001505565b94506200182e60408801620017bc565b9350606087013561ffff811681146200184657600080fd5b925060808701356200185881620017d5565b915060a08701356200186a81620017d5565b809150509295509295509295565b600080600080600060a086880312156200189157600080fd5b85356200189e8162001505565b94506020860135620018b08162001505565b9350620018c060408701620017bc565b92506060860135620018d281620017d5565b91506080860135620018e481620017d5565b809150509295509295909350565b600080604083850312156200190657600080fd5b8235620019138162001505565b91506020830135620019258162001505565b809150509250929050565b6000806000606084860312156200194657600080fd5b8335620019538162001505565b92506020840135620019658162001505565b91506040840135620019778162001505565b809150509250925092565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811262001a0c57600080fd5b8301803591506001600160401b0382111562001a2757600080fd5b6020019150368190038213156200134f57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001aa85762001aa862001a7d565b5060010190565b80820180821115620007f657620007f662001a7d565b60006020828403121562001ad857600080fd5b81516001600160401b038082111562001af057600080fd5b818401915084601f83011262001b0557600080fd5b81518181111562001b1a5762001b1a6200153e565b62001b2f601f8201601f191660200162001554565b915080825285602082850101111562001b4757600080fd5b62001b5a81602084016020860162001704565b50949350505050565b60006020828403121562001b7657600080fd5b815162000ed38162001505565b60e08152600062001b9860e08301896200172a565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001c0c818460208b0162001704565b86519083019062001c22818360208b0162001704565b865191019062001c37818360208a0162001704565b855191019062001c4c81836020890162001704565b845191019062001c6181836020880162001704565b01979650505050505050565b60006020828403121562001c8057600080fd5b815162000ed381620017d5565b60008260020b8062001caf57634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220bab4dc364f42f8e82ed2983d450c7f7b787f86ecc2b056c62a10271dfd59e29364736f6c63430008130033", - "deployedBytecode": "0x60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e620001583660046200151e565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e3660046200160f565b62000448565b6200015e620001a5366004620016b0565b620005b0565b6200016a6200068a565b6200015e620001c6366004620016b0565b620006f5565b6200016a620001dd3660046200151e565b620007d3565b620001ed620007fc565b604051620001749190620016f0565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001758565b6200023a6200080b565b6040516200017491906200176d565b6200023a6200025a3660046200151e565b62000820565b6200023a620008dd565b6200015e62000997565b620001ed62000285366004620017e5565b62000a04565b600254620001ed906001600160a01b031681565b620002b6620002b03660046200151e565b62000a22565b604051901515815260200162000174565b620001ed620002d836600462001878565b62000a3f565b62000221620002ef366004620018f2565b62000a5e565b6200015e6200030636600462001930565b62000bad565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e620003593660046200151e565b62000cb7565b6200015e620003703660046200151e565b62000d56565b620001ed620003873660046200151e565b62000e3d565b3362000398620007fc565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001982565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b03909116908490620019c4565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000ea4565b905090565b3362000453620007fc565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001982565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005aa57838181518110620004eb57620004eb620019de565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200052c576200052c620019de565b9050602002810190620005409190620019f4565b6040518463ffffffff1660e01b8152600401620005609392919062001a3d565b600060405180830381600087803b1580156200057b57600080fd5b505af115801562000590573d6000803e3d6000fd5b505050508080620005a19062001a93565b915050620004cc565b50505050565b33620005bb620007fc565b6001600160a01b031614620005e45760405162461bcd60e51b8152600401620003c19062001982565b60005b81518110156200068657818181518110620006065762000606620019de565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200063c9190620016f0565b600060405180830381600087803b1580156200065757600080fd5b505af11580156200066c573d6000803e3d6000fd5b5050505080806200067d9062001a93565b915050620005e7565b5050565b60008062000697620008dd565b905060005b8151811015620006f057620006cd828281518110620006bf57620006bf620019de565b6020026020010151620007d3565b620006d9908462001aaf565b925080620006e78162001a93565b9150506200069c565b505090565b3362000700620007fc565b6001600160a01b031614620007295760405162461bcd60e51b8152600401620003c19062001982565b60005b815181101562000686578181815181106200074b576200074b620019de565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200078992911690600401620016f0565b600060405180830381600087803b158015620007a457600080fd5b505af1158015620007b9573d6000803e3d6000fd5b505050508080620007ca9062001a93565b9150506200072c565b6001600160a01b0381166000908152600560205260408120620007f69062000ea4565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200082f83620007d3565b90506000816001600160401b038111156200084e576200084e6200153e565b60405190808252806020026020018201604052801562000878578160200160208202803683370190505b50905060005b82811015620008d55762000893858262000eaf565b828281518110620008a857620008a8620019de565b6001600160a01b039092166020928302919091019091015280620008cc8162001a93565b9150506200087e565b509392505050565b60606000620008eb62000435565b90506000816001600160401b038111156200090a576200090a6200153e565b60405190808252806020026020018201604052801562000934578160200160208202803683370190505b50905060005b8281101562000990576200094e8162000eda565b828281518110620009635762000963620019de565b6001600160a01b039092166020928302919091019091015280620009878162001a93565b9150506200093a565b5092915050565b33620009a2620007fc565b6001600160a01b031614620009cb5760405162461bcd60e51b8152600401620003c19062001982565b600080546040516001600160a01b039091169060008051602062002651833981519152908390a3600080546001600160a01b0319169055565b600062000a178787878787873362000ee9565b979650505050505050565b600062000a2f8262000e3d565b6001600160a01b03161592915050565b600062000a5486868660008787600062000ee9565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000aa1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000acb919081019062001ac5565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000b0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b38919081019062001ac5565b905062000ba46040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001243565b95945050505050565b600054600160a81b900460ff168062000bd05750600054600160a01b900460ff16155b62000c355760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000c60576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005aa576000805460ff60a81b1916905550505050565b3362000cc2620007fc565b6001600160a01b03161462000ceb5760405162461bcd60e51b8152600401620003c19062001982565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000d2c916001600160a01b03909116908490620019c4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000d61620007fc565b6001600160a01b03161462000d8a5760405162461bcd60e51b8152600401620003c19062001982565b6001600160a01b03811662000df35760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200265183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007f6919062001b63565b6000620007f6825490565b6001600160a01b038216600090815260056020526040812062000ed390836200127a565b9392505050565b6000620007f66003836200127a565b600080600062000efa8a8a62001288565b6001546040519294509092506001600160a01b031690309062000f1d90620014f7565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000f60573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb99062000fb29086908690600401620019c4565b600060405180830381865afa92505050801562000ff357506040513d6000823e601f3d908101601f1916820160405262000ff0919081019062001ac5565b60015b1562000ffc5790505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee8290606401602060405180830381865afa1580156200107b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010a1919062001b63565b90506001600160a01b038116620010f95760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b6200110681898962001356565b6200114b5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200118390859085908e908e908e908e9060040162001b83565b600060405180830381600087803b1580156200119e57600080fd5b505af1158015620011b3573d6000803e3d6000fd5b50505050620011cd3360036200140390919063ffffffff16565b50336000908152600560205260409020620011e9908662001403565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200126095949392919062001bf8565b604051602081830303815290604052905095945050505050565b600062000ed383836200141a565b600080826001600160a01b0316846001600160a01b031603620012db5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620012fd57828462001300565b83835b90925090506001600160a01b0382166200134f5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001398573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013be919062001c6d565b90508260020b8460020b128015620013e25750620013dd818562001c8d565b60020b155b801562000ba45750620013f6818462001c8d565b60020b1595945050505050565b600062000ed3836001600160a01b038416620014a5565b815460009082106200147a5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b826000018281548110620014925762001492620019de565b9060005260206000200154905092915050565b6000818152600183016020526040812054620014ee57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007f6565b506000620007f6565b6109928062001cbf83390190565b6001600160a01b03811681146200151b57600080fd5b50565b6000602082840312156200153157600080fd5b813562000ed38162001505565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200157f576200157f6200153e565b604052919050565b600082601f8301126200159957600080fd5b813560206001600160401b03821115620015b757620015b76200153e565b8160051b620015c882820162001554565b9283528481018201928281019087851115620015e357600080fd5b83870192505b8483101562000a17578235620015ff8162001505565b82529183019190830190620015e9565b6000806000604084860312156200162557600080fd5b83356001600160401b03808211156200163d57600080fd5b6200164b8783880162001587565b945060208601359150808211156200166257600080fd5b818601915086601f8301126200167757600080fd5b8135818111156200168757600080fd5b8760208260051b85010111156200169d57600080fd5b6020830194508093505050509250925092565b600060208284031215620016c357600080fd5b81356001600160401b03811115620016da57600080fd5b620016e88482850162001587565b949350505050565b6001600160a01b0391909116815260200190565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b60208152600062000ed360208301846200172a565b6020808252825182820181905260009190848201906040850190845b81811015620017b05783516001600160a01b03168352928401929184019160010162001789565b50909695505050505050565b803562ffffff81168114620017d057600080fd5b919050565b8060020b81146200151b57600080fd5b60008060008060008060c08789031215620017ff57600080fd5b86356200180c8162001505565b955060208701356200181e8162001505565b94506200182e60408801620017bc565b9350606087013561ffff811681146200184657600080fd5b925060808701356200185881620017d5565b915060a08701356200186a81620017d5565b809150509295509295509295565b600080600080600060a086880312156200189157600080fd5b85356200189e8162001505565b94506020860135620018b08162001505565b9350620018c060408701620017bc565b92506060860135620018d281620017d5565b91506080860135620018e481620017d5565b809150509295509295909350565b600080604083850312156200190657600080fd5b8235620019138162001505565b91506020830135620019258162001505565b809150509250929050565b6000806000606084860312156200194657600080fd5b8335620019538162001505565b92506020840135620019658162001505565b91506040840135620019778162001505565b809150509250925092565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811262001a0c57600080fd5b8301803591506001600160401b0382111562001a2757600080fd5b6020019150368190038213156200134f57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052601160045260246000fd5b60006001820162001aa85762001aa862001a7d565b5060010190565b80820180821115620007f657620007f662001a7d565b60006020828403121562001ad857600080fd5b81516001600160401b038082111562001af057600080fd5b818401915084601f83011262001b0557600080fd5b81518181111562001b1a5762001b1a6200153e565b62001b2f601f8201601f191660200162001554565b915080825285602082850101111562001b4757600080fd5b62001b5a81602084016020860162001704565b50949350505050565b60006020828403121562001b7657600080fd5b815162000ed38162001505565b60e08152600062001b9860e08301896200172a565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001c0c818460208b0162001704565b86519083019062001c22818360208b0162001704565b865191019062001c37818360208a0162001704565b855191019062001c4c81836020890162001704565b845191019062001c6181836020880162001704565b01979650505050505050565b60006020828403121562001c8057600080fd5b815162000ed381620017d5565b60008260020b8062001caf57634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220bab4dc364f42f8e82ed2983d450c7f7b787f86ecc2b056c62a10271dfd59e29364736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "managerFee": "proportion of earned fees that go to pool manager in Basis Points", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "createPool(address,address,uint24,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "getDeployers()": { - "returns": { - "_0": "deployers the list of deployer addresses" - } - }, - "getGelatoPools()": { - "returns": { - "_0": "list of Gelato managed G-UNI pool addresses" - } - }, - "getPools(address)": { - "params": { - "deployer": "address that has potentially deployed G-UNI pools (can return empty array)" - }, - "returns": { - "_0": "pools the list of G-UNI pool addresses deployed by `deployer`" - } - }, - "getProxyAdmin(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "address that controls the G-UNI implementation (has power to upgrade it)" - } - }, - "isPoolImmutable(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "bool signaling if pool is immutable (true) or not (false)" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "numDeployers()": { - "returns": { - "_0": "total number of G-UNI pool deployer addresses" - } - }, - "numPools()": { - "returns": { - "result": "total number of G-UNI pools deployed" - } - }, - "numPools(address)": { - "params": { - "deployer": "deployer address" - }, - "returns": { - "_0": "total number of G-UNI pools deployed by `deployer`" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "notice": "createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`" - }, - "createPool(address,address,uint24,int24,int24)": { - "notice": "createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`" - }, - "getDeployers()": { - "notice": "getDeployers fetches all addresses that have deployed a G-UNI pool" - }, - "getGelatoPools()": { - "notice": "getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)" - }, - "getPools(address)": { - "notice": "getPools fetches all the G-UNI pool addresses deployed by `deployer`" - }, - "getProxyAdmin(address)": { - "notice": "getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address)." - }, - "isPoolImmutable(address)": { - "notice": "isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded" - }, - "numDeployers()": { - "notice": "numDeployers counts the total number of G-UNI pool deployer addresses" - }, - "numPools()": { - "notice": "numPools counts the total number of G-UNI pools in existence" - }, - "numPools(address)": { - "notice": "numPools counts the total number of G-UNI pools deployed by `deployer`" - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6441, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_manager", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 5, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initialized", - "offset": 20, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initializing", - "offset": 21, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 5909, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "poolImplementation", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 5911, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "gelatoDeployer", - "offset": 0, - "slot": "2", - "type": "t_address" - }, - { - "astId": 5914, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_deployers", - "offset": 0, - "slot": "3", - "type": "t_struct(AddressSet)2007_storage" - }, - { - "astId": 5919, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_pools", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_struct(AddressSet)2007_storage)" - } - ], - "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_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(AddressSet)2007_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.AddressSet)", - "numberOfBytes": "32", - "value": "t_struct(AddressSet)2007_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(AddressSet)2007_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.AddressSet", - "members": [ - { - "astId": 2006, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1732_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Set)1732_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 1727, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 1731, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "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/lib/g-uni-v1-core/deployments/modeSepolia/GUniFactory_Proxy.json b/lib/g-uni-v1-core/deployments/modeSepolia/GUniFactory_Proxy.json deleted file mode 100644 index 7dcac2a60..000000000 --- a/lib/g-uni-v1-core/deployments/modeSepolia/GUniFactory_Proxy.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "address": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x9e92b7b419cc62dde1aadd2fa750de298ef790070620569671994356527bd4a8", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F", - "transactionIndex": 1, - "gasUsed": "551510", - "logsBloom": "0x00100000800020000000000000000000000000000000000000000080000000000000000000000000010400000000000000000000000000000000000000000000000040000000000000000000000008000000000000000000000000000200000000000000020000000000000000008800000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000000400000000001000000000000000000000000000000000", - "blockHash": "0xf829ad2b3e67b2623fddc236797a247dd11794e41416c1fc4d1e1030e753f06e", - "transactionHash": "0x9e92b7b419cc62dde1aadd2fa750de298ef790070620569671994356527bd4a8", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 15086476, - "transactionHash": "0x9e92b7b419cc62dde1aadd2fa750de298ef790070620569671994356527bd4a8", - "address": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000909f26919989167d051312fbb0a1df4cd93bf70b" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0xf829ad2b3e67b2623fddc236797a247dd11794e41416c1fc4d1e1030e753f06e" - }, - { - "transactionIndex": 1, - "blockNumber": 15086476, - "transactionHash": "0x9e92b7b419cc62dde1aadd2fa750de298ef790070620569671994356527bd4a8", - "address": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0xf829ad2b3e67b2623fddc236797a247dd11794e41416c1fc4d1e1030e753f06e" - } - ], - "blockNumber": 15086476, - "cumulativeGasUsed": "603737", - "status": 1, - "byzantium": true - }, - "args": [ - "0x909F26919989167d051312fBB0a1Df4CD93Bf70b", - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b000000000000000000000000909f26919989167d051312fbb0a1df4cd93bf70b000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x3e2e1473604e7e42e99f77ad5e5d8eb8a3b6d0e63c154a9c6d9a223190372070\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5fd4f538f92f377d4e7b09fe8d5387eb1d5ff5ac95869c969be5049ae23439ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610992380380610992833981016040819052610022916101de565b61002c838261003d565b61003582610119565b5050506102ca565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102ae565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109728339815191525490565b90508160008051602061097283398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b6000806000606084860312156101f357600080fd5b6101fc84610188565b925061020a60208501610188565b60408501519092506001600160401b038082111561022757600080fd5b818601915086601f83011261023b57600080fd5b81518181111561024d5761024d6101a4565b604051601f8201601f19908116603f01168101908382118183101715610275576102756101a4565b8160405282815289602084870101111561028e57600080fd5b61029f8360208301602088016101ba565b80955050505050509250925092565b600082516102c08184602087016101ba565b9190910192915050565b610699806102d96000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106448339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831690036101e157506000919050565b600080516020610644833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106248339815191525490565b6000805160206106448339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061062483398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b50600092019182525091905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220f8092c6d4e38cdaacdb3c899e6c75d21baaeaba76b22f353673f931b1f0f8a9b64736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/modeSepolia/GUniPool.json b/lib/g-uni-v1-core/deployments/modeSepolia/GUniPool.json deleted file mode 100644 index 574d3ddb6..000000000 --- a/lib/g-uni-v1-core/deployments/modeSepolia/GUniPool.json +++ /dev/null @@ -1,1649 +0,0 @@ -{ - "address": "0xe1B83edA3399A2c9B8265215EA21042C9b918dc5", - "abi": [ - { - "inputs": [ - { - "internalType": "address payable", - "name": "_gelato", - "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": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned0", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned1", - "type": "uint256" - } - ], - "name": "FeesEarned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int24", - "name": "lowerTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "int24", - "name": "upperTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBefore", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityAfter", - "type": "uint128" - } - ], - "name": "Rebalance", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - } - ], - "name": "SetManagerFee", - "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" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldAdminTreasury", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdminTreasury", - "type": "address" - } - ], - "name": "UpdateAdminTreasury", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoRebalanceBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoWithdrawBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoSlippageBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "gelatoSlippageInterval", - "type": "uint32" - } - ], - "name": "UpdateGelatoParams", - "type": "event" - }, - { - "inputs": [], - "name": "GELATO", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "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": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "burn", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "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": [ - { - "internalType": "int24", - "name": "newLowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "newUpperTick", - "type": "int24" - }, - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - } - ], - "name": "executiveRebalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoRebalanceBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageInterval", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoWithdrawBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Max", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Max", - "type": "uint256" - } - ], - "name": "getMintAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPositionID", - "outputs": [ - { - "internalType": "bytes32", - "name": "positionID", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUnderlyingBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "sqrtRatioX96", - "type": "uint160" - } - ], - "name": "getUnderlyingBalancesAtPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "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": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "address", - "name": "_pool", - "type": "address" - }, - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "_lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "_upperTick", - "type": "int24" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - } - ], - "name": "initializeManagerFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "lowerTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerTreasury", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pool", - "outputs": [ - { - "internalType": "contract IUniswapV3Pool", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "paymentToken", - "type": "address" - } - ], - "name": "rebalance", - "outputs": [], - "stateMutability": "nonpayable", - "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": "token0", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token1", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Owed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Owed", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3MintCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amount0Delta", - "type": "int256" - }, - { - "internalType": "int256", - "name": "amount1Delta", - "type": "int256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3SwapCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "newRebalanceBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newWithdrawBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newSlippageBPS", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "newSlippageInterval", - "type": "uint32" - }, - { - "internalType": "address", - "name": "newTreasury", - "type": "address" - } - ], - "name": "updateGelatoParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "upperTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawGelatoBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawManagerBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x9598de42fd9366e0c83dede9e3f2e4266b2fd226a7481da1e2186aebe5eebe2a", - "receipt": { - "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0xe1B83edA3399A2c9B8265215EA21042C9b918dc5", - "transactionIndex": 1, - "gasUsed": "5209546", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x32c6236cf9c11262a001973f3f0c797bdfec48929c1ea276c0aea0361f9466eb", - "transactionHash": "0x9598de42fd9366e0c83dede9e3f2e4266b2fd226a7481da1e2186aebe5eebe2a", - "logs": [], - "blockNumber": 15254909, - "cumulativeGasUsed": "5253409", - "status": 1, - "byzantium": true - }, - "args": [ - "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - ], - "solcInputHash": "f1f932b5297d788fce5c0abb03e1e395", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_gelato\",\"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\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned1\",\"type\":\"uint256\"}],\"name\":\"FeesEarned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"lowerTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"upperTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBefore\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityAfter\",\"type\":\"uint128\"}],\"name\":\"Rebalance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"}],\"name\":\"SetManagerFee\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAdminTreasury\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdminTreasury\",\"type\":\"address\"}],\"name\":\"UpdateAdminTreasury\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoRebalanceBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoWithdrawBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoSlippageBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gelatoSlippageInterval\",\"type\":\"uint32\"}],\"name\":\"UpdateGelatoParams\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GELATO\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"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\":[{\"internalType\":\"int24\",\"name\":\"newLowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"newUpperTick\",\"type\":\"int24\"},{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"}],\"name\":\"executiveRebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoRebalanceBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageInterval\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoWithdrawBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Max\",\"type\":\"uint256\"}],\"name\":\"getMintAmounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPositionID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"positionID\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUnderlyingBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtRatioX96\",\"type\":\"uint160\"}],\"name\":\"getUnderlyingBalancesAtPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"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\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_pool\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"_lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"_upperTick\",\"type\":\"int24\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"}],\"name\":\"initializeManagerFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lowerTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pool\",\"outputs\":[{\"internalType\":\"contract IUniswapV3Pool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"}],\"name\":\"rebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"token0\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newRebalanceBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newWithdrawBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newSlippageBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"newSlippageInterval\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateGelatoParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upperTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawGelatoBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawManagerBalance\",\"outputs\":[],\"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\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"burn(uint256,address)\":{\"params\":{\"burnAmount\":\"The number of G-UNI tokens to burn\",\"receiver\":\"The account to receive the underlying amounts of token0 and token1\"},\"returns\":{\"amount0\":\"amount of token0 transferred to receiver for burning `burnAmount`\",\"amount1\":\"amount of token1 transferred to receiver for burning `burnAmount`\",\"liquidityBurned\":\"amount of liquidity removed from the underlying Uniswap V3 position\"}},\"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 this function is overridden; 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`.\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"details\":\"When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.\",\"params\":{\"newLowerTick\":\"The new lower bound of the position's range\",\"newUpperTick\":\"The new upper bound of the position's range\",\"swapAmountBPS\":\"amount of token to swap as proportion of total. Pass 0 to ignore swap.\",\"swapThresholdPrice\":\"slippage parameter on the swap as a max or min sqrtPriceX96\",\"zeroForOne\":\"Which token to input into the swap (true = token0, false = token1)\"}},\"getMintAmounts(uint256,uint256)\":{\"params\":{\"amount0Max\":\"The maximum amount of token1 to forward on mint\"},\"returns\":{\"amount0\":\"actual amount of token0 to forward when minting `mintAmount`\",\"amount1\":\"actual amount of token1 to forward when minting `mintAmount`\",\"mintAmount\":\"maximum number of G-UNI tokens to mint\"}},\"getUnderlyingBalances()\":{\"returns\":{\"amount0Current\":\"current total underlying balance of token0\",\"amount1Current\":\"current total underlying balance of token1\"}},\"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.\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"params\":{\"_lowerTick\":\"initial upperTick (only changeable with executiveRebalance)\",\"_managerFeeBPS\":\"proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\",\"_manager_\":\"address of manager (ownership can be transferred)\",\"_name\":\"name of G-UNI token\",\"_pool\":\"address of Uniswap V3 pool\",\"_symbol\":\"symbol of G-UNI token\"}},\"initializeManagerFee(uint16)\":{\"params\":{\"_managerFeeBPS\":\"proportion of fees earned that are credited to manager in Basis Points\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"mint(uint256,address)\":{\"details\":\"to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\",\"params\":{\"mintAmount\":\"The number of G-UNI tokens to mint\",\"receiver\":\"The account to receive the minted tokens\"},\"returns\":{\"amount0\":\"amount of token0 transferred from msg.sender to mint `mintAmount`\",\"amount1\":\"amount of token1 transferred from msg.sender to mint `mintAmount`\",\"liquidityMinted\":\"amount of liquidity added to the underlying Uniswap V3 position\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"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 manager.\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"params\":{\"newRebalanceBPS\":\"controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\",\"newSlippageBPS\":\"maximum slippage on swaps during gelato rebalance\",\"newSlippageInterval\":\"length of time for TWAP used in computing slippage on swaps\",\"newTreasury\":\"address where managerFee withdrawals are sent\",\"newWithdrawBPS\":\"controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(uint256,address)\":{\"notice\":\"burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"notice\":\"Change the range of underlying UniswapV3 position, only manager can call\"},\"getMintAmounts(uint256,uint256)\":{\"notice\":\"compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\"},\"getUnderlyingBalances()\":{\"notice\":\"compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"notice\":\"initialize storage variables on a new G-UNI pool, only called once\"},\"initializeManagerFee(uint16)\":{\"notice\":\"initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\"},\"mint(uint256,address)\":{\"notice\":\"mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\"},\"rebalance(uint160,uint256,bool,uint256,address)\":{\"notice\":\"Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\"},\"uniswapV3MintCallback(uint256,uint256,bytes)\":{\"notice\":\"Uniswap V3 callback fn, called back on pool.mint\"},\"uniswapV3SwapCallback(int256,int256,bytes)\":{\"notice\":\"Uniswap v3 callback fn, called back on pool.swap\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"notice\":\"change configurable parameters, only manager can call\"},\"withdrawGelatoBalance(uint256,address)\":{\"notice\":\"withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"},\"withdrawManagerBalance(uint256,address)\":{\"notice\":\"withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniPool.sol\":\"GUniPool\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal initializer {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal initializer {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and make it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x89fa60d14355f7ae06af11e28fce2bb90c5c6186645d681a30e1b36234a4c210\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\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\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The defaut value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\\n __Context_init_unchained();\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override 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 override 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 this function is\\n * overridden;\\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 override returns (uint8) {\\n return 18;\\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\\n uint256 currentAllowance = _allowances[sender][_msgSender()];\\n require(currentAllowance >= amount, \\\"ERC20: transfer amount exceeds allowance\\\");\\n _approve(sender, _msgSender(), currentAllowance - amount);\\n\\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\\n\\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 uint256 senderBalance = _balances[sender];\\n require(senderBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n _balances[sender] = senderBalance - amount;\\n _balances[recipient] += amount;\\n\\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 += amount;\\n _balances[account] += 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 uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n _balances[account] = accountBalance - amount;\\n _totalSupply -= amount;\\n\\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 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 uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0x9c2d7425f3343ea340d6ea67e9d90109d4d846bb013c2572096ec88c9e74946b\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\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\":\"0x8d4a0f2b5b760b5e2c19ed3c108d83897a4dfd5bfed97a93867918df19191e5e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x6795c369a4eefa78468e38966f7851fbc2dda5e5b9ccd3fa2b45970e2e4d3abd\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../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 initializer {\\n __Context_init_unchained();\\n }\\n\\n function __Context_init_unchained() internal initializer {\\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x8e9eb503de1189f50c5f16fef327da310b11898d6b9ab3ca937df07c35233b9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.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 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) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\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\":\"0x99f5c21018d796db7833a2100bb0e7411999e248a3c950fb526eee5d2bf47cb7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0x069b2631bb5b5193a58ccf7a06266c7361bd2c20095667af4402817605627f45\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCast {\\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 require(value < 2**128, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return uint128(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 require(value < 2**64, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return uint64(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 require(value < 2**32, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return uint32(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 require(value < 2**16, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\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 require(value < 2**8, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\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 require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n return uint256(value);\\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 * _Available since v3.1._\\n */\\n function toInt128(int256 value) internal pure returns (int128) {\\n require(value >= -2**127 && value < 2**127, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return int128(value);\\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 * _Available since v3.1._\\n */\\n function toInt64(int256 value) internal pure returns (int64) {\\n require(value >= -2**63 && value < 2**63, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return int64(value);\\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 * _Available since v3.1._\\n */\\n function toInt32(int256 value) internal pure returns (int32) {\\n require(value >= -2**31 && value < 2**31, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return int32(value);\\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 * _Available since v3.1._\\n */\\n function toInt16(int256 value) internal pure returns (int16) {\\n require(value >= -2**15 && value < 2**15, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\n return int16(value);\\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 * _Available since v3.1._\\n */\\n function toInt8(int256 value) internal pure returns (int8) {\\n require(value >= -2**7 && value < 2**7, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\n return int8(value);\\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 require(value < 2**255, \\\"SafeCast: value doesn't fit in an int256\\\");\\n return int256(value);\\n }\\n}\\n\",\"keccak256\":\"0xc37d85b96c2a8d7bc09f25958e0a81394bf5780286444147ddf875fa628d53ce\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\nimport './pool/IUniswapV3PoolImmutables.sol';\\nimport './pool/IUniswapV3PoolState.sol';\\nimport './pool/IUniswapV3PoolDerivedState.sol';\\nimport './pool/IUniswapV3PoolActions.sol';\\nimport './pool/IUniswapV3PoolOwnerActions.sol';\\nimport './pool/IUniswapV3PoolEvents.sol';\\n\\n/// @title The interface for a Uniswap V3 Pool\\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\\n/// to the ERC20 specification\\n/// @dev The pool interface is broken up into many smaller pieces\\ninterface IUniswapV3Pool is\\n IUniswapV3PoolImmutables,\\n IUniswapV3PoolState,\\n IUniswapV3PoolDerivedState,\\n IUniswapV3PoolActions,\\n IUniswapV3PoolOwnerActions,\\n IUniswapV3PoolEvents\\n{\\n\\n}\\n\",\"keccak256\":\"0xfe6113d518466cd6652c85b111e01f33eb62157f49ae5ed7d5a3947a2044adb1\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#mint\\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\\ninterface IUniswapV3MintCallback {\\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x27a9725b8f831a92d16380860c3d348a0b926a7f01b34a54ea6eea78cbdbcd6a\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#swap\\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\\ninterface IUniswapV3SwapCallback {\\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x3f485fb1a44e8fbeadefb5da07d66edab3cfe809f0ac4074b1e54e3eb3c4cf69\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissionless pool actions\\n/// @notice Contains pool methods that can be called by anyone\\ninterface IUniswapV3PoolActions {\\n /// @notice Sets the initial price for the pool\\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\\n function initialize(uint160 sqrtPriceX96) external;\\n\\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\\n /// @param recipient The address for which the liquidity will be created\\n /// @param tickLower The lower tick of the position in which to add liquidity\\n /// @param tickUpper The upper tick of the position in which to add liquidity\\n /// @param amount The amount of liquidity to mint\\n /// @param data Any data that should be passed through to the callback\\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n function mint(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount,\\n bytes calldata data\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Collects tokens owed to a position\\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\\n /// @param recipient The address which should receive the fees collected\\n /// @param tickLower The lower tick of the position for which to collect fees\\n /// @param tickUpper The upper tick of the position for which to collect fees\\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\\n /// @return amount0 The amount of fees collected in token0\\n /// @return amount1 The amount of fees collected in token1\\n function collect(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n\\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\\n /// @dev Fees must be collected separately via a call to #collect\\n /// @param tickLower The lower tick of the position for which to burn liquidity\\n /// @param tickUpper The upper tick of the position for which to burn liquidity\\n /// @param amount How much liquidity to burn\\n /// @return amount0 The amount of token0 sent to the recipient\\n /// @return amount1 The amount of token1 sent to the recipient\\n function burn(\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Swap token0 for token1, or token1 for token0\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\\n /// @param recipient The address to receive the output of the swap\\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\\n /// @param data Any data to be passed through to the callback\\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\\n function swap(\\n address recipient,\\n bool zeroForOne,\\n int256 amountSpecified,\\n uint160 sqrtPriceLimitX96,\\n bytes calldata data\\n ) external returns (int256 amount0, int256 amount1);\\n\\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\\n /// @param recipient The address which will receive the token0 and token1 amounts\\n /// @param amount0 The amount of token0 to send\\n /// @param amount1 The amount of token1 to send\\n /// @param data Any data to be passed through to the callback\\n function flash(\\n address recipient,\\n uint256 amount0,\\n uint256 amount1,\\n bytes calldata data\\n ) external;\\n\\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\\n /// the input observationCardinalityNext.\\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0x9453dd0e7442188667d01d9b65de3f1e14e9511ff3e303179a15f6fc267f7634\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that is not stored\\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\\n/// blockchain. The functions here may have variable gas costs.\\ninterface IUniswapV3PoolDerivedState {\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\\n /// you must call it with secondsAgos = [3600, 0].\\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\\n /// timestamp\\n function observe(uint32[] calldata secondsAgos)\\n external\\n view\\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\\n\\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\\n /// snapshot is taken and the second snapshot is taken.\\n /// @param tickLower The lower tick of the range\\n /// @param tickUpper The upper tick of the range\\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\\n /// @return secondsInside The snapshot of seconds per liquidity for the range\\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\\n external\\n view\\n returns (\\n int56 tickCumulativeInside,\\n uint160 secondsPerLiquidityInsideX128,\\n uint32 secondsInside\\n );\\n}\\n\",\"keccak256\":\"0xe603ac5b17ecdee73ba2b27efdf386c257a19c14206e87eee77e2017b742d9e5\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Events emitted by a pool\\n/// @notice Contains all events emitted by the pool\\ninterface IUniswapV3PoolEvents {\\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\\n event Initialize(uint160 sqrtPriceX96, int24 tick);\\n\\n /// @notice Emitted when liquidity is minted for a given position\\n /// @param sender The address that minted the liquidity\\n /// @param owner The owner of the position and recipient of any minted liquidity\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity minted to the position range\\n /// @param amount0 How much token0 was required for the minted liquidity\\n /// @param amount1 How much token1 was required for the minted liquidity\\n event Mint(\\n address sender,\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted when fees are collected by the owner of a position\\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\\n /// @param owner The owner of the position for which fees are collected\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount0 The amount of token0 fees collected\\n /// @param amount1 The amount of token1 fees collected\\n event Collect(\\n address indexed owner,\\n address recipient,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount0,\\n uint128 amount1\\n );\\n\\n /// @notice Emitted when a position's liquidity is removed\\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\\n /// @param owner The owner of the position for which liquidity is removed\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity to remove\\n /// @param amount0 The amount of token0 withdrawn\\n /// @param amount1 The amount of token1 withdrawn\\n event Burn(\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted by the pool for any swaps between token0 and token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the output of the swap\\n /// @param amount0 The delta of the token0 balance of the pool\\n /// @param amount1 The delta of the token1 balance of the pool\\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param liquidity The liquidity of the pool after the swap\\n /// @param tick The log base 1.0001 of price of the pool after the swap\\n event Swap(\\n address indexed sender,\\n address indexed recipient,\\n int256 amount0,\\n int256 amount1,\\n uint160 sqrtPriceX96,\\n uint128 liquidity,\\n int24 tick\\n );\\n\\n /// @notice Emitted by the pool for any flashes of token0/token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the tokens from flash\\n /// @param amount0 The amount of token0 that was flashed\\n /// @param amount1 The amount of token1 that was flashed\\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\\n event Flash(\\n address indexed sender,\\n address indexed recipient,\\n uint256 amount0,\\n uint256 amount1,\\n uint256 paid0,\\n uint256 paid1\\n );\\n\\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\\n /// just before a mint/swap/burn.\\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(\\n uint16 observationCardinalityNextOld,\\n uint16 observationCardinalityNextNew\\n );\\n\\n /// @notice Emitted when the protocol fee is changed by the pool\\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\\n /// @param feeProtocol0New The updated value of the token0 protocol fee\\n /// @param feeProtocol1New The updated value of the token1 protocol fee\\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\\n\\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\\n /// @param sender The address that collects the protocol fees\\n /// @param recipient The address that receives the collected protocol fees\\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x8071514d0fe5d17d6fbd31c191cdfb703031c24e0ece3621d88ab10e871375cd\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that never changes\\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\\ninterface IUniswapV3PoolImmutables {\\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\\n /// @return The contract address\\n function factory() external view returns (address);\\n\\n /// @notice The first of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token0() external view returns (address);\\n\\n /// @notice The second of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token1() external view returns (address);\\n\\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\\n /// @return The fee\\n function fee() external view returns (uint24);\\n\\n /// @notice The pool tick spacing\\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\\n /// This value is an int24 to avoid casting even though it is always positive.\\n /// @return The tick spacing\\n function tickSpacing() external view returns (int24);\\n\\n /// @notice The maximum amount of position liquidity that can use any tick in the range\\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\\n /// @return The max amount of liquidity per tick\\n function maxLiquidityPerTick() external view returns (uint128);\\n}\\n\",\"keccak256\":\"0xf6e5d2cd1139c4c276bdbc8e1d2b256e456c866a91f1b868da265c6d2685c3f7\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissioned pool actions\\n/// @notice Contains pool methods that may only be called by the factory owner\\ninterface IUniswapV3PoolOwnerActions {\\n /// @notice Set the denominator of the protocol's % share of the fees\\n /// @param feeProtocol0 new protocol fee for token0 of the pool\\n /// @param feeProtocol1 new protocol fee for token1 of the pool\\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\\n\\n /// @notice Collect the protocol fee accrued to the pool\\n /// @param recipient The address to which collected protocol fees should be sent\\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\\n /// @return amount0 The protocol fee collected in token0\\n /// @return amount1 The protocol fee collected in token1\\n function collectProtocol(\\n address recipient,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x759b78a2918af9e99e246dc3af084f654e48ef32bb4e4cb8a966aa3dcaece235\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that can change\\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\\n/// per transaction\\ninterface IUniswapV3PoolState {\\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\\n /// when accessed externally.\\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\\n /// boundary.\\n /// observationIndex The index of the last oracle observation that was written,\\n /// observationCardinality The current maximum number of observations stored in the pool,\\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// feeProtocol The protocol fee for both tokens of the pool.\\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\\n /// unlocked Whether the pool is currently locked to reentrancy\\n function slot0()\\n external\\n view\\n returns (\\n uint160 sqrtPriceX96,\\n int24 tick,\\n uint16 observationIndex,\\n uint16 observationCardinality,\\n uint16 observationCardinalityNext,\\n uint8 feeProtocol,\\n bool unlocked\\n );\\n\\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal0X128() external view returns (uint256);\\n\\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal1X128() external view returns (uint256);\\n\\n /// @notice The amounts of token0 and token1 that are owed to the protocol\\n /// @dev Protocol fees will never exceed uint128 max in either token\\n function protocolFees() external view returns (uint128 token0, uint128 token1);\\n\\n /// @notice The currently in range liquidity available to the pool\\n /// @dev This value has no relationship to the total liquidity across all ticks\\n function liquidity() external view returns (uint128);\\n\\n /// @notice Look up information about a specific tick in the pool\\n /// @param tick The tick to look up\\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\\n /// tick upper,\\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\\n /// a specific position.\\n function ticks(int24 tick)\\n external\\n view\\n returns (\\n uint128 liquidityGross,\\n int128 liquidityNet,\\n uint256 feeGrowthOutside0X128,\\n uint256 feeGrowthOutside1X128,\\n int56 tickCumulativeOutside,\\n uint160 secondsPerLiquidityOutsideX128,\\n uint32 secondsOutside,\\n bool initialized\\n );\\n\\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\\n function tickBitmap(int16 wordPosition) external view returns (uint256);\\n\\n /// @notice Returns the information about a position by the position's key\\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\\n /// @return _liquidity The amount of liquidity in the position,\\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\\n function positions(bytes32 key)\\n external\\n view\\n returns (\\n uint128 _liquidity,\\n uint256 feeGrowthInside0LastX128,\\n uint256 feeGrowthInside1LastX128,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param index The element of the observations array to fetch\\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\\n /// ago, rather than at a specific index in the array.\\n /// @return blockTimestamp The timestamp of the observation,\\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// Returns initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 index)\\n external\\n view\\n returns (\\n uint32 blockTimestamp,\\n int56 tickCumulative,\\n uint160 secondsPerLiquidityCumulativeX128,\\n bool initialized\\n );\\n}\\n\",\"keccak256\":\"0x852dc1f5df7dcf7f11e7bb3eed79f0cea72ad4b25f6a9d2c35aafb48925fd49f\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.4.0;\\n\\n/// @title FixedPoint96\\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\\n/// @dev Used in SqrtPriceMath.sol\\nlibrary FixedPoint96 {\\n uint8 internal constant RESOLUTION = 96;\\n uint256 internal constant Q96 = 0x1000000000000000000000000;\\n}\\n\",\"keccak256\":\"0x0ba8a9b95a956a4050749c0158e928398c447c91469682ca8a7cc7e77a7fe032\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {\\n IUniswapV3MintCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\\\";\\nimport {\\n IUniswapV3SwapCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\\\";\\nimport {GUniPoolStorage} from \\\"./abstract/GUniPoolStorage.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {TickMath} from \\\"./vendor/uniswap/TickMath.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {SafeCast} from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport {\\n FullMath,\\n LiquidityAmounts\\n} from \\\"./vendor/uniswap/LiquidityAmounts.sol\\\";\\n\\ncontract GUniPool is\\n IUniswapV3MintCallback,\\n IUniswapV3SwapCallback,\\n GUniPoolStorage\\n{\\n using SafeERC20 for IERC20;\\n using TickMath for int24;\\n\\n event Minted(\\n address receiver,\\n uint256 mintAmount,\\n uint256 amount0In,\\n uint256 amount1In,\\n uint128 liquidityMinted\\n );\\n\\n event Burned(\\n address receiver,\\n uint256 burnAmount,\\n uint256 amount0Out,\\n uint256 amount1Out,\\n uint128 liquidityBurned\\n );\\n\\n event Rebalance(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidityBefore,\\n uint128 liquidityAfter\\n );\\n\\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice Uniswap V3 callback fn, called back on pool.mint\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata /*_data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\\n }\\n\\n /// @notice Uniswap v3 callback fn, called back on pool.swap\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata /*data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Delta > 0)\\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\\n else if (amount1Delta > 0)\\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\\n }\\n\\n // User functions => Should be called via a Router\\n\\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\\n /// @param mintAmount The number of G-UNI tokens to mint\\n /// @param receiver The account to receive the minted tokens\\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function mint(uint256 mintAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityMinted\\n )\\n {\\n require(mintAmount > 0, \\\"mint 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n\\n if (totalSupply > 0) {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n amount0 = FullMath.mulDivRoundingUp(\\n amount0Current,\\n mintAmount,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n amount1Current,\\n mintAmount,\\n totalSupply\\n );\\n } else {\\n // if supply is 0 mintAmount == liquidity to deposit\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n SafeCast.toUint128(mintAmount)\\n );\\n }\\n\\n // transfer amounts owed to contract\\n if (amount0 > 0) {\\n token0.safeTransferFrom(msg.sender, address(this), amount0);\\n }\\n if (amount1 > 0) {\\n token1.safeTransferFrom(msg.sender, address(this), amount1);\\n }\\n\\n // deposit as much new liquidity as possible\\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n\\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \\\"\\\");\\n\\n _mint(receiver, mintAmount);\\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\\n }\\n\\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\\n /// @param burnAmount The number of G-UNI tokens to burn\\n /// @param receiver The account to receive the underlying amounts of token0 and token1\\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines\\n function burn(uint256 burnAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityBurned\\n )\\n {\\n require(burnAmount > 0, \\\"burn 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n\\n _burn(msg.sender, burnAmount);\\n\\n uint256 liquidityBurned_ =\\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidityBurned);\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n\\n amount0 =\\n burn0 +\\n FullMath.mulDiv(\\n token0.balanceOf(address(this)) -\\n burn0 -\\n managerBalance0 -\\n gelatoBalance0,\\n burnAmount,\\n totalSupply\\n );\\n amount1 =\\n burn1 +\\n FullMath.mulDiv(\\n token1.balanceOf(address(this)) -\\n burn1 -\\n managerBalance1 -\\n gelatoBalance1,\\n burnAmount,\\n totalSupply\\n );\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(receiver, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(receiver, amount1);\\n }\\n\\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\\n }\\n\\n // Manager Functions => Called by Pool Manager\\n\\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\\n /// any leftover will be unused and sit idle until the next rebalance.\\n /// @param newLowerTick The new lower bound of the position's range\\n /// @param newUpperTick The new upper bound of the position's range\\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\\n // solhint-disable-next-line function-max-lines\\n function executiveRebalance(\\n int24 newLowerTick,\\n int24 newUpperTick,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) external onlyManager {\\n uint128 liquidity;\\n uint128 newLiquidity;\\n if (totalSupply() > 0) {\\n (liquidity, , , , ) = pool.positions(_getPositionID());\\n if (liquidity > 0) {\\n (, , uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n }\\n\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n\\n uint256 reinvest0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n uint256 reinvest1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n\\n _deposit(\\n newLowerTick,\\n newUpperTick,\\n reinvest0,\\n reinvest1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n\\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > 0, \\\"new position 0\\\");\\n } else {\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n }\\n\\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\\n }\\n\\n // Gelatofied functions => Automatically called by Gelato\\n\\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\\n function rebalance(\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) external gelatofy(feeAmount, paymentToken) {\\n if (swapAmountBPS > 0) {\\n _checkSlippage(swapThresholdPrice, zeroForOne);\\n }\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n _rebalance(\\n liquidity,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne,\\n feeAmount,\\n paymentToken\\n );\\n\\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > liquidity, \\\"liquidity must increase\\\");\\n\\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\\n }\\n\\n /// @notice withdraw manager fees accrued, only gelato executors can call.\\n /// Target account to receive fees is managerTreasury, alterable by manager.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n managerBalance0,\\n managerBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(managerTreasury, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(managerTreasury, amount1);\\n }\\n }\\n\\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n gelatoBalance0,\\n gelatoBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n gelatoBalance0 = 0;\\n gelatoBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(GELATO, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(GELATO, amount1);\\n }\\n }\\n\\n function _balancesToWithdraw(\\n uint256 balance0,\\n uint256 balance1,\\n uint256 feeAmount,\\n address feeToken\\n ) internal view returns (uint256 amount0, uint256 amount1) {\\n if (feeToken == address(token0)) {\\n require(\\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount0 = balance0 - feeAmount;\\n amount1 = balance1;\\n } else if (feeToken == address(token1)) {\\n require(\\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount1 = balance1 - feeAmount;\\n amount0 = balance0;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n }\\n\\n // View functions\\n\\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\\n /// @param amount0Max The maximum amount of token0 to forward on mint\\n /// @param amount0Max The maximum amount of token1 to forward on mint\\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\\n /// @return mintAmount maximum number of G-UNI tokens to mint\\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\\n external\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n uint256 totalSupply = totalSupply();\\n if (totalSupply > 0) {\\n (amount0, amount1, mintAmount) = _computeMintAmounts(\\n totalSupply,\\n amount0Max,\\n amount1Max\\n );\\n } else {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 newLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0Max,\\n amount1Max\\n );\\n mintAmount = uint256(newLiquidity);\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n newLiquidity\\n );\\n }\\n }\\n\\n /// @notice compute total underlying holdings of the G-UNI token supply\\n /// includes current liquidity invested in uniswap position, current fees earned\\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\\n /// @return amount0Current current total underlying balance of token0\\n /// @return amount1Current current total underlying balance of token1\\n function getUnderlyingBalances()\\n public\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\\n external\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\\n internal\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (\\n uint128 liquidity,\\n uint256 feeGrowthInside0Last,\\n uint256 feeGrowthInside1Last,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n ) = pool.positions(_getPositionID());\\n\\n // compute current holdings from liquidity\\n (amount0Current, amount1Current) = LiquidityAmounts\\n .getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n liquidity\\n );\\n\\n // compute current fees earned\\n uint256 fee0 =\\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\\n uint256(tokensOwed0);\\n uint256 fee1 =\\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\\n uint256(tokensOwed1);\\n\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n\\n // add any leftover in contract to current holdings\\n amount0Current +=\\n fee0 +\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n amount1Current +=\\n fee1 +\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n }\\n\\n // Private functions\\n\\n // solhint-disable-next-line function-max-lines\\n function _rebalance(\\n uint128 liquidity,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) private {\\n uint256 leftover0 =\\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\\n uint256 leftover1 =\\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\\n\\n (, , uint256 feesEarned0, uint256 feesEarned1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n _applyFees(feesEarned0, feesEarned1);\\n (feesEarned0, feesEarned1) = _subtractAdminFees(\\n feesEarned0,\\n feesEarned1\\n );\\n emit FeesEarned(feesEarned0, feesEarned1);\\n feesEarned0 += leftover0;\\n feesEarned1 += leftover1;\\n\\n if (paymentToken == address(token0)) {\\n require(\\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0 -\\n feeAmount;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n } else if (paymentToken == address(token1)) {\\n require(\\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1 -\\n feeAmount;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n\\n _deposit(\\n lowerTick,\\n upperTick,\\n leftover0,\\n leftover1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _withdraw(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidity\\n )\\n private\\n returns (\\n uint256 burn0,\\n uint256 burn1,\\n uint256 fee0,\\n uint256 fee1\\n )\\n {\\n uint256 preBalance0 = token0.balanceOf(address(this));\\n uint256 preBalance1 = token1.balanceOf(address(this));\\n\\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\\n\\n pool.collect(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n type(uint128).max,\\n type(uint128).max\\n );\\n\\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _deposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) private {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n // First, deposit as much as we can\\n uint128 baseLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n if (baseLiquidity > 0) {\\n (uint256 amountDeposited0, uint256 amountDeposited1) =\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n baseLiquidity,\\n \\\"\\\"\\n );\\n\\n amount0 -= amountDeposited0;\\n amount1 -= amountDeposited1;\\n }\\n int256 swapAmount =\\n SafeCast.toInt256(\\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\\n );\\n if (swapAmount > 0) {\\n _swapAndDeposit(\\n lowerTick_,\\n upperTick_,\\n amount0,\\n amount1,\\n swapAmount,\\n swapThresholdPrice,\\n zeroForOne\\n );\\n }\\n }\\n\\n function _swapAndDeposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n int256 swapAmount,\\n uint160 swapThresholdPrice,\\n bool zeroForOne\\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\\n (int256 amount0Delta, int256 amount1Delta) =\\n pool.swap(\\n address(this),\\n zeroForOne,\\n swapAmount,\\n swapThresholdPrice,\\n \\\"\\\"\\n );\\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\\n\\n // Add liquidity a second time\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 liquidityAfterSwap =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n finalAmount0,\\n finalAmount1\\n );\\n if (liquidityAfterSwap > 0) {\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n liquidityAfterSwap,\\n \\\"\\\"\\n );\\n }\\n }\\n\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function _computeMintAmounts(\\n uint256 totalSupply,\\n uint256 amount0Max,\\n uint256 amount1Max\\n )\\n private\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n // compute proportional amount of tokens to mint\\n if (amount0Current == 0 && amount1Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount1Max,\\n totalSupply,\\n amount1Current\\n );\\n } else if (amount1Current == 0 && amount0Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount0Max,\\n totalSupply,\\n amount0Current\\n );\\n } else if (amount0Current == 0 && amount1Current == 0) {\\n revert(\\\"\\\");\\n } else {\\n // only if both are non-zero\\n uint256 amount0Mint =\\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\\n uint256 amount1Mint =\\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\\n require(amount0Mint > 0 && amount1Mint > 0, \\\"mint 0\\\");\\n\\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\\n }\\n\\n // compute amounts owed to contract\\n amount0 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount0Current,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount1Current,\\n totalSupply\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _computeFeesEarned(\\n bool isZero,\\n uint256 feeGrowthInsideLast,\\n int24 tick,\\n uint128 liquidity\\n ) private view returns (uint256 fee) {\\n uint256 feeGrowthOutsideLower;\\n uint256 feeGrowthOutsideUpper;\\n uint256 feeGrowthGlobal;\\n if (isZero) {\\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\\n } else {\\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\\n }\\n\\n unchecked {\\n // calculate fee growth below\\n uint256 feeGrowthBelow;\\n if (tick >= lowerTick) {\\n feeGrowthBelow = feeGrowthOutsideLower;\\n } else {\\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\\n }\\n\\n // calculate fee growth above\\n uint256 feeGrowthAbove;\\n if (tick < upperTick) {\\n feeGrowthAbove = feeGrowthOutsideUpper;\\n } else {\\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\\n }\\n\\n uint256 feeGrowthInside =\\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\\n fee = FullMath.mulDiv(\\n liquidity,\\n feeGrowthInside - feeGrowthInsideLast,\\n 0x100000000000000000000000000000000\\n );\\n }\\n }\\n\\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\\n }\\n\\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\\n private\\n view\\n returns (uint256 fee0, uint256 fee1)\\n {\\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n fee0 = rawFee0 - deduct0;\\n fee1 = rawFee1 - deduct1;\\n }\\n\\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\\n private\\n view\\n {\\n uint32[] memory secondsAgo = new uint32[](2);\\n secondsAgo[0] = gelatoSlippageInterval;\\n secondsAgo[1] = 0;\\n\\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\\n\\n require(tickCumulatives.length == 2, \\\"array len\\\");\\n uint160 avgSqrtRatioX96;\\n unchecked {\\n int24 avgTick =\\n int24(\\n (tickCumulatives[1] - tickCumulatives[0]) /\\n int56(uint56(gelatoSlippageInterval))\\n );\\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\\n }\\n\\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\\n if (zeroForOne) {\\n require(\\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\\n \\\"high slippage\\\"\\n );\\n } else {\\n require(\\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\\n \\\"high slippage\\\"\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdd382818c81f34c434bb3d4235ac9ff39034cb68e1b87244837d9250878d9fa0\",\"license\":\"GPL-3.0\"},\"contracts/abstract/GUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {Gelatofied} from \\\"./Gelatofied.sol\\\";\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {\\n ReentrancyGuardUpgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport {\\n ERC20Upgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\n\\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\\n/// @dev ERC20Upgradable Includes Initialize\\n// solhint-disable-next-line max-states-count\\n/// @dev Modified to support 0.8.19\\n/// @dev Modified to set the gelatoFeeBPS to 0\\nabstract contract GUniPoolStorage is\\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\\n ReentrancyGuardUpgradeable,\\n OwnableUninitialized,\\n Gelatofied\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n // solhint-disable-next-line const-name-snakecase\\n uint16 public constant gelatoFeeBPS = 0;\\n\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n int24 public lowerTick;\\n int24 public upperTick;\\n\\n uint16 public gelatoRebalanceBPS;\\n uint16 public gelatoWithdrawBPS;\\n uint16 public gelatoSlippageBPS;\\n uint32 public gelatoSlippageInterval;\\n\\n uint16 public managerFeeBPS;\\n address public managerTreasury;\\n\\n uint256 public managerBalance0;\\n uint256 public managerBalance1;\\n uint256 public gelatoBalance0;\\n uint256 public gelatoBalance1;\\n\\n IUniswapV3Pool public pool;\\n IERC20 public token0;\\n IERC20 public token1;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdateAdminTreasury(\\n address oldAdminTreasury,\\n address newAdminTreasury\\n );\\n\\n event UpdateGelatoParams(\\n uint16 gelatoRebalanceBPS,\\n uint16 gelatoWithdrawBPS,\\n uint16 gelatoSlippageBPS,\\n uint32 gelatoSlippageInterval\\n );\\n\\n event SetManagerFee(uint16 managerFee);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice initialize storage variables on a new G-UNI pool, only called once\\n /// @param _name name of G-UNI token\\n /// @param _symbol symbol of G-UNI token\\n /// @param _pool address of Uniswap V3 pool\\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\\n /// @param _manager_ address of manager (ownership can be transferred)\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external initializer {\\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \\\"mBPS\\\");\\n\\n // these variables are immutable after initialization\\n pool = IUniswapV3Pool(_pool);\\n token0 = IERC20(pool.token0());\\n token1 = IERC20(pool.token1());\\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\\n\\n // these variables can be udpated by the manager\\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\\n gelatoSlippageBPS = 500; // default: 5% slippage\\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\\n managerTreasury = _manager_; // default: treasury is admin\\n lowerTick = _lowerTick;\\n upperTick = _upperTick;\\n _manager = _manager_;\\n\\n // e.g. \\\"Gelato Uniswap V3 USDC/DAI LP\\\" and \\\"G-UNI\\\"\\n __ERC20_init(_name, _symbol);\\n __ReentrancyGuard_init();\\n }\\n\\n /// @notice change configurable parameters, only manager can call\\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\\n /// @param newTreasury address where managerFee withdrawals are sent\\n // solhint-disable-next-line code-complexity\\n function updateGelatoParams(\\n uint16 newRebalanceBPS,\\n uint16 newWithdrawBPS,\\n uint16 newSlippageBPS,\\n uint32 newSlippageInterval,\\n address newTreasury\\n ) external onlyManager {\\n require(newWithdrawBPS <= 10000, \\\"BPS\\\");\\n require(newRebalanceBPS <= 10000, \\\"BPS\\\");\\n require(newSlippageBPS <= 10000, \\\"BPS\\\");\\n emit UpdateGelatoParams(\\n newRebalanceBPS,\\n newWithdrawBPS,\\n newSlippageBPS,\\n newSlippageInterval\\n );\\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\\n if (newSlippageInterval != 0)\\n gelatoSlippageInterval = newSlippageInterval;\\n if (newTreasury != address(0)) managerTreasury = newTreasury;\\n }\\n\\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\\n /// If a manager fee was not set in the initialize function it can be set here\\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\\n require(managerFeeBPS == 0, \\\"fee\\\");\\n require(\\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\\n \\\"mBPS\\\"\\n );\\n emit SetManagerFee(_managerFeeBPS);\\n managerFeeBPS = _managerFeeBPS;\\n }\\n\\n function renounceOwnership() public virtual override onlyManager {\\n managerTreasury = address(0);\\n managerFeeBPS = 0;\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n super.renounceOwnership();\\n }\\n\\n function getPositionID() external view returns (bytes32 positionID) {\\n return _getPositionID();\\n }\\n\\n function _getPositionID() internal view returns (bytes32 positionID) {\\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\\n }\\n}\\n\",\"keccak256\":\"0xd1ad805a13c7cd73554b1e3cc3735f3f369d759f8e0b9188977b85295456d033\",\"license\":\"GPL-3.0\"},\"contracts/abstract/Gelatofied.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract Gelatofied {\\n using Address for address payable;\\n using SafeERC20 for IERC20;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n address payable public immutable GELATO;\\n\\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n constructor(address payable _gelato) {\\n GELATO = _gelato;\\n }\\n\\n modifier gelatofy(uint256 _amount, address _paymentToken) {\\n require(msg.sender == GELATO, \\\"Gelatofied: Only gelato\\\");\\n _;\\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x264bc07e6e1b80c454c311ecf4b56afe245ddde31151ed9bcc4cb9ad25bec46a\",\"license\":\"GPL-3.0\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xb6016d5611f38fbd516a84ea2e56794cb76a8d61c40f6716d5f0133f195759bd\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/FullMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.4;\\n\\n/// @title Contains 512-bit math functions\\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\\n/// @dev Handles \\\"phantom overflow\\\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\\nlibrary FullMath {\\n /// @notice Calculates floor(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\\n function mulDiv(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = a * b\\n // Compute the product mod 2**256 and mod 2**256 - 1\\n // then use the Chinese Remainder Theorem to reconstruct\\n // the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2**256 + prod0\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(a, b, not(0))\\n prod0 := mul(a, b)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division\\n if (prod1 == 0) {\\n require(denominator > 0);\\n assembly {\\n result := div(prod0, denominator)\\n }\\n return result;\\n }\\n\\n // Make sure the result is less than 2**256.\\n // Also prevents denominator == 0\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0]\\n // Compute remainder using mulmod\\n uint256 remainder;\\n assembly {\\n remainder := mulmod(a, b, denominator)\\n }\\n // Subtract 256 bit number from 512 bit number\\n assembly {\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator\\n // Compute largest power of two divisor of denominator.\\n // Always >= 1.\\n // EDIT for 0.8 compatibility:\\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\\n uint256 twos = denominator & (~denominator + 1);\\n\\n // Divide denominator by power of two\\n assembly {\\n denominator := div(denominator, twos)\\n }\\n\\n // Divide [prod1 prod0] by the factors of two\\n assembly {\\n prod0 := div(prod0, twos)\\n }\\n // Shift in bits from prod1 into prod0. For this we need\\n // to flip `twos` such that it is 2**256 / twos.\\n // If twos is zero, then it becomes one\\n assembly {\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2**256\\n // Now that denominator is an odd number, it has an inverse\\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\\n // Compute the inverse by starting with a seed that is correct\\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\\n uint256 inv = (3 * denominator) ^ 2;\\n // Now use Newton-Raphson iteration to improve the precision.\\n // Thanks to Hensel's lifting lemma, this also works in modular\\n // arithmetic, doubling the correct bits in each step.\\n inv *= 2 - denominator * inv; // inverse mod 2**8\\n inv *= 2 - denominator * inv; // inverse mod 2**16\\n inv *= 2 - denominator * inv; // inverse mod 2**32\\n inv *= 2 - denominator * inv; // inverse mod 2**64\\n inv *= 2 - denominator * inv; // inverse mod 2**128\\n inv *= 2 - denominator * inv; // inverse mod 2**256\\n\\n // Because the division is now exact we can divide by multiplying\\n // with the modular inverse of denominator. This will give us the\\n // correct result modulo 2**256. Since the precoditions guarantee\\n // that the outcome is less than 2**256, this is the final result.\\n // We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inv;\\n return result;\\n }\\n }\\n\\n /// @notice Calculates ceil(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n function mulDivRoundingUp(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n result = mulDiv(a, b, denominator);\\n if (mulmod(a, b, denominator) > 0) {\\n require(result < type(uint256).max);\\n result++;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3fa0efa3eea2a84bd6ab7e55badd61f97069a6c50780059b036c810427a9740c\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/LiquidityAmounts.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.5.0;\\n\\nimport {FullMath} from \\\"./FullMath.sol\\\";\\nimport \\\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\\\";\\n\\n/// @title Liquidity amount functions\\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\\nlibrary LiquidityAmounts {\\n function toUint128(uint256 x) private pure returns (uint128 y) {\\n require((y = uint128(x)) == x);\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount0 The amount0 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount0(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n uint256 intermediate =\\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount0,\\n intermediate,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount1 The amount1 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount1(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount1,\\n FixedPoint96.Q96,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\\n /// pool prices and the prices at the tick boundaries\\n function getLiquidityForAmounts(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n liquidity = getLiquidityForAmount0(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount0\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n uint128 liquidity0 =\\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\\n uint128 liquidity1 =\\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\\n\\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\\n } else {\\n liquidity = getLiquidityForAmount1(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount1\\n );\\n }\\n }\\n\\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount0 The amount0\\n function getAmount0ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n uint256(liquidity) << FixedPoint96.RESOLUTION,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n sqrtRatioBX96\\n ) / sqrtRatioAX96;\\n }\\n\\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount1 The amount1\\n function getAmount1ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n liquidity,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n FixedPoint96.Q96\\n );\\n }\\n\\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\\n /// pool prices and the prices at the tick boundaries\\n function getAmountsForLiquidity(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0, uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioX96,\\n liquidity\\n );\\n } else {\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x6205f6409d42fc9565530d2a69819bf8c4e4c66b7a4c61d0827e81c084df6832\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/TickMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.19;\\n\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\n/// prices between 2**-128 and 2**128\\nlibrary TickMath {\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\n int24 internal constant MIN_TICK = -887272;\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\n int24 internal constant MAX_TICK = -MIN_TICK;\\n\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\n uint160 internal constant MAX_SQRT_RATIO =\\n 1461446703485210103287273052203988822378723970342;\\n\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\n /// @dev Throws if |tick| > max tick\\n /// @param tick The input tick for the above formula\\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\n /// at the given tick\\n function getSqrtRatioAtTick(int24 tick)\\n internal\\n pure\\n returns (uint160 sqrtPriceX96)\\n {\\n uint256 absTick =\\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\\n\\n // EDIT: 0.8 compatibility\\n require(absTick <= uint256(int256(MAX_TICK)), \\\"T\\\");\\n\\n uint256 ratio =\\n absTick & 0x1 != 0\\n ? 0xfffcb933bd6fad37aa2d162d1a594001\\n : 0x100000000000000000000000000000000;\\n if (absTick & 0x2 != 0)\\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\\n if (absTick & 0x4 != 0)\\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\\n if (absTick & 0x8 != 0)\\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\\n if (absTick & 0x10 != 0)\\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\\n if (absTick & 0x20 != 0)\\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\\n if (absTick & 0x40 != 0)\\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\\n if (absTick & 0x80 != 0)\\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\\n if (absTick & 0x100 != 0)\\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\\n if (absTick & 0x200 != 0)\\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\\n if (absTick & 0x400 != 0)\\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\\n if (absTick & 0x800 != 0)\\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\\n if (absTick & 0x1000 != 0)\\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\\n if (absTick & 0x2000 != 0)\\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\\n if (absTick & 0x4000 != 0)\\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\\n if (absTick & 0x8000 != 0)\\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\\n if (absTick & 0x10000 != 0)\\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\\n if (absTick & 0x20000 != 0)\\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\\n if (absTick & 0x40000 != 0)\\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\\n if (absTick & 0x80000 != 0)\\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\\n\\n if (tick > 0) ratio = type(uint256).max / ratio;\\n\\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\n sqrtPriceX96 = uint160(\\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\\n );\\n }\\n\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\n /// ever return.\\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\\n internal\\n pure\\n returns (int24 tick)\\n {\\n // second inequality must be < because the price can never reach the price at the max tick\\n require(\\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\\n \\\"R\\\"\\n );\\n uint256 ratio = uint256(sqrtPriceX96) << 32;\\n\\n uint256 r = ratio;\\n uint256 msb = 0;\\n\\n assembly {\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(4, gt(r, 0xFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(3, gt(r, 0xFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(2, gt(r, 0xF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(1, gt(r, 0x3))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := gt(r, 0x1)\\n msb := or(msb, f)\\n }\\n\\n if (msb >= 128) r = ratio >> (msb - 127);\\n else r = ratio << (127 - msb);\\n\\n int256 log_2 = (int256(msb) - 128) << 64;\\n\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(63, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(62, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(61, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(60, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(59, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(58, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(57, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(56, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(55, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(54, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(53, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(52, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(51, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(50, f))\\n }\\n\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\n\\n int24 tickLow =\\n int24(\\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\\n );\\n int24 tickHi =\\n int24(\\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\\n );\\n\\n tick = tickLow == tickHi\\n ? tickLow\\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\\n ? tickHi\\n : tickLow;\\n }\\n}\\n\",\"keccak256\":\"0x589b6104fd07d2e56e5b52edcfa53e6e47e2c38cace38025c16278ca73413f2d\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b5060405162005e0e38038062005e0e833981016040819052620000349162000046565b6001600160a01b031660805262000078565b6000602082840312156200005957600080fd5b81516001600160a01b03811681146200007157600080fd5b9392505050565b608051615d3b620000d3600039600081816105f801528181610ce301528181610dcc01528181610e06015281816114a7015281816116d50152818161170f015281816117e20152818161185901526118960152615d3b6000f3fe608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190614dc5565b61026e610269366004614e0d565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d9190614e39565b6102a66106fc565b60405161023d929190614e4d565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004614e5b565b610796565b6102f56102f0366004614eb9565b61084e565b005b6102ff600081565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004614e0d565b610c3a565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610c71565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b1366004614f21565b6001600160a01b031660009081526033602052604090205490565b6102f5610c80565b6097546103e890600160b81b900460020b81565b60405161023d9190614f3e565b6102f5610403366004614f4c565b610cd6565b61041b610416366004614f4c565b610e31565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e6110ea565b61045a610455366004614f7c565b6110f9565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004614fc0565b611232565b6097546103e890600160a01b900460020b81565b61026e6104aa366004614e0d565b6113f2565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004614e0d565b61148d565b6102f56104e5366004615023565b61149a565b610233609b5481565b6102a6610501366004614f21565b61173d565b6102f5610514366004614f4c565b6117d5565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046150bc565b6118bb565b6097546102ff90600160f01b900461ffff1681565b61023361059a36600461510e565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b61023361191f565b6102f56105db3660046151f1565b61192e565b6102f56105ee3660046152b3565b611ba3565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f5610628366004614f21565b611cb0565b6102f561063b3660046150bc565b611d90565b61041b61064e366004614f4c565b611dfa565b606060368054610662906152d0565b80601f016020809104026020016040519081016040528092919081815260200182805461068e906152d0565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f2338484612114565b5060015b92915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610779919061530a565b50505050509150915061078c8282612239565b9350935050509091565b60006107a38484846124b9565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561082d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610841853361083c86856153b2565b612114565b60019150505b9392505050565b33610857610c71565b6001600160a01b03161461087d5760405162461bcd60e51b8152600401610824906153c5565b600080600061088b60355490565b1115610bca57609d546001600160a01b031663514ea4bf6108aa61267f565b6040518263ffffffff1660e01b81526004016108c891815260200190565b60a060405180830381865afa1580156108e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610909919061541e565b5092945050506001600160801b03831615905061099257609754600090819061094890600160a01b8104600290810b91600160b81b9004900b866126da565b9350935050506109588282612a0d565b6109628282612ae6565b6040519193509150600080516020615ce6833981519152906109879084908490614e4d565b60405180910390a150505b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a06903090600401614e39565b602060405180830381865afa158015610a23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a479190615475565b610a5191906153b2565b610a5b91906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610a97903090600401614e39565b602060405180830381865afa158015610ab4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad89190615475565b610ae291906153b2565b610aec91906153b2565b9050610afd898984848b8b8b612b80565b609d546001600160a01b031663514ea4bf610b1661267f565b6040518263ffffffff1660e01b8152600401610b3491815260200190565b60a060405180830381865afa158015610b51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b75919061541e565b509295505050506001600160801b038316610bc35760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610824565b5050610c06565b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615c8683398151915287878484604051610c29949392919061548e565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061083c9086906154bc565b6097546001600160a01b031690565b33610c89610c71565b6001600160a01b031614610caf5760405162461bcd60e51b8152600401610824906153c5565b60988054600160201b600160d01b031916905560006099819055609a55610cd4612d21565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d205760405162461bcd60e51b8152600401610824906154cf565b600080610d33609954609a548888612d88565b60006099819055609a5590925090508115610d6d57609854609e54610d6d916001600160a01b0391821691600160301b9091041684612eac565b8015610d9857609854609f54610d98916001600160a01b0391821691600160301b9091041683612eac565b505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601610df757610df26001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b610e2b565b610e2b6001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050565b6000806000600260655403610e585760405162461bcd60e51b815260040161082490615500565b600260655584610e7a5760405162461bcd60e51b815260040161082490615537565b6000610e8560355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610edc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f00919061530a565b50505050505090506000821115610f4157600080610f1c6106fc565b91509150610f2b828a8661302a565b9650610f38818a8661302a565b95505050610f87565b609754610f81908290610f5d90600160a01b900460020b613073565b609754610f7390600160b81b900460020b613073565b610f7c8b613488565b6134f1565b90955093505b8415610fa557609e54610fa5906001600160a01b031633308861358c565b8315610fc357609f54610fc3906001600160a01b031633308761358c565b609754610ffc908290610fdf90600160a01b900460020b613073565b609754610ff590600160b81b900460020b613073565b88886135c4565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d9161104c913091600160a01b8104600290810b92600160b81b909204900b908990600401615557565b60408051808303816000875af115801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190615599565b505061109a8688613686565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e786888787876040516110d19594939291906155bd565b60405180910390a1505060016065819055509250925092565b606060378054610662906152d0565b60008060008061110860355490565b905080156111275761111b818787613753565b9195509350915061122a565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611195919061530a565b505050505050905060006111db826111be609760149054906101000a900460020b60020b613073565b6097546111d490600160b81b900460020b613073565b8b8b6135c4565b6097546001600160801b038216955090915061122290839061120690600160a01b900460020b613073565b60975461121c90600160b81b900460020b613073565b846134f1565b909650945050505b509250925092565b3361123b610c71565b6001600160a01b0316146112615760405162461bcd60e51b8152600401610824906153c5565b6127108461ffff1611156112875760405162461bcd60e51b8152600401610824906155f4565b6127108561ffff1611156112ad5760405162461bcd60e51b8152600401610824906155f4565b6127108361ffff1611156112d35760405162461bcd60e51b8152600401610824906155f4565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff85161561134a576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff84161561136f576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561139557609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff8216156113b7576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156113eb5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156114745760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610824565b611483338561083c86856153b2565b5060019392505050565b60006106f23384846124b9565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114e45760405162461bcd60e51b8152600401610824906154cf565b85156114f4576114f48786613862565b609d546000906001600160a01b031663514ea4bf61151061267f565b6040518263ffffffff1660e01b815260040161152e91815260200190565b60a060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f919061541e565b505050509050611583818989898989613abb565b609d546000906001600160a01b031663514ea4bf61159f61267f565b6040518263ffffffff1660e01b81526004016115bd91815260200190565b60a060405180830381865afa1580156115da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fe919061541e565b505050509050816001600160801b0316816001600160801b03161161165f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610824565b609754604051600080516020615c868339815191529161169991600160a01b8204600290810b92600160b81b9004900b908690869061548e565b60405180910390a1505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601611700576116fb6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b611734565b6117346001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b9919061530a565b50505050509150506117cb8482612239565b9250925050915091565b8181336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461181f5760405162461bcd60e51b8152600401610824906154cf565b600080611832609b54609c548888612d88565b6000609b819055609c559092509050811561187e57609e5461187e906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084612eac565b8015610d9857609f54610d98906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083612eac565b609d546001600160a01b031633146118e55760405162461bcd60e51b815260040161082490615611565b831561190257609e54611902906001600160a01b03163386612eac565b8215610e2b57609f54610e2b906001600160a01b03163385612eac565b600061192961267f565b905090565b600054610100900460ff1680611947575060005460ff16155b6119635760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015611985576000805461ffff19166101011790555b6119926000612710615688565b61ffff168561ffff1611156119b95760405162461bcd60e51b8152600401610824906156aa565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe1681916004808201926020929091908290030181865afa158015611a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3691906156c8565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a79160048083019260209291908290030181865afa158015611a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab891906156c8565b609f80546001600160a01b039283166001600160a01b0319918216179091556098805460978054948716600160301b8102600160301b600160d01b031963ffffffff1961ffff8e16600160201b021665ffffffffffff199095169490941761012c17939093169290921790925562ffffff878116600160b81b02909316600165ffffff00000160a01b0319938916600160a01b02600165ffffff00000160a01b0390951694909417643e800c801960d31b179290921692909217179055611b7f8888613f83565b611b87614002565b8015611b99576000805461ff00191690555b5050505050505050565b33611bac610c71565b6001600160a01b031614611bd25760405162461bcd60e51b8152600401610824906153c5565b609854600160201b900461ffff1615611c135760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610824565b60008161ffff16118015611c3b5750611c2f6000612710615688565b61ffff168161ffff1611155b611c575760405162461bcd60e51b8152600401610824906156aa565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611cb9610c71565b6001600160a01b031614611cdf5760405162461bcd60e51b8152600401610824906153c5565b6001600160a01b038116611d465760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610824565b6097546040516001600160a01b03808416921690600080516020615ca683398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611dba5760405162461bcd60e51b815260040161082490615611565b6000841315611dda57609e54610df2906001600160a01b03163386612eac565b6000831315610e2b57609f54610e2b906001600160a01b03163385612eac565b6000806000600260655403611e215760405162461bcd60e51b815260040161082490615500565b600260655584611e5c5760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610824565b6000611e6760355490565b609d549091506000906001600160a01b031663514ea4bf611e8661267f565b6040518263ffffffff1660e01b8152600401611ea491815260200190565b60a060405180830381865afa158015611ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee5919061541e565b505050509050611ef53388614076565b6000611f0b88836001600160801b0316856141b3565b9050611f1681613488565b609754909450600090819081908190611f4590600160a01b8104600290810b91600160b81b9004900b8a6126da565b9350935093509350611f578282612a0d565b611f618282612ae6565b6040519193509150600080516020615ce683398151915290611f869084908490614e4d565b60405180910390a1609b54609954609e546040516370a0823160e01b815261203293929188916001600160a01b03909116906370a0823190611fcc903090600401614e39565b602060405180830381865afa158015611fe9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200d9190615475565b61201791906153b2565b61202191906153b2565b61202b91906153b2565b8d896141b3565b61203c90856154bc565b609c54609a54609f546040516370a0823160e01b8152939d506120799387916001600160a01b0316906370a0823190611fcc903090600401614e39565b61208390846154bc565b985089156120a257609e546120a2906001600160a01b03168c8c612eac565b88156120bf57609f546120bf906001600160a01b03168c8b612eac565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516120f69594939291906155bd565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166121765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610824565b6001600160a01b0382166121d75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610824565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61226161267f565b6040518263ffffffff1660e01b815260040161227f91815260200190565b60a060405180830381865afa15801561229c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c0919061541e565b94509450945094509450612305896122e9609760149054906101000a900460020b60020b613073565b6097546122ff90600160b81b900460020b613073565b886134f1565b909750955060006001600160801b0383166123236001878c8a614261565b61232d91906154bc565b90506000826001600160801b03166123486000878d8b614261565b61235291906154bc565b905061235e8282612ae6565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a082319061239c903090600401614e39565b602060405180830381865afa1580156123b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dd9190615475565b6123e790856154bc565b6123f191906153b2565b6123fb91906153b2565b612405908a6154bc565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a0823190612440903090600401614e39565b602060405180830381865afa15801561245d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124819190615475565b61248b90846154bc565b61249591906153b2565b61249f91906153b2565b6124a990896154bc565b9750505050505050509250929050565b6001600160a01b03831661251d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610824565b6001600160a01b03821661257f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610824565b6001600160a01b038316600090815260336020526040902054818110156125f75760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610824565b61260182826153b2565b6001600160a01b0380861660009081526033602052604080822093909355908516815290812080548492906126379084906154bc565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615cc68339815191528460405161267191815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b820460e890811b6034830152600160b81b90920490911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a0823190612713903090600401614e39565b602060405180830381865afa158015612730573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127549190615475565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061278a903090600401614e39565b602060405180830381865afa1580156127a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cb9190615475565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a79060640160408051808303816000875af1158015612830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128549190615599565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a40160408051808303816000875af11580156128c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128eb91906156e5565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612921903090600401614e39565b602060405180830381865afa15801561293e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129629190615475565b61296c91906153b2565b61297691906153b2565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a08231906129ab903090600401614e39565b602060405180830381865afa1580156129c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ec9190615475565b6129f691906153b2565b612a0091906153b2565b9250505093509350935093565b612710612a1b600084615718565b612a259190615745565b609b6000828254612a3691906154bc565b909155506127109050612a4a600083615718565b612a549190615745565b609c6000828254612a6591906154bc565b909155505060985461271090612a8690600160201b900461ffff1684615718565b612a909190615745565b60996000828254612aa191906154bc565b909155505060985461271090612ac290600160201b900461ffff1683615718565b612acc9190615745565b609a6000828254612add91906154bc565b90915550505050565b6000806000612710609860049054906101000a900461ffff166000612b0b9190615759565b612b199061ffff1687615718565b612b239190615745565b60985490915060009061271090612b4590600160201b900461ffff1683615759565b612b539061ffff1687615718565b612b5d9190615745565b9050612b6982876153b2565b9350612b7581866153b2565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015612bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bee919061530a565b50505050505090506000612c1b82612c088b60020b613073565b612c148b60020b613073565b8a8a6135c4565b90506001600160801b03811615612cc957609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612c679030908f908f908990600401615557565b60408051808303816000875af1158015612c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ca99190615599565b9092509050612cb8828a6153b2565b9850612cc481896153b2565b975050505b6000612cf86127108686612cdd5789612cdf565b8a5b612ce99190615718565b612cf39190615745565b61460d565b90506000811315612d1557612d128a8a8a8a858b8a614673565b50505b50505050505050505050565b33612d2a610c71565b6001600160a01b031614612d505760405162461bcd60e51b8152600401610824906153c5565b6097546040516000916001600160a01b031690600080516020615ca6833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0390811690841603612dfd57609754849061271090612dc190600160e01b900461ffff1689615718565b612dcb9190615745565b1015612de95760405162461bcd60e51b815260040161082490615774565b612df384876153b2565b9150849050612ea3565b609f546001600160a01b0390811690841603612e6d57609754849061271090612e3190600160e01b900461ffff1688615718565b612e3b9190615745565b1015612e595760405162461bcd60e51b815260040161082490615774565b612e6384866153b2565b9050859150612ea3565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610824565b94509492505050565b6040516001600160a01b038316602482015260448101829052612f0f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261488f565b505050565b80471015612f645760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610824565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612fb1576040519150601f19603f3d011682016040523d82523d6000602084013e612fb6565b606091505b5050905080612f0f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610824565b60006130378484846141b3565b9050600082806130495761304961572f565b848609111561084757600019811061306057600080fd5b8061306a81615796565b95945050505050565b60008060008360020b1261308a578260020b613097565b8260020b613097906157af565b90506130a6620d89e7196157cb565b60020b8111156130dc5760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610824565b6000816001166000036130f357600160801b613105565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561313a576080613135826ffff97272373d413259a46990580e213a615718565b901c90505b600482161561316457608061315f826ffff2e50f5f656932ef12357cf3c7fdcc615718565b901c90505b600882161561318e576080613189826fffe5caca7e10e4e61c3624eaa0941cd0615718565b901c90505b60108216156131b85760806131b3826fffcb9843d60f6159c9db58835c926644615718565b901c90505b60208216156131e25760806131dd826fff973b41fa98c081472e6896dfb254c0615718565b901c90505b604082161561320c576080613207826fff2ea16466c96a3843ec78b326b52861615718565b901c90505b6080821615613236576080613231826ffe5dee046a99a2a811c461f1969c3053615718565b901c90505b61010082161561326157608061325c826ffcbe86c7900a88aedcffc83b479aa3a4615718565b901c90505b61020082161561328c576080613287826ff987a7253ac413176f2b074cf7815e54615718565b901c90505b6104008216156132b75760806132b2826ff3392b0822b70005940c7a398e4b70f3615718565b901c90505b6108008216156132e25760806132dd826fe7159475a2c29b7443b29c7fa6e889d9615718565b901c90505b61100082161561330d576080613308826fd097f3bdfd2022b8845ad8f792aa5825615718565b901c90505b612000821615613338576080613333826fa9f746462d870fdf8a65dc1f90e061e5615718565b901c90505b61400082161561336357608061335e826f70d869a156d2a1b890bb3df62baf32f7615718565b901c90505b61800082161561338e576080613389826f31be135f97d08fd981231505542fcfa6615718565b901c90505b620100008216156133ba5760806133b5826f09aa508b5b7a84e1c677de54f3e99bc9615718565b901c90505b620200008216156133e55760806133e0826e5d6af8dedb81196699c329225ee604615718565b901c90505b6204000082161561340f57608061340a826d2216e584f5fa1ea926041bedfe98615718565b901c90505b62080000821615613437576080613432826b048a170391f7dc42444e8fa2615718565b901c90505b60008460020b13156134525761344f81600019615745565b90505b613460600160201b826157ed565b1561346c57600161346f565b60005b6134809060ff16602083901c6154bc565b949350505050565b6000600160801b82106134ed5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610824565b5090565b600080836001600160a01b0316856001600160a01b03161115613512579293925b846001600160a01b0316866001600160a01b03161161353d57613536858585614961565b9150612ea3565b836001600160a01b0316866001600160a01b0316101561357657613562868585614961565b915061356f8587856149cb565b9050612ea3565b6135818585856149cb565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e2b9085906323b872dd60e01b90608401612ed8565b6000836001600160a01b0316856001600160a01b031611156135e4579293925b846001600160a01b0316866001600160a01b03161161360f57613608858585614a15565b905061306a565b836001600160a01b0316866001600160a01b03161015613671576000613636878686614a15565b90506000613645878986614a7f565b9050806001600160801b0316826001600160801b0316106136665780613668565b815b9250505061306a565b61367c858584614a7f565b9695505050505050565b6001600160a01b0382166136dc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610824565b80603560008282546136ee91906154bc565b90915550506001600160a01b0382166000908152603360205260408120805483929061371b9084906154bc565b90915550506040518181526001600160a01b03831690600090600080516020615cc68339815191529060200160405180910390a35050565b60008060008060006137636106fc565b915091508160001480156137775750600081115b1561378e576137878689836141b3565b925061383d565b8015801561379c5750600082115b156137ac576137878789846141b3565b811580156137b8575080155b156137df5760405162461bcd60e51b81526020600482015260006024820152604401610824565b60006137ec888a856141b3565b905060006137fb888b856141b3565b905060008211801561380d5750600081115b6138295760405162461bcd60e51b815260040161082490615537565b8082106138365780613838565b815b945050505b61384883838a61302a565b945061385583828a61302a565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff16918391506000906138a0576138a0615801565b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106138cf576138cf615801565b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613915908590600401615817565b600060405180830381865afa158015613932573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261395a919081019061590a565b509050805160021461399a5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610824565b6098548151600091829163ffffffff90911660060b90849083906139c0576139c0615801565b6020026020010151846001815181106139db576139db615801565b60200260200101510360060b816139f4576139f461572f565b059050613a038160020b613073565b6097549092506000915061271090613a2690600160f01b900461ffff16846159cc565b613a3091906159fe565b90508415613a7857613a428183615a24565b6001600160a01b0316866001600160a01b03161015613a735760405162461bcd60e51b815260040161082490615a44565b613ab3565b613a828183615a6b565b6001600160a01b0316866001600160a01b03161115613ab35760405162461bcd60e51b815260040161082490615a44565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613af4903090600401614e39565b602060405180830381865afa158015613b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b359190615475565b613b3f91906153b2565b613b4991906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613b85903090600401614e39565b602060405180830381865afa158015613ba2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bc69190615475565b613bd091906153b2565b613bda91906153b2565b6097549091506000908190613c0590600160a01b8104600290810b91600160b81b9004900b8c6126da565b935093505050613c158282612a0d565b613c1f8282612ae6565b6040519193509150600080516020615ce683398151915290613c449084908490614e4d565b60405180910390a1613c5684836154bc565b9150613c6283826154bc565b609e549091506001600160a01b0390811690861603613def57609754869061271090613c9990600160d01b900461ffff1685615718565b613ca39190615745565b1015613cc15760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613cf9903090600401614e39565b602060405180830381865afa158015613d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d3a9190615475565b613d4491906153b2565b613d4e91906153b2565b613d5891906153b2565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613d93903090600401614e39565b602060405180830381865afa158015613db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dd49190615475565b613dde91906153b2565b613de891906153b2565b9250613f5c565b609f546001600160a01b0390811690861603612e6d57609754869061271090613e2390600160d01b900461ffff1684615718565b613e2d9190615745565b1015613e4b5760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a0823190613e81903090600401614e39565b602060405180830381865afa158015613e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ec29190615475565b613ecc91906153b2565b613ed691906153b2565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a0823190613f11903090600401614e39565b602060405180830381865afa158015613f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f529190615475565b613dd491906153b2565b609754612d1590600160a01b8104600290810b91600160b81b9004900b86868d8d8d612b80565b600054610100900460ff1680613f9c575060005460ff16155b613fb85760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015613fda576000805461ffff19166101011790555b613fe2614ab5565b613fec8383614b1f565b8015612f0f576000805461ff0019169055505050565b600054610100900460ff168061401b575060005460ff16155b6140375760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614059576000805461ffff19166101011790555b614061614ba6565b8015614073576000805461ff00191690555b50565b6001600160a01b0382166140d65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610824565b6001600160a01b0382166000908152603360205260409020548181101561414a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610824565b61415482826153b2565b6001600160a01b038416600090815260336020526040812091909155603580548492906141829084906153b2565b90915550506040518281526000906001600160a01b03851690600080516020615cc68339815191529060200161222c565b60008080600019858709858702925082811083820303915050806000036141ec57600084116141e157600080fd5b508290049050610847565b8084116141f857600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600080871561440157609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b8152600401602060405180830381865afa1580156142c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142e49190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161432491600160a01b90910460020b90600401614f3e565b61010060405180830381865afa158015614342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143669190615a8b565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba9395506143af94600160b81b90910460020b93506004019150614f3e9050565b61010060405180830381865afa1580156143cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143f19190615a8b565b5093975061458f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b8152600401602060405180830381865afa158015614454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144789190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916144b891600160a01b90910460020b90600401614f3e565b61010060405180830381865afa1580156144d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144fa9190615a8b565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506145429450600160b81b900460020b926004019150614f3e9050565b61010060405180830381865afa158015614560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145849190615a8b565b509297505050505050505b609754600090600160a01b9004600290810b9088900b126145b15750826145b6565b508281035b609754600090600160b81b9004600290810b9089900b12156145d95750826145de565b508282035b8183038190036145fe6001600160801b0389168b8303600160801b6141b3565b9b9a5050505050505050505050565b6000600160ff1b82106134ed5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610824565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c40160408051808303816000875af11580156146e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061470c9190615599565b915091508161471a8a61460d565b6147249190615b27565b9350806147308961460d565b61473a9190615b27565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015614791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b5919061530a565b505050505050905060006147e2826147cf8f60020b613073565b6147db8f60020b613073565b89896135c4565b90506001600160801b0381161561487f57609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b815260040161483a9493929190615557565b60408051808303816000875af1158015614858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061487c9190615599565b50505b5050505097509795505050505050565b60006148e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c169092919063ffffffff16565b805190915015612f0f57808060200190518101906149029190615b47565b612f0f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610824565b6000826001600160a01b0316846001600160a01b03161115614981579192915b6001600160a01b0384166149c1600160601b600160e01b03606085901b166149a98787615a24565b6001600160a01b0316866001600160a01b03166141b3565b6134809190615745565b6000826001600160a01b0316846001600160a01b031611156149eb579192915b6134806001600160801b038316614a028686615a24565b6001600160a01b0316600160601b6141b3565b6000826001600160a01b0316846001600160a01b03161115614a35579192915b6000614a58856001600160a01b0316856001600160a01b0316600160601b6141b3565b905061306a614a7a8483614a6c8989615a24565b6001600160a01b03166141b3565b614c25565b6000826001600160a01b0316846001600160a01b03161115614a9f579192915b613480614a7a83600160601b614a6c8888615a24565b600054610100900460ff1680614ace575060005460ff16155b614aea5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614061576000805461ffff19166101011790558015614073576000805461ff001916905550565b600054610100900460ff1680614b38575060005460ff16155b614b545760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614b76576000805461ffff19166101011790555b6036614b828482615baa565b506037614b8f8382615baa565b508015612f0f576000805461ff0019169055505050565b600054610100900460ff1680614bbf575060005460ff16155b614bdb5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614bfd576000805461ffff19166101011790555b60016065558015614073576000805461ff001916905550565b60606134808484600085614c40565b806001600160801b0381168114614c3b57600080fd5b919050565b606082471015614ca15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610824565b843b614cef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610824565b600080866001600160a01b03168587604051614d0b9190615c69565b60006040518083038185875af1925050503d8060008114614d48576040519150601f19603f3d011682016040523d82523d6000602084013e614d4d565b606091505b5091509150614d5d828286614d68565b979650505050505050565b60608315614d77575081610847565b825115614d875782518084602001fd5b8160405162461bcd60e51b81526004016108249190614dc5565b60005b83811015614dbc578181015183820152602001614da4565b50506000910152565b6020815260008251806020840152614de4816040850160208701614da1565b601f01601f19169190910160400192915050565b6001600160a01b038116811461407357600080fd5b60008060408385031215614e2057600080fd5b8235614e2b81614df8565b946020939093013593505050565b6001600160a01b0391909116815260200190565b918252602082015260400190565b600080600060608486031215614e7057600080fd5b8335614e7b81614df8565b92506020840135614e8b81614df8565b929592945050506040919091013590565b8060020b811461407357600080fd5b801515811461407357600080fd5b600080600080600060a08688031215614ed157600080fd5b8535614edc81614e9c565b94506020860135614eec81614e9c565b93506040860135614efc81614df8565b9250606086013591506080860135614f1381614eab565b809150509295509295909350565b600060208284031215614f3357600080fd5b813561084781614df8565b60029190910b815260200190565b60008060408385031215614f5f57600080fd5b823591506020830135614f7181614df8565b809150509250929050565b60008060408385031215614f8f57600080fd5b50508035926020909101359150565b61ffff8116811461407357600080fd5b63ffffffff8116811461407357600080fd5b600080600080600060a08688031215614fd857600080fd5b8535614fe381614f9e565b94506020860135614ff381614f9e565b9350604086013561500381614f9e565b9250606086013561501381614fae565b91506080860135614f1381614df8565b600080600080600060a0868803121561503b57600080fd5b853561504681614df8565b945060208601359350604086013561505d81614eab565b9250606086013591506080860135614f1381614df8565b60008083601f84011261508657600080fd5b5081356001600160401b0381111561509d57600080fd5b6020830191508360208285010111156150b557600080fd5b9250929050565b600080600080606085870312156150d257600080fd5b843593506020850135925060408501356001600160401b038111156150f657600080fd5b61510287828801615074565b95989497509550505050565b6000806040838503121561512157600080fd5b823561512c81614df8565b91506020830135614f7181614df8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561517a5761517a61513c565b604052919050565b600082601f83011261519357600080fd5b81356001600160401b038111156151ac576151ac61513c565b6151bf601f8201601f1916602001615152565b8181528460208386010111156151d457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060e0888a03121561520c57600080fd5b87356001600160401b038082111561522357600080fd5b61522f8b838c01615182565b985060208a013591508082111561524557600080fd5b506152528a828b01615182565b965050604088013561526381614df8565b9450606088013561527381614f9e565b9350608088013561528381614e9c565b925060a088013561529381614e9c565b915060c08801356152a381614df8565b8091505092959891949750929550565b6000602082840312156152c557600080fd5b813561084781614f9e565b600181811c908216806152e457607f821691505b60208210810361530457634e487b7160e01b600052602260045260246000fd5b50919050565b600080600080600080600060e0888a03121561532557600080fd5b875161533081614df8565b602089015190975061534181614e9c565b604089015190965061535281614f9e565b606089015190955061536381614f9e565b608089015190945061537481614f9e565b60a089015190935060ff8116811461538b57600080fd5b60c08901519092506152a381614eab565b634e487b7160e01b600052601160045260246000fd5b818103818111156106f6576106f661539c565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b80516001600160801b0381168114614c3b57600080fd5b600080600080600060a0868803121561543657600080fd5b61543f86615407565b9450602086015193506040860151925061545b60608701615407565b915061546960808701615407565b90509295509295909350565b60006020828403121561548757600080fd5b5051919050565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b808201808211156106f6576106f661539c565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b600080604083850312156155ac57600080fd5b505080516020909101519092909150565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b60208082526003908201526242505360e81b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b61ffff8281168282160390808211156156a3576156a361539c565b5092915050565b6020808252600490820152636d42505360e01b604082015260600190565b6000602082840312156156da57600080fd5b815161084781614df8565b600080604083850312156156f857600080fd5b61570183615407565b915061570f60208401615407565b90509250929050565b80820281158282048414176106f6576106f661539c565b634e487b7160e01b600052601260045260246000fd5b6000826157545761575461572f565b500490565b61ffff8181168382160190808211156156a3576156a361539c565b602080825260089082015267686967682066656560c01b604082015260600190565b6000600182016157a8576157a861539c565b5060010190565b6000600160ff1b82016157c4576157c461539c565b5060000390565b60008160020b627fffff1981036157e4576157e461539c565b60000392915050565b6000826157fc576157fc61572f565b500690565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561585557835163ffffffff1683529284019291840191600101615833565b50909695505050505050565b60006001600160401b0382111561587a5761587a61513c565b5060051b60200190565b8051600681900b8114614c3b57600080fd5b600082601f8301126158a757600080fd5b815160206158bc6158b783615861565b615152565b82815260059290921b840181019181810190868411156158db57600080fd5b8286015b848110156158ff5780516158f281614df8565b83529183019183016158df565b509695505050505050565b6000806040838503121561591d57600080fd5b82516001600160401b038082111561593457600080fd5b818501915085601f83011261594857600080fd5b815160206159586158b783615861565b82815260059290921b8401810191818101908984111561597757600080fd5b948201945b8386101561599c5761598d86615884565b8252948201949082019061597c565b918801519196509093505050808211156159b557600080fd5b506159c285828601615896565b9150509250929050565b6001600160a01b038281168282168181028316929181158285048214176159f5576159f561539c565b50505092915050565b60006001600160a01b0383811680615a1857615a1861572f565b92169190910492915050565b6001600160a01b038281168282160390808211156156a3576156a361539c565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b6001600160a01b038181168382160190808211156156a3576156a361539c565b600080600080600080600080610100898b031215615aa857600080fd5b615ab189615407565b9750602089015180600f0b8114615ac757600080fd5b60408a015160608b015191985096509450615ae460808a01615884565b935060a0890151615af481614df8565b60c08a0151909350615b0581614fae565b60e08a0151909250615b1681614eab565b809150509295985092959890939650565b81810360008312801583831316838312821617156156a3576156a361539c565b600060208284031215615b5957600080fd5b815161084781614eab565b601f821115612f0f57600081815260208120601f850160051c81016020861015615b8b5750805b601f850160051c820191505b81811015613ab357828155600101615b97565b81516001600160401b03811115615bc357615bc361513c565b615bd781615bd184546152d0565b84615b64565b602080601f831160018114615c0c5760008415615bf45750858301515b600019600386901b1c1916600185901b178555613ab3565b600085815260208120601f198616915b82811015615c3b57888601518255948401946001909101908401615c1c565b5085821015615c595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251615c7b818460208701614da1565b919091019291505056fec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a2646970667358221220a11bde499516b0a2e8e737821292815fcefc66549a9729f24ea128d34ed6027364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190614dc5565b61026e610269366004614e0d565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d9190614e39565b6102a66106fc565b60405161023d929190614e4d565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004614e5b565b610796565b6102f56102f0366004614eb9565b61084e565b005b6102ff600081565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004614e0d565b610c3a565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610c71565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b1366004614f21565b6001600160a01b031660009081526033602052604090205490565b6102f5610c80565b6097546103e890600160b81b900460020b81565b60405161023d9190614f3e565b6102f5610403366004614f4c565b610cd6565b61041b610416366004614f4c565b610e31565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e6110ea565b61045a610455366004614f7c565b6110f9565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004614fc0565b611232565b6097546103e890600160a01b900460020b81565b61026e6104aa366004614e0d565b6113f2565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004614e0d565b61148d565b6102f56104e5366004615023565b61149a565b610233609b5481565b6102a6610501366004614f21565b61173d565b6102f5610514366004614f4c565b6117d5565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046150bc565b6118bb565b6097546102ff90600160f01b900461ffff1681565b61023361059a36600461510e565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b61023361191f565b6102f56105db3660046151f1565b61192e565b6102f56105ee3660046152b3565b611ba3565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f5610628366004614f21565b611cb0565b6102f561063b3660046150bc565b611d90565b61041b61064e366004614f4c565b611dfa565b606060368054610662906152d0565b80601f016020809104026020016040519081016040528092919081815260200182805461068e906152d0565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f2338484612114565b5060015b92915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610779919061530a565b50505050509150915061078c8282612239565b9350935050509091565b60006107a38484846124b9565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561082d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610841853361083c86856153b2565b612114565b60019150505b9392505050565b33610857610c71565b6001600160a01b03161461087d5760405162461bcd60e51b8152600401610824906153c5565b600080600061088b60355490565b1115610bca57609d546001600160a01b031663514ea4bf6108aa61267f565b6040518263ffffffff1660e01b81526004016108c891815260200190565b60a060405180830381865afa1580156108e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610909919061541e565b5092945050506001600160801b03831615905061099257609754600090819061094890600160a01b8104600290810b91600160b81b9004900b866126da565b9350935050506109588282612a0d565b6109628282612ae6565b6040519193509150600080516020615ce6833981519152906109879084908490614e4d565b60405180910390a150505b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a06903090600401614e39565b602060405180830381865afa158015610a23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a479190615475565b610a5191906153b2565b610a5b91906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610a97903090600401614e39565b602060405180830381865afa158015610ab4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad89190615475565b610ae291906153b2565b610aec91906153b2565b9050610afd898984848b8b8b612b80565b609d546001600160a01b031663514ea4bf610b1661267f565b6040518263ffffffff1660e01b8152600401610b3491815260200190565b60a060405180830381865afa158015610b51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b75919061541e565b509295505050506001600160801b038316610bc35760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610824565b5050610c06565b6097805462ffffff888116600160b81b0262ffffff60b81b19918b16600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615c8683398151915287878484604051610c29949392919061548e565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061083c9086906154bc565b6097546001600160a01b031690565b33610c89610c71565b6001600160a01b031614610caf5760405162461bcd60e51b8152600401610824906153c5565b60988054600160201b600160d01b031916905560006099819055609a55610cd4612d21565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d205760405162461bcd60e51b8152600401610824906154cf565b600080610d33609954609a548888612d88565b60006099819055609a5590925090508115610d6d57609854609e54610d6d916001600160a01b0391821691600160301b9091041684612eac565b8015610d9857609854609f54610d98916001600160a01b0391821691600160301b9091041683612eac565b505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601610df757610df26001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b610e2b565b610e2b6001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050565b6000806000600260655403610e585760405162461bcd60e51b815260040161082490615500565b600260655584610e7a5760405162461bcd60e51b815260040161082490615537565b6000610e8560355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610edc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f00919061530a565b50505050505090506000821115610f4157600080610f1c6106fc565b91509150610f2b828a8661302a565b9650610f38818a8661302a565b95505050610f87565b609754610f81908290610f5d90600160a01b900460020b613073565b609754610f7390600160b81b900460020b613073565b610f7c8b613488565b6134f1565b90955093505b8415610fa557609e54610fa5906001600160a01b031633308861358c565b8315610fc357609f54610fc3906001600160a01b031633308761358c565b609754610ffc908290610fdf90600160a01b900460020b613073565b609754610ff590600160b81b900460020b613073565b88886135c4565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d9161104c913091600160a01b8104600290810b92600160b81b909204900b908990600401615557565b60408051808303816000875af115801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190615599565b505061109a8688613686565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e786888787876040516110d19594939291906155bd565b60405180910390a1505060016065819055509250925092565b606060378054610662906152d0565b60008060008061110860355490565b905080156111275761111b818787613753565b9195509350915061122a565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611195919061530a565b505050505050905060006111db826111be609760149054906101000a900460020b60020b613073565b6097546111d490600160b81b900460020b613073565b8b8b6135c4565b6097546001600160801b038216955090915061122290839061120690600160a01b900460020b613073565b60975461121c90600160b81b900460020b613073565b846134f1565b909650945050505b509250925092565b3361123b610c71565b6001600160a01b0316146112615760405162461bcd60e51b8152600401610824906153c5565b6127108461ffff1611156112875760405162461bcd60e51b8152600401610824906155f4565b6127108561ffff1611156112ad5760405162461bcd60e51b8152600401610824906155f4565b6127108361ffff1611156112d35760405162461bcd60e51b8152600401610824906155f4565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff85161561134a576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff84161561136f576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561139557609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff8216156113b7576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156113eb5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156114745760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610824565b611483338561083c86856153b2565b5060019392505050565b60006106f23384846124b9565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114e45760405162461bcd60e51b8152600401610824906154cf565b85156114f4576114f48786613862565b609d546000906001600160a01b031663514ea4bf61151061267f565b6040518263ffffffff1660e01b815260040161152e91815260200190565b60a060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f919061541e565b505050509050611583818989898989613abb565b609d546000906001600160a01b031663514ea4bf61159f61267f565b6040518263ffffffff1660e01b81526004016115bd91815260200190565b60a060405180830381865afa1580156115da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fe919061541e565b505050509050816001600160801b0316816001600160801b03161161165f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610824565b609754604051600080516020615c868339815191529161169991600160a01b8204600290810b92600160b81b9004900b908690869061548e565b60405180910390a1505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601611700576116fb6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683612f14565b611734565b6117346001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084612eac565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b9919061530a565b50505050509150506117cb8482612239565b9250925050915091565b8181336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461181f5760405162461bcd60e51b8152600401610824906154cf565b600080611832609b54609c548888612d88565b6000609b819055609c559092509050811561187e57609e5461187e906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084612eac565b8015610d9857609f54610d98906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083612eac565b609d546001600160a01b031633146118e55760405162461bcd60e51b815260040161082490615611565b831561190257609e54611902906001600160a01b03163386612eac565b8215610e2b57609f54610e2b906001600160a01b03163385612eac565b600061192961267f565b905090565b600054610100900460ff1680611947575060005460ff16155b6119635760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015611985576000805461ffff19166101011790555b6119926000612710615688565b61ffff168561ffff1611156119b95760405162461bcd60e51b8152600401610824906156aa565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe1681916004808201926020929091908290030181865afa158015611a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3691906156c8565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a79160048083019260209291908290030181865afa158015611a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab891906156c8565b609f80546001600160a01b039283166001600160a01b0319918216179091556098805460978054948716600160301b8102600160301b600160d01b031963ffffffff1961ffff8e16600160201b021665ffffffffffff199095169490941761012c17939093169290921790925562ffffff878116600160b81b02909316600165ffffff00000160a01b0319938916600160a01b02600165ffffff00000160a01b0390951694909417643e800c801960d31b179290921692909217179055611b7f8888613f83565b611b87614002565b8015611b99576000805461ff00191690555b5050505050505050565b33611bac610c71565b6001600160a01b031614611bd25760405162461bcd60e51b8152600401610824906153c5565b609854600160201b900461ffff1615611c135760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610824565b60008161ffff16118015611c3b5750611c2f6000612710615688565b61ffff168161ffff1611155b611c575760405162461bcd60e51b8152600401610824906156aa565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611cb9610c71565b6001600160a01b031614611cdf5760405162461bcd60e51b8152600401610824906153c5565b6001600160a01b038116611d465760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610824565b6097546040516001600160a01b03808416921690600080516020615ca683398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611dba5760405162461bcd60e51b815260040161082490615611565b6000841315611dda57609e54610df2906001600160a01b03163386612eac565b6000831315610e2b57609f54610e2b906001600160a01b03163385612eac565b6000806000600260655403611e215760405162461bcd60e51b815260040161082490615500565b600260655584611e5c5760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610824565b6000611e6760355490565b609d549091506000906001600160a01b031663514ea4bf611e8661267f565b6040518263ffffffff1660e01b8152600401611ea491815260200190565b60a060405180830381865afa158015611ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee5919061541e565b505050509050611ef53388614076565b6000611f0b88836001600160801b0316856141b3565b9050611f1681613488565b609754909450600090819081908190611f4590600160a01b8104600290810b91600160b81b9004900b8a6126da565b9350935093509350611f578282612a0d565b611f618282612ae6565b6040519193509150600080516020615ce683398151915290611f869084908490614e4d565b60405180910390a1609b54609954609e546040516370a0823160e01b815261203293929188916001600160a01b03909116906370a0823190611fcc903090600401614e39565b602060405180830381865afa158015611fe9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200d9190615475565b61201791906153b2565b61202191906153b2565b61202b91906153b2565b8d896141b3565b61203c90856154bc565b609c54609a54609f546040516370a0823160e01b8152939d506120799387916001600160a01b0316906370a0823190611fcc903090600401614e39565b61208390846154bc565b985089156120a257609e546120a2906001600160a01b03168c8c612eac565b88156120bf57609f546120bf906001600160a01b03168c8b612eac565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516120f69594939291906155bd565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166121765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610824565b6001600160a01b0382166121d75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610824565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61226161267f565b6040518263ffffffff1660e01b815260040161227f91815260200190565b60a060405180830381865afa15801561229c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c0919061541e565b94509450945094509450612305896122e9609760149054906101000a900460020b60020b613073565b6097546122ff90600160b81b900460020b613073565b886134f1565b909750955060006001600160801b0383166123236001878c8a614261565b61232d91906154bc565b90506000826001600160801b03166123486000878d8b614261565b61235291906154bc565b905061235e8282612ae6565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a082319061239c903090600401614e39565b602060405180830381865afa1580156123b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dd9190615475565b6123e790856154bc565b6123f191906153b2565b6123fb91906153b2565b612405908a6154bc565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a0823190612440903090600401614e39565b602060405180830381865afa15801561245d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124819190615475565b61248b90846154bc565b61249591906153b2565b61249f91906153b2565b6124a990896154bc565b9750505050505050509250929050565b6001600160a01b03831661251d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610824565b6001600160a01b03821661257f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610824565b6001600160a01b038316600090815260336020526040902054818110156125f75760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610824565b61260182826153b2565b6001600160a01b0380861660009081526033602052604080822093909355908516815290812080548492906126379084906154bc565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615cc68339815191528460405161267191815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b820460e890811b6034830152600160b81b90920490911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a0823190612713903090600401614e39565b602060405180830381865afa158015612730573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127549190615475565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061278a903090600401614e39565b602060405180830381865afa1580156127a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cb9190615475565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a79060640160408051808303816000875af1158015612830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128549190615599565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a40160408051808303816000875af11580156128c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128eb91906156e5565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612921903090600401614e39565b602060405180830381865afa15801561293e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129629190615475565b61296c91906153b2565b61297691906153b2565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a08231906129ab903090600401614e39565b602060405180830381865afa1580156129c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ec9190615475565b6129f691906153b2565b612a0091906153b2565b9250505093509350935093565b612710612a1b600084615718565b612a259190615745565b609b6000828254612a3691906154bc565b909155506127109050612a4a600083615718565b612a549190615745565b609c6000828254612a6591906154bc565b909155505060985461271090612a8690600160201b900461ffff1684615718565b612a909190615745565b60996000828254612aa191906154bc565b909155505060985461271090612ac290600160201b900461ffff1683615718565b612acc9190615745565b609a6000828254612add91906154bc565b90915550505050565b6000806000612710609860049054906101000a900461ffff166000612b0b9190615759565b612b199061ffff1687615718565b612b239190615745565b60985490915060009061271090612b4590600160201b900461ffff1683615759565b612b539061ffff1687615718565b612b5d9190615745565b9050612b6982876153b2565b9350612b7581866153b2565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e09291908290030181865afa158015612bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bee919061530a565b50505050505090506000612c1b82612c088b60020b613073565b612c148b60020b613073565b8a8a6135c4565b90506001600160801b03811615612cc957609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612c679030908f908f908990600401615557565b60408051808303816000875af1158015612c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ca99190615599565b9092509050612cb8828a6153b2565b9850612cc481896153b2565b975050505b6000612cf86127108686612cdd5789612cdf565b8a5b612ce99190615718565b612cf39190615745565b61460d565b90506000811315612d1557612d128a8a8a8a858b8a614673565b50505b50505050505050505050565b33612d2a610c71565b6001600160a01b031614612d505760405162461bcd60e51b8152600401610824906153c5565b6097546040516000916001600160a01b031690600080516020615ca6833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0390811690841603612dfd57609754849061271090612dc190600160e01b900461ffff1689615718565b612dcb9190615745565b1015612de95760405162461bcd60e51b815260040161082490615774565b612df384876153b2565b9150849050612ea3565b609f546001600160a01b0390811690841603612e6d57609754849061271090612e3190600160e01b900461ffff1688615718565b612e3b9190615745565b1015612e595760405162461bcd60e51b815260040161082490615774565b612e6384866153b2565b9050859150612ea3565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610824565b94509492505050565b6040516001600160a01b038316602482015260448101829052612f0f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261488f565b505050565b80471015612f645760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610824565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612fb1576040519150601f19603f3d011682016040523d82523d6000602084013e612fb6565b606091505b5050905080612f0f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610824565b60006130378484846141b3565b9050600082806130495761304961572f565b848609111561084757600019811061306057600080fd5b8061306a81615796565b95945050505050565b60008060008360020b1261308a578260020b613097565b8260020b613097906157af565b90506130a6620d89e7196157cb565b60020b8111156130dc5760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610824565b6000816001166000036130f357600160801b613105565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561313a576080613135826ffff97272373d413259a46990580e213a615718565b901c90505b600482161561316457608061315f826ffff2e50f5f656932ef12357cf3c7fdcc615718565b901c90505b600882161561318e576080613189826fffe5caca7e10e4e61c3624eaa0941cd0615718565b901c90505b60108216156131b85760806131b3826fffcb9843d60f6159c9db58835c926644615718565b901c90505b60208216156131e25760806131dd826fff973b41fa98c081472e6896dfb254c0615718565b901c90505b604082161561320c576080613207826fff2ea16466c96a3843ec78b326b52861615718565b901c90505b6080821615613236576080613231826ffe5dee046a99a2a811c461f1969c3053615718565b901c90505b61010082161561326157608061325c826ffcbe86c7900a88aedcffc83b479aa3a4615718565b901c90505b61020082161561328c576080613287826ff987a7253ac413176f2b074cf7815e54615718565b901c90505b6104008216156132b75760806132b2826ff3392b0822b70005940c7a398e4b70f3615718565b901c90505b6108008216156132e25760806132dd826fe7159475a2c29b7443b29c7fa6e889d9615718565b901c90505b61100082161561330d576080613308826fd097f3bdfd2022b8845ad8f792aa5825615718565b901c90505b612000821615613338576080613333826fa9f746462d870fdf8a65dc1f90e061e5615718565b901c90505b61400082161561336357608061335e826f70d869a156d2a1b890bb3df62baf32f7615718565b901c90505b61800082161561338e576080613389826f31be135f97d08fd981231505542fcfa6615718565b901c90505b620100008216156133ba5760806133b5826f09aa508b5b7a84e1c677de54f3e99bc9615718565b901c90505b620200008216156133e55760806133e0826e5d6af8dedb81196699c329225ee604615718565b901c90505b6204000082161561340f57608061340a826d2216e584f5fa1ea926041bedfe98615718565b901c90505b62080000821615613437576080613432826b048a170391f7dc42444e8fa2615718565b901c90505b60008460020b13156134525761344f81600019615745565b90505b613460600160201b826157ed565b1561346c57600161346f565b60005b6134809060ff16602083901c6154bc565b949350505050565b6000600160801b82106134ed5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610824565b5090565b600080836001600160a01b0316856001600160a01b03161115613512579293925b846001600160a01b0316866001600160a01b03161161353d57613536858585614961565b9150612ea3565b836001600160a01b0316866001600160a01b0316101561357657613562868585614961565b915061356f8587856149cb565b9050612ea3565b6135818585856149cb565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e2b9085906323b872dd60e01b90608401612ed8565b6000836001600160a01b0316856001600160a01b031611156135e4579293925b846001600160a01b0316866001600160a01b03161161360f57613608858585614a15565b905061306a565b836001600160a01b0316866001600160a01b03161015613671576000613636878686614a15565b90506000613645878986614a7f565b9050806001600160801b0316826001600160801b0316106136665780613668565b815b9250505061306a565b61367c858584614a7f565b9695505050505050565b6001600160a01b0382166136dc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610824565b80603560008282546136ee91906154bc565b90915550506001600160a01b0382166000908152603360205260408120805483929061371b9084906154bc565b90915550506040518181526001600160a01b03831690600090600080516020615cc68339815191529060200160405180910390a35050565b60008060008060006137636106fc565b915091508160001480156137775750600081115b1561378e576137878689836141b3565b925061383d565b8015801561379c5750600082115b156137ac576137878789846141b3565b811580156137b8575080155b156137df5760405162461bcd60e51b81526020600482015260006024820152604401610824565b60006137ec888a856141b3565b905060006137fb888b856141b3565b905060008211801561380d5750600081115b6138295760405162461bcd60e51b815260040161082490615537565b8082106138365780613838565b815b945050505b61384883838a61302a565b945061385583828a61302a565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff16918391506000906138a0576138a0615801565b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106138cf576138cf615801565b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613915908590600401615817565b600060405180830381865afa158015613932573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261395a919081019061590a565b509050805160021461399a5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610824565b6098548151600091829163ffffffff90911660060b90849083906139c0576139c0615801565b6020026020010151846001815181106139db576139db615801565b60200260200101510360060b816139f4576139f461572f565b059050613a038160020b613073565b6097549092506000915061271090613a2690600160f01b900461ffff16846159cc565b613a3091906159fe565b90508415613a7857613a428183615a24565b6001600160a01b0316866001600160a01b03161015613a735760405162461bcd60e51b815260040161082490615a44565b613ab3565b613a828183615a6b565b6001600160a01b0316866001600160a01b03161115613ab35760405162461bcd60e51b815260040161082490615a44565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613af4903090600401614e39565b602060405180830381865afa158015613b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b359190615475565b613b3f91906153b2565b613b4991906153b2565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613b85903090600401614e39565b602060405180830381865afa158015613ba2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bc69190615475565b613bd091906153b2565b613bda91906153b2565b6097549091506000908190613c0590600160a01b8104600290810b91600160b81b9004900b8c6126da565b935093505050613c158282612a0d565b613c1f8282612ae6565b6040519193509150600080516020615ce683398151915290613c449084908490614e4d565b60405180910390a1613c5684836154bc565b9150613c6283826154bc565b609e549091506001600160a01b0390811690861603613def57609754869061271090613c9990600160d01b900461ffff1685615718565b613ca39190615745565b1015613cc15760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613cf9903090600401614e39565b602060405180830381865afa158015613d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d3a9190615475565b613d4491906153b2565b613d4e91906153b2565b613d5891906153b2565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613d93903090600401614e39565b602060405180830381865afa158015613db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dd49190615475565b613dde91906153b2565b613de891906153b2565b9250613f5c565b609f546001600160a01b0390811690861603612e6d57609754869061271090613e2390600160d01b900461ffff1684615718565b613e2d9190615745565b1015613e4b5760405162461bcd60e51b815260040161082490615774565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a0823190613e81903090600401614e39565b602060405180830381865afa158015613e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ec29190615475565b613ecc91906153b2565b613ed691906153b2565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a0823190613f11903090600401614e39565b602060405180830381865afa158015613f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f529190615475565b613dd491906153b2565b609754612d1590600160a01b8104600290810b91600160b81b9004900b86868d8d8d612b80565b600054610100900460ff1680613f9c575060005460ff16155b613fb85760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015613fda576000805461ffff19166101011790555b613fe2614ab5565b613fec8383614b1f565b8015612f0f576000805461ff0019169055505050565b600054610100900460ff168061401b575060005460ff16155b6140375760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614059576000805461ffff19166101011790555b614061614ba6565b8015614073576000805461ff00191690555b50565b6001600160a01b0382166140d65760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610824565b6001600160a01b0382166000908152603360205260409020548181101561414a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610824565b61415482826153b2565b6001600160a01b038416600090815260336020526040812091909155603580548492906141829084906153b2565b90915550506040518281526000906001600160a01b03851690600080516020615cc68339815191529060200161222c565b60008080600019858709858702925082811083820303915050806000036141ec57600084116141e157600080fd5b508290049050610847565b8084116141f857600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600080871561440157609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b8152600401602060405180830381865afa1580156142c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142e49190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161432491600160a01b90910460020b90600401614f3e565b61010060405180830381865afa158015614342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143669190615a8b565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba9395506143af94600160b81b90910460020b93506004019150614f3e9050565b61010060405180830381865afa1580156143cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143f19190615a8b565b5093975061458f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b8152600401602060405180830381865afa158015614454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144789190615475565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916144b891600160a01b90910460020b90600401614f3e565b61010060405180830381865afa1580156144d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144fa9190615a8b565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506145429450600160b81b900460020b926004019150614f3e9050565b61010060405180830381865afa158015614560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145849190615a8b565b509297505050505050505b609754600090600160a01b9004600290810b9088900b126145b15750826145b6565b508281035b609754600090600160b81b9004600290810b9089900b12156145d95750826145de565b508282035b8183038190036145fe6001600160801b0389168b8303600160801b6141b3565b9b9a5050505050505050505050565b6000600160ff1b82106134ed5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610824565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c40160408051808303816000875af11580156146e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061470c9190615599565b915091508161471a8a61460d565b6147249190615b27565b9350806147308961460d565b61473a9190615b27565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015614791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b5919061530a565b505050505050905060006147e2826147cf8f60020b613073565b6147db8f60020b613073565b89896135c4565b90506001600160801b0381161561487f57609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b815260040161483a9493929190615557565b60408051808303816000875af1158015614858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061487c9190615599565b50505b5050505097509795505050505050565b60006148e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c169092919063ffffffff16565b805190915015612f0f57808060200190518101906149029190615b47565b612f0f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610824565b6000826001600160a01b0316846001600160a01b03161115614981579192915b6001600160a01b0384166149c1600160601b600160e01b03606085901b166149a98787615a24565b6001600160a01b0316866001600160a01b03166141b3565b6134809190615745565b6000826001600160a01b0316846001600160a01b031611156149eb579192915b6134806001600160801b038316614a028686615a24565b6001600160a01b0316600160601b6141b3565b6000826001600160a01b0316846001600160a01b03161115614a35579192915b6000614a58856001600160a01b0316856001600160a01b0316600160601b6141b3565b905061306a614a7a8483614a6c8989615a24565b6001600160a01b03166141b3565b614c25565b6000826001600160a01b0316846001600160a01b03161115614a9f579192915b613480614a7a83600160601b614a6c8888615a24565b600054610100900460ff1680614ace575060005460ff16155b614aea5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614061576000805461ffff19166101011790558015614073576000805461ff001916905550565b600054610100900460ff1680614b38575060005460ff16155b614b545760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614b76576000805461ffff19166101011790555b6036614b828482615baa565b506037614b8f8382615baa565b508015612f0f576000805461ff0019169055505050565b600054610100900460ff1680614bbf575060005460ff16155b614bdb5760405162461bcd60e51b81526004016108249061563a565b600054610100900460ff16158015614bfd576000805461ffff19166101011790555b60016065558015614073576000805461ff001916905550565b60606134808484600085614c40565b806001600160801b0381168114614c3b57600080fd5b919050565b606082471015614ca15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610824565b843b614cef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610824565b600080866001600160a01b03168587604051614d0b9190615c69565b60006040518083038185875af1925050503d8060008114614d48576040519150601f19603f3d011682016040523d82523d6000602084013e614d4d565b606091505b5091509150614d5d828286614d68565b979650505050505050565b60608315614d77575081610847565b825115614d875782518084602001fd5b8160405162461bcd60e51b81526004016108249190614dc5565b60005b83811015614dbc578181015183820152602001614da4565b50506000910152565b6020815260008251806020840152614de4816040850160208701614da1565b601f01601f19169190910160400192915050565b6001600160a01b038116811461407357600080fd5b60008060408385031215614e2057600080fd5b8235614e2b81614df8565b946020939093013593505050565b6001600160a01b0391909116815260200190565b918252602082015260400190565b600080600060608486031215614e7057600080fd5b8335614e7b81614df8565b92506020840135614e8b81614df8565b929592945050506040919091013590565b8060020b811461407357600080fd5b801515811461407357600080fd5b600080600080600060a08688031215614ed157600080fd5b8535614edc81614e9c565b94506020860135614eec81614e9c565b93506040860135614efc81614df8565b9250606086013591506080860135614f1381614eab565b809150509295509295909350565b600060208284031215614f3357600080fd5b813561084781614df8565b60029190910b815260200190565b60008060408385031215614f5f57600080fd5b823591506020830135614f7181614df8565b809150509250929050565b60008060408385031215614f8f57600080fd5b50508035926020909101359150565b61ffff8116811461407357600080fd5b63ffffffff8116811461407357600080fd5b600080600080600060a08688031215614fd857600080fd5b8535614fe381614f9e565b94506020860135614ff381614f9e565b9350604086013561500381614f9e565b9250606086013561501381614fae565b91506080860135614f1381614df8565b600080600080600060a0868803121561503b57600080fd5b853561504681614df8565b945060208601359350604086013561505d81614eab565b9250606086013591506080860135614f1381614df8565b60008083601f84011261508657600080fd5b5081356001600160401b0381111561509d57600080fd5b6020830191508360208285010111156150b557600080fd5b9250929050565b600080600080606085870312156150d257600080fd5b843593506020850135925060408501356001600160401b038111156150f657600080fd5b61510287828801615074565b95989497509550505050565b6000806040838503121561512157600080fd5b823561512c81614df8565b91506020830135614f7181614df8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561517a5761517a61513c565b604052919050565b600082601f83011261519357600080fd5b81356001600160401b038111156151ac576151ac61513c565b6151bf601f8201601f1916602001615152565b8181528460208386010111156151d457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060e0888a03121561520c57600080fd5b87356001600160401b038082111561522357600080fd5b61522f8b838c01615182565b985060208a013591508082111561524557600080fd5b506152528a828b01615182565b965050604088013561526381614df8565b9450606088013561527381614f9e565b9350608088013561528381614e9c565b925060a088013561529381614e9c565b915060c08801356152a381614df8565b8091505092959891949750929550565b6000602082840312156152c557600080fd5b813561084781614f9e565b600181811c908216806152e457607f821691505b60208210810361530457634e487b7160e01b600052602260045260246000fd5b50919050565b600080600080600080600060e0888a03121561532557600080fd5b875161533081614df8565b602089015190975061534181614e9c565b604089015190965061535281614f9e565b606089015190955061536381614f9e565b608089015190945061537481614f9e565b60a089015190935060ff8116811461538b57600080fd5b60c08901519092506152a381614eab565b634e487b7160e01b600052601160045260246000fd5b818103818111156106f6576106f661539c565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b80516001600160801b0381168114614c3b57600080fd5b600080600080600060a0868803121561543657600080fd5b61543f86615407565b9450602086015193506040860151925061545b60608701615407565b915061546960808701615407565b90509295509295909350565b60006020828403121561548757600080fd5b5051919050565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b808201808211156106f6576106f661539c565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b600080604083850312156155ac57600080fd5b505080516020909101519092909150565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b60208082526003908201526242505360e81b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b61ffff8281168282160390808211156156a3576156a361539c565b5092915050565b6020808252600490820152636d42505360e01b604082015260600190565b6000602082840312156156da57600080fd5b815161084781614df8565b600080604083850312156156f857600080fd5b61570183615407565b915061570f60208401615407565b90509250929050565b80820281158282048414176106f6576106f661539c565b634e487b7160e01b600052601260045260246000fd5b6000826157545761575461572f565b500490565b61ffff8181168382160190808211156156a3576156a361539c565b602080825260089082015267686967682066656560c01b604082015260600190565b6000600182016157a8576157a861539c565b5060010190565b6000600160ff1b82016157c4576157c461539c565b5060000390565b60008160020b627fffff1981036157e4576157e461539c565b60000392915050565b6000826157fc576157fc61572f565b500690565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561585557835163ffffffff1683529284019291840191600101615833565b50909695505050505050565b60006001600160401b0382111561587a5761587a61513c565b5060051b60200190565b8051600681900b8114614c3b57600080fd5b600082601f8301126158a757600080fd5b815160206158bc6158b783615861565b615152565b82815260059290921b840181019181810190868411156158db57600080fd5b8286015b848110156158ff5780516158f281614df8565b83529183019183016158df565b509695505050505050565b6000806040838503121561591d57600080fd5b82516001600160401b038082111561593457600080fd5b818501915085601f83011261594857600080fd5b815160206159586158b783615861565b82815260059290921b8401810191818101908984111561597757600080fd5b948201945b8386101561599c5761598d86615884565b8252948201949082019061597c565b918801519196509093505050808211156159b557600080fd5b506159c285828601615896565b9150509250929050565b6001600160a01b038281168282168181028316929181158285048214176159f5576159f561539c565b50505092915050565b60006001600160a01b0383811680615a1857615a1861572f565b92169190910492915050565b6001600160a01b038281168282160390808211156156a3576156a361539c565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b6001600160a01b038181168382160190808211156156a3576156a361539c565b600080600080600080600080610100898b031215615aa857600080fd5b615ab189615407565b9750602089015180600f0b8114615ac757600080fd5b60408a015160608b015191985096509450615ae460808a01615884565b935060a0890151615af481614df8565b60c08a0151909350615b0581614fae565b60e08a0151909250615b1681614eab565b809150509295985092959890939650565b81810360008312801583831316838312821617156156a3576156a361539c565b600060208284031215615b5957600080fd5b815161084781614eab565b601f821115612f0f57600081815260208120601f850160051c81016020861015615b8b5750805b601f850160051c820191505b81811015613ab357828155600101615b97565b81516001600160401b03811115615bc357615bc361513c565b615bd781615bd184546152d0565b84615b64565b602080601f831160018114615c0c5760008415615bf45750858301515b600019600386901b1c1916600185901b178555613ab3565b600085815260208120601f198616915b82811015615c3b57888601518255948401946001909101908401615c1c565b5085821015615c595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251615c7b818460208701614da1565b919091019291505056fec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a2646970667358221220a11bde499516b0a2e8e737821292815fcefc66549a9729f24ea128d34ed6027364736f6c63430008130033", - "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": "See {IERC20-allowance}." - }, - "approve(address,uint256)": { - "details": "See {IERC20-approve}. Requirements: - `spender` cannot be the zero address." - }, - "balanceOf(address)": { - "details": "See {IERC20-balanceOf}." - }, - "burn(uint256,address)": { - "params": { - "burnAmount": "The number of G-UNI tokens to burn", - "receiver": "The account to receive the underlying amounts of token0 and token1" - }, - "returns": { - "amount0": "amount of token0 transferred to receiver for burning `burnAmount`", - "amount1": "amount of token1 transferred to receiver for burning `burnAmount`", - "liquidityBurned": "amount of liquidity removed from the underlying Uniswap V3 position" - } - }, - "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 this function is overridden; 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`." - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "details": "When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.", - "params": { - "newLowerTick": "The new lower bound of the position's range", - "newUpperTick": "The new upper bound of the position's range", - "swapAmountBPS": "amount of token to swap as proportion of total. Pass 0 to ignore swap.", - "swapThresholdPrice": "slippage parameter on the swap as a max or min sqrtPriceX96", - "zeroForOne": "Which token to input into the swap (true = token0, false = token1)" - } - }, - "getMintAmounts(uint256,uint256)": { - "params": { - "amount0Max": "The maximum amount of token1 to forward on mint" - }, - "returns": { - "amount0": "actual amount of token0 to forward when minting `mintAmount`", - "amount1": "actual amount of token1 to forward when minting `mintAmount`", - "mintAmount": "maximum number of G-UNI tokens to mint" - } - }, - "getUnderlyingBalances()": { - "returns": { - "amount0Current": "current total underlying balance of token0", - "amount1Current": "current total underlying balance of token1" - } - }, - "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." - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "params": { - "_lowerTick": "initial upperTick (only changeable with executiveRebalance)", - "_managerFeeBPS": "proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION", - "_manager_": "address of manager (ownership can be transferred)", - "_name": "name of G-UNI token", - "_pool": "address of Uniswap V3 pool", - "_symbol": "symbol of G-UNI token" - } - }, - "initializeManagerFee(uint16)": { - "params": { - "_managerFeeBPS": "proportion of fees earned that are credited to manager in Basis Points" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "mint(uint256,address)": { - "details": "to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts", - "params": { - "mintAmount": "The number of G-UNI tokens to mint", - "receiver": "The account to receive the minted tokens" - }, - "returns": { - "amount0": "amount of token0 transferred from msg.sender to mint `mintAmount`", - "amount1": "amount of token1 transferred from msg.sender to mint `mintAmount`", - "liquidityMinted": "amount of liquidity added to the underlying Uniswap V3 position" - } - }, - "name()": { - "details": "Returns the name of the token." - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "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 manager." - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "params": { - "newRebalanceBPS": "controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance", - "newSlippageBPS": "maximum slippage on swaps during gelato rebalance", - "newSlippageInterval": "length of time for TWAP used in computing slippage on swaps", - "newTreasury": "address where managerFee withdrawals are sent", - "newWithdrawBPS": "controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "burn(uint256,address)": { - "notice": "burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens" - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "notice": "Change the range of underlying UniswapV3 position, only manager can call" - }, - "getMintAmounts(uint256,uint256)": { - "notice": "compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`" - }, - "getUnderlyingBalances()": { - "notice": "compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)" - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "notice": "initialize storage variables on a new G-UNI pool, only called once" - }, - "initializeManagerFee(uint16)": { - "notice": "initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again." - }, - "mint(uint256,address)": { - "notice": "mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position" - }, - "rebalance(uint160,uint256,bool,uint256,address)": { - "notice": "Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager." - }, - "uniswapV3MintCallback(uint256,uint256,bytes)": { - "notice": "Uniswap V3 callback fn, called back on pool.mint" - }, - "uniswapV3SwapCallback(int256,int256,bytes)": { - "notice": "Uniswap v3 callback fn, called back on pool.swap" - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "notice": "change configurable parameters, only manager can call" - }, - "withdrawGelatoBalance(uint256,address)": { - "notice": "withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - }, - "withdrawManagerBalance(uint256,address)": { - "notice": "withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 5, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 784, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage" - }, - { - "astId": 122, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_balances", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 128, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_allowances", - "offset": 0, - "slot": "52", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 130, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_totalSupply", - "offset": 0, - "slot": "53", - "type": "t_uint256" - }, - { - "astId": 132, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_name", - "offset": 0, - "slot": "54", - "type": "t_string_storage" - }, - { - "astId": 134, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_symbol", - "offset": 0, - "slot": "55", - "type": "t_string_storage" - }, - { - "astId": 636, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "56", - "type": "t_array(t_uint256)45_storage" - }, - { - "astId": 59, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_status", - "offset": 0, - "slot": "101", - "type": "t_uint256" - }, - { - "astId": 102, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "102", - "type": "t_array(t_uint256)49_storage" - }, - { - "astId": 6441, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_manager", - "offset": 0, - "slot": "151", - "type": "t_address" - }, - { - "astId": 6031, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "lowerTick", - "offset": 20, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6033, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "upperTick", - "offset": 23, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6035, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoRebalanceBPS", - "offset": 26, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6037, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoWithdrawBPS", - "offset": 28, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6039, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageBPS", - "offset": 30, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6041, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageInterval", - "offset": 0, - "slot": "152", - "type": "t_uint32" - }, - { - "astId": 6043, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerFeeBPS", - "offset": 4, - "slot": "152", - "type": "t_uint16" - }, - { - "astId": 6045, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerTreasury", - "offset": 6, - "slot": "152", - "type": "t_address" - }, - { - "astId": 6047, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance0", - "offset": 0, - "slot": "153", - "type": "t_uint256" - }, - { - "astId": 6049, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance1", - "offset": 0, - "slot": "154", - "type": "t_uint256" - }, - { - "astId": 6051, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance0", - "offset": 0, - "slot": "155", - "type": "t_uint256" - }, - { - "astId": 6053, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance1", - "offset": 0, - "slot": "156", - "type": "t_uint256" - }, - { - "astId": 6056, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "pool", - "offset": 0, - "slot": "157", - "type": "t_contract(IUniswapV3Pool)2339" - }, - { - "astId": 6059, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token0", - "offset": 0, - "slot": "158", - "type": "t_contract(IERC20)863" - }, - { - "astId": 6062, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token1", - "offset": 0, - "slot": "159", - "type": "t_contract(IERC20)863" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)45_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)49_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "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)863": { - "encoding": "inplace", - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_contract(IUniswapV3Pool)2339": { - "encoding": "inplace", - "label": "contract IUniswapV3Pool", - "numberOfBytes": "20" - }, - "t_int24": { - "encoding": "inplace", - "label": "int24", - "numberOfBytes": "3" - }, - "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_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/modeSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json b/lib/g-uni-v1-core/deployments/modeSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json deleted file mode 100644 index 371127af2..000000000 --- a/lib/g-uni-v1-core/deployments/modeSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\n/// @dev Modified to support 0.8.19\n/// @dev Modified to set the gelatoFeeBPS to 0\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 0;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n event SetManagerFee(uint16 managerFee);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n emit SetManagerFee(_managerFeeBPS);\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidityBefore,\n uint128 liquidityAfter\n );\n\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n SafeCast.toUint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidityBurned);\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n\n amount0 =\n burn0 +\n FullMath.mulDiv(\n token0.balanceOf(address(this)) -\n burn0 -\n managerBalance0 -\n gelatoBalance0,\n burnAmount,\n totalSupply\n );\n amount1 =\n burn1 +\n FullMath.mulDiv(\n token1.balanceOf(address(this)) -\n burn1 -\n managerBalance1 -\n gelatoBalance1,\n burnAmount,\n totalSupply\n );\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n // solhint-disable-next-line function-max-lines\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n uint128 liquidity;\n uint128 newLiquidity;\n if (totalSupply() > 0) {\n (liquidity, , , , ) = pool.positions(_getPositionID());\n if (liquidity > 0) {\n (, , uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n }\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > 0, \"new position 0\");\n } else {\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n }\n\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n _rebalance(\n liquidity,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > liquidity, \"liquidity must increase\");\n\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\n external\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n // solhint-disable-next-line function-max-lines\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\n internal\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint128 liquidity,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n uint256 leftover0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 leftover1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n (, , uint256 feesEarned0, uint256 feesEarned1) =\n _withdraw(lowerTick, upperTick, liquidity);\n _applyFees(feesEarned0, feesEarned1);\n (feesEarned0, feesEarned1) = _subtractAdminFees(\n feesEarned0,\n feesEarned1\n );\n emit FeesEarned(feesEarned0, feesEarned1);\n feesEarned0 += leftover0;\n feesEarned1 += leftover1;\n\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n leftover0,\n leftover1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdraw(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n )\n private\n returns (\n uint256 burn0,\n uint256 burn1,\n uint256 fee0,\n uint256 fee1\n )\n {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n SafeCast.toInt256(\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\n );\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array len\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"high slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"high slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\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 require(value < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return uint128(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 require(value < 2**64, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return uint64(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 require(value < 2**32, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return uint32(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 require(value < 2**16, \"SafeCast: value doesn\\'t fit in 16 bits\");\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 require(value < 2**8, \"SafeCast: value doesn\\'t fit in 8 bits\");\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 require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= -2**127 && value < 2**127, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return int128(value);\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= -2**63 && value < 2**63, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return int64(value);\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= -2**31 && value < 2**31, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return int32(value);\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= -2**15 && value < 2**15, \"SafeCast: value doesn\\'t fit in 16 bits\");\n return int16(value);\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= -2**7 && value < 2**7, \"SafeCast: value doesn\\'t fit in 8 bits\");\n return int8(value);\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 require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IUniswapV3TickSpacing} from \"./interfaces/IUniswapV3TickSpacing.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n }\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n 0,\n lowerTick,\n upperTick,\n address(0)\n );\n }\n\n function _createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n address manager\n ) internal returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory name = \"Gelato Uniswap LP\";\n try this.getTokenName(token0, token1) returns (string memory result) {\n name = result;\n } catch {} // solhint-disable-line no-empty-blocks\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n require(uniPool != address(0), \"uniswap pool does not exist\");\n require(\n _validateTickSpacing(uniPool, lowerTick, upperTick),\n \"tickSpacing mismatch\"\n );\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n manager\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, manager, pool);\n }\n\n function _validateTickSpacing(\n address uniPool,\n int24 lowerTick,\n int24 upperTick\n ) internal view returns (bool) {\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\n return\n lowerTick < upperTick &&\n lowerTick % spacing == 0 &&\n upperTick % spacing == 0;\n }\n\n function getTokenName(address token0, address token1)\n external\n view\n returns (string memory)\n {\n string memory symbol0 = IERC20Metadata(token0).symbol();\n string memory symbol1 = IERC20Metadata(token1).symbol();\n\n return _append(\"Gelato Uniswap \", symbol0, \"/\", symbol1, \" LP\");\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IUniswapV3TickSpacing.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IUniswapV3TickSpacing {\n function tickSpacing() external view returns (int24);\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.19;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "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/lib/g-uni-v1-core/deployments/optimism/.chainId b/lib/g-uni-v1-core/deployments/optimism/.chainId deleted file mode 100644 index 9a037142a..000000000 --- a/lib/g-uni-v1-core/deployments/optimism/.chainId +++ /dev/null @@ -1 +0,0 @@ -10 \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/optimism/GUniFactory.json b/lib/g-uni-v1-core/deployments/optimism/GUniFactory.json deleted file mode 100644 index 5b60a8caf..000000000 --- a/lib/g-uni-v1-core/deployments/optimism/GUniFactory.json +++ /dev/null @@ -1,721 +0,0 @@ -{ - "address": "0x2845c6929d621e32B7596520C8a1E5a37e616F09", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - } - ], - "transactionHash": "0xa0597f8bff12f9cb06fe9eca72083e7b2d9e5a3ea1921c7878516afb8685a369", - "receipt": { - "to": null, - "from": "0x88215a2794ddC031439C72922EC8983bDE831c78", - "contractAddress": "0x2845c6929d621e32B7596520C8a1E5a37e616F09", - "transactionIndex": 0, - "gasUsed": "566280", - "logsBloom": "0x00100000000020000000000000000000000000000800000004000000000000000000000000000000000400020080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020002000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000004000000000000000200000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000004020000000000000000000000400000000000000000000000080000000000000000000", - "blockHash": "0xcf8a46180e426c8ecff4b8ff16cfe06a67d8b47b1a31923f1841dd03c8c48dcd", - "transactionHash": "0xa0597f8bff12f9cb06fe9eca72083e7b2d9e5a3ea1921c7878516afb8685a369", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 2146721, - "transactionHash": "0xa0597f8bff12f9cb06fe9eca72083e7b2d9e5a3ea1921c7878516afb8685a369", - "address": "0x2845c6929d621e32B7596520C8a1E5a37e616F09", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b9bfd9807ef39821beaeab51acdf32e23e195b5d" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0xcf8a46180e426c8ecff4b8ff16cfe06a67d8b47b1a31923f1841dd03c8c48dcd" - }, - { - "transactionIndex": 0, - "blockNumber": 2146721, - "transactionHash": "0xa0597f8bff12f9cb06fe9eca72083e7b2d9e5a3ea1921c7878516afb8685a369", - "address": "0x2845c6929d621e32B7596520C8a1E5a37e616F09", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000088215a2794ddc031439c72922ec8983bde831c78" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0xcf8a46180e426c8ecff4b8ff16cfe06a67d8b47b1a31923f1841dd03c8c48dcd" - } - ], - "blockNumber": 2146721, - "cumulativeGasUsed": "566280", - "status": 1, - "byzantium": true - }, - "args": [ - "0xb9BFd9807EF39821BEAEAB51aCdF32E23e195b5d", - "0x88215a2794ddC031439C72922EC8983bDE831c78", - "0xc0c53b8b0000000000000000000000008582bf142be76fef830d23f590a2587f2ad7c21600000000000000000000000088215a2794ddc031439c72922ec8983bde831c7800000000000000000000000088215a2794ddc031439c72922ec8983bde831c78" - ], - "solcInputHash": "5b7722421ca04d0a130cd8a2a08f9ec3", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x4ad41656a53bc38d766197d9974be4be70f506b1d1f78def2c3726e8d580a3f5\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x00dbb59cf486ff9a2930fb588ef70d761dbf439aa05d48ef0001a0448769ec11\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033", - "execute": { - "methodName": "initialize", - "args": [ - "0x8582Bf142BE76fEF830D23f590a2587f2aD7C216", - "0x88215a2794ddC031439C72922EC8983bDE831c78", - "0x88215a2794ddC031439C72922EC8983bDE831c78" - ] - }, - "implementation": "0xb9BFd9807EF39821BEAEAB51aCdF32E23e195b5d", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} diff --git a/lib/g-uni-v1-core/deployments/optimism/GUniFactory_Implementation.json b/lib/g-uni-v1-core/deployments/optimism/GUniFactory_Implementation.json deleted file mode 100644 index 2963fef9d..000000000 --- a/lib/g-uni-v1-core/deployments/optimism/GUniFactory_Implementation.json +++ /dev/null @@ -1,800 +0,0 @@ -{ - "address": "0xb9BFd9807EF39821BEAEAB51aCdF32E23e195b5d", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_uniswapV3Factory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x2034cc9771ad863625e145ed917554702b9ff76a034c51ced631a54b726caa69", - "receipt": { - "to": null, - "from": "0x88215a2794ddC031439C72922EC8983bDE831c78", - "contractAddress": "0xb9BFd9807EF39821BEAEAB51aCdF32E23e195b5d", - "transactionIndex": 0, - "gasUsed": "2234889", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x6bcc998c18d7dcdcdc3833729b3574851ea026a66ae3b69c36f25510a0c050ce", - "transactionHash": "0x2034cc9771ad863625e145ed917554702b9ff76a034c51ced631a54b726caa69", - "logs": [], - "blockNumber": 2146712, - "cumulativeGasUsed": "2234889", - "status": 1, - "byzantium": true - }, - "args": ["0x1F98431c8aD98523631AE4a59f267346ea31F984"], - "solcInputHash": "5b7722421ca04d0a130cd8a2a08f9ec3", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_uniswapV3Factory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"uniPool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previosGelatoDeployer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newGelatoDeployer\",\"type\":\"address\"}],\"name\":\"UpdateGelatoDeployer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"UpdatePoolImplementation\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createManagedPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDeployers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGelatoPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"getTokenName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gelatoDeployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isPoolImmutable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"makePoolsImmutable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numDeployers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextGelatoDeployer\",\"type\":\"address\"}],\"name\":\"setGelatoDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextImplementation\",\"type\":\"address\"}],\"name\":\"setPoolImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"upgradePools\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"bytes[]\",\"name\":\"datas\",\"type\":\"bytes[]\"}],\"name\":\"upgradePoolsAndCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"managerFee\":\"proportion of earned fees that go to pool manager in Basis Points\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"createPool(address,address,uint24,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"getDeployers()\":{\"returns\":{\"_0\":\"deployers the list of deployer addresses\"}},\"getGelatoPools()\":{\"returns\":{\"_0\":\"list of Gelato managed G-UNI pool addresses\"}},\"getPools(address)\":{\"params\":{\"deployer\":\"address that has potentially deployed G-UNI pools (can return empty array)\"},\"returns\":{\"_0\":\"pools the list of G-UNI pool addresses deployed by `deployer`\"}},\"getProxyAdmin(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"address that controls the G-UNI implementation (has power to upgrade it)\"}},\"isPoolImmutable(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"bool signaling if pool is immutable (true) or not (false)\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"numDeployers()\":{\"returns\":{\"_0\":\"total number of G-UNI pool deployer addresses\"}},\"numPools()\":{\"returns\":{\"result\":\"total number of G-UNI pools deployed\"}},\"numPools(address)\":{\"params\":{\"deployer\":\"deployer address\"},\"returns\":{\"_0\":\"total number of G-UNI pools deployed by `deployer`\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"notice\":\"createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`\"},\"createPool(address,address,uint24,int24,int24)\":{\"notice\":\"createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`\"},\"getDeployers()\":{\"notice\":\"getDeployers fetches all addresses that have deployed a G-UNI pool\"},\"getGelatoPools()\":{\"notice\":\"getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)\"},\"getPools(address)\":{\"notice\":\"getPools fetches all the G-UNI pool addresses deployed by `deployer`\"},\"getProxyAdmin(address)\":{\"notice\":\"getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address).\"},\"isPoolImmutable(address)\":{\"notice\":\"isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\"},\"numDeployers()\":{\"notice\":\"numDeployers counts the total number of G-UNI pool deployer addresses\"},\"numPools()\":{\"notice\":\"numPools counts the total number of G-UNI pools in existence\"},\"numPools(address)\":{\"notice\":\"numPools counts the total number of G-UNI pools deployed by `deployer`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniFactory.sol\":\"GUniFactory\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\\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\":\"0x4878ef6c288f4cef3c2a288d32cc548c648831cc55503ad3d9a581ed3b93aad9\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title The interface for the Uniswap V3 Factory\\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\\ninterface IUniswapV3Factory {\\n /// @notice Emitted when the owner of the factory is changed\\n /// @param oldOwner The owner before the owner was changed\\n /// @param newOwner The owner after the owner was changed\\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\\n\\n /// @notice Emitted when a pool is created\\n /// @param token0 The first token of the pool by address sort order\\n /// @param token1 The second token of the pool by address sort order\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks\\n /// @param pool The address of the created pool\\n event PoolCreated(\\n address indexed token0,\\n address indexed token1,\\n uint24 indexed fee,\\n int24 tickSpacing,\\n address pool\\n );\\n\\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\\n /// @param fee The enabled fee, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\\n\\n /// @notice Returns the current owner of the factory\\n /// @dev Can be changed by the current owner via setOwner\\n /// @return The address of the factory owner\\n function owner() external view returns (address);\\n\\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\\n /// @return The tick spacing\\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\\n\\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\\n /// @param tokenA The contract address of either token0 or token1\\n /// @param tokenB The contract address of the other token\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @return pool The pool address\\n function getPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external view returns (address pool);\\n\\n /// @notice Creates a pool for the given two tokens and fee\\n /// @param tokenA One of the two tokens in the desired pool\\n /// @param tokenB The other of the two tokens in the desired pool\\n /// @param fee The desired fee for the pool\\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\\n /// are invalid.\\n /// @return pool The address of the newly created pool\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external returns (address pool);\\n\\n /// @notice Updates the owner of the factory\\n /// @dev Must be called by the current owner\\n /// @param _owner The new owner of the factory\\n function setOwner(address _owner) external;\\n\\n /// @notice Enables a fee amount with the given tickSpacing\\n /// @dev Fee amounts may never be removed once enabled\\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\\n}\\n\",\"keccak256\":\"0xcc3d0c93fc9ac0febbe09f941b465b57f750bcf3b48432da0b97dc289cfdc489\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\nimport {\\n IUniswapV3Factory\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\\\";\\nimport {IUniswapV3TickSpacing} from \\\"./interfaces/IUniswapV3TickSpacing.sol\\\";\\nimport {IGUniFactory} from \\\"./interfaces/IGUniFactory.sol\\\";\\nimport {IGUniPoolStorage} from \\\"./interfaces/IGUniPoolStorage.sol\\\";\\nimport {GUniFactoryStorage} from \\\"./abstract/GUniFactoryStorage.sol\\\";\\nimport {EIP173Proxy} from \\\"./vendor/proxy/EIP173Proxy.sol\\\";\\nimport {IEIP173Proxy} from \\\"./interfaces/IEIP173Proxy.sol\\\";\\nimport {\\n IERC20Metadata\\n} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n constructor(address _uniswapV3Factory)\\n GUniFactoryStorage(_uniswapV3Factory)\\n {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n managerFee,\\n lowerTick,\\n upperTick,\\n msg.sender\\n );\\n }\\n\\n /// @notice createPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n 0,\\n lowerTick,\\n upperTick,\\n address(0)\\n );\\n }\\n\\n function _createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick,\\n address manager\\n ) internal returns (address pool) {\\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\\n\\n pool = address(new EIP173Proxy(poolImplementation, address(this), \\\"\\\"));\\n\\n string memory name = \\\"Gelato Uniswap LP\\\";\\n try this.getTokenName(token0, token1) returns (string memory result) {\\n name = result;\\n } catch {} // solhint-disable-line no-empty-blocks\\n\\n address uniPool =\\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\\n require(uniPool != address(0), \\\"uniswap pool does not exist\\\");\\n require(\\n _validateTickSpacing(uniPool, lowerTick, upperTick),\\n \\\"tickSpacing mismatch\\\"\\n );\\n\\n IGUniPoolStorage(pool).initialize(\\n name,\\n \\\"G-UNI\\\",\\n uniPool,\\n managerFee,\\n lowerTick,\\n upperTick,\\n manager\\n );\\n _deployers.add(msg.sender);\\n _pools[msg.sender].add(pool);\\n emit PoolCreated(uniPool, manager, pool);\\n }\\n\\n function _validateTickSpacing(\\n address uniPool,\\n int24 lowerTick,\\n int24 upperTick\\n ) internal view returns (bool) {\\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\\n return\\n lowerTick < upperTick &&\\n lowerTick % spacing == 0 &&\\n upperTick % spacing == 0;\\n }\\n\\n function getTokenName(address token0, address token1)\\n external\\n view\\n returns (string memory)\\n {\\n string memory symbol0 = IERC20Metadata(token0).symbol();\\n string memory symbol1 = IERC20Metadata(token1).symbol();\\n\\n return _append(\\\"Gelato Uniswap \\\", symbol0, \\\"/\\\", symbol1, \\\" LP\\\");\\n }\\n\\n function upgradePools(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\\n }\\n }\\n\\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\\n external\\n onlyManager\\n {\\n require(pools.length == datas.length, \\\"mismatching array length\\\");\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeToAndCall(\\n poolImplementation,\\n datas[i]\\n );\\n }\\n }\\n\\n function makePoolsImmutable(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\\n }\\n }\\n\\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the\\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\\n /// @param pool address of the G-UNI pool\\n /// @return bool signaling if pool is immutable (true) or not (false)\\n function isPoolImmutable(address pool) external view returns (bool) {\\n return address(0) == getProxyAdmin(pool);\\n }\\n\\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\\n /// @return list of Gelato managed G-UNI pool addresses\\n function getGelatoPools() external view returns (address[] memory) {\\n return getPools(gelatoDeployer);\\n }\\n\\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\\n /// @return deployers the list of deployer addresses\\n function getDeployers() public view returns (address[] memory) {\\n uint256 length = numDeployers();\\n address[] memory deployers = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n deployers[i] = _getDeployer(i);\\n }\\n\\n return deployers;\\n }\\n\\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\\n function getPools(address deployer) public view returns (address[] memory) {\\n uint256 length = numPools(deployer);\\n address[] memory pools = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n pools[i] = _getPool(deployer, i);\\n }\\n\\n return pools;\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools in existence\\n /// @return result total number of G-UNI pools deployed\\n function numPools() public view returns (uint256 result) {\\n address[] memory deployers = getDeployers();\\n for (uint256 i = 0; i < deployers.length; i++) {\\n result += numPools(deployers[i]);\\n }\\n }\\n\\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\\n /// @return total number of G-UNI pool deployer addresses\\n function numDeployers() public view returns (uint256) {\\n return _deployers.length();\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\\n /// @param deployer deployer address\\n /// @return total number of G-UNI pools deployed by `deployer`\\n function numPools(address deployer) public view returns (uint256) {\\n return _pools[deployer].length();\\n }\\n\\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\\n /// no longer upgradable (no one owns the zero address).\\n /// @param pool address of the G-UNI pool\\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\\n function getProxyAdmin(address pool) public view returns (address) {\\n return IEIP173Proxy(pool).proxyAdmin();\\n }\\n\\n function _getDeployer(uint256 index) internal view returns (address) {\\n return _deployers.at(index);\\n }\\n\\n function _getPool(address deployer, uint256 index)\\n internal\\n view\\n returns (address)\\n {\\n return _pools[deployer].at(index);\\n }\\n\\n function _getTokenOrder(address tokenA, address tokenB)\\n internal\\n pure\\n returns (address token0, address token1)\\n {\\n require(tokenA != tokenB, \\\"same token\\\");\\n (token0, token1) = tokenA < tokenB\\n ? (tokenA, tokenB)\\n : (tokenB, tokenA);\\n require(token0 != address(0), \\\"no address zero\\\");\\n }\\n\\n function _append(\\n string memory a,\\n string memory b,\\n string memory c,\\n string memory d,\\n string memory e\\n ) internal pure returns (string memory) {\\n return string(abi.encodePacked(a, b, c, d, e));\\n }\\n}\\n\",\"keccak256\":\"0x476238c3222674c2c192a71fed95dbf9a54ac2b0f09867b7dbae7cd56bc52942\",\"license\":\"MIT\"},\"contracts/abstract/GUniFactoryStorage.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n Initializable\\n} from \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\n// solhint-disable-next-line max-states-count\\ncontract GUniFactoryStorage is\\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\\n Initializable\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n address public immutable factory;\\n address public poolImplementation;\\n address public gelatoDeployer;\\n EnumerableSet.AddressSet internal _deployers;\\n mapping(address => EnumerableSet.AddressSet) internal _pools;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdatePoolImplementation(\\n address previousImplementation,\\n address newImplementation\\n );\\n\\n event UpdateGelatoDeployer(\\n address previosGelatoDeployer,\\n address newGelatoDeployer\\n );\\n\\n constructor(address _uniswapV3Factory) {\\n factory = _uniswapV3Factory;\\n }\\n\\n function initialize(\\n address _implementation,\\n address _gelatoDeployer,\\n address _manager_\\n ) external initializer {\\n poolImplementation = _implementation;\\n gelatoDeployer = _gelatoDeployer;\\n _manager = _manager_;\\n }\\n\\n function setPoolImplementation(address nextImplementation)\\n external\\n onlyManager\\n {\\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\\n poolImplementation = nextImplementation;\\n }\\n\\n function setGelatoDeployer(address nextGelatoDeployer)\\n external\\n onlyManager\\n {\\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\\n gelatoDeployer = nextGelatoDeployer;\\n }\\n}\\n\",\"keccak256\":\"0x81b65c0b1c660c0935d6c40310b19e62df7fdd7c0af94915afcc600bdb647fb0\",\"license\":\"MIT\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.4;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x81d888640e2261ac5189e6061a0cf4a7f3cec5994be1859ba60ffeb961f70c01\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IEIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\ninterface IEIP173Proxy {\\n function proxyAdmin() external view returns (address);\\n\\n function transferProxyAdmin(address newAdmin) external;\\n\\n function upgradeTo(address newImplementation) external;\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable;\\n}\\n\",\"keccak256\":\"0x3ff5ed428adeaaa9ba05a91b4ccec7df22cd5de80a53a7bff109543bdebe1a68\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IGUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\ninterface IGUniFactory {\\n event PoolCreated(\\n address indexed uniPool,\\n address indexed manager,\\n address indexed pool\\n );\\n\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n}\\n\",\"keccak256\":\"0xd284f6caaca9268dbe508b0ceae918eedcf96d3a7beee2b19f3b57e732deba66\",\"license\":\"MIT\"},\"contracts/interfaces/IGUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\ninterface IGUniPoolStorage {\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external;\\n}\\n\",\"keccak256\":\"0x39f4bc4e8684c9674e1967a3ac4ea5531f45492266586c4e6e9eb2f6d9108ced\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IUniswapV3TickSpacing.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\ninterface IUniswapV3TickSpacing {\\n function tickSpacing() external view returns (int24);\\n}\\n\",\"keccak256\":\"0x3fa60458d5f66e28118c971b0bcf2d2ef25d28383f1ce94f2f1d4c02643cd7af\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x4ad41656a53bc38d766197d9974be4be70f506b1d1f78def2c3726e8d580a3f5\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x00dbb59cf486ff9a2930fb588ef70d761dbf439aa05d48ef0001a0448769ec11\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b5060405161281e38038061281e83398101604081905261002f91610044565b60601b6001600160601b031916608052610072565b600060208284031215610055578081fd5b81516001600160a01b038116811461006b578182fd5b9392505050565b60805160601c6127876100976000396000818161031201526110e201526127876000f3fe60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e6200015836600462001692565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e366004620018a6565b62000448565b6200015e620001a536600462001868565b620005c8565b6200016a620006ae565b6200015e620001c636600462001868565b62000725565b6200016a620001dd36600462001692565b6200080f565b620001ed62000838565b60405162000174919062001a9d565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001b5a565b6200023a62000847565b60405162000174919062001b0b565b6200023a6200025a36600462001692565b6200085c565b6200023a62000931565b6200015e62000a03565b620001ed62000285366004620017d7565b62000a70565b600254620001ed906001600160a01b031681565b620002b6620002b036600462001692565b62000a8e565b604051901515815260200162000174565b620001ed620002d83660046200175e565b62000aab565b62000221620002ef366004620016d0565b62000aca565b6200015e620003063660046200170d565b62000c39565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e6200035936600462001692565b62000d43565b6200015e6200037036600462001692565b62000de2565b620001ed6200038736600462001692565b62000ec9565b336200039862000838565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001be4565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b0390911690849062001ab1565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000f40565b905090565b336200045362000838565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001be4565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005c257838181518110620004f757634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200054457634e487b7160e01b600052603260045260246000fd5b905060200281019062000558919062001c26565b6040518463ffffffff1660e01b8152600401620005789392919062001acb565b600060405180830381600087803b1580156200059357600080fd5b505af1158015620005a8573d6000803e3d6000fd5b505050508080620005b99062001cea565b915050620004cc565b50505050565b33620005d362000838565b6001600160a01b031614620005fc5760405162461bcd60e51b8152600401620003c19062001be4565b60005b8151811015620006aa578181815181106200062a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b815260040162000660919062001a9d565b600060405180830381600087803b1580156200067b57600080fd5b505af115801562000690573d6000803e3d6000fd5b505050508080620006a19062001cea565b915050620005ff565b5050565b600080620006bb62000931565b905060005b81518110156200072057620006fd828281518110620006ef57634e487b7160e01b600052603260045260246000fd5b60200260200101516200080f565b62000709908462001ca0565b925080620007178162001cea565b915050620006c0565b505090565b336200073062000838565b6001600160a01b031614620007595760405162461bcd60e51b8152600401620003c19062001be4565b60005b8151811015620006aa578181815181106200078757634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe692620007c59291169060040162001a9d565b600060405180830381600087803b158015620007e057600080fd5b505af1158015620007f5573d6000803e3d6000fd5b505050508080620008069062001cea565b9150506200075c565b6001600160a01b0381166000908152600560205260408120620008329062000f40565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200086b836200080f565b90506000816001600160401b038111156200089657634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015620008c0578160200160208202803683370190505b50905060005b828110156200092957620008db858262000f4b565b828281518110620008fc57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280620009208162001cea565b915050620008c6565b509392505050565b606060006200093f62000435565b90506000816001600160401b038111156200096a57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000994578160200160208202803683370190505b50905060005b82811015620009fc57620009ae8162000f76565b828281518110620009cf57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280620009f38162001cea565b9150506200099a565b5092915050565b3362000a0e62000838565b6001600160a01b03161462000a375760405162461bcd60e51b8152600401620003c19062001be4565b600080546040516001600160a01b039091169060008051602062002732833981519152908390a3600080546001600160a01b0319169055565b600062000a838787878787873362000f85565b979650505050505050565b600062000a9b8262000ec9565b6001600160a01b03161592915050565b600062000ac086868660008787600062000f85565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000b0857600080fd5b505afa15801562000b1d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b47919081019062001960565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000b8557600080fd5b505afa15801562000b9a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000bc4919081019062001960565b905062000c306040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001304565b95945050505050565b600054600160a81b900460ff168062000c5c5750600054600160a01b900460ff16155b62000cc15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000cec576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005c2576000805460ff60a81b1916905550505050565b3362000d4e62000838565b6001600160a01b03161462000d775760405162461bcd60e51b8152600401620003c19062001be4565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000db8916001600160a01b0390911690849062001ab1565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000ded62000838565b6001600160a01b03161462000e165760405162461bcd60e51b8152600401620003c19062001be4565b6001600160a01b03811662000e7f5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200273283398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000f0557600080fd5b505afa15801562000f1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620008329190620016b1565b600062000832825490565b6001600160a01b038216600090815260056020526040812062000f6f90836200133b565b9392505050565b6000620008326003836200133b565b600080600062000f968a8a62001349565b6001546040519294509092506001600160a01b031690309062000fb990620015d5565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000ffc573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb9906200104e908690869060040162001ab1565b60006040518083038186803b1580156200106757600080fd5b505afa9250505080156200109f57506040513d6000823e601f3d908101601f191682016040526200109c919081019062001960565b60015b620010aa57620010ad565b90505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee829060640160206040518083038186803b1580156200112757600080fd5b505afa1580156200113c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011629190620016b1565b90506001600160a01b038116620011ba5760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b620011c781898962001418565b6200120c5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200124490859085908e908e908e908e9060040162001b6f565b600060405180830381600087803b1580156200125f57600080fd5b505af115801562001274573d6000803e3d6000fd5b505050506200128e336003620014d590919063ffffffff16565b50336000908152600560205260409020620012aa9086620014d5565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200132195949392919062001a28565b604051602081830303815290604052905095945050505050565b600062000f6f8383620014ec565b600080826001600160a01b0316846001600160a01b031614156200139d5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620013bf578284620013c2565b83835b90925090506001600160a01b038216620014115760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200145557600080fd5b505afa1580156200146a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001490919062001941565b90508260020b8460020b128015620014b45750620014af818562001d08565b60020b155b801562000c305750620014c8818462001d08565b60020b1595945050505050565b600062000f6f836001600160a01b03841662001583565b815460009082106200154c5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b8260000182815481106200157057634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b6000818152600183016020526040812054620015cc5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000832565b50600062000832565b6109a58062001d8d83390190565b600082601f830112620015f4578081fd5b813560206001600160401b0382111562001612576200161262001d4d565b8160051b6200162382820162001c6d565b8381528281019086840183880185018910156200163e578687fd5b8693505b858410156200166d578035620016588162001d63565b83526001939093019291840191840162001642565b50979650505050505050565b803562ffffff811681146200168d57600080fd5b919050565b600060208284031215620016a4578081fd5b813562000f6f8162001d63565b600060208284031215620016c3578081fd5b815162000f6f8162001d63565b60008060408385031215620016e3578081fd5b8235620016f08162001d63565b91506020830135620017028162001d63565b809150509250929050565b60008060006060848603121562001722578081fd5b83356200172f8162001d63565b92506020840135620017418162001d63565b91506040840135620017538162001d63565b809150509250925092565b600080600080600060a0868803121562001776578081fd5b8535620017838162001d63565b94506020860135620017958162001d63565b9350620017a56040870162001679565b92506060860135620017b78162001d7c565b91506080860135620017c98162001d7c565b809150509295509295909350565b60008060008060008060c08789031215620017f0578081fd5b8635620017fd8162001d63565b955060208701356200180f8162001d63565b94506200181f6040880162001679565b9350606087013561ffff8116811462001836578182fd5b92506080870135620018488162001d7c565b915060a08701356200185a8162001d7c565b809150509295509295509295565b6000602082840312156200187a578081fd5b81356001600160401b0381111562001890578182fd5b6200189e84828501620015e3565b949350505050565b600080600060408486031215620018bb578283fd5b83356001600160401b0380821115620018d2578485fd5b620018e087838801620015e3565b94506020860135915080821115620018f6578384fd5b818601915086601f8301126200190a578384fd5b81358181111562001919578485fd5b8760208260051b85010111156200192e578485fd5b6020830194508093505050509250925092565b60006020828403121562001953578081fd5b815162000f6f8162001d7c565b60006020828403121562001972578081fd5b81516001600160401b038082111562001989578283fd5b818401915084601f8301126200199d578283fd5b815181811115620019b257620019b262001d4d565b620019c7601f8201601f191660200162001c6d565b9150808252856020828501011115620019de578384fd5b620019f181602084016020860162001cbb565b50949350505050565b6000815180845262001a1481602086016020860162001cbb565b601f01601f19169290920160200192915050565b6000865162001a3c818460208b0162001cbb565b86519083019062001a52818360208b0162001cbb565b865191019062001a67818360208a0162001cbb565b855191019062001a7c81836020890162001cbb565b845191019062001a9181836020880162001cbb565b01979650505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b6020808252825182820181905260009190848201906040850190845b8181101562001b4e5783516001600160a01b03168352928401929184019160010162001b27565b50909695505050505050565b60208152600062000f6f6020830184620019fa565b60e08152600062001b8460e0830189620019fa565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6000808335601e1984360301811262001c3d578283fd5b8301803591506001600160401b0382111562001c57578283fd5b6020019150368190038213156200141157600080fd5b604051601f8201601f191681016001600160401b038111828210171562001c985762001c9862001d4d565b604052919050565b6000821982111562001cb65762001cb662001d37565b500190565b60005b8381101562001cd857818101518382015260200162001cbe565b83811115620005c25750506000910152565b600060001982141562001d015762001d0162001d37565b5060010190565b60008260020b8062001d2857634e487b7160e01b82526012600452602482fd5b808360020b0791505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811462001d7957600080fd5b50565b8060020b811462001d7957600080fdfe60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a26469706673582212202e6ff5d3661cc2336a91145498f5e5e835222f3bed72d3235d7e02f381e1b62564736f6c63430008040033", - "deployedBytecode": "0x60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e6200015836600462001692565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e366004620018a6565b62000448565b6200015e620001a536600462001868565b620005c8565b6200016a620006ae565b6200015e620001c636600462001868565b62000725565b6200016a620001dd36600462001692565b6200080f565b620001ed62000838565b60405162000174919062001a9d565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001b5a565b6200023a62000847565b60405162000174919062001b0b565b6200023a6200025a36600462001692565b6200085c565b6200023a62000931565b6200015e62000a03565b620001ed62000285366004620017d7565b62000a70565b600254620001ed906001600160a01b031681565b620002b6620002b036600462001692565b62000a8e565b604051901515815260200162000174565b620001ed620002d83660046200175e565b62000aab565b62000221620002ef366004620016d0565b62000aca565b6200015e620003063660046200170d565b62000c39565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e6200035936600462001692565b62000d43565b6200015e6200037036600462001692565b62000de2565b620001ed6200038736600462001692565b62000ec9565b336200039862000838565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001be4565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b0390911690849062001ab1565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000f40565b905090565b336200045362000838565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001be4565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005c257838181518110620004f757634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200054457634e487b7160e01b600052603260045260246000fd5b905060200281019062000558919062001c26565b6040518463ffffffff1660e01b8152600401620005789392919062001acb565b600060405180830381600087803b1580156200059357600080fd5b505af1158015620005a8573d6000803e3d6000fd5b505050508080620005b99062001cea565b915050620004cc565b50505050565b33620005d362000838565b6001600160a01b031614620005fc5760405162461bcd60e51b8152600401620003c19062001be4565b60005b8151811015620006aa578181815181106200062a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b815260040162000660919062001a9d565b600060405180830381600087803b1580156200067b57600080fd5b505af115801562000690573d6000803e3d6000fd5b505050508080620006a19062001cea565b915050620005ff565b5050565b600080620006bb62000931565b905060005b81518110156200072057620006fd828281518110620006ef57634e487b7160e01b600052603260045260246000fd5b60200260200101516200080f565b62000709908462001ca0565b925080620007178162001cea565b915050620006c0565b505090565b336200073062000838565b6001600160a01b031614620007595760405162461bcd60e51b8152600401620003c19062001be4565b60005b8151811015620006aa578181815181106200078757634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe692620007c59291169060040162001a9d565b600060405180830381600087803b158015620007e057600080fd5b505af1158015620007f5573d6000803e3d6000fd5b505050508080620008069062001cea565b9150506200075c565b6001600160a01b0381166000908152600560205260408120620008329062000f40565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200086b836200080f565b90506000816001600160401b038111156200089657634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015620008c0578160200160208202803683370190505b50905060005b828110156200092957620008db858262000f4b565b828281518110620008fc57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280620009208162001cea565b915050620008c6565b509392505050565b606060006200093f62000435565b90506000816001600160401b038111156200096a57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000994578160200160208202803683370190505b50905060005b82811015620009fc57620009ae8162000f76565b828281518110620009cf57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280620009f38162001cea565b9150506200099a565b5092915050565b3362000a0e62000838565b6001600160a01b03161462000a375760405162461bcd60e51b8152600401620003c19062001be4565b600080546040516001600160a01b039091169060008051602062002732833981519152908390a3600080546001600160a01b0319169055565b600062000a838787878787873362000f85565b979650505050505050565b600062000a9b8262000ec9565b6001600160a01b03161592915050565b600062000ac086868660008787600062000f85565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000b0857600080fd5b505afa15801562000b1d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b47919081019062001960565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000b8557600080fd5b505afa15801562000b9a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000bc4919081019062001960565b905062000c306040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001304565b95945050505050565b600054600160a81b900460ff168062000c5c5750600054600160a01b900460ff16155b62000cc15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000cec576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005c2576000805460ff60a81b1916905550505050565b3362000d4e62000838565b6001600160a01b03161462000d775760405162461bcd60e51b8152600401620003c19062001be4565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000db8916001600160a01b0390911690849062001ab1565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000ded62000838565b6001600160a01b03161462000e165760405162461bcd60e51b8152600401620003c19062001be4565b6001600160a01b03811662000e7f5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200273283398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000f0557600080fd5b505afa15801562000f1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620008329190620016b1565b600062000832825490565b6001600160a01b038216600090815260056020526040812062000f6f90836200133b565b9392505050565b6000620008326003836200133b565b600080600062000f968a8a62001349565b6001546040519294509092506001600160a01b031690309062000fb990620015d5565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000ffc573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb9906200104e908690869060040162001ab1565b60006040518083038186803b1580156200106757600080fd5b505afa9250505080156200109f57506040513d6000823e601f3d908101601f191682016040526200109c919081019062001960565b60015b620010aa57620010ad565b90505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee829060640160206040518083038186803b1580156200112757600080fd5b505afa1580156200113c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011629190620016b1565b90506001600160a01b038116620011ba5760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b620011c781898962001418565b6200120c5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200124490859085908e908e908e908e9060040162001b6f565b600060405180830381600087803b1580156200125f57600080fd5b505af115801562001274573d6000803e3d6000fd5b505050506200128e336003620014d590919063ffffffff16565b50336000908152600560205260409020620012aa9086620014d5565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200132195949392919062001a28565b604051602081830303815290604052905095945050505050565b600062000f6f8383620014ec565b600080826001600160a01b0316846001600160a01b031614156200139d5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620013bf578284620013c2565b83835b90925090506001600160a01b038216620014115760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200145557600080fd5b505afa1580156200146a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001490919062001941565b90508260020b8460020b128015620014b45750620014af818562001d08565b60020b155b801562000c305750620014c8818462001d08565b60020b1595945050505050565b600062000f6f836001600160a01b03841662001583565b815460009082106200154c5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b8260000182815481106200157057634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b6000818152600183016020526040812054620015cc5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000832565b50600062000832565b6109a58062001d8d83390190565b600082601f830112620015f4578081fd5b813560206001600160401b0382111562001612576200161262001d4d565b8160051b6200162382820162001c6d565b8381528281019086840183880185018910156200163e578687fd5b8693505b858410156200166d578035620016588162001d63565b83526001939093019291840191840162001642565b50979650505050505050565b803562ffffff811681146200168d57600080fd5b919050565b600060208284031215620016a4578081fd5b813562000f6f8162001d63565b600060208284031215620016c3578081fd5b815162000f6f8162001d63565b60008060408385031215620016e3578081fd5b8235620016f08162001d63565b91506020830135620017028162001d63565b809150509250929050565b60008060006060848603121562001722578081fd5b83356200172f8162001d63565b92506020840135620017418162001d63565b91506040840135620017538162001d63565b809150509250925092565b600080600080600060a0868803121562001776578081fd5b8535620017838162001d63565b94506020860135620017958162001d63565b9350620017a56040870162001679565b92506060860135620017b78162001d7c565b91506080860135620017c98162001d7c565b809150509295509295909350565b60008060008060008060c08789031215620017f0578081fd5b8635620017fd8162001d63565b955060208701356200180f8162001d63565b94506200181f6040880162001679565b9350606087013561ffff8116811462001836578182fd5b92506080870135620018488162001d7c565b915060a08701356200185a8162001d7c565b809150509295509295509295565b6000602082840312156200187a578081fd5b81356001600160401b0381111562001890578182fd5b6200189e84828501620015e3565b949350505050565b600080600060408486031215620018bb578283fd5b83356001600160401b0380821115620018d2578485fd5b620018e087838801620015e3565b94506020860135915080821115620018f6578384fd5b818601915086601f8301126200190a578384fd5b81358181111562001919578485fd5b8760208260051b85010111156200192e578485fd5b6020830194508093505050509250925092565b60006020828403121562001953578081fd5b815162000f6f8162001d7c565b60006020828403121562001972578081fd5b81516001600160401b038082111562001989578283fd5b818401915084601f8301126200199d578283fd5b815181811115620019b257620019b262001d4d565b620019c7601f8201601f191660200162001c6d565b9150808252856020828501011115620019de578384fd5b620019f181602084016020860162001cbb565b50949350505050565b6000815180845262001a1481602086016020860162001cbb565b601f01601f19169290920160200192915050565b6000865162001a3c818460208b0162001cbb565b86519083019062001a52818360208b0162001cbb565b865191019062001a67818360208a0162001cbb565b855191019062001a7c81836020890162001cbb565b845191019062001a9181836020880162001cbb565b01979650505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b6020808252825182820181905260009190848201906040850190845b8181101562001b4e5783516001600160a01b03168352928401929184019160010162001b27565b50909695505050505050565b60208152600062000f6f6020830184620019fa565b60e08152600062001b8460e0830189620019fa565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6000808335601e1984360301811262001c3d578283fd5b8301803591506001600160401b0382111562001c57578283fd5b6020019150368190038213156200141157600080fd5b604051601f8201601f191681016001600160401b038111828210171562001c985762001c9862001d4d565b604052919050565b6000821982111562001cb65762001cb662001d37565b500190565b60005b8381101562001cd857818101518382015260200162001cbe565b83811115620005c25750506000910152565b600060001982141562001d015762001d0162001d37565b5060010190565b60008260020b8062001d2857634e487b7160e01b82526012600452602482fd5b808360020b0791505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811462001d7957600080fd5b50565b8060020b811462001d7957600080fdfe60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a26469706673582212202e6ff5d3661cc2336a91145498f5e5e835222f3bed72d3235d7e02f381e1b62564736f6c63430008040033", - "devdoc": { - "kind": "dev", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "managerFee": "proportion of earned fees that go to pool manager in Basis Points", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "createPool(address,address,uint24,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "getDeployers()": { - "returns": { - "_0": "deployers the list of deployer addresses" - } - }, - "getGelatoPools()": { - "returns": { - "_0": "list of Gelato managed G-UNI pool addresses" - } - }, - "getPools(address)": { - "params": { - "deployer": "address that has potentially deployed G-UNI pools (can return empty array)" - }, - "returns": { - "_0": "pools the list of G-UNI pool addresses deployed by `deployer`" - } - }, - "getProxyAdmin(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "address that controls the G-UNI implementation (has power to upgrade it)" - } - }, - "isPoolImmutable(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "bool signaling if pool is immutable (true) or not (false)" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "numDeployers()": { - "returns": { - "_0": "total number of G-UNI pool deployer addresses" - } - }, - "numPools()": { - "returns": { - "result": "total number of G-UNI pools deployed" - } - }, - "numPools(address)": { - "params": { - "deployer": "deployer address" - }, - "returns": { - "_0": "total number of G-UNI pools deployed by `deployer`" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "notice": "createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`" - }, - "createPool(address,address,uint24,int24,int24)": { - "notice": "createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`" - }, - "getDeployers()": { - "notice": "getDeployers fetches all addresses that have deployed a G-UNI pool" - }, - "getGelatoPools()": { - "notice": "getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)" - }, - "getPools(address)": { - "notice": "getPools fetches all the G-UNI pool addresses deployed by `deployer`" - }, - "getProxyAdmin(address)": { - "notice": "getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address)." - }, - "isPoolImmutable(address)": { - "notice": "isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded" - }, - "numDeployers()": { - "notice": "numDeployers counts the total number of G-UNI pool deployer addresses" - }, - "numPools()": { - "notice": "numPools counts the total number of G-UNI pools in existence" - }, - "numPools(address)": { - "notice": "numPools counts the total number of G-UNI pools deployed by `deployer`" - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6441, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_manager", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 5, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initialized", - "offset": 20, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initializing", - "offset": 21, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 5909, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "poolImplementation", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 5911, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "gelatoDeployer", - "offset": 0, - "slot": "2", - "type": "t_address" - }, - { - "astId": 5914, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_deployers", - "offset": 0, - "slot": "3", - "type": "t_struct(AddressSet)2007_storage" - }, - { - "astId": 5919, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_pools", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_struct(AddressSet)2007_storage)" - } - ], - "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_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(AddressSet)2007_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.AddressSet)", - "numberOfBytes": "32", - "value": "t_struct(AddressSet)2007_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(AddressSet)2007_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.AddressSet", - "members": [ - { - "astId": 2006, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1732_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Set)1732_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 1727, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 1731, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_indexes", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_uint256)" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} diff --git a/lib/g-uni-v1-core/deployments/optimism/GUniFactory_Proxy.json b/lib/g-uni-v1-core/deployments/optimism/GUniFactory_Proxy.json deleted file mode 100644 index 85ac6b302..000000000 --- a/lib/g-uni-v1-core/deployments/optimism/GUniFactory_Proxy.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "address": "0x2845c6929d621e32B7596520C8a1E5a37e616F09", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xa0597f8bff12f9cb06fe9eca72083e7b2d9e5a3ea1921c7878516afb8685a369", - "receipt": { - "to": null, - "from": "0x88215a2794ddC031439C72922EC8983bDE831c78", - "contractAddress": "0x2845c6929d621e32B7596520C8a1E5a37e616F09", - "transactionIndex": 0, - "gasUsed": "566280", - "logsBloom": "0x00100000000020000000000000000000000000000800000004000000000000000000000000000000000400020080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020002000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000004000000000000000200000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000004020000000000000000000000400000000000000000000000080000000000000000000", - "blockHash": "0xcf8a46180e426c8ecff4b8ff16cfe06a67d8b47b1a31923f1841dd03c8c48dcd", - "transactionHash": "0xa0597f8bff12f9cb06fe9eca72083e7b2d9e5a3ea1921c7878516afb8685a369", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 2146721, - "transactionHash": "0xa0597f8bff12f9cb06fe9eca72083e7b2d9e5a3ea1921c7878516afb8685a369", - "address": "0x2845c6929d621e32B7596520C8a1E5a37e616F09", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b9bfd9807ef39821beaeab51acdf32e23e195b5d" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0xcf8a46180e426c8ecff4b8ff16cfe06a67d8b47b1a31923f1841dd03c8c48dcd" - }, - { - "transactionIndex": 0, - "blockNumber": 2146721, - "transactionHash": "0xa0597f8bff12f9cb06fe9eca72083e7b2d9e5a3ea1921c7878516afb8685a369", - "address": "0x2845c6929d621e32B7596520C8a1E5a37e616F09", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000088215a2794ddc031439c72922ec8983bde831c78" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0xcf8a46180e426c8ecff4b8ff16cfe06a67d8b47b1a31923f1841dd03c8c48dcd" - } - ], - "blockNumber": 2146721, - "cumulativeGasUsed": "566280", - "status": 1, - "byzantium": true - }, - "args": [ - "0xb9BFd9807EF39821BEAEAB51aCdF32E23e195b5d", - "0x88215a2794ddC031439C72922EC8983bDE831c78", - "0xc0c53b8b0000000000000000000000008582bf142be76fef830d23f590a2587f2ad7c21600000000000000000000000088215a2794ddc031439c72922ec8983bde831c7800000000000000000000000088215a2794ddc031439c72922ec8983bde831c78" - ], - "solcInputHash": "5b7722421ca04d0a130cd8a2a08f9ec3", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x4ad41656a53bc38d766197d9974be4be70f506b1d1f78def2c3726e8d580a3f5\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x00dbb59cf486ff9a2930fb588ef70d761dbf439aa05d48ef0001a0448769ec11\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} diff --git a/lib/g-uni-v1-core/deployments/optimism/GUniPool.json b/lib/g-uni-v1-core/deployments/optimism/GUniPool.json deleted file mode 100644 index f4d0b9888..000000000 --- a/lib/g-uni-v1-core/deployments/optimism/GUniPool.json +++ /dev/null @@ -1,1639 +0,0 @@ -{ - "address": "0x8582Bf142BE76fEF830D23f590a2587f2aD7C216", - "abi": [ - { - "inputs": [ - { - "internalType": "address payable", - "name": "_gelato", - "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": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned0", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned1", - "type": "uint256" - } - ], - "name": "FeesEarned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int24", - "name": "lowerTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "int24", - "name": "upperTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBefore", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityAfter", - "type": "uint128" - } - ], - "name": "Rebalance", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - } - ], - "name": "SetManagerFee", - "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" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldAdminTreasury", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdminTreasury", - "type": "address" - } - ], - "name": "UpdateAdminTreasury", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoRebalanceBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoWithdrawBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoSlippageBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "gelatoSlippageInterval", - "type": "uint32" - } - ], - "name": "UpdateGelatoParams", - "type": "event" - }, - { - "inputs": [], - "name": "GELATO", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "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": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "burn", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "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": [ - { - "internalType": "int24", - "name": "newLowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "newUpperTick", - "type": "int24" - }, - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - } - ], - "name": "executiveRebalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoRebalanceBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageInterval", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoWithdrawBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Max", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Max", - "type": "uint256" - } - ], - "name": "getMintAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPositionID", - "outputs": [ - { - "internalType": "bytes32", - "name": "positionID", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUnderlyingBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "sqrtRatioX96", - "type": "uint160" - } - ], - "name": "getUnderlyingBalancesAtPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "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": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "address", - "name": "_pool", - "type": "address" - }, - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "_lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "_upperTick", - "type": "int24" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - } - ], - "name": "initializeManagerFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "lowerTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerTreasury", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pool", - "outputs": [ - { - "internalType": "contract IUniswapV3Pool", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "paymentToken", - "type": "address" - } - ], - "name": "rebalance", - "outputs": [], - "stateMutability": "nonpayable", - "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": "token0", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token1", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Owed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Owed", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3MintCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amount0Delta", - "type": "int256" - }, - { - "internalType": "int256", - "name": "amount1Delta", - "type": "int256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3SwapCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "newRebalanceBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newWithdrawBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newSlippageBPS", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "newSlippageInterval", - "type": "uint32" - }, - { - "internalType": "address", - "name": "newTreasury", - "type": "address" - } - ], - "name": "updateGelatoParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "upperTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawGelatoBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawManagerBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x901d53213f80985efbb9c80af84d25a1034d483f14f46db3ef4d620ffcdbce95", - "receipt": { - "to": null, - "from": "0x88215a2794ddC031439C72922EC8983bDE831c78", - "contractAddress": "0x8582Bf142BE76fEF830D23f590a2587f2aD7C216", - "transactionIndex": 0, - "gasUsed": "5359747", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xd6ebe7fbd0682c683fba53abea839165382cb224a6e2cbc5287c3b60450260bc", - "transactionHash": "0x901d53213f80985efbb9c80af84d25a1034d483f14f46db3ef4d620ffcdbce95", - "logs": [], - "blockNumber": 2146524, - "cumulativeGasUsed": "5359747", - "status": 1, - "byzantium": true - }, - "args": ["0x01051113D81D7d6DA508462F2ad6d7fD96cF42Ef"], - "solcInputHash": "5b7722421ca04d0a130cd8a2a08f9ec3", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_gelato\",\"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\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned1\",\"type\":\"uint256\"}],\"name\":\"FeesEarned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"lowerTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"upperTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBefore\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityAfter\",\"type\":\"uint128\"}],\"name\":\"Rebalance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"}],\"name\":\"SetManagerFee\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAdminTreasury\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdminTreasury\",\"type\":\"address\"}],\"name\":\"UpdateAdminTreasury\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoRebalanceBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoWithdrawBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoSlippageBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gelatoSlippageInterval\",\"type\":\"uint32\"}],\"name\":\"UpdateGelatoParams\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GELATO\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"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\":[{\"internalType\":\"int24\",\"name\":\"newLowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"newUpperTick\",\"type\":\"int24\"},{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"}],\"name\":\"executiveRebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoRebalanceBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageInterval\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoWithdrawBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Max\",\"type\":\"uint256\"}],\"name\":\"getMintAmounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPositionID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"positionID\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUnderlyingBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtRatioX96\",\"type\":\"uint160\"}],\"name\":\"getUnderlyingBalancesAtPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"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\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_pool\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"_lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"_upperTick\",\"type\":\"int24\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"}],\"name\":\"initializeManagerFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lowerTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pool\",\"outputs\":[{\"internalType\":\"contract IUniswapV3Pool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"}],\"name\":\"rebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"token0\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newRebalanceBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newWithdrawBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newSlippageBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"newSlippageInterval\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateGelatoParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upperTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawGelatoBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawManagerBalance\",\"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}.\"},\"burn(uint256,address)\":{\"params\":{\"burnAmount\":\"The number of G-UNI tokens to burn\",\"receiver\":\"The account to receive the underlying amounts of token0 and token1\"},\"returns\":{\"amount0\":\"amount of token0 transferred to receiver for burning `burnAmount`\",\"amount1\":\"amount of token1 transferred to receiver for burning `burnAmount`\",\"liquidityBurned\":\"amount of liquidity removed from the underlying Uniswap V3 position\"}},\"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 this function is overridden; 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`.\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"details\":\"When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.\",\"params\":{\"newLowerTick\":\"The new lower bound of the position's range\",\"newUpperTick\":\"The new upper bound of the position's range\",\"swapAmountBPS\":\"amount of token to swap as proportion of total. Pass 0 to ignore swap.\",\"swapThresholdPrice\":\"slippage parameter on the swap as a max or min sqrtPriceX96\",\"zeroForOne\":\"Which token to input into the swap (true = token0, false = token1)\"}},\"getMintAmounts(uint256,uint256)\":{\"params\":{\"amount0Max\":\"The maximum amount of token1 to forward on mint\"},\"returns\":{\"amount0\":\"actual amount of token0 to forward when minting `mintAmount`\",\"amount1\":\"actual amount of token1 to forward when minting `mintAmount`\",\"mintAmount\":\"maximum number of G-UNI tokens to mint\"}},\"getUnderlyingBalances()\":{\"returns\":{\"amount0Current\":\"current total underlying balance of token0\",\"amount1Current\":\"current total underlying balance of token1\"}},\"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.\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"params\":{\"_lowerTick\":\"initial upperTick (only changeable with executiveRebalance)\",\"_managerFeeBPS\":\"proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\",\"_manager_\":\"address of manager (ownership can be transferred)\",\"_name\":\"name of G-UNI token\",\"_pool\":\"address of Uniswap V3 pool\",\"_symbol\":\"symbol of G-UNI token\"}},\"initializeManagerFee(uint16)\":{\"params\":{\"_managerFeeBPS\":\"proportion of fees earned that are credited to manager in Basis Points\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"mint(uint256,address)\":{\"details\":\"to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\",\"params\":{\"mintAmount\":\"The number of G-UNI tokens to mint\",\"receiver\":\"The account to receive the minted tokens\"},\"returns\":{\"amount0\":\"amount of token0 transferred from msg.sender to mint `mintAmount`\",\"amount1\":\"amount of token1 transferred from msg.sender to mint `mintAmount`\",\"liquidityMinted\":\"amount of liquidity added to the underlying Uniswap V3 position\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"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 manager.\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"params\":{\"newRebalanceBPS\":\"controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\",\"newSlippageBPS\":\"maximum slippage on swaps during gelato rebalance\",\"newSlippageInterval\":\"length of time for TWAP used in computing slippage on swaps\",\"newTreasury\":\"address where managerFee withdrawals are sent\",\"newWithdrawBPS\":\"controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(uint256,address)\":{\"notice\":\"burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"notice\":\"Change the range of underlying UniswapV3 position, only manager can call\"},\"getMintAmounts(uint256,uint256)\":{\"notice\":\"compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\"},\"getUnderlyingBalances()\":{\"notice\":\"compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"notice\":\"initialize storage variables on a new G-UNI pool, only called once\"},\"initializeManagerFee(uint16)\":{\"notice\":\"initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\"},\"mint(uint256,address)\":{\"notice\":\"mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\"},\"rebalance(uint160,uint256,bool,uint256,address)\":{\"notice\":\"Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\"},\"uniswapV3MintCallback(uint256,uint256,bytes)\":{\"notice\":\"Uniswap V3 callback fn, called back on pool.mint\"},\"uniswapV3SwapCallback(int256,int256,bytes)\":{\"notice\":\"Uniswap v3 callback fn, called back on pool.swap\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"notice\":\"change configurable parameters, only manager can call\"},\"withdrawGelatoBalance(uint256,address)\":{\"notice\":\"withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"},\"withdrawManagerBalance(uint256,address)\":{\"notice\":\"withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniPool.sol\":\"GUniPool\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal initializer {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal initializer {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and make it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x89fa60d14355f7ae06af11e28fce2bb90c5c6186645d681a30e1b36234a4c210\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\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\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The defaut value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\\n __Context_init_unchained();\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override 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 override 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 this function is\\n * overridden;\\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 override returns (uint8) {\\n return 18;\\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\\n uint256 currentAllowance = _allowances[sender][_msgSender()];\\n require(currentAllowance >= amount, \\\"ERC20: transfer amount exceeds allowance\\\");\\n _approve(sender, _msgSender(), currentAllowance - amount);\\n\\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\\n\\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 uint256 senderBalance = _balances[sender];\\n require(senderBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n _balances[sender] = senderBalance - amount;\\n _balances[recipient] += amount;\\n\\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 += amount;\\n _balances[account] += 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 uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n _balances[account] = accountBalance - amount;\\n _totalSupply -= amount;\\n\\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 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 uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0x9c2d7425f3343ea340d6ea67e9d90109d4d846bb013c2572096ec88c9e74946b\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\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\":\"0x8d4a0f2b5b760b5e2c19ed3c108d83897a4dfd5bfed97a93867918df19191e5e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x6795c369a4eefa78468e38966f7851fbc2dda5e5b9ccd3fa2b45970e2e4d3abd\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../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 initializer {\\n __Context_init_unchained();\\n }\\n\\n function __Context_init_unchained() internal initializer {\\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x8e9eb503de1189f50c5f16fef327da310b11898d6b9ab3ca937df07c35233b9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.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 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) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\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\":\"0x99f5c21018d796db7833a2100bb0e7411999e248a3c950fb526eee5d2bf47cb7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0x069b2631bb5b5193a58ccf7a06266c7361bd2c20095667af4402817605627f45\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCast {\\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 require(value < 2**128, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return uint128(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 require(value < 2**64, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return uint64(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 require(value < 2**32, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return uint32(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 require(value < 2**16, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\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 require(value < 2**8, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\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 require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n return uint256(value);\\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 * _Available since v3.1._\\n */\\n function toInt128(int256 value) internal pure returns (int128) {\\n require(value >= -2**127 && value < 2**127, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return int128(value);\\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 * _Available since v3.1._\\n */\\n function toInt64(int256 value) internal pure returns (int64) {\\n require(value >= -2**63 && value < 2**63, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return int64(value);\\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 * _Available since v3.1._\\n */\\n function toInt32(int256 value) internal pure returns (int32) {\\n require(value >= -2**31 && value < 2**31, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return int32(value);\\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 * _Available since v3.1._\\n */\\n function toInt16(int256 value) internal pure returns (int16) {\\n require(value >= -2**15 && value < 2**15, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\n return int16(value);\\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 * _Available since v3.1._\\n */\\n function toInt8(int256 value) internal pure returns (int8) {\\n require(value >= -2**7 && value < 2**7, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\n return int8(value);\\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 require(value < 2**255, \\\"SafeCast: value doesn't fit in an int256\\\");\\n return int256(value);\\n }\\n}\\n\",\"keccak256\":\"0xc37d85b96c2a8d7bc09f25958e0a81394bf5780286444147ddf875fa628d53ce\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\nimport './pool/IUniswapV3PoolImmutables.sol';\\nimport './pool/IUniswapV3PoolState.sol';\\nimport './pool/IUniswapV3PoolDerivedState.sol';\\nimport './pool/IUniswapV3PoolActions.sol';\\nimport './pool/IUniswapV3PoolOwnerActions.sol';\\nimport './pool/IUniswapV3PoolEvents.sol';\\n\\n/// @title The interface for a Uniswap V3 Pool\\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\\n/// to the ERC20 specification\\n/// @dev The pool interface is broken up into many smaller pieces\\ninterface IUniswapV3Pool is\\n IUniswapV3PoolImmutables,\\n IUniswapV3PoolState,\\n IUniswapV3PoolDerivedState,\\n IUniswapV3PoolActions,\\n IUniswapV3PoolOwnerActions,\\n IUniswapV3PoolEvents\\n{\\n\\n}\\n\",\"keccak256\":\"0xfe6113d518466cd6652c85b111e01f33eb62157f49ae5ed7d5a3947a2044adb1\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#mint\\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\\ninterface IUniswapV3MintCallback {\\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x27a9725b8f831a92d16380860c3d348a0b926a7f01b34a54ea6eea78cbdbcd6a\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#swap\\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\\ninterface IUniswapV3SwapCallback {\\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x3f485fb1a44e8fbeadefb5da07d66edab3cfe809f0ac4074b1e54e3eb3c4cf69\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissionless pool actions\\n/// @notice Contains pool methods that can be called by anyone\\ninterface IUniswapV3PoolActions {\\n /// @notice Sets the initial price for the pool\\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\\n function initialize(uint160 sqrtPriceX96) external;\\n\\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\\n /// @param recipient The address for which the liquidity will be created\\n /// @param tickLower The lower tick of the position in which to add liquidity\\n /// @param tickUpper The upper tick of the position in which to add liquidity\\n /// @param amount The amount of liquidity to mint\\n /// @param data Any data that should be passed through to the callback\\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n function mint(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount,\\n bytes calldata data\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Collects tokens owed to a position\\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\\n /// @param recipient The address which should receive the fees collected\\n /// @param tickLower The lower tick of the position for which to collect fees\\n /// @param tickUpper The upper tick of the position for which to collect fees\\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\\n /// @return amount0 The amount of fees collected in token0\\n /// @return amount1 The amount of fees collected in token1\\n function collect(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n\\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\\n /// @dev Fees must be collected separately via a call to #collect\\n /// @param tickLower The lower tick of the position for which to burn liquidity\\n /// @param tickUpper The upper tick of the position for which to burn liquidity\\n /// @param amount How much liquidity to burn\\n /// @return amount0 The amount of token0 sent to the recipient\\n /// @return amount1 The amount of token1 sent to the recipient\\n function burn(\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Swap token0 for token1, or token1 for token0\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\\n /// @param recipient The address to receive the output of the swap\\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\\n /// @param data Any data to be passed through to the callback\\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\\n function swap(\\n address recipient,\\n bool zeroForOne,\\n int256 amountSpecified,\\n uint160 sqrtPriceLimitX96,\\n bytes calldata data\\n ) external returns (int256 amount0, int256 amount1);\\n\\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\\n /// @param recipient The address which will receive the token0 and token1 amounts\\n /// @param amount0 The amount of token0 to send\\n /// @param amount1 The amount of token1 to send\\n /// @param data Any data to be passed through to the callback\\n function flash(\\n address recipient,\\n uint256 amount0,\\n uint256 amount1,\\n bytes calldata data\\n ) external;\\n\\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\\n /// the input observationCardinalityNext.\\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0x9453dd0e7442188667d01d9b65de3f1e14e9511ff3e303179a15f6fc267f7634\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that is not stored\\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\\n/// blockchain. The functions here may have variable gas costs.\\ninterface IUniswapV3PoolDerivedState {\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\\n /// you must call it with secondsAgos = [3600, 0].\\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\\n /// timestamp\\n function observe(uint32[] calldata secondsAgos)\\n external\\n view\\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\\n\\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\\n /// snapshot is taken and the second snapshot is taken.\\n /// @param tickLower The lower tick of the range\\n /// @param tickUpper The upper tick of the range\\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\\n /// @return secondsInside The snapshot of seconds per liquidity for the range\\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\\n external\\n view\\n returns (\\n int56 tickCumulativeInside,\\n uint160 secondsPerLiquidityInsideX128,\\n uint32 secondsInside\\n );\\n}\\n\",\"keccak256\":\"0xe603ac5b17ecdee73ba2b27efdf386c257a19c14206e87eee77e2017b742d9e5\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Events emitted by a pool\\n/// @notice Contains all events emitted by the pool\\ninterface IUniswapV3PoolEvents {\\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\\n event Initialize(uint160 sqrtPriceX96, int24 tick);\\n\\n /// @notice Emitted when liquidity is minted for a given position\\n /// @param sender The address that minted the liquidity\\n /// @param owner The owner of the position and recipient of any minted liquidity\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity minted to the position range\\n /// @param amount0 How much token0 was required for the minted liquidity\\n /// @param amount1 How much token1 was required for the minted liquidity\\n event Mint(\\n address sender,\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted when fees are collected by the owner of a position\\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\\n /// @param owner The owner of the position for which fees are collected\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount0 The amount of token0 fees collected\\n /// @param amount1 The amount of token1 fees collected\\n event Collect(\\n address indexed owner,\\n address recipient,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount0,\\n uint128 amount1\\n );\\n\\n /// @notice Emitted when a position's liquidity is removed\\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\\n /// @param owner The owner of the position for which liquidity is removed\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity to remove\\n /// @param amount0 The amount of token0 withdrawn\\n /// @param amount1 The amount of token1 withdrawn\\n event Burn(\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted by the pool for any swaps between token0 and token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the output of the swap\\n /// @param amount0 The delta of the token0 balance of the pool\\n /// @param amount1 The delta of the token1 balance of the pool\\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param liquidity The liquidity of the pool after the swap\\n /// @param tick The log base 1.0001 of price of the pool after the swap\\n event Swap(\\n address indexed sender,\\n address indexed recipient,\\n int256 amount0,\\n int256 amount1,\\n uint160 sqrtPriceX96,\\n uint128 liquidity,\\n int24 tick\\n );\\n\\n /// @notice Emitted by the pool for any flashes of token0/token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the tokens from flash\\n /// @param amount0 The amount of token0 that was flashed\\n /// @param amount1 The amount of token1 that was flashed\\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\\n event Flash(\\n address indexed sender,\\n address indexed recipient,\\n uint256 amount0,\\n uint256 amount1,\\n uint256 paid0,\\n uint256 paid1\\n );\\n\\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\\n /// just before a mint/swap/burn.\\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(\\n uint16 observationCardinalityNextOld,\\n uint16 observationCardinalityNextNew\\n );\\n\\n /// @notice Emitted when the protocol fee is changed by the pool\\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\\n /// @param feeProtocol0New The updated value of the token0 protocol fee\\n /// @param feeProtocol1New The updated value of the token1 protocol fee\\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\\n\\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\\n /// @param sender The address that collects the protocol fees\\n /// @param recipient The address that receives the collected protocol fees\\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x8071514d0fe5d17d6fbd31c191cdfb703031c24e0ece3621d88ab10e871375cd\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that never changes\\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\\ninterface IUniswapV3PoolImmutables {\\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\\n /// @return The contract address\\n function factory() external view returns (address);\\n\\n /// @notice The first of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token0() external view returns (address);\\n\\n /// @notice The second of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token1() external view returns (address);\\n\\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\\n /// @return The fee\\n function fee() external view returns (uint24);\\n\\n /// @notice The pool tick spacing\\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\\n /// This value is an int24 to avoid casting even though it is always positive.\\n /// @return The tick spacing\\n function tickSpacing() external view returns (int24);\\n\\n /// @notice The maximum amount of position liquidity that can use any tick in the range\\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\\n /// @return The max amount of liquidity per tick\\n function maxLiquidityPerTick() external view returns (uint128);\\n}\\n\",\"keccak256\":\"0xf6e5d2cd1139c4c276bdbc8e1d2b256e456c866a91f1b868da265c6d2685c3f7\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissioned pool actions\\n/// @notice Contains pool methods that may only be called by the factory owner\\ninterface IUniswapV3PoolOwnerActions {\\n /// @notice Set the denominator of the protocol's % share of the fees\\n /// @param feeProtocol0 new protocol fee for token0 of the pool\\n /// @param feeProtocol1 new protocol fee for token1 of the pool\\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\\n\\n /// @notice Collect the protocol fee accrued to the pool\\n /// @param recipient The address to which collected protocol fees should be sent\\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\\n /// @return amount0 The protocol fee collected in token0\\n /// @return amount1 The protocol fee collected in token1\\n function collectProtocol(\\n address recipient,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x759b78a2918af9e99e246dc3af084f654e48ef32bb4e4cb8a966aa3dcaece235\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that can change\\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\\n/// per transaction\\ninterface IUniswapV3PoolState {\\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\\n /// when accessed externally.\\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\\n /// boundary.\\n /// observationIndex The index of the last oracle observation that was written,\\n /// observationCardinality The current maximum number of observations stored in the pool,\\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// feeProtocol The protocol fee for both tokens of the pool.\\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\\n /// unlocked Whether the pool is currently locked to reentrancy\\n function slot0()\\n external\\n view\\n returns (\\n uint160 sqrtPriceX96,\\n int24 tick,\\n uint16 observationIndex,\\n uint16 observationCardinality,\\n uint16 observationCardinalityNext,\\n uint8 feeProtocol,\\n bool unlocked\\n );\\n\\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal0X128() external view returns (uint256);\\n\\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal1X128() external view returns (uint256);\\n\\n /// @notice The amounts of token0 and token1 that are owed to the protocol\\n /// @dev Protocol fees will never exceed uint128 max in either token\\n function protocolFees() external view returns (uint128 token0, uint128 token1);\\n\\n /// @notice The currently in range liquidity available to the pool\\n /// @dev This value has no relationship to the total liquidity across all ticks\\n function liquidity() external view returns (uint128);\\n\\n /// @notice Look up information about a specific tick in the pool\\n /// @param tick The tick to look up\\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\\n /// tick upper,\\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\\n /// a specific position.\\n function ticks(int24 tick)\\n external\\n view\\n returns (\\n uint128 liquidityGross,\\n int128 liquidityNet,\\n uint256 feeGrowthOutside0X128,\\n uint256 feeGrowthOutside1X128,\\n int56 tickCumulativeOutside,\\n uint160 secondsPerLiquidityOutsideX128,\\n uint32 secondsOutside,\\n bool initialized\\n );\\n\\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\\n function tickBitmap(int16 wordPosition) external view returns (uint256);\\n\\n /// @notice Returns the information about a position by the position's key\\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\\n /// @return _liquidity The amount of liquidity in the position,\\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\\n function positions(bytes32 key)\\n external\\n view\\n returns (\\n uint128 _liquidity,\\n uint256 feeGrowthInside0LastX128,\\n uint256 feeGrowthInside1LastX128,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param index The element of the observations array to fetch\\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\\n /// ago, rather than at a specific index in the array.\\n /// @return blockTimestamp The timestamp of the observation,\\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// Returns initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 index)\\n external\\n view\\n returns (\\n uint32 blockTimestamp,\\n int56 tickCumulative,\\n uint160 secondsPerLiquidityCumulativeX128,\\n bool initialized\\n );\\n}\\n\",\"keccak256\":\"0x852dc1f5df7dcf7f11e7bb3eed79f0cea72ad4b25f6a9d2c35aafb48925fd49f\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.4.0;\\n\\n/// @title FixedPoint96\\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\\n/// @dev Used in SqrtPriceMath.sol\\nlibrary FixedPoint96 {\\n uint8 internal constant RESOLUTION = 96;\\n uint256 internal constant Q96 = 0x1000000000000000000000000;\\n}\\n\",\"keccak256\":\"0x0ba8a9b95a956a4050749c0158e928398c447c91469682ca8a7cc7e77a7fe032\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {\\n IUniswapV3MintCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\\\";\\nimport {\\n IUniswapV3SwapCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\\\";\\nimport {GUniPoolStorage} from \\\"./abstract/GUniPoolStorage.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {TickMath} from \\\"./vendor/uniswap/TickMath.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {SafeCast} from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport {\\n FullMath,\\n LiquidityAmounts\\n} from \\\"./vendor/uniswap/LiquidityAmounts.sol\\\";\\n\\ncontract GUniPool is\\n IUniswapV3MintCallback,\\n IUniswapV3SwapCallback,\\n GUniPoolStorage\\n{\\n using SafeERC20 for IERC20;\\n using TickMath for int24;\\n\\n event Minted(\\n address receiver,\\n uint256 mintAmount,\\n uint256 amount0In,\\n uint256 amount1In,\\n uint128 liquidityMinted\\n );\\n\\n event Burned(\\n address receiver,\\n uint256 burnAmount,\\n uint256 amount0Out,\\n uint256 amount1Out,\\n uint128 liquidityBurned\\n );\\n\\n event Rebalance(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidityBefore,\\n uint128 liquidityAfter\\n );\\n\\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice Uniswap V3 callback fn, called back on pool.mint\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata /*_data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\\n }\\n\\n /// @notice Uniswap v3 callback fn, called back on pool.swap\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata /*data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Delta > 0)\\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\\n else if (amount1Delta > 0)\\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\\n }\\n\\n // User functions => Should be called via a Router\\n\\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\\n /// @param mintAmount The number of G-UNI tokens to mint\\n /// @param receiver The account to receive the minted tokens\\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function mint(uint256 mintAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityMinted\\n )\\n {\\n require(mintAmount > 0, \\\"mint 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n\\n if (totalSupply > 0) {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n amount0 = FullMath.mulDivRoundingUp(\\n amount0Current,\\n mintAmount,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n amount1Current,\\n mintAmount,\\n totalSupply\\n );\\n } else {\\n // if supply is 0 mintAmount == liquidity to deposit\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n SafeCast.toUint128(mintAmount)\\n );\\n }\\n\\n // transfer amounts owed to contract\\n if (amount0 > 0) {\\n token0.safeTransferFrom(msg.sender, address(this), amount0);\\n }\\n if (amount1 > 0) {\\n token1.safeTransferFrom(msg.sender, address(this), amount1);\\n }\\n\\n // deposit as much new liquidity as possible\\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n\\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \\\"\\\");\\n\\n _mint(receiver, mintAmount);\\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\\n }\\n\\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\\n /// @param burnAmount The number of G-UNI tokens to burn\\n /// @param receiver The account to receive the underlying amounts of token0 and token1\\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines\\n function burn(uint256 burnAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityBurned\\n )\\n {\\n require(burnAmount > 0, \\\"burn 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n\\n _burn(msg.sender, burnAmount);\\n\\n uint256 liquidityBurned_ =\\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidityBurned);\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n\\n amount0 =\\n burn0 +\\n FullMath.mulDiv(\\n token0.balanceOf(address(this)) -\\n burn0 -\\n managerBalance0 -\\n gelatoBalance0,\\n burnAmount,\\n totalSupply\\n );\\n amount1 =\\n burn1 +\\n FullMath.mulDiv(\\n token1.balanceOf(address(this)) -\\n burn1 -\\n managerBalance1 -\\n gelatoBalance1,\\n burnAmount,\\n totalSupply\\n );\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(receiver, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(receiver, amount1);\\n }\\n\\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\\n }\\n\\n // Manager Functions => Called by Pool Manager\\n\\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\\n /// any leftover will be unused and sit idle until the next rebalance.\\n /// @param newLowerTick The new lower bound of the position's range\\n /// @param newUpperTick The new upper bound of the position's range\\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\\n // solhint-disable-next-line function-max-lines\\n function executiveRebalance(\\n int24 newLowerTick,\\n int24 newUpperTick,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) external onlyManager {\\n uint128 liquidity;\\n uint128 newLiquidity;\\n if (totalSupply() > 0) {\\n (liquidity, , , , ) = pool.positions(_getPositionID());\\n if (liquidity > 0) {\\n (, , uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n }\\n\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n\\n uint256 reinvest0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n uint256 reinvest1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n\\n _deposit(\\n newLowerTick,\\n newUpperTick,\\n reinvest0,\\n reinvest1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n\\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > 0, \\\"new position 0\\\");\\n } else {\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n }\\n\\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\\n }\\n\\n // Gelatofied functions => Automatically called by Gelato\\n\\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\\n function rebalance(\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) external gelatofy(feeAmount, paymentToken) {\\n if (swapAmountBPS > 0) {\\n _checkSlippage(swapThresholdPrice, zeroForOne);\\n }\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n _rebalance(\\n liquidity,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne,\\n feeAmount,\\n paymentToken\\n );\\n\\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > liquidity, \\\"liquidity must increase\\\");\\n\\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\\n }\\n\\n /// @notice withdraw manager fees accrued, only gelato executors can call.\\n /// Target account to receive fees is managerTreasury, alterable by manager.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n managerBalance0,\\n managerBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(managerTreasury, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(managerTreasury, amount1);\\n }\\n }\\n\\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n gelatoBalance0,\\n gelatoBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n gelatoBalance0 = 0;\\n gelatoBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(GELATO, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(GELATO, amount1);\\n }\\n }\\n\\n function _balancesToWithdraw(\\n uint256 balance0,\\n uint256 balance1,\\n uint256 feeAmount,\\n address feeToken\\n ) internal view returns (uint256 amount0, uint256 amount1) {\\n if (feeToken == address(token0)) {\\n require(\\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount0 = balance0 - feeAmount;\\n amount1 = balance1;\\n } else if (feeToken == address(token1)) {\\n require(\\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount1 = balance1 - feeAmount;\\n amount0 = balance0;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n }\\n\\n // View functions\\n\\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\\n /// @param amount0Max The maximum amount of token0 to forward on mint\\n /// @param amount0Max The maximum amount of token1 to forward on mint\\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\\n /// @return mintAmount maximum number of G-UNI tokens to mint\\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\\n external\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n uint256 totalSupply = totalSupply();\\n if (totalSupply > 0) {\\n (amount0, amount1, mintAmount) = _computeMintAmounts(\\n totalSupply,\\n amount0Max,\\n amount1Max\\n );\\n } else {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 newLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0Max,\\n amount1Max\\n );\\n mintAmount = uint256(newLiquidity);\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n newLiquidity\\n );\\n }\\n }\\n\\n /// @notice compute total underlying holdings of the G-UNI token supply\\n /// includes current liquidity invested in uniswap position, current fees earned\\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\\n /// @return amount0Current current total underlying balance of token0\\n /// @return amount1Current current total underlying balance of token1\\n function getUnderlyingBalances()\\n public\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\\n external\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\\n internal\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (\\n uint128 liquidity,\\n uint256 feeGrowthInside0Last,\\n uint256 feeGrowthInside1Last,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n ) = pool.positions(_getPositionID());\\n\\n // compute current holdings from liquidity\\n (amount0Current, amount1Current) = LiquidityAmounts\\n .getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n liquidity\\n );\\n\\n // compute current fees earned\\n uint256 fee0 =\\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\\n uint256(tokensOwed0);\\n uint256 fee1 =\\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\\n uint256(tokensOwed1);\\n\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n\\n // add any leftover in contract to current holdings\\n amount0Current +=\\n fee0 +\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n amount1Current +=\\n fee1 +\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n }\\n\\n // Private functions\\n\\n // solhint-disable-next-line function-max-lines\\n function _rebalance(\\n uint128 liquidity,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) private {\\n uint256 leftover0 =\\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\\n uint256 leftover1 =\\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\\n\\n (, , uint256 feesEarned0, uint256 feesEarned1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n _applyFees(feesEarned0, feesEarned1);\\n (feesEarned0, feesEarned1) = _subtractAdminFees(\\n feesEarned0,\\n feesEarned1\\n );\\n emit FeesEarned(feesEarned0, feesEarned1);\\n feesEarned0 += leftover0;\\n feesEarned1 += leftover1;\\n\\n if (paymentToken == address(token0)) {\\n require(\\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0 -\\n feeAmount;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n } else if (paymentToken == address(token1)) {\\n require(\\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1 -\\n feeAmount;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n\\n _deposit(\\n lowerTick,\\n upperTick,\\n leftover0,\\n leftover1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _withdraw(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidity\\n )\\n private\\n returns (\\n uint256 burn0,\\n uint256 burn1,\\n uint256 fee0,\\n uint256 fee1\\n )\\n {\\n uint256 preBalance0 = token0.balanceOf(address(this));\\n uint256 preBalance1 = token1.balanceOf(address(this));\\n\\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\\n\\n pool.collect(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n type(uint128).max,\\n type(uint128).max\\n );\\n\\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _deposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) private {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n // First, deposit as much as we can\\n uint128 baseLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n if (baseLiquidity > 0) {\\n (uint256 amountDeposited0, uint256 amountDeposited1) =\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n baseLiquidity,\\n \\\"\\\"\\n );\\n\\n amount0 -= amountDeposited0;\\n amount1 -= amountDeposited1;\\n }\\n int256 swapAmount =\\n SafeCast.toInt256(\\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\\n );\\n if (swapAmount > 0) {\\n _swapAndDeposit(\\n lowerTick_,\\n upperTick_,\\n amount0,\\n amount1,\\n swapAmount,\\n swapThresholdPrice,\\n zeroForOne\\n );\\n }\\n }\\n\\n function _swapAndDeposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n int256 swapAmount,\\n uint160 swapThresholdPrice,\\n bool zeroForOne\\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\\n (int256 amount0Delta, int256 amount1Delta) =\\n pool.swap(\\n address(this),\\n zeroForOne,\\n swapAmount,\\n swapThresholdPrice,\\n \\\"\\\"\\n );\\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\\n\\n // Add liquidity a second time\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 liquidityAfterSwap =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n finalAmount0,\\n finalAmount1\\n );\\n if (liquidityAfterSwap > 0) {\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n liquidityAfterSwap,\\n \\\"\\\"\\n );\\n }\\n }\\n\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function _computeMintAmounts(\\n uint256 totalSupply,\\n uint256 amount0Max,\\n uint256 amount1Max\\n )\\n private\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n // compute proportional amount of tokens to mint\\n if (amount0Current == 0 && amount1Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount1Max,\\n totalSupply,\\n amount1Current\\n );\\n } else if (amount1Current == 0 && amount0Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount0Max,\\n totalSupply,\\n amount0Current\\n );\\n } else if (amount0Current == 0 && amount1Current == 0) {\\n revert(\\\"\\\");\\n } else {\\n // only if both are non-zero\\n uint256 amount0Mint =\\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\\n uint256 amount1Mint =\\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\\n require(amount0Mint > 0 && amount1Mint > 0, \\\"mint 0\\\");\\n\\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\\n }\\n\\n // compute amounts owed to contract\\n amount0 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount0Current,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount1Current,\\n totalSupply\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _computeFeesEarned(\\n bool isZero,\\n uint256 feeGrowthInsideLast,\\n int24 tick,\\n uint128 liquidity\\n ) private view returns (uint256 fee) {\\n uint256 feeGrowthOutsideLower;\\n uint256 feeGrowthOutsideUpper;\\n uint256 feeGrowthGlobal;\\n if (isZero) {\\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\\n } else {\\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\\n }\\n\\n unchecked {\\n // calculate fee growth below\\n uint256 feeGrowthBelow;\\n if (tick >= lowerTick) {\\n feeGrowthBelow = feeGrowthOutsideLower;\\n } else {\\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\\n }\\n\\n // calculate fee growth above\\n uint256 feeGrowthAbove;\\n if (tick < upperTick) {\\n feeGrowthAbove = feeGrowthOutsideUpper;\\n } else {\\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\\n }\\n\\n uint256 feeGrowthInside =\\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\\n fee = FullMath.mulDiv(\\n liquidity,\\n feeGrowthInside - feeGrowthInsideLast,\\n 0x100000000000000000000000000000000\\n );\\n }\\n }\\n\\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\\n }\\n\\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\\n private\\n view\\n returns (uint256 fee0, uint256 fee1)\\n {\\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n fee0 = rawFee0 - deduct0;\\n fee1 = rawFee1 - deduct1;\\n }\\n\\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\\n private\\n view\\n {\\n uint32[] memory secondsAgo = new uint32[](2);\\n secondsAgo[0] = gelatoSlippageInterval;\\n secondsAgo[1] = 0;\\n\\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\\n\\n require(tickCumulatives.length == 2, \\\"array len\\\");\\n uint160 avgSqrtRatioX96;\\n unchecked {\\n int24 avgTick =\\n int24(\\n (tickCumulatives[1] - tickCumulatives[0]) /\\n int56(uint56(gelatoSlippageInterval))\\n );\\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\\n }\\n\\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\\n if (zeroForOne) {\\n require(\\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\\n \\\"high slippage\\\"\\n );\\n } else {\\n require(\\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\\n \\\"high slippage\\\"\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x57283d620777e122c97c6ca2c10a442c125cc72b07fd8b5c192104aa3279d1e3\",\"license\":\"GPL-3.0\"},\"contracts/abstract/GUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {Gelatofied} from \\\"./Gelatofied.sol\\\";\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {\\n ReentrancyGuardUpgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport {\\n ERC20Upgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\n\\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\\n/// @dev ERC20Upgradable Includes Initialize\\n// solhint-disable-next-line max-states-count\\nabstract contract GUniPoolStorage is\\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\\n ReentrancyGuardUpgradeable,\\n OwnableUninitialized,\\n Gelatofied\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n // solhint-disable-next-line const-name-snakecase\\n uint16 public constant gelatoFeeBPS = 250;\\n\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n int24 public lowerTick;\\n int24 public upperTick;\\n\\n uint16 public gelatoRebalanceBPS;\\n uint16 public gelatoWithdrawBPS;\\n uint16 public gelatoSlippageBPS;\\n uint32 public gelatoSlippageInterval;\\n\\n uint16 public managerFeeBPS;\\n address public managerTreasury;\\n\\n uint256 public managerBalance0;\\n uint256 public managerBalance1;\\n uint256 public gelatoBalance0;\\n uint256 public gelatoBalance1;\\n\\n IUniswapV3Pool public pool;\\n IERC20 public token0;\\n IERC20 public token1;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdateAdminTreasury(\\n address oldAdminTreasury,\\n address newAdminTreasury\\n );\\n\\n event UpdateGelatoParams(\\n uint16 gelatoRebalanceBPS,\\n uint16 gelatoWithdrawBPS,\\n uint16 gelatoSlippageBPS,\\n uint32 gelatoSlippageInterval\\n );\\n\\n event SetManagerFee(uint16 managerFee);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice initialize storage variables on a new G-UNI pool, only called once\\n /// @param _name name of G-UNI token\\n /// @param _symbol symbol of G-UNI token\\n /// @param _pool address of Uniswap V3 pool\\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\\n /// @param _manager_ address of manager (ownership can be transferred)\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external initializer {\\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \\\"mBPS\\\");\\n\\n // these variables are immutable after initialization\\n pool = IUniswapV3Pool(_pool);\\n token0 = IERC20(pool.token0());\\n token1 = IERC20(pool.token1());\\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\\n\\n // these variables can be udpated by the manager\\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\\n gelatoSlippageBPS = 500; // default: 5% slippage\\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\\n managerTreasury = _manager_; // default: treasury is admin\\n lowerTick = _lowerTick;\\n upperTick = _upperTick;\\n _manager = _manager_;\\n\\n // e.g. \\\"Gelato Uniswap V3 USDC/DAI LP\\\" and \\\"G-UNI\\\"\\n __ERC20_init(_name, _symbol);\\n __ReentrancyGuard_init();\\n }\\n\\n /// @notice change configurable parameters, only manager can call\\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\\n /// @param newTreasury address where managerFee withdrawals are sent\\n // solhint-disable-next-line code-complexity\\n function updateGelatoParams(\\n uint16 newRebalanceBPS,\\n uint16 newWithdrawBPS,\\n uint16 newSlippageBPS,\\n uint32 newSlippageInterval,\\n address newTreasury\\n ) external onlyManager {\\n require(newWithdrawBPS <= 10000, \\\"BPS\\\");\\n require(newRebalanceBPS <= 10000, \\\"BPS\\\");\\n require(newSlippageBPS <= 10000, \\\"BPS\\\");\\n emit UpdateGelatoParams(\\n newRebalanceBPS,\\n newWithdrawBPS,\\n newSlippageBPS,\\n newSlippageInterval\\n );\\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\\n if (newSlippageInterval != 0)\\n gelatoSlippageInterval = newSlippageInterval;\\n if (newTreasury != address(0)) managerTreasury = newTreasury;\\n }\\n\\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\\n /// If a manager fee was not set in the initialize function it can be set here\\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\\n require(managerFeeBPS == 0, \\\"fee\\\");\\n require(\\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\\n \\\"mBPS\\\"\\n );\\n emit SetManagerFee(_managerFeeBPS);\\n managerFeeBPS = _managerFeeBPS;\\n }\\n\\n function renounceOwnership() public virtual override onlyManager {\\n managerTreasury = address(0);\\n managerFeeBPS = 0;\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n super.renounceOwnership();\\n }\\n\\n function getPositionID() external view returns (bytes32 positionID) {\\n return _getPositionID();\\n }\\n\\n function _getPositionID() internal view returns (bytes32 positionID) {\\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\\n }\\n}\\n\",\"keccak256\":\"0xd641844e84406e827578ae316c8690b05db17ac84ee5a6b235228b3605ea46de\",\"license\":\"GPL-3.0\"},\"contracts/abstract/Gelatofied.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract Gelatofied {\\n using Address for address payable;\\n using SafeERC20 for IERC20;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n address payable public immutable GELATO;\\n\\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n constructor(address payable _gelato) {\\n GELATO = _gelato;\\n }\\n\\n modifier gelatofy(uint256 _amount, address _paymentToken) {\\n require(msg.sender == GELATO, \\\"Gelatofied: Only gelato\\\");\\n _;\\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x31ddffff0545c4342d3cea88f4d2af520057f467f5e550e4e7166d24cc911cf1\",\"license\":\"GPL-3.0\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.4;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x81d888640e2261ac5189e6061a0cf4a7f3cec5994be1859ba60ffeb961f70c01\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/FullMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.4;\\n\\n/// @title Contains 512-bit math functions\\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\\n/// @dev Handles \\\"phantom overflow\\\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\\nlibrary FullMath {\\n /// @notice Calculates floor(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\\n function mulDiv(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = a * b\\n // Compute the product mod 2**256 and mod 2**256 - 1\\n // then use the Chinese Remainder Theorem to reconstruct\\n // the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2**256 + prod0\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(a, b, not(0))\\n prod0 := mul(a, b)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division\\n if (prod1 == 0) {\\n require(denominator > 0);\\n assembly {\\n result := div(prod0, denominator)\\n }\\n return result;\\n }\\n\\n // Make sure the result is less than 2**256.\\n // Also prevents denominator == 0\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0]\\n // Compute remainder using mulmod\\n uint256 remainder;\\n assembly {\\n remainder := mulmod(a, b, denominator)\\n }\\n // Subtract 256 bit number from 512 bit number\\n assembly {\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator\\n // Compute largest power of two divisor of denominator.\\n // Always >= 1.\\n // EDIT for 0.8 compatibility:\\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\\n uint256 twos = denominator & (~denominator + 1);\\n\\n // Divide denominator by power of two\\n assembly {\\n denominator := div(denominator, twos)\\n }\\n\\n // Divide [prod1 prod0] by the factors of two\\n assembly {\\n prod0 := div(prod0, twos)\\n }\\n // Shift in bits from prod1 into prod0. For this we need\\n // to flip `twos` such that it is 2**256 / twos.\\n // If twos is zero, then it becomes one\\n assembly {\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2**256\\n // Now that denominator is an odd number, it has an inverse\\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\\n // Compute the inverse by starting with a seed that is correct\\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\\n uint256 inv = (3 * denominator) ^ 2;\\n // Now use Newton-Raphson iteration to improve the precision.\\n // Thanks to Hensel's lifting lemma, this also works in modular\\n // arithmetic, doubling the correct bits in each step.\\n inv *= 2 - denominator * inv; // inverse mod 2**8\\n inv *= 2 - denominator * inv; // inverse mod 2**16\\n inv *= 2 - denominator * inv; // inverse mod 2**32\\n inv *= 2 - denominator * inv; // inverse mod 2**64\\n inv *= 2 - denominator * inv; // inverse mod 2**128\\n inv *= 2 - denominator * inv; // inverse mod 2**256\\n\\n // Because the division is now exact we can divide by multiplying\\n // with the modular inverse of denominator. This will give us the\\n // correct result modulo 2**256. Since the precoditions guarantee\\n // that the outcome is less than 2**256, this is the final result.\\n // We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inv;\\n return result;\\n }\\n }\\n\\n /// @notice Calculates ceil(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n function mulDivRoundingUp(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n result = mulDiv(a, b, denominator);\\n if (mulmod(a, b, denominator) > 0) {\\n require(result < type(uint256).max);\\n result++;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3fa0efa3eea2a84bd6ab7e55badd61f97069a6c50780059b036c810427a9740c\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/LiquidityAmounts.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.5.0;\\n\\nimport {FullMath} from \\\"./FullMath.sol\\\";\\nimport \\\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\\\";\\n\\n/// @title Liquidity amount functions\\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\\nlibrary LiquidityAmounts {\\n function toUint128(uint256 x) private pure returns (uint128 y) {\\n require((y = uint128(x)) == x);\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount0 The amount0 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount0(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n uint256 intermediate =\\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount0,\\n intermediate,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount1 The amount1 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount1(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount1,\\n FixedPoint96.Q96,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\\n /// pool prices and the prices at the tick boundaries\\n function getLiquidityForAmounts(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n liquidity = getLiquidityForAmount0(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount0\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n uint128 liquidity0 =\\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\\n uint128 liquidity1 =\\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\\n\\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\\n } else {\\n liquidity = getLiquidityForAmount1(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount1\\n );\\n }\\n }\\n\\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount0 The amount0\\n function getAmount0ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n uint256(liquidity) << FixedPoint96.RESOLUTION,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n sqrtRatioBX96\\n ) / sqrtRatioAX96;\\n }\\n\\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount1 The amount1\\n function getAmount1ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n liquidity,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n FixedPoint96.Q96\\n );\\n }\\n\\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\\n /// pool prices and the prices at the tick boundaries\\n function getAmountsForLiquidity(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0, uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioX96,\\n liquidity\\n );\\n } else {\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x6205f6409d42fc9565530d2a69819bf8c4e4c66b7a4c61d0827e81c084df6832\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/TickMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\n/// prices between 2**-128 and 2**128\\nlibrary TickMath {\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\n int24 internal constant MIN_TICK = -887272;\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\n int24 internal constant MAX_TICK = -MIN_TICK;\\n\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\n uint160 internal constant MAX_SQRT_RATIO =\\n 1461446703485210103287273052203988822378723970342;\\n\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\n /// @dev Throws if |tick| > max tick\\n /// @param tick The input tick for the above formula\\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\n /// at the given tick\\n function getSqrtRatioAtTick(int24 tick)\\n internal\\n pure\\n returns (uint160 sqrtPriceX96)\\n {\\n uint256 absTick =\\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\\n\\n // EDIT: 0.8 compatibility\\n require(absTick <= uint256(int256(MAX_TICK)), \\\"T\\\");\\n\\n uint256 ratio =\\n absTick & 0x1 != 0\\n ? 0xfffcb933bd6fad37aa2d162d1a594001\\n : 0x100000000000000000000000000000000;\\n if (absTick & 0x2 != 0)\\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\\n if (absTick & 0x4 != 0)\\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\\n if (absTick & 0x8 != 0)\\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\\n if (absTick & 0x10 != 0)\\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\\n if (absTick & 0x20 != 0)\\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\\n if (absTick & 0x40 != 0)\\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\\n if (absTick & 0x80 != 0)\\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\\n if (absTick & 0x100 != 0)\\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\\n if (absTick & 0x200 != 0)\\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\\n if (absTick & 0x400 != 0)\\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\\n if (absTick & 0x800 != 0)\\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\\n if (absTick & 0x1000 != 0)\\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\\n if (absTick & 0x2000 != 0)\\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\\n if (absTick & 0x4000 != 0)\\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\\n if (absTick & 0x8000 != 0)\\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\\n if (absTick & 0x10000 != 0)\\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\\n if (absTick & 0x20000 != 0)\\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\\n if (absTick & 0x40000 != 0)\\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\\n if (absTick & 0x80000 != 0)\\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\\n\\n if (tick > 0) ratio = type(uint256).max / ratio;\\n\\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\n sqrtPriceX96 = uint160(\\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\\n );\\n }\\n\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\n /// ever return.\\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\\n internal\\n pure\\n returns (int24 tick)\\n {\\n // second inequality must be < because the price can never reach the price at the max tick\\n require(\\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\\n \\\"R\\\"\\n );\\n uint256 ratio = uint256(sqrtPriceX96) << 32;\\n\\n uint256 r = ratio;\\n uint256 msb = 0;\\n\\n assembly {\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(4, gt(r, 0xFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(3, gt(r, 0xFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(2, gt(r, 0xF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(1, gt(r, 0x3))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := gt(r, 0x1)\\n msb := or(msb, f)\\n }\\n\\n if (msb >= 128) r = ratio >> (msb - 127);\\n else r = ratio << (127 - msb);\\n\\n int256 log_2 = (int256(msb) - 128) << 64;\\n\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(63, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(62, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(61, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(60, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(59, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(58, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(57, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(56, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(55, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(54, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(53, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(52, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(51, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(50, f))\\n }\\n\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\n\\n int24 tickLow =\\n int24(\\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\\n );\\n int24 tickHi =\\n int24(\\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\\n );\\n\\n tick = tickLow == tickHi\\n ? tickLow\\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\\n ? tickHi\\n : tickLow;\\n }\\n}\\n\",\"keccak256\":\"0xc0faed28071dc68a5f4b03abbb6115759824980feb95a7fcf3b66ae7e1bab58f\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b50604051620060d1380380620060d183398101604081905262000034916200004a565b60601b6001600160601b0319166080526200007a565b6000602082840312156200005c578081fd5b81516001600160a01b038116811462000073578182fd5b9392505050565b60805160601c615ff9620000d8600039600081816105f801528181610d3f01528181610e2801528181610e620152818161154901528181611795015281816117cf015281816118b10152818161192801526119650152615ff96000f3fe608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190615a02565b61026e610269366004615353565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d91906158ef565b6102a66106fb565b60405161023d929190615bfa565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004615313565b6107a4565b6102f56102f036600461545d565b61085c565b005b6102ff60fa81565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004615353565b610c96565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610ccd565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b13660046152a3565b6001600160a01b031660009081526033602052604090205490565b6102f5610cdc565b6097546103e890600160b81b900460020b81565b60405161023d91906159c6565b6102f561040336600461588e565b610d32565b61041b61041636600461588e565b610e8d565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e611173565b61045a6104553660046158b2565b611182565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004615814565b6112d4565b6097546103e890600160a01b900460020b81565b61026e6104aa366004615353565b611494565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004615353565b61152f565b6102f56104e53660046157c4565b61153c565b610233609b5481565b6102a66105013660046152a3565b6117fd565b6102f561051436600461588e565b6118a4565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046154e7565b61198a565b6097546102ff90600160f01b900461ffff1681565b61023361059a3660046152db565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6102336119ee565b6102f56105db366004615537565b6119fd565b6102f56105ee366004615718565b611c9a565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f56106283660046152a3565b611da7565b6102f561063b3660046154e7565b611e87565b61041b61064e36600461588e565b611ef1565b60606036805461066290615e08565b80601f016020809104026020016040519081016040528092919081815260200182805461068e90615e08565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f233848461222a565b50600192915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190615734565b50505050509150915061079a828261234f565b9350935050509091565b60006107b1848484612600565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561083b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61084f853361084a8685615dc5565b61222a565b60019150505b9392505050565b33610865610ccd565b6001600160a01b03161461088b5760405162461bcd60e51b815260040161083290615b61565b600080600061089960355490565b1115610c1d57609d546001600160a01b031663514ea4bf6108b86127c6565b6040518263ffffffff1660e01b81526004016108d691815260200190565b60a06040518083038186803b1580156108ee57600080fd5b505afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092691906156c2565b5092945050506001600160801b0383161590506109af57609754600090819061096590600160a01b8104600290810b91600160b81b9004900b8661282c565b9350935050506109758282612bb9565b61097f8282612c92565b6040519193509150600080516020615fa4833981519152906109a49084908490615bfa565b60405180910390a150505b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a2c9030906004016158ef565b60206040518083038186803b158015610a4457600080fd5b505afa158015610a58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7c9190615876565b610a869190615dc5565b610a909190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610acc9030906004016158ef565b60206040518083038186803b158015610ae457600080fd5b505afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c9190615876565b610b269190615dc5565b610b309190615dc5565b9050610b41898984848b8b8b612d2d565b609d546001600160a01b031663514ea4bf610b5a6127c6565b6040518263ffffffff1660e01b8152600401610b7891815260200190565b60a06040518083038186803b158015610b9057600080fd5b505afa158015610ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc891906156c2565b509295505050506001600160801b038316610c165760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610832565b5050610c62565b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615f4483398151915287878484604051610c8594939291906159d4565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061084a908690615ca3565b6097546001600160a01b031690565b33610ce5610ccd565b6001600160a01b031614610d0b5760405162461bcd60e51b815260040161083290615b61565b60988054600160201b600160d01b031916905560006099819055609a55610d30612eec565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d7c5760405162461bcd60e51b815260040161083290615a35565b600080610d8f609954609a548888612f53565b60006099819055609a5590925090508115610dc957609854609e54610dc9916001600160a01b0391821691600160301b9091041684613077565b8015610df457609854609f54610df4916001600160a01b0391821691600160301b9091041683613077565b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610e5357610e4e6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b610e87565b610e876001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050565b600080600060026065541415610eb55760405162461bcd60e51b815260040161083290615bc3565b600260655584610ed75760405162461bcd60e51b815260040161083290615ba3565b6000610ee260355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610f3457600080fd5b505afa158015610f48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6c9190615734565b50505050505090506000821115610fad57600080610f886106fb565b91509150610f97828a866131f5565b9650610fa4818a866131f5565b95505050610ffa565b610ff481610fcc609760149054906101000a900460020b60020b61324c565b609754610fe690600160b81b9004600290810b900b61324c565b610fef8b61365e565b6136c7565b90955093505b841561101857609e54611018906001600160a01b0316333088613762565b831561103657609f54611036906001600160a01b0316333087613762565b61107681611055609760149054906101000a900460020b60020b61324c565b60975461106f90600160b81b9004600290810b900b61324c565b888861379a565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d916110c6913091600160a01b8104600290810b92600160b81b909204900b908990600401615903565b6040805180830381600087803b1580156110df57600080fd5b505af11580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111791906154c4565b5050611123868861385c565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e7868887878760405161115a959493929190615945565b60405180910390a1505060016065819055509250925092565b60606037805461066290615e08565b60008060008061119160355490565b905080156111b0576111a4818787613929565b919550935091506112cc565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b1580156111f557600080fd5b505afa158015611209573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122d9190615734565b5050505050509050600061127782611256609760149054906101000a900460020b60020b61324c565b60975461127090600160b81b9004600290810b900b61324c565b8b8b61379a565b9050806001600160801b031693506112c4826112a4609760149054906101000a900460020b60020b61324c565b6097546112be90600160b81b9004600290810b900b61324c565b846136c7565b909650945050505b509250925092565b336112dd610ccd565b6001600160a01b0316146113035760405162461bcd60e51b815260040161083290615b61565b6127108461ffff1611156113295760405162461bcd60e51b815260040161083290615b44565b6127108561ffff16111561134f5760405162461bcd60e51b815260040161083290615b44565b6127108361ffff1611156113755760405162461bcd60e51b815260040161083290615b44565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff8516156113ec576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff841615611411576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561143757609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff821615611459576098805463ffffffff191663ffffffff84161790555b6001600160a01b0381161561148d5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156115165760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610832565b611525338561084a8685615dc5565b5060019392505050565b60006106f2338484612600565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146115865760405162461bcd60e51b815260040161083290615a35565b8515611596576115968786613a38565b609d546000906001600160a01b031663514ea4bf6115b26127c6565b6040518263ffffffff1660e01b81526004016115d091815260200190565b60a06040518083038186803b1580156115e857600080fd5b505afa1580156115fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162091906156c2565b505050509050611634818989898989613ce6565b609d546000906001600160a01b031663514ea4bf6116506127c6565b6040518263ffffffff1660e01b815260040161166e91815260200190565b60a06040518083038186803b15801561168657600080fd5b505afa15801561169a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116be91906156c2565b505050509050816001600160801b0316816001600160801b03161161171f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610832565b609754604051600080516020615f448339815191529161175991600160a01b8204600290810b92600160b81b9004900b90869086906159d4565b60405180910390a150506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156117c0576117bb6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b6117f4565b6117f46001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561185057600080fd5b505afa158015611864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118889190615734565b505050505091505061189a848261234f565b9250925050915091565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118ee5760405162461bcd60e51b815260040161083290615a35565b600080611901609b54609c548888612f53565b6000609b819055609c559092509050811561194d57609e5461194d906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084613077565b8015610df457609f54610df4906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083613077565b609d546001600160a01b031633146119b45760405162461bcd60e51b815260040161083290615a84565b83156119d157609e546119d1906001600160a01b03163386613077565b8215610e8757609f54610e87906001600160a01b03163385613077565b60006119f86127c6565b905090565b600054610100900460ff1680611a16575060005460ff16155b611a325760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015611a54576000805461ffff19166101011790555b611a6160fa612710615d82565b61ffff168561ffff161115611a885760405162461bcd60e51b815260040161083290615a66565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe168191600480820192602092909190829003018186803b158015611adc57600080fd5b505afa158015611af0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1491906152bf565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611b6d57600080fd5b505afa158015611b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba591906152bf565b609f80546001600160a01b03199081166001600160a01b0393841617909155609880546097805461012c65ffffffffffff19909316600160201b61ffff8d160263ffffffff19161792909217600160301b600160d01b031916600160301b95881695860217909255643e800c801960d31b600165ffffff00000160a01b03909116600160a01b60028a810b62ffffff908116929092029290921792909217600165ffffff00000160a01b031916600160b81b9189900b9290921602909216919091179091179055611c768888614208565b611c7e614287565b8015611c90576000805461ff00191690555b5050505050505050565b33611ca3610ccd565b6001600160a01b031614611cc95760405162461bcd60e51b815260040161083290615b61565b609854600160201b900461ffff1615611d0a5760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610832565b60008161ffff16118015611d325750611d2660fa612710615d82565b61ffff168161ffff1611155b611d4e5760405162461bcd60e51b815260040161083290615a66565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611db0610ccd565b6001600160a01b031614611dd65760405162461bcd60e51b815260040161083290615b61565b6001600160a01b038116611e3d5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610832565b6097546040516001600160a01b03808416921690600080516020615f6483398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611eb15760405162461bcd60e51b815260040161083290615a84565b6000841315611ed157609e54610e4e906001600160a01b03163386613077565b6000831315610e8757609f54610e87906001600160a01b03163385613077565b600080600060026065541415611f195760405162461bcd60e51b815260040161083290615bc3565b600260655584611f545760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610832565b6000611f5f60355490565b609d549091506000906001600160a01b031663514ea4bf611f7e6127c6565b6040518263ffffffff1660e01b8152600401611f9c91815260200190565b60a06040518083038186803b158015611fb457600080fd5b505afa158015611fc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fec91906156c2565b505050509050611ffc33886142fb565b600061201288836001600160801b031685614438565b905061201d8161365e565b60975490945060009081908190819061204c90600160a01b8104600290810b91600160b81b9004900b8a61282c565b935093509350935061205e8282612bb9565b6120688282612c92565b6040519193509150600080516020615fa48339815191529061208d9084908490615bfa565b60405180910390a1609b54609954609e546040516370a0823160e01b815261214893929188916001600160a01b03909116906370a08231906120d39030906004016158ef565b60206040518083038186803b1580156120eb57600080fd5b505afa1580156120ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121239190615876565b61212d9190615dc5565b6121379190615dc5565b6121419190615dc5565b8d89614438565b6121529085615ca3565b609c54609a54609f546040516370a0823160e01b8152939d5061218f9387916001600160a01b0316906370a08231906120d39030906004016158ef565b6121999084615ca3565b985089156121b857609e546121b8906001600160a01b03168c8c613077565b88156121d557609f546121d5906001600160a01b03168c8b613077565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c60405161220c959493929190615945565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b03831661228c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610832565b6001600160a01b0382166122ed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610832565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf6123776127c6565b6040518263ffffffff1660e01b815260040161239591815260200190565b60a06040518083038186803b1580156123ad57600080fd5b505afa1580156123c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e591906156c2565b9450945094509450945061242e8961240e609760149054906101000a900460020b60020b61324c565b60975461242890600160b81b9004600290810b900b61324c565b886136c7565b909750955060006001600160801b03831661244c6001878c8a6144e7565b6124569190615ca3565b90506000826001600160801b03166124716000878d8b6144e7565b61247b9190615ca3565b90506124878282612c92565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a08231906124c59030906004016158ef565b60206040518083038186803b1580156124dd57600080fd5b505afa1580156124f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125159190615876565b61251f9085615ca3565b6125299190615dc5565b6125339190615dc5565b61253d908a615ca3565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a08231906125789030906004016158ef565b60206040518083038186803b15801561259057600080fd5b505afa1580156125a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c89190615876565b6125d29084615ca3565b6125dc9190615dc5565b6125e69190615dc5565b6125f09089615ca3565b9750505050505050509250929050565b6001600160a01b0383166126645760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610832565b6001600160a01b0382166126c65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610832565b6001600160a01b0383166000908152603360205260409020548181101561273e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610832565b6127488282615dc5565b6001600160a01b03808616600090815260336020526040808220939093559085168152908120805484929061277e908490615ca3565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615f84833981519152846040516127b891815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b8204600290810b810b60e890811b6034840152600160b81b909304810b900b90911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a08231906128659030906004016158ef565b60206040518083038186803b15801561287d57600080fd5b505afa158015612891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b59190615876565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a08231906128eb9030906004016158ef565b60206040518083038186803b15801561290357600080fd5b505afa158015612917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293b9190615876565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a7906064016040805180830381600087803b15801561299b57600080fd5b505af11580156129af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d391906154c4565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a4016040805180830381600087803b158015612a4157600080fd5b505af1158015612a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a799190615690565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612aaf9030906004016158ef565b60206040518083038186803b158015612ac757600080fd5b505afa158015612adb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aff9190615876565b612b099190615dc5565b612b139190615dc5565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a0823190612b489030906004016158ef565b60206040518083038186803b158015612b6057600080fd5b505afa158015612b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b989190615876565b612ba29190615dc5565b612bac9190615dc5565b9250505093509350935093565b612710612bc760fa84615d24565b612bd19190615ce1565b609b6000828254612be29190615ca3565b909155506127109050612bf660fa83615d24565b612c009190615ce1565b609c6000828254612c119190615ca3565b909155505060985461271090612c3290600160201b900461ffff1684615d24565b612c3c9190615ce1565b60996000828254612c4d9190615ca3565b909155505060985461271090612c6e90600160201b900461ffff1683615d24565b612c789190615ce1565b609a6000828254612c899190615ca3565b90915550505050565b6000806000612710609860049054906101000a900461ffff1660fa612cb79190615c5b565b612cc59061ffff1687615d24565b612ccf9190615ce1565b60985490915060009061271090612cf290600160201b900461ffff1660fa615c5b565b612d009061ffff1687615d24565b612d0a9190615ce1565b9050612d168287615dc5565b9350612d228186615dc5565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b158015612d7257600080fd5b505afa158015612d86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612daa9190615734565b50505050505090506000612dd782612dc48b60020b61324c565b612dd08b60020b61324c565b8a8a61379a565b90506001600160801b03811615612e9457609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612e239030908f908f908990600401615903565b6040805180830381600087803b158015612e3c57600080fd5b505af1158015612e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7491906154c4565b9092509050612e83828a615dc5565b9850612e8f8189615dc5565b975050505b6000612ec36127108686612ea85789612eaa565b8a5b612eb49190615d24565b612ebe9190615ce1565b6148f3565b90506000811315612ee057612edd8a8a8a8a858b8a614959565b50505b50505050505050505050565b33612ef5610ccd565b6001600160a01b031614612f1b5760405162461bcd60e51b815260040161083290615b61565b6097546040516000916001600160a01b031690600080516020615f64833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0384811691161415612fc857609754849061271090612f8c90600160e01b900461ffff1689615d24565b612f969190615ce1565b1015612fb45760405162461bcd60e51b815260040161083290615afb565b612fbe8487615dc5565b915084905061306e565b609f546001600160a01b038481169116141561303857609754849061271090612ffc90600160e01b900461ffff1688615d24565b6130069190615ce1565b10156130245760405162461bcd60e51b815260040161083290615afb565b61302e8486615dc5565b905085915061306e565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610832565b94509492505050565b6040516001600160a01b0383166024820152604481018290526130da90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614ba2565b505050565b8047101561312f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610832565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461317c576040519150601f19603f3d011682016040523d82523d6000602084013e613181565b606091505b50509050806130da5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610832565b6000613202848484614438565b90506000828061322257634e487b7160e01b600052601260045260246000fd5b848609111561085557600019811061323957600080fd5b8061324381615e43565b95945050505050565b60008060008360020b12613263578260020b613270565b8260020b61327090615e93565b905061327f620d89e719615e72565b60020b8111156132b55760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610832565b6000600182166132c957600160801b6132db565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561331057608061330b826ffff97272373d413259a46990580e213a615d24565b901c90505b600482161561333a576080613335826ffff2e50f5f656932ef12357cf3c7fdcc615d24565b901c90505b600882161561336457608061335f826fffe5caca7e10e4e61c3624eaa0941cd0615d24565b901c90505b601082161561338e576080613389826fffcb9843d60f6159c9db58835c926644615d24565b901c90505b60208216156133b85760806133b3826fff973b41fa98c081472e6896dfb254c0615d24565b901c90505b60408216156133e25760806133dd826fff2ea16466c96a3843ec78b326b52861615d24565b901c90505b608082161561340c576080613407826ffe5dee046a99a2a811c461f1969c3053615d24565b901c90505b610100821615613437576080613432826ffcbe86c7900a88aedcffc83b479aa3a4615d24565b901c90505b61020082161561346257608061345d826ff987a7253ac413176f2b074cf7815e54615d24565b901c90505b61040082161561348d576080613488826ff3392b0822b70005940c7a398e4b70f3615d24565b901c90505b6108008216156134b85760806134b3826fe7159475a2c29b7443b29c7fa6e889d9615d24565b901c90505b6110008216156134e35760806134de826fd097f3bdfd2022b8845ad8f792aa5825615d24565b901c90505b61200082161561350e576080613509826fa9f746462d870fdf8a65dc1f90e061e5615d24565b901c90505b614000821615613539576080613534826f70d869a156d2a1b890bb3df62baf32f7615d24565b901c90505b61800082161561356457608061355f826f31be135f97d08fd981231505542fcfa6615d24565b901c90505b6201000082161561359057608061358b826f09aa508b5b7a84e1c677de54f3e99bc9615d24565b901c90505b620200008216156135bb5760806135b6826e5d6af8dedb81196699c329225ee604615d24565b901c90505b620400008216156135e55760806135e0826d2216e584f5fa1ea926041bedfe98615d24565b901c90505b6208000082161561360d576080613608826b048a170391f7dc42444e8fa2615d24565b901c90505b60008460020b13156136285761362581600019615ce1565b90505b613636600160201b82615e5e565b15613642576001613645565b60005b6136569060ff16602083901c615ca3565b949350505050565b6000600160801b82106136c35760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610832565b5090565b600080836001600160a01b0316856001600160a01b031611156136e8579293925b846001600160a01b0316866001600160a01b0316116137135761370c858585614c74565b915061306e565b836001600160a01b0316866001600160a01b0316101561374c57613738868585614c74565b9150613745858785614cde565b905061306e565b613757858585614cde565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e879085906323b872dd60e01b906084016130a3565b6000836001600160a01b0316856001600160a01b031611156137ba579293925b846001600160a01b0316866001600160a01b0316116137e5576137de858585614d28565b9050613243565b836001600160a01b0316866001600160a01b0316101561384757600061380c878686614d28565b9050600061381b878986614d92565b9050806001600160801b0316826001600160801b03161061383c578061383e565b815b92505050613243565b613852858584614d92565b9695505050505050565b6001600160a01b0382166138b25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610832565b80603560008282546138c49190615ca3565b90915550506001600160a01b038216600090815260336020526040812080548392906138f1908490615ca3565b90915550506040518181526001600160a01b03831690600090600080516020615f848339815191529060200160405180910390a35050565b60008060008060006139396106fb565b9150915081600014801561394d5750600081115b156139645761395d868983614438565b9250613a13565b801580156139725750600082115b156139825761395d878984614438565b8115801561398e575080155b156139b55760405162461bcd60e51b81526020600482015260006024820152604401610832565b60006139c2888a85614438565b905060006139d1888b85614438565b90506000821180156139e35750600081115b6139ff5760405162461bcd60e51b815260040161083290615ba3565b808210613a0c5780613a0e565b815b945050505b613a1e83838a6131f5565b9450613a2b83828a6131f5565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff1691839150600090613a8457634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110613ac157634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613b0790859060040161597c565b60006040518083038186803b158015613b1f57600080fd5b505afa158015613b33573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613b5b919081019061537e565b5090508051600214613b9b5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610832565b6098548151600091829163ffffffff90911660060b9084908390613bcf57634e487b7160e01b600052603260045260246000fd5b602002602001015184600181518110613bf857634e487b7160e01b600052603260045260246000fd5b60200260200101510360060b81613c1f57634e487b7160e01b600052601260045260246000fd5b059050613c2e8160020b61324c565b6097549092506000915061271090613c5190600160f01b900461ffff1684615cf5565b613c5b9190615cbb565b90508415613ca357613c6d8183615da5565b6001600160a01b0316866001600160a01b03161015613c9e5760405162461bcd60e51b815260040161083290615b1d565b613cde565b613cad8183615c81565b6001600160a01b0316866001600160a01b03161115613cde5760405162461bcd60e51b815260040161083290615b1d565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613d1f9030906004016158ef565b60206040518083038186803b158015613d3757600080fd5b505afa158015613d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d6f9190615876565b613d799190615dc5565b613d839190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613dbf9030906004016158ef565b60206040518083038186803b158015613dd757600080fd5b505afa158015613deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0f9190615876565b613e199190615dc5565b613e239190615dc5565b6097549091506000908190613e4e90600160a01b8104600290810b91600160b81b9004900b8c61282c565b935093505050613e5e8282612bb9565b613e688282612c92565b6040519193509150600080516020615fa483398151915290613e8d9084908490615bfa565b60405180910390a1613e9f8483615ca3565b9150613eab8382615ca3565b609e549091506001600160a01b038681169116141561405657609754869061271090613ee290600160d01b900461ffff1685615d24565b613eec9190615ce1565b1015613f0a5760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613f429030906004016158ef565b60206040518083038186803b158015613f5a57600080fd5b505afa158015613f6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f929190615876565b613f9c9190615dc5565b613fa69190615dc5565b613fb09190615dc5565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613feb9030906004016158ef565b60206040518083038186803b15801561400357600080fd5b505afa158015614017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061403b9190615876565b6140459190615dc5565b61404f9190615dc5565b92506141e1565b609f546001600160a01b03868116911614156130385760975486906127109061408a90600160d01b900461ffff1684615d24565b6140949190615ce1565b10156140b25760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a08231906140e89030906004016158ef565b60206040518083038186803b15801561410057600080fd5b505afa158015614114573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141389190615876565b6141429190615dc5565b61414c9190615dc5565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a08231906141879030906004016158ef565b60206040518083038186803b15801561419f57600080fd5b505afa1580156141b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141d79190615876565b61403b9190615dc5565b609754612ee090600160a01b8104600290810b91600160b81b9004900b86868d8d8d612d2d565b600054610100900460ff1680614221575060005460ff16155b61423d5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff1615801561425f576000805461ffff19166101011790555b614267614dc8565b6142718383614e32565b80156130da576000805461ff0019169055505050565b600054610100900460ff16806142a0575060005460ff16155b6142bc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142de576000805461ffff19166101011790555b6142e6614ec7565b80156142f8576000805461ff00191690555b50565b6001600160a01b03821661435b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610832565b6001600160a01b038216600090815260336020526040902054818110156143cf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610832565b6143d98282615dc5565b6001600160a01b03841660009081526033602052604081209190915560358054849290614407908490615dc5565b90915550506040518281526000906001600160a01b03851690600080516020615f8483398151915290602001612342565b600080806000198587098587029250828110838203039150508060001415614472576000841161446757600080fd5b508290049050610855565b80841161447e57600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b60008060008087156146b457609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b815260040160206040518083038186803b15801561454157600080fd5b505afa158015614555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145799190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916145b991600160a01b90910460020b906004016159c6565b6101006040518083038186803b1580156145d257600080fd5b505afa1580156145e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061460a91906155f6565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba93955061465394600160b81b90910460020b935060040191506159c69050565b6101006040518083038186803b15801561466c57600080fd5b505afa158015614680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146a491906155f6565b5093975061486f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b815260040160206040518083038186803b15801561470257600080fd5b505afa158015614716573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061473a9190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161477a91600160a01b90910460020b906004016159c6565b6101006040518083038186803b15801561479357600080fd5b505afa1580156147a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147cb91906155f6565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506148139450600160b81b900460020b9260040191506159c69050565b6101006040518083038186803b15801561482c57600080fd5b505afa158015614840573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061486491906155f6565b509297505050505050505b6000609760149054906101000a900460020b60020b8760020b12614894575082614899565b508281035b6000609760179054906101000a900460020b60020b8860020b12156148bf5750826148c4565b508282035b8183038190036148e46001600160801b0389168b8303600160801b614438565b9b9a5050505050505050505050565b6000600160ff1b82106136c35760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610832565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c4016040805180830381600087803b1580156149c957600080fd5b505af11580156149dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a0191906154c4565b9150915081614a0f8a6148f3565b614a199190615d43565b935080614a25896148f3565b614a2f9190615d43565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015614a8157600080fd5b505afa158015614a95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ab99190615734565b50505050505090506000614ae682614ad38f60020b61324c565b614adf8f60020b61324c565b898961379a565b90506001600160801b03811615614b9257609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b8152600401614b3e9493929190615903565b6040805180830381600087803b158015614b5757600080fd5b505af1158015614b6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b8f91906154c4565b50505b5050505097509795505050505050565b6000614bf7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614f379092919063ffffffff16565b8051909150156130da5780806020019051810190614c159190615441565b6130da5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610832565b6000826001600160a01b0316846001600160a01b03161115614c94579192915b6001600160a01b038416614cd4600160601b600160e01b03606085901b16614cbc8787615da5565b6001600160a01b0316866001600160a01b0316614438565b6136569190615ce1565b6000826001600160a01b0316846001600160a01b03161115614cfe579192915b6136566001600160801b038316614d158686615da5565b6001600160a01b0316600160601b614438565b6000826001600160a01b0316846001600160a01b03161115614d48579192915b6000614d6b856001600160a01b0316856001600160a01b0316600160601b614438565b9050613243614d8d8483614d7f8989615da5565b6001600160a01b0316614438565b614f46565b6000826001600160a01b0316846001600160a01b03161115614db2579192915b613656614d8d83600160601b614d7f8888615da5565b600054610100900460ff1680614de1575060005460ff16155b614dfd5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142e6576000805461ffff191661010117905580156142f8576000805461ff001916905550565b600054610100900460ff1680614e4b575060005460ff16155b614e675760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614e89576000805461ffff19166101011790555b8251614e9c9060369060208601906150c2565b508151614eb09060379060208501906150c2565b5080156130da576000805461ff0019169055505050565b600054610100900460ff1680614ee0575060005460ff16155b614efc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614f1e576000805461ffff19166101011790555b600160655580156142f8576000805461ff001916905550565b60606136568484600085614f61565b806001600160801b0381168114614f5c57600080fd5b919050565b606082471015614fc25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610832565b843b6150105760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610832565b600080866001600160a01b0316858760405161502c91906158d3565b60006040518083038185875af1925050503d8060008114615069576040519150601f19603f3d011682016040523d82523d6000602084013e61506e565b606091505b509150915061507e828286615089565b979650505050505050565b60608315615098575081610855565b8251156150a85782518084602001fd5b8160405162461bcd60e51b81526004016108329190615a02565b8280546150ce90615e08565b90600052602060002090601f0160209004810192826150f05760008555615136565b82601f1061510957805160ff1916838001178555615136565b82800160010185558215615136579182015b8281111561513657825182559160200191906001019061511b565b506136c39291505b808211156136c3576000815560010161513e565b600082601f830112615162578081fd5b8151602061517761517283615c38565b615c08565b80838252828201915082860187848660051b8901011115615196578586fd5b855b858110156151bd5781516151ab81615eef565b84529284019290840190600101615198565b5090979650505050505050565b60008083601f8401126151db578182fd5b5081356001600160401b038111156151f1578182fd5b60208301915083602082850101111561520957600080fd5b9250929050565b8051600681900b8114614f5c57600080fd5b600082601f830112615232578081fd5b81356001600160401b0381111561524b5761524b615ed9565b61525e601f8201601f1916602001615c08565b818152846020838601011115615272578283fd5b816020850160208301379081016020019190915292915050565b80516001600160801b0381168114614f5c57600080fd5b6000602082840312156152b4578081fd5b813561085581615eef565b6000602082840312156152d0578081fd5b815161085581615eef565b600080604083850312156152ed578081fd5b82356152f881615eef565b9150602083013561530881615eef565b809150509250929050565b600080600060608486031215615327578081fd5b833561533281615eef565b9250602084013561534281615eef565b929592945050506040919091013590565b60008060408385031215615365578182fd5b823561537081615eef565b946020939093013593505050565b60008060408385031215615390578182fd5b82516001600160401b03808211156153a6578384fd5b818501915085601f8301126153b9578384fd5b815160206153c961517283615c38565b8083825282820191508286018a848660051b89010111156153e8578889fd5b8896505b84871015615411576153fd81615210565b8352600196909601959183019183016153ec565b509188015191965090935050508082111561542a578283fd5b5061543785828601615152565b9150509250929050565b600060208284031215615452578081fd5b815161085581615f04565b600080600080600060a08688031215615474578283fd5b853561547f81615f12565b9450602086013561548f81615f12565b9350604086013561549f81615eef565b92506060860135915060808601356154b681615f04565b809150509295509295909350565b600080604083850312156154d6578182fd5b505080516020909101519092909150565b600080600080606085870312156154fc578182fd5b843593506020850135925060408501356001600160401b0381111561551f578283fd5b61552b878288016151ca565b95989497509550505050565b600080600080600080600060e0888a031215615551578485fd5b87356001600160401b0380821115615567578687fd5b6155738b838c01615222565b985060208a0135915080821115615588578687fd5b506155958a828b01615222565b96505060408801356155a681615eef565b945060608801356155b681615f21565b935060808801356155c681615f12565b925060a08801356155d681615f12565b915060c08801356155e681615eef565b8091505092959891949750929550565b600080600080600080600080610100898b031215615612578182fd5b61561b8961528c565b9750602089015180600f0b8114615630578283fd5b60408a015160608b01519198509650945061564d60808a01615210565b935060a089015161565d81615eef565b60c08a015190935061566e81615f31565b60e08a015190925061567f81615f04565b809150509295985092959890939650565b600080604083850312156156a2578182fd5b6156ab8361528c565b91506156b96020840161528c565b90509250929050565b600080600080600060a086880312156156d9578283fd5b6156e28661528c565b945060208601519350604086015192506156fe6060870161528c565b915061570c6080870161528c565b90509295509295909350565b600060208284031215615729578081fd5b813561085581615f21565b600080600080600080600060e0888a03121561574e578081fd5b875161575981615eef565b602089015190975061576a81615f12565b604089015190965061577b81615f21565b606089015190955061578c81615f21565b608089015190945061579d81615f21565b60a089015190935060ff811681146157b3578182fd5b60c08901519092506155e681615f04565b600080600080600060a086880312156157db578283fd5b85356157e681615eef565b94506020860135935060408601356157fd81615f04565b92506060860135915060808601356154b681615eef565b600080600080600060a0868803121561582b578283fd5b853561583681615f21565b9450602086013561584681615f21565b9350604086013561585681615f21565b9250606086013561586681615f31565b915060808601356154b681615eef565b600060208284031215615887578081fd5b5051919050565b600080604083850312156158a0578182fd5b82359150602083013561530881615eef565b600080604083850312156158c4578182fd5b50508035926020909101359150565b600082516158e5818460208701615ddc565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b6020808252825182820181905260009190848201906040850190845b818110156159ba57835163ffffffff1683529284019291840191600101615998565b50909695505050505050565b60029190910b815260200190565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b6020815260008251806020840152615a21816040850160208701615ddc565b601f01601f19169190910160400192915050565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252600490820152636d42505360e01b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260089082015267686967682066656560c01b604082015260600190565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b60208082526003908201526242505360e81b604082015260600190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b918252602082015260400190565b604051601f8201601f191681016001600160401b0381118282101715615c3057615c30615ed9565b604052919050565b60006001600160401b03821115615c5157615c51615ed9565b5060051b60200190565b600061ffff808316818516808303821115615c7857615c78615ead565b01949350505050565b60006001600160a01b03828116848216808303821115615c7857615c78615ead565b60008219821115615cb657615cb6615ead565b500190565b60006001600160a01b0383811680615cd557615cd5615ec3565b92169190910492915050565b600082615cf057615cf0615ec3565b500490565b60006001600160a01b0382811684821681151582840482111615615d1b57615d1b615ead565b02949350505050565b6000816000190483118215151615615d3e57615d3e615ead565b500290565b60008083128015600160ff1b850184121615615d6157615d61615ead565b6001600160ff1b0384018313811615615d7c57615d7c615ead565b50500390565b600061ffff83811690831681811015615d9d57615d9d615ead565b039392505050565b60006001600160a01b0383811690831681811015615d9d57615d9d615ead565b600082821015615dd757615dd7615ead565b500390565b60005b83811015615df7578181015183820152602001615ddf565b83811115610e875750506000910152565b600181811c90821680615e1c57607f821691505b60208210811415615e3d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615e5757615e57615ead565b5060010190565b600082615e6d57615e6d615ec3565b500690565b60008160020b627fffff19811415615e8c57615e8c615ead565b9003919050565b6000600160ff1b821415615ea957615ea9615ead565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146142f857600080fd5b80151581146142f857600080fd5b8060020b81146142f857600080fd5b61ffff811681146142f857600080fd5b63ffffffff811681146142f857600080fdfec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a26469706673582212200d68bbc56177fb98dc03b8435a294744f29eb4d74dbc9371fa03141fd2efac7464736f6c63430008040033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190615a02565b61026e610269366004615353565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d91906158ef565b6102a66106fb565b60405161023d929190615bfa565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004615313565b6107a4565b6102f56102f036600461545d565b61085c565b005b6102ff60fa81565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004615353565b610c96565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610ccd565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b13660046152a3565b6001600160a01b031660009081526033602052604090205490565b6102f5610cdc565b6097546103e890600160b81b900460020b81565b60405161023d91906159c6565b6102f561040336600461588e565b610d32565b61041b61041636600461588e565b610e8d565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e611173565b61045a6104553660046158b2565b611182565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004615814565b6112d4565b6097546103e890600160a01b900460020b81565b61026e6104aa366004615353565b611494565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004615353565b61152f565b6102f56104e53660046157c4565b61153c565b610233609b5481565b6102a66105013660046152a3565b6117fd565b6102f561051436600461588e565b6118a4565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046154e7565b61198a565b6097546102ff90600160f01b900461ffff1681565b61023361059a3660046152db565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6102336119ee565b6102f56105db366004615537565b6119fd565b6102f56105ee366004615718565b611c9a565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f56106283660046152a3565b611da7565b6102f561063b3660046154e7565b611e87565b61041b61064e36600461588e565b611ef1565b60606036805461066290615e08565b80601f016020809104026020016040519081016040528092919081815260200182805461068e90615e08565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f233848461222a565b50600192915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190615734565b50505050509150915061079a828261234f565b9350935050509091565b60006107b1848484612600565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561083b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61084f853361084a8685615dc5565b61222a565b60019150505b9392505050565b33610865610ccd565b6001600160a01b03161461088b5760405162461bcd60e51b815260040161083290615b61565b600080600061089960355490565b1115610c1d57609d546001600160a01b031663514ea4bf6108b86127c6565b6040518263ffffffff1660e01b81526004016108d691815260200190565b60a06040518083038186803b1580156108ee57600080fd5b505afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092691906156c2565b5092945050506001600160801b0383161590506109af57609754600090819061096590600160a01b8104600290810b91600160b81b9004900b8661282c565b9350935050506109758282612bb9565b61097f8282612c92565b6040519193509150600080516020615fa4833981519152906109a49084908490615bfa565b60405180910390a150505b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a2c9030906004016158ef565b60206040518083038186803b158015610a4457600080fd5b505afa158015610a58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7c9190615876565b610a869190615dc5565b610a909190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610acc9030906004016158ef565b60206040518083038186803b158015610ae457600080fd5b505afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c9190615876565b610b269190615dc5565b610b309190615dc5565b9050610b41898984848b8b8b612d2d565b609d546001600160a01b031663514ea4bf610b5a6127c6565b6040518263ffffffff1660e01b8152600401610b7891815260200190565b60a06040518083038186803b158015610b9057600080fd5b505afa158015610ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc891906156c2565b509295505050506001600160801b038316610c165760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610832565b5050610c62565b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615f4483398151915287878484604051610c8594939291906159d4565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061084a908690615ca3565b6097546001600160a01b031690565b33610ce5610ccd565b6001600160a01b031614610d0b5760405162461bcd60e51b815260040161083290615b61565b60988054600160201b600160d01b031916905560006099819055609a55610d30612eec565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d7c5760405162461bcd60e51b815260040161083290615a35565b600080610d8f609954609a548888612f53565b60006099819055609a5590925090508115610dc957609854609e54610dc9916001600160a01b0391821691600160301b9091041684613077565b8015610df457609854609f54610df4916001600160a01b0391821691600160301b9091041683613077565b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610e5357610e4e6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b610e87565b610e876001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050565b600080600060026065541415610eb55760405162461bcd60e51b815260040161083290615bc3565b600260655584610ed75760405162461bcd60e51b815260040161083290615ba3565b6000610ee260355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610f3457600080fd5b505afa158015610f48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6c9190615734565b50505050505090506000821115610fad57600080610f886106fb565b91509150610f97828a866131f5565b9650610fa4818a866131f5565b95505050610ffa565b610ff481610fcc609760149054906101000a900460020b60020b61324c565b609754610fe690600160b81b9004600290810b900b61324c565b610fef8b61365e565b6136c7565b90955093505b841561101857609e54611018906001600160a01b0316333088613762565b831561103657609f54611036906001600160a01b0316333087613762565b61107681611055609760149054906101000a900460020b60020b61324c565b60975461106f90600160b81b9004600290810b900b61324c565b888861379a565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d916110c6913091600160a01b8104600290810b92600160b81b909204900b908990600401615903565b6040805180830381600087803b1580156110df57600080fd5b505af11580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111791906154c4565b5050611123868861385c565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e7868887878760405161115a959493929190615945565b60405180910390a1505060016065819055509250925092565b60606037805461066290615e08565b60008060008061119160355490565b905080156111b0576111a4818787613929565b919550935091506112cc565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b1580156111f557600080fd5b505afa158015611209573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122d9190615734565b5050505050509050600061127782611256609760149054906101000a900460020b60020b61324c565b60975461127090600160b81b9004600290810b900b61324c565b8b8b61379a565b9050806001600160801b031693506112c4826112a4609760149054906101000a900460020b60020b61324c565b6097546112be90600160b81b9004600290810b900b61324c565b846136c7565b909650945050505b509250925092565b336112dd610ccd565b6001600160a01b0316146113035760405162461bcd60e51b815260040161083290615b61565b6127108461ffff1611156113295760405162461bcd60e51b815260040161083290615b44565b6127108561ffff16111561134f5760405162461bcd60e51b815260040161083290615b44565b6127108361ffff1611156113755760405162461bcd60e51b815260040161083290615b44565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff8516156113ec576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff841615611411576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561143757609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff821615611459576098805463ffffffff191663ffffffff84161790555b6001600160a01b0381161561148d5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156115165760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610832565b611525338561084a8685615dc5565b5060019392505050565b60006106f2338484612600565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146115865760405162461bcd60e51b815260040161083290615a35565b8515611596576115968786613a38565b609d546000906001600160a01b031663514ea4bf6115b26127c6565b6040518263ffffffff1660e01b81526004016115d091815260200190565b60a06040518083038186803b1580156115e857600080fd5b505afa1580156115fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162091906156c2565b505050509050611634818989898989613ce6565b609d546000906001600160a01b031663514ea4bf6116506127c6565b6040518263ffffffff1660e01b815260040161166e91815260200190565b60a06040518083038186803b15801561168657600080fd5b505afa15801561169a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116be91906156c2565b505050509050816001600160801b0316816001600160801b03161161171f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610832565b609754604051600080516020615f448339815191529161175991600160a01b8204600290810b92600160b81b9004900b90869086906159d4565b60405180910390a150506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156117c0576117bb6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b6117f4565b6117f46001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561185057600080fd5b505afa158015611864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118889190615734565b505050505091505061189a848261234f565b9250925050915091565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118ee5760405162461bcd60e51b815260040161083290615a35565b600080611901609b54609c548888612f53565b6000609b819055609c559092509050811561194d57609e5461194d906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084613077565b8015610df457609f54610df4906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083613077565b609d546001600160a01b031633146119b45760405162461bcd60e51b815260040161083290615a84565b83156119d157609e546119d1906001600160a01b03163386613077565b8215610e8757609f54610e87906001600160a01b03163385613077565b60006119f86127c6565b905090565b600054610100900460ff1680611a16575060005460ff16155b611a325760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015611a54576000805461ffff19166101011790555b611a6160fa612710615d82565b61ffff168561ffff161115611a885760405162461bcd60e51b815260040161083290615a66565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe168191600480820192602092909190829003018186803b158015611adc57600080fd5b505afa158015611af0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1491906152bf565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611b6d57600080fd5b505afa158015611b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba591906152bf565b609f80546001600160a01b03199081166001600160a01b0393841617909155609880546097805461012c65ffffffffffff19909316600160201b61ffff8d160263ffffffff19161792909217600160301b600160d01b031916600160301b95881695860217909255643e800c801960d31b600165ffffff00000160a01b03909116600160a01b60028a810b62ffffff908116929092029290921792909217600165ffffff00000160a01b031916600160b81b9189900b9290921602909216919091179091179055611c768888614208565b611c7e614287565b8015611c90576000805461ff00191690555b5050505050505050565b33611ca3610ccd565b6001600160a01b031614611cc95760405162461bcd60e51b815260040161083290615b61565b609854600160201b900461ffff1615611d0a5760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610832565b60008161ffff16118015611d325750611d2660fa612710615d82565b61ffff168161ffff1611155b611d4e5760405162461bcd60e51b815260040161083290615a66565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611db0610ccd565b6001600160a01b031614611dd65760405162461bcd60e51b815260040161083290615b61565b6001600160a01b038116611e3d5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610832565b6097546040516001600160a01b03808416921690600080516020615f6483398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611eb15760405162461bcd60e51b815260040161083290615a84565b6000841315611ed157609e54610e4e906001600160a01b03163386613077565b6000831315610e8757609f54610e87906001600160a01b03163385613077565b600080600060026065541415611f195760405162461bcd60e51b815260040161083290615bc3565b600260655584611f545760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610832565b6000611f5f60355490565b609d549091506000906001600160a01b031663514ea4bf611f7e6127c6565b6040518263ffffffff1660e01b8152600401611f9c91815260200190565b60a06040518083038186803b158015611fb457600080fd5b505afa158015611fc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fec91906156c2565b505050509050611ffc33886142fb565b600061201288836001600160801b031685614438565b905061201d8161365e565b60975490945060009081908190819061204c90600160a01b8104600290810b91600160b81b9004900b8a61282c565b935093509350935061205e8282612bb9565b6120688282612c92565b6040519193509150600080516020615fa48339815191529061208d9084908490615bfa565b60405180910390a1609b54609954609e546040516370a0823160e01b815261214893929188916001600160a01b03909116906370a08231906120d39030906004016158ef565b60206040518083038186803b1580156120eb57600080fd5b505afa1580156120ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121239190615876565b61212d9190615dc5565b6121379190615dc5565b6121419190615dc5565b8d89614438565b6121529085615ca3565b609c54609a54609f546040516370a0823160e01b8152939d5061218f9387916001600160a01b0316906370a08231906120d39030906004016158ef565b6121999084615ca3565b985089156121b857609e546121b8906001600160a01b03168c8c613077565b88156121d557609f546121d5906001600160a01b03168c8b613077565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c60405161220c959493929190615945565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b03831661228c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610832565b6001600160a01b0382166122ed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610832565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf6123776127c6565b6040518263ffffffff1660e01b815260040161239591815260200190565b60a06040518083038186803b1580156123ad57600080fd5b505afa1580156123c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e591906156c2565b9450945094509450945061242e8961240e609760149054906101000a900460020b60020b61324c565b60975461242890600160b81b9004600290810b900b61324c565b886136c7565b909750955060006001600160801b03831661244c6001878c8a6144e7565b6124569190615ca3565b90506000826001600160801b03166124716000878d8b6144e7565b61247b9190615ca3565b90506124878282612c92565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a08231906124c59030906004016158ef565b60206040518083038186803b1580156124dd57600080fd5b505afa1580156124f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125159190615876565b61251f9085615ca3565b6125299190615dc5565b6125339190615dc5565b61253d908a615ca3565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a08231906125789030906004016158ef565b60206040518083038186803b15801561259057600080fd5b505afa1580156125a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c89190615876565b6125d29084615ca3565b6125dc9190615dc5565b6125e69190615dc5565b6125f09089615ca3565b9750505050505050509250929050565b6001600160a01b0383166126645760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610832565b6001600160a01b0382166126c65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610832565b6001600160a01b0383166000908152603360205260409020548181101561273e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610832565b6127488282615dc5565b6001600160a01b03808616600090815260336020526040808220939093559085168152908120805484929061277e908490615ca3565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615f84833981519152846040516127b891815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b8204600290810b810b60e890811b6034840152600160b81b909304810b900b90911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a08231906128659030906004016158ef565b60206040518083038186803b15801561287d57600080fd5b505afa158015612891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b59190615876565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a08231906128eb9030906004016158ef565b60206040518083038186803b15801561290357600080fd5b505afa158015612917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293b9190615876565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a7906064016040805180830381600087803b15801561299b57600080fd5b505af11580156129af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d391906154c4565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a4016040805180830381600087803b158015612a4157600080fd5b505af1158015612a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a799190615690565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612aaf9030906004016158ef565b60206040518083038186803b158015612ac757600080fd5b505afa158015612adb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aff9190615876565b612b099190615dc5565b612b139190615dc5565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a0823190612b489030906004016158ef565b60206040518083038186803b158015612b6057600080fd5b505afa158015612b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b989190615876565b612ba29190615dc5565b612bac9190615dc5565b9250505093509350935093565b612710612bc760fa84615d24565b612bd19190615ce1565b609b6000828254612be29190615ca3565b909155506127109050612bf660fa83615d24565b612c009190615ce1565b609c6000828254612c119190615ca3565b909155505060985461271090612c3290600160201b900461ffff1684615d24565b612c3c9190615ce1565b60996000828254612c4d9190615ca3565b909155505060985461271090612c6e90600160201b900461ffff1683615d24565b612c789190615ce1565b609a6000828254612c899190615ca3565b90915550505050565b6000806000612710609860049054906101000a900461ffff1660fa612cb79190615c5b565b612cc59061ffff1687615d24565b612ccf9190615ce1565b60985490915060009061271090612cf290600160201b900461ffff1660fa615c5b565b612d009061ffff1687615d24565b612d0a9190615ce1565b9050612d168287615dc5565b9350612d228186615dc5565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b158015612d7257600080fd5b505afa158015612d86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612daa9190615734565b50505050505090506000612dd782612dc48b60020b61324c565b612dd08b60020b61324c565b8a8a61379a565b90506001600160801b03811615612e9457609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612e239030908f908f908990600401615903565b6040805180830381600087803b158015612e3c57600080fd5b505af1158015612e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7491906154c4565b9092509050612e83828a615dc5565b9850612e8f8189615dc5565b975050505b6000612ec36127108686612ea85789612eaa565b8a5b612eb49190615d24565b612ebe9190615ce1565b6148f3565b90506000811315612ee057612edd8a8a8a8a858b8a614959565b50505b50505050505050505050565b33612ef5610ccd565b6001600160a01b031614612f1b5760405162461bcd60e51b815260040161083290615b61565b6097546040516000916001600160a01b031690600080516020615f64833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0384811691161415612fc857609754849061271090612f8c90600160e01b900461ffff1689615d24565b612f969190615ce1565b1015612fb45760405162461bcd60e51b815260040161083290615afb565b612fbe8487615dc5565b915084905061306e565b609f546001600160a01b038481169116141561303857609754849061271090612ffc90600160e01b900461ffff1688615d24565b6130069190615ce1565b10156130245760405162461bcd60e51b815260040161083290615afb565b61302e8486615dc5565b905085915061306e565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610832565b94509492505050565b6040516001600160a01b0383166024820152604481018290526130da90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614ba2565b505050565b8047101561312f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610832565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461317c576040519150601f19603f3d011682016040523d82523d6000602084013e613181565b606091505b50509050806130da5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610832565b6000613202848484614438565b90506000828061322257634e487b7160e01b600052601260045260246000fd5b848609111561085557600019811061323957600080fd5b8061324381615e43565b95945050505050565b60008060008360020b12613263578260020b613270565b8260020b61327090615e93565b905061327f620d89e719615e72565b60020b8111156132b55760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610832565b6000600182166132c957600160801b6132db565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561331057608061330b826ffff97272373d413259a46990580e213a615d24565b901c90505b600482161561333a576080613335826ffff2e50f5f656932ef12357cf3c7fdcc615d24565b901c90505b600882161561336457608061335f826fffe5caca7e10e4e61c3624eaa0941cd0615d24565b901c90505b601082161561338e576080613389826fffcb9843d60f6159c9db58835c926644615d24565b901c90505b60208216156133b85760806133b3826fff973b41fa98c081472e6896dfb254c0615d24565b901c90505b60408216156133e25760806133dd826fff2ea16466c96a3843ec78b326b52861615d24565b901c90505b608082161561340c576080613407826ffe5dee046a99a2a811c461f1969c3053615d24565b901c90505b610100821615613437576080613432826ffcbe86c7900a88aedcffc83b479aa3a4615d24565b901c90505b61020082161561346257608061345d826ff987a7253ac413176f2b074cf7815e54615d24565b901c90505b61040082161561348d576080613488826ff3392b0822b70005940c7a398e4b70f3615d24565b901c90505b6108008216156134b85760806134b3826fe7159475a2c29b7443b29c7fa6e889d9615d24565b901c90505b6110008216156134e35760806134de826fd097f3bdfd2022b8845ad8f792aa5825615d24565b901c90505b61200082161561350e576080613509826fa9f746462d870fdf8a65dc1f90e061e5615d24565b901c90505b614000821615613539576080613534826f70d869a156d2a1b890bb3df62baf32f7615d24565b901c90505b61800082161561356457608061355f826f31be135f97d08fd981231505542fcfa6615d24565b901c90505b6201000082161561359057608061358b826f09aa508b5b7a84e1c677de54f3e99bc9615d24565b901c90505b620200008216156135bb5760806135b6826e5d6af8dedb81196699c329225ee604615d24565b901c90505b620400008216156135e55760806135e0826d2216e584f5fa1ea926041bedfe98615d24565b901c90505b6208000082161561360d576080613608826b048a170391f7dc42444e8fa2615d24565b901c90505b60008460020b13156136285761362581600019615ce1565b90505b613636600160201b82615e5e565b15613642576001613645565b60005b6136569060ff16602083901c615ca3565b949350505050565b6000600160801b82106136c35760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610832565b5090565b600080836001600160a01b0316856001600160a01b031611156136e8579293925b846001600160a01b0316866001600160a01b0316116137135761370c858585614c74565b915061306e565b836001600160a01b0316866001600160a01b0316101561374c57613738868585614c74565b9150613745858785614cde565b905061306e565b613757858585614cde565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e879085906323b872dd60e01b906084016130a3565b6000836001600160a01b0316856001600160a01b031611156137ba579293925b846001600160a01b0316866001600160a01b0316116137e5576137de858585614d28565b9050613243565b836001600160a01b0316866001600160a01b0316101561384757600061380c878686614d28565b9050600061381b878986614d92565b9050806001600160801b0316826001600160801b03161061383c578061383e565b815b92505050613243565b613852858584614d92565b9695505050505050565b6001600160a01b0382166138b25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610832565b80603560008282546138c49190615ca3565b90915550506001600160a01b038216600090815260336020526040812080548392906138f1908490615ca3565b90915550506040518181526001600160a01b03831690600090600080516020615f848339815191529060200160405180910390a35050565b60008060008060006139396106fb565b9150915081600014801561394d5750600081115b156139645761395d868983614438565b9250613a13565b801580156139725750600082115b156139825761395d878984614438565b8115801561398e575080155b156139b55760405162461bcd60e51b81526020600482015260006024820152604401610832565b60006139c2888a85614438565b905060006139d1888b85614438565b90506000821180156139e35750600081115b6139ff5760405162461bcd60e51b815260040161083290615ba3565b808210613a0c5780613a0e565b815b945050505b613a1e83838a6131f5565b9450613a2b83828a6131f5565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff1691839150600090613a8457634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110613ac157634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613b0790859060040161597c565b60006040518083038186803b158015613b1f57600080fd5b505afa158015613b33573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613b5b919081019061537e565b5090508051600214613b9b5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610832565b6098548151600091829163ffffffff90911660060b9084908390613bcf57634e487b7160e01b600052603260045260246000fd5b602002602001015184600181518110613bf857634e487b7160e01b600052603260045260246000fd5b60200260200101510360060b81613c1f57634e487b7160e01b600052601260045260246000fd5b059050613c2e8160020b61324c565b6097549092506000915061271090613c5190600160f01b900461ffff1684615cf5565b613c5b9190615cbb565b90508415613ca357613c6d8183615da5565b6001600160a01b0316866001600160a01b03161015613c9e5760405162461bcd60e51b815260040161083290615b1d565b613cde565b613cad8183615c81565b6001600160a01b0316866001600160a01b03161115613cde5760405162461bcd60e51b815260040161083290615b1d565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613d1f9030906004016158ef565b60206040518083038186803b158015613d3757600080fd5b505afa158015613d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d6f9190615876565b613d799190615dc5565b613d839190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613dbf9030906004016158ef565b60206040518083038186803b158015613dd757600080fd5b505afa158015613deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0f9190615876565b613e199190615dc5565b613e239190615dc5565b6097549091506000908190613e4e90600160a01b8104600290810b91600160b81b9004900b8c61282c565b935093505050613e5e8282612bb9565b613e688282612c92565b6040519193509150600080516020615fa483398151915290613e8d9084908490615bfa565b60405180910390a1613e9f8483615ca3565b9150613eab8382615ca3565b609e549091506001600160a01b038681169116141561405657609754869061271090613ee290600160d01b900461ffff1685615d24565b613eec9190615ce1565b1015613f0a5760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613f429030906004016158ef565b60206040518083038186803b158015613f5a57600080fd5b505afa158015613f6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f929190615876565b613f9c9190615dc5565b613fa69190615dc5565b613fb09190615dc5565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613feb9030906004016158ef565b60206040518083038186803b15801561400357600080fd5b505afa158015614017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061403b9190615876565b6140459190615dc5565b61404f9190615dc5565b92506141e1565b609f546001600160a01b03868116911614156130385760975486906127109061408a90600160d01b900461ffff1684615d24565b6140949190615ce1565b10156140b25760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a08231906140e89030906004016158ef565b60206040518083038186803b15801561410057600080fd5b505afa158015614114573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141389190615876565b6141429190615dc5565b61414c9190615dc5565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a08231906141879030906004016158ef565b60206040518083038186803b15801561419f57600080fd5b505afa1580156141b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141d79190615876565b61403b9190615dc5565b609754612ee090600160a01b8104600290810b91600160b81b9004900b86868d8d8d612d2d565b600054610100900460ff1680614221575060005460ff16155b61423d5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff1615801561425f576000805461ffff19166101011790555b614267614dc8565b6142718383614e32565b80156130da576000805461ff0019169055505050565b600054610100900460ff16806142a0575060005460ff16155b6142bc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142de576000805461ffff19166101011790555b6142e6614ec7565b80156142f8576000805461ff00191690555b50565b6001600160a01b03821661435b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610832565b6001600160a01b038216600090815260336020526040902054818110156143cf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610832565b6143d98282615dc5565b6001600160a01b03841660009081526033602052604081209190915560358054849290614407908490615dc5565b90915550506040518281526000906001600160a01b03851690600080516020615f8483398151915290602001612342565b600080806000198587098587029250828110838203039150508060001415614472576000841161446757600080fd5b508290049050610855565b80841161447e57600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b60008060008087156146b457609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b815260040160206040518083038186803b15801561454157600080fd5b505afa158015614555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145799190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916145b991600160a01b90910460020b906004016159c6565b6101006040518083038186803b1580156145d257600080fd5b505afa1580156145e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061460a91906155f6565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba93955061465394600160b81b90910460020b935060040191506159c69050565b6101006040518083038186803b15801561466c57600080fd5b505afa158015614680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146a491906155f6565b5093975061486f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b815260040160206040518083038186803b15801561470257600080fd5b505afa158015614716573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061473a9190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161477a91600160a01b90910460020b906004016159c6565b6101006040518083038186803b15801561479357600080fd5b505afa1580156147a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147cb91906155f6565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506148139450600160b81b900460020b9260040191506159c69050565b6101006040518083038186803b15801561482c57600080fd5b505afa158015614840573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061486491906155f6565b509297505050505050505b6000609760149054906101000a900460020b60020b8760020b12614894575082614899565b508281035b6000609760179054906101000a900460020b60020b8860020b12156148bf5750826148c4565b508282035b8183038190036148e46001600160801b0389168b8303600160801b614438565b9b9a5050505050505050505050565b6000600160ff1b82106136c35760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610832565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c4016040805180830381600087803b1580156149c957600080fd5b505af11580156149dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a0191906154c4565b9150915081614a0f8a6148f3565b614a199190615d43565b935080614a25896148f3565b614a2f9190615d43565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015614a8157600080fd5b505afa158015614a95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ab99190615734565b50505050505090506000614ae682614ad38f60020b61324c565b614adf8f60020b61324c565b898961379a565b90506001600160801b03811615614b9257609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b8152600401614b3e9493929190615903565b6040805180830381600087803b158015614b5757600080fd5b505af1158015614b6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b8f91906154c4565b50505b5050505097509795505050505050565b6000614bf7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614f379092919063ffffffff16565b8051909150156130da5780806020019051810190614c159190615441565b6130da5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610832565b6000826001600160a01b0316846001600160a01b03161115614c94579192915b6001600160a01b038416614cd4600160601b600160e01b03606085901b16614cbc8787615da5565b6001600160a01b0316866001600160a01b0316614438565b6136569190615ce1565b6000826001600160a01b0316846001600160a01b03161115614cfe579192915b6136566001600160801b038316614d158686615da5565b6001600160a01b0316600160601b614438565b6000826001600160a01b0316846001600160a01b03161115614d48579192915b6000614d6b856001600160a01b0316856001600160a01b0316600160601b614438565b9050613243614d8d8483614d7f8989615da5565b6001600160a01b0316614438565b614f46565b6000826001600160a01b0316846001600160a01b03161115614db2579192915b613656614d8d83600160601b614d7f8888615da5565b600054610100900460ff1680614de1575060005460ff16155b614dfd5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142e6576000805461ffff191661010117905580156142f8576000805461ff001916905550565b600054610100900460ff1680614e4b575060005460ff16155b614e675760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614e89576000805461ffff19166101011790555b8251614e9c9060369060208601906150c2565b508151614eb09060379060208501906150c2565b5080156130da576000805461ff0019169055505050565b600054610100900460ff1680614ee0575060005460ff16155b614efc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614f1e576000805461ffff19166101011790555b600160655580156142f8576000805461ff001916905550565b60606136568484600085614f61565b806001600160801b0381168114614f5c57600080fd5b919050565b606082471015614fc25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610832565b843b6150105760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610832565b600080866001600160a01b0316858760405161502c91906158d3565b60006040518083038185875af1925050503d8060008114615069576040519150601f19603f3d011682016040523d82523d6000602084013e61506e565b606091505b509150915061507e828286615089565b979650505050505050565b60608315615098575081610855565b8251156150a85782518084602001fd5b8160405162461bcd60e51b81526004016108329190615a02565b8280546150ce90615e08565b90600052602060002090601f0160209004810192826150f05760008555615136565b82601f1061510957805160ff1916838001178555615136565b82800160010185558215615136579182015b8281111561513657825182559160200191906001019061511b565b506136c39291505b808211156136c3576000815560010161513e565b600082601f830112615162578081fd5b8151602061517761517283615c38565b615c08565b80838252828201915082860187848660051b8901011115615196578586fd5b855b858110156151bd5781516151ab81615eef565b84529284019290840190600101615198565b5090979650505050505050565b60008083601f8401126151db578182fd5b5081356001600160401b038111156151f1578182fd5b60208301915083602082850101111561520957600080fd5b9250929050565b8051600681900b8114614f5c57600080fd5b600082601f830112615232578081fd5b81356001600160401b0381111561524b5761524b615ed9565b61525e601f8201601f1916602001615c08565b818152846020838601011115615272578283fd5b816020850160208301379081016020019190915292915050565b80516001600160801b0381168114614f5c57600080fd5b6000602082840312156152b4578081fd5b813561085581615eef565b6000602082840312156152d0578081fd5b815161085581615eef565b600080604083850312156152ed578081fd5b82356152f881615eef565b9150602083013561530881615eef565b809150509250929050565b600080600060608486031215615327578081fd5b833561533281615eef565b9250602084013561534281615eef565b929592945050506040919091013590565b60008060408385031215615365578182fd5b823561537081615eef565b946020939093013593505050565b60008060408385031215615390578182fd5b82516001600160401b03808211156153a6578384fd5b818501915085601f8301126153b9578384fd5b815160206153c961517283615c38565b8083825282820191508286018a848660051b89010111156153e8578889fd5b8896505b84871015615411576153fd81615210565b8352600196909601959183019183016153ec565b509188015191965090935050508082111561542a578283fd5b5061543785828601615152565b9150509250929050565b600060208284031215615452578081fd5b815161085581615f04565b600080600080600060a08688031215615474578283fd5b853561547f81615f12565b9450602086013561548f81615f12565b9350604086013561549f81615eef565b92506060860135915060808601356154b681615f04565b809150509295509295909350565b600080604083850312156154d6578182fd5b505080516020909101519092909150565b600080600080606085870312156154fc578182fd5b843593506020850135925060408501356001600160401b0381111561551f578283fd5b61552b878288016151ca565b95989497509550505050565b600080600080600080600060e0888a031215615551578485fd5b87356001600160401b0380821115615567578687fd5b6155738b838c01615222565b985060208a0135915080821115615588578687fd5b506155958a828b01615222565b96505060408801356155a681615eef565b945060608801356155b681615f21565b935060808801356155c681615f12565b925060a08801356155d681615f12565b915060c08801356155e681615eef565b8091505092959891949750929550565b600080600080600080600080610100898b031215615612578182fd5b61561b8961528c565b9750602089015180600f0b8114615630578283fd5b60408a015160608b01519198509650945061564d60808a01615210565b935060a089015161565d81615eef565b60c08a015190935061566e81615f31565b60e08a015190925061567f81615f04565b809150509295985092959890939650565b600080604083850312156156a2578182fd5b6156ab8361528c565b91506156b96020840161528c565b90509250929050565b600080600080600060a086880312156156d9578283fd5b6156e28661528c565b945060208601519350604086015192506156fe6060870161528c565b915061570c6080870161528c565b90509295509295909350565b600060208284031215615729578081fd5b813561085581615f21565b600080600080600080600060e0888a03121561574e578081fd5b875161575981615eef565b602089015190975061576a81615f12565b604089015190965061577b81615f21565b606089015190955061578c81615f21565b608089015190945061579d81615f21565b60a089015190935060ff811681146157b3578182fd5b60c08901519092506155e681615f04565b600080600080600060a086880312156157db578283fd5b85356157e681615eef565b94506020860135935060408601356157fd81615f04565b92506060860135915060808601356154b681615eef565b600080600080600060a0868803121561582b578283fd5b853561583681615f21565b9450602086013561584681615f21565b9350604086013561585681615f21565b9250606086013561586681615f31565b915060808601356154b681615eef565b600060208284031215615887578081fd5b5051919050565b600080604083850312156158a0578182fd5b82359150602083013561530881615eef565b600080604083850312156158c4578182fd5b50508035926020909101359150565b600082516158e5818460208701615ddc565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b6020808252825182820181905260009190848201906040850190845b818110156159ba57835163ffffffff1683529284019291840191600101615998565b50909695505050505050565b60029190910b815260200190565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b6020815260008251806020840152615a21816040850160208701615ddc565b601f01601f19169190910160400192915050565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252600490820152636d42505360e01b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260089082015267686967682066656560c01b604082015260600190565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b60208082526003908201526242505360e81b604082015260600190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b918252602082015260400190565b604051601f8201601f191681016001600160401b0381118282101715615c3057615c30615ed9565b604052919050565b60006001600160401b03821115615c5157615c51615ed9565b5060051b60200190565b600061ffff808316818516808303821115615c7857615c78615ead565b01949350505050565b60006001600160a01b03828116848216808303821115615c7857615c78615ead565b60008219821115615cb657615cb6615ead565b500190565b60006001600160a01b0383811680615cd557615cd5615ec3565b92169190910492915050565b600082615cf057615cf0615ec3565b500490565b60006001600160a01b0382811684821681151582840482111615615d1b57615d1b615ead565b02949350505050565b6000816000190483118215151615615d3e57615d3e615ead565b500290565b60008083128015600160ff1b850184121615615d6157615d61615ead565b6001600160ff1b0384018313811615615d7c57615d7c615ead565b50500390565b600061ffff83811690831681811015615d9d57615d9d615ead565b039392505050565b60006001600160a01b0383811690831681811015615d9d57615d9d615ead565b600082821015615dd757615dd7615ead565b500390565b60005b83811015615df7578181015183820152602001615ddf565b83811115610e875750506000910152565b600181811c90821680615e1c57607f821691505b60208210811415615e3d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615e5757615e57615ead565b5060010190565b600082615e6d57615e6d615ec3565b500690565b60008160020b627fffff19811415615e8c57615e8c615ead565b9003919050565b6000600160ff1b821415615ea957615ea9615ead565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146142f857600080fd5b80151581146142f857600080fd5b8060020b81146142f857600080fd5b61ffff811681146142f857600080fd5b63ffffffff811681146142f857600080fdfec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a26469706673582212200d68bbc56177fb98dc03b8435a294744f29eb4d74dbc9371fa03141fd2efac7464736f6c63430008040033", - "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}." - }, - "burn(uint256,address)": { - "params": { - "burnAmount": "The number of G-UNI tokens to burn", - "receiver": "The account to receive the underlying amounts of token0 and token1" - }, - "returns": { - "amount0": "amount of token0 transferred to receiver for burning `burnAmount`", - "amount1": "amount of token1 transferred to receiver for burning `burnAmount`", - "liquidityBurned": "amount of liquidity removed from the underlying Uniswap V3 position" - } - }, - "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 this function is overridden; 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`." - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "details": "When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.", - "params": { - "newLowerTick": "The new lower bound of the position's range", - "newUpperTick": "The new upper bound of the position's range", - "swapAmountBPS": "amount of token to swap as proportion of total. Pass 0 to ignore swap.", - "swapThresholdPrice": "slippage parameter on the swap as a max or min sqrtPriceX96", - "zeroForOne": "Which token to input into the swap (true = token0, false = token1)" - } - }, - "getMintAmounts(uint256,uint256)": { - "params": { - "amount0Max": "The maximum amount of token1 to forward on mint" - }, - "returns": { - "amount0": "actual amount of token0 to forward when minting `mintAmount`", - "amount1": "actual amount of token1 to forward when minting `mintAmount`", - "mintAmount": "maximum number of G-UNI tokens to mint" - } - }, - "getUnderlyingBalances()": { - "returns": { - "amount0Current": "current total underlying balance of token0", - "amount1Current": "current total underlying balance of token1" - } - }, - "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." - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "params": { - "_lowerTick": "initial upperTick (only changeable with executiveRebalance)", - "_managerFeeBPS": "proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION", - "_manager_": "address of manager (ownership can be transferred)", - "_name": "name of G-UNI token", - "_pool": "address of Uniswap V3 pool", - "_symbol": "symbol of G-UNI token" - } - }, - "initializeManagerFee(uint16)": { - "params": { - "_managerFeeBPS": "proportion of fees earned that are credited to manager in Basis Points" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "mint(uint256,address)": { - "details": "to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts", - "params": { - "mintAmount": "The number of G-UNI tokens to mint", - "receiver": "The account to receive the minted tokens" - }, - "returns": { - "amount0": "amount of token0 transferred from msg.sender to mint `mintAmount`", - "amount1": "amount of token1 transferred from msg.sender to mint `mintAmount`", - "liquidityMinted": "amount of liquidity added to the underlying Uniswap V3 position" - } - }, - "name()": { - "details": "Returns the name of the token." - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "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 manager." - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "params": { - "newRebalanceBPS": "controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance", - "newSlippageBPS": "maximum slippage on swaps during gelato rebalance", - "newSlippageInterval": "length of time for TWAP used in computing slippage on swaps", - "newTreasury": "address where managerFee withdrawals are sent", - "newWithdrawBPS": "controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "burn(uint256,address)": { - "notice": "burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens" - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "notice": "Change the range of underlying UniswapV3 position, only manager can call" - }, - "getMintAmounts(uint256,uint256)": { - "notice": "compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`" - }, - "getUnderlyingBalances()": { - "notice": "compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)" - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "notice": "initialize storage variables on a new G-UNI pool, only called once" - }, - "initializeManagerFee(uint16)": { - "notice": "initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again." - }, - "mint(uint256,address)": { - "notice": "mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position" - }, - "rebalance(uint160,uint256,bool,uint256,address)": { - "notice": "Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager." - }, - "uniswapV3MintCallback(uint256,uint256,bytes)": { - "notice": "Uniswap V3 callback fn, called back on pool.mint" - }, - "uniswapV3SwapCallback(int256,int256,bytes)": { - "notice": "Uniswap v3 callback fn, called back on pool.swap" - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "notice": "change configurable parameters, only manager can call" - }, - "withdrawGelatoBalance(uint256,address)": { - "notice": "withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - }, - "withdrawManagerBalance(uint256,address)": { - "notice": "withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 5, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 784, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage" - }, - { - "astId": 122, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_balances", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 128, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_allowances", - "offset": 0, - "slot": "52", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 130, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_totalSupply", - "offset": 0, - "slot": "53", - "type": "t_uint256" - }, - { - "astId": 132, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_name", - "offset": 0, - "slot": "54", - "type": "t_string_storage" - }, - { - "astId": 134, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_symbol", - "offset": 0, - "slot": "55", - "type": "t_string_storage" - }, - { - "astId": 636, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "56", - "type": "t_array(t_uint256)45_storage" - }, - { - "astId": 59, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_status", - "offset": 0, - "slot": "101", - "type": "t_uint256" - }, - { - "astId": 102, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "102", - "type": "t_array(t_uint256)49_storage" - }, - { - "astId": 6441, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_manager", - "offset": 0, - "slot": "151", - "type": "t_address" - }, - { - "astId": 6031, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "lowerTick", - "offset": 20, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6033, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "upperTick", - "offset": 23, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6035, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoRebalanceBPS", - "offset": 26, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6037, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoWithdrawBPS", - "offset": 28, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6039, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageBPS", - "offset": 30, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6041, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageInterval", - "offset": 0, - "slot": "152", - "type": "t_uint32" - }, - { - "astId": 6043, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerFeeBPS", - "offset": 4, - "slot": "152", - "type": "t_uint16" - }, - { - "astId": 6045, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerTreasury", - "offset": 6, - "slot": "152", - "type": "t_address" - }, - { - "astId": 6047, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance0", - "offset": 0, - "slot": "153", - "type": "t_uint256" - }, - { - "astId": 6049, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance1", - "offset": 0, - "slot": "154", - "type": "t_uint256" - }, - { - "astId": 6051, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance0", - "offset": 0, - "slot": "155", - "type": "t_uint256" - }, - { - "astId": 6053, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance1", - "offset": 0, - "slot": "156", - "type": "t_uint256" - }, - { - "astId": 6056, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "pool", - "offset": 0, - "slot": "157", - "type": "t_contract(IUniswapV3Pool)2339" - }, - { - "astId": 6059, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token0", - "offset": 0, - "slot": "158", - "type": "t_contract(IERC20)863" - }, - { - "astId": 6062, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token1", - "offset": 0, - "slot": "159", - "type": "t_contract(IERC20)863" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)45_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)49_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "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)863": { - "encoding": "inplace", - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_contract(IUniswapV3Pool)2339": { - "encoding": "inplace", - "label": "contract IUniswapV3Pool", - "numberOfBytes": "20" - }, - "t_int24": { - "encoding": "inplace", - "label": "int24", - "numberOfBytes": "3" - }, - "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_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} diff --git a/lib/g-uni-v1-core/deployments/optimism/solcInputs/5b7722421ca04d0a130cd8a2a08f9ec3.json b/lib/g-uni-v1-core/deployments/optimism/solcInputs/5b7722421ca04d0a130cd8a2a08f9ec3.json deleted file mode 100644 index fe2c0f2c9..000000000 --- a/lib/g-uni-v1-core/deployments/optimism/solcInputs/5b7722421ca04d0a130cd8a2a08f9ec3.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 250;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n event SetManagerFee(uint16 managerFee);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n emit SetManagerFee(_managerFeeBPS);\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.4;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidityBefore,\n uint128 liquidityAfter\n );\n\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n SafeCast.toUint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidityBurned);\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n\n amount0 =\n burn0 +\n FullMath.mulDiv(\n token0.balanceOf(address(this)) -\n burn0 -\n managerBalance0 -\n gelatoBalance0,\n burnAmount,\n totalSupply\n );\n amount1 =\n burn1 +\n FullMath.mulDiv(\n token1.balanceOf(address(this)) -\n burn1 -\n managerBalance1 -\n gelatoBalance1,\n burnAmount,\n totalSupply\n );\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n // solhint-disable-next-line function-max-lines\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n uint128 liquidity;\n uint128 newLiquidity;\n if (totalSupply() > 0) {\n (liquidity, , , , ) = pool.positions(_getPositionID());\n if (liquidity > 0) {\n (, , uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n }\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > 0, \"new position 0\");\n } else {\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n }\n\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n _rebalance(\n liquidity,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > liquidity, \"liquidity must increase\");\n\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\n external\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n // solhint-disable-next-line function-max-lines\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\n internal\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint128 liquidity,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n uint256 leftover0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 leftover1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n (, , uint256 feesEarned0, uint256 feesEarned1) =\n _withdraw(lowerTick, upperTick, liquidity);\n _applyFees(feesEarned0, feesEarned1);\n (feesEarned0, feesEarned1) = _subtractAdminFees(\n feesEarned0,\n feesEarned1\n );\n emit FeesEarned(feesEarned0, feesEarned1);\n feesEarned0 += leftover0;\n feesEarned1 += leftover1;\n\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n leftover0,\n leftover1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdraw(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n )\n private\n returns (\n uint256 burn0,\n uint256 burn1,\n uint256 fee0,\n uint256 fee1\n )\n {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n SafeCast.toInt256(\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\n );\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array len\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"high slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"high slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\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 require(value < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return uint128(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 require(value < 2**64, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return uint64(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 require(value < 2**32, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return uint32(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 require(value < 2**16, \"SafeCast: value doesn\\'t fit in 16 bits\");\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 require(value < 2**8, \"SafeCast: value doesn\\'t fit in 8 bits\");\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 require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= -2**127 && value < 2**127, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return int128(value);\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= -2**63 && value < 2**63, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return int64(value);\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= -2**31 && value < 2**31, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return int32(value);\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= -2**15 && value < 2**15, \"SafeCast: value doesn\\'t fit in 16 bits\");\n return int16(value);\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= -2**7 && value < 2**7, \"SafeCast: value doesn\\'t fit in 8 bits\");\n return int8(value);\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 require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IUniswapV3TickSpacing} from \"./interfaces/IUniswapV3TickSpacing.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n }\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n 0,\n lowerTick,\n upperTick,\n address(0)\n );\n }\n\n function _createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n address manager\n ) internal returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory name = \"Gelato Uniswap LP\";\n try this.getTokenName(token0, token1) returns (string memory result) {\n name = result;\n } catch {} // solhint-disable-line no-empty-blocks\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n require(uniPool != address(0), \"uniswap pool does not exist\");\n require(\n _validateTickSpacing(uniPool, lowerTick, upperTick),\n \"tickSpacing mismatch\"\n );\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n manager\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, manager, pool);\n }\n\n function _validateTickSpacing(\n address uniPool,\n int24 lowerTick,\n int24 upperTick\n ) internal view returns (bool) {\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\n return\n lowerTick < upperTick &&\n lowerTick % spacing == 0 &&\n upperTick % spacing == 0;\n }\n\n function getTokenName(address token0, address token1)\n external\n view\n returns (string memory)\n {\n string memory symbol0 = IERC20Metadata(token0).symbol();\n string memory symbol1 = IERC20Metadata(token1).symbol();\n\n return _append(\"Gelato Uniswap \", symbol0, \"/\", symbol1, \" LP\");\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IUniswapV3TickSpacing.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IUniswapV3TickSpacing {\n function tickSpacing() external view returns (int24);\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": ["ast"] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} diff --git a/lib/g-uni-v1-core/deployments/polygon/.chainId b/lib/g-uni-v1-core/deployments/polygon/.chainId deleted file mode 100644 index 0973804c4..000000000 --- a/lib/g-uni-v1-core/deployments/polygon/.chainId +++ /dev/null @@ -1 +0,0 @@ -137 \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/polygon/GUniFactory.json b/lib/g-uni-v1-core/deployments/polygon/GUniFactory.json deleted file mode 100644 index f4722b1e1..000000000 --- a/lib/g-uni-v1-core/deployments/polygon/GUniFactory.json +++ /dev/null @@ -1,736 +0,0 @@ -{ - "address": "0x37265A834e95D11c36527451c7844eF346dC342a", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - } - ], - "transactionHash": "0x1d83eb9d3f492db769ae53cbd5ff25ac56d319d639f4692ac493c98dfb762856", - "receipt": { - "to": null, - "from": "0x88215a2794ddC031439C72922EC8983bDE831c78", - "contractAddress": "0x37265A834e95D11c36527451c7844eF346dC342a", - "transactionIndex": 29, - "gasUsed": "554844", - "logsBloom": "0x40100000000020000000000000000000000000000820000000000020000000000000000000000000000400000001000010008000000000000000000000000000000004100000000000000000000800800004000000000000000100000010000000000000020000000000000000000800000000000000000080000000000000000000000000000000800000000000000000000000000000000000000000000000200000000044000000000000000200000000000000000000000000000000004000000000000000000001000000000010000000000000000000100000004020000000000000000000000400000000000000000000000000000000000000100000", - "blockHash": "0xa6612969aff697c0aa435d3f074dbd27eecee86098411de26b31376bb85360e6", - "transactionHash": "0x1d83eb9d3f492db769ae53cbd5ff25ac56d319d639f4692ac493c98dfb762856", - "logs": [ - { - "transactionIndex": 29, - "blockNumber": 22840132, - "transactionHash": "0x1d83eb9d3f492db769ae53cbd5ff25ac56d319d639f4692ac493c98dfb762856", - "address": "0x37265A834e95D11c36527451c7844eF346dC342a", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000033f054051f2cd19fd53eaf33e33f7faad7c15e86" - ], - "data": "0x", - "logIndex": 215, - "blockHash": "0xa6612969aff697c0aa435d3f074dbd27eecee86098411de26b31376bb85360e6" - }, - { - "transactionIndex": 29, - "blockNumber": 22840132, - "transactionHash": "0x1d83eb9d3f492db769ae53cbd5ff25ac56d319d639f4692ac493c98dfb762856", - "address": "0x37265A834e95D11c36527451c7844eF346dC342a", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000002864b9a53fd250900ba74de507a56503c3dc90b" - ], - "data": "0x", - "logIndex": 216, - "blockHash": "0xa6612969aff697c0aa435d3f074dbd27eecee86098411de26b31376bb85360e6" - }, - { - "transactionIndex": 29, - "blockNumber": 22840132, - "transactionHash": "0x1d83eb9d3f492db769ae53cbd5ff25ac56d319d639f4692ac493c98dfb762856", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x00000000000000000000000088215a2794ddc031439c72922ec8983bde831c78", - "0x0000000000000000000000007b5000af8ab69fd59eb0d4f5762bff57c9c04385" - ], - "data": "0x000000000000000000000000000000000000000000000000003d1b75414c680000000000000000000000000000000000000000000000000037a7c767e8eb27000000000000000000000000000000000000000000000000ff9fb5a7760b0e849e000000000000000000000000000000000000000000000000376aabf2a79ebf000000000000000000000000000000000000000000000000ff9ff2c2eb4c5aec9e", - "logIndex": 217, - "blockHash": "0xa6612969aff697c0aa435d3f074dbd27eecee86098411de26b31376bb85360e6" - } - ], - "blockNumber": 22840132, - "cumulativeGasUsed": "7101065", - "status": 1, - "byzantium": true - }, - "args": [ - "0x33F054051f2Cd19fD53EAf33e33f7fAad7c15e86", - "0x02864B9A53fd250900Ba74De507a56503C3DC90b", - "0xc0c53b8b000000000000000000000000d2bb190dd88e7af5df176064ec42f6dfa8672f4000000000000000000000000002864b9a53fd250900ba74de507a56503c3dc90b00000000000000000000000002864b9a53fd250900ba74de507a56503c3dc90b" - ], - "solcInputHash": "5b7722421ca04d0a130cd8a2a08f9ec3", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x4ad41656a53bc38d766197d9974be4be70f506b1d1f78def2c3726e8d580a3f5\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x00dbb59cf486ff9a2930fb588ef70d761dbf439aa05d48ef0001a0448769ec11\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033", - "execute": { - "methodName": "initialize", - "args": [ - "0xd2Bb190dD88e7Af5DF176064Ec42f6dfA8672F40", - "0x02864B9A53fd250900Ba74De507a56503C3DC90b", - "0x02864B9A53fd250900Ba74De507a56503C3DC90b" - ] - }, - "implementation": "0x33F054051f2Cd19fD53EAf33e33f7fAad7c15e86", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} diff --git a/lib/g-uni-v1-core/deployments/polygon/GUniFactory_Implementation.json b/lib/g-uni-v1-core/deployments/polygon/GUniFactory_Implementation.json deleted file mode 100644 index 3e98c2ddd..000000000 --- a/lib/g-uni-v1-core/deployments/polygon/GUniFactory_Implementation.json +++ /dev/null @@ -1,816 +0,0 @@ -{ - "address": "0x33F054051f2Cd19fD53EAf33e33f7fAad7c15e86", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_uniswapV3Factory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createManagedPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getTokenName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x754b44e5b01e505e0f37e24367dfe23a964b3d9f782c838fc6dbf39c339ffde4", - "receipt": { - "to": null, - "from": "0x88215a2794ddC031439C72922EC8983bDE831c78", - "contractAddress": "0x33F054051f2Cd19fD53EAf33e33f7fAad7c15e86", - "transactionIndex": 84, - "gasUsed": "2234889", - "logsBloom": "0x00000000000000000000000000000000000000000820000000000000000000000000000000000000000000000000000000008000000000000000000000000000000004000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000800000000000000000000000000000000000000000000000200000000004000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000100000004000000000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x9705374512ded2739e5869e23a5f551a232cd3ef327f4ce73839af57d9b8fb3f", - "transactionHash": "0x754b44e5b01e505e0f37e24367dfe23a964b3d9f782c838fc6dbf39c339ffde4", - "logs": [ - { - "transactionIndex": 84, - "blockNumber": 22840128, - "transactionHash": "0x754b44e5b01e505e0f37e24367dfe23a964b3d9f782c838fc6dbf39c339ffde4", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x00000000000000000000000088215a2794ddc031439c72922ec8983bde831c78", - "0x0000000000000000000000007b5000af8ab69fd59eb0d4f5762bff57c9c04385" - ], - "data": "0x00000000000000000000000000000000000000000000000000f62335f9ae2600000000000000000000000000000000000000000000000000389dea9de2994d000000000000000000000000000000000000000000000000ff7162501a16c6732c00000000000000000000000000000000000000000000000037a7c767e8eb27000000000000000000000000000000000000000000000000ff725873501074992c", - "logIndex": 422, - "blockHash": "0x9705374512ded2739e5869e23a5f551a232cd3ef327f4ce73839af57d9b8fb3f" - } - ], - "blockNumber": 22840128, - "cumulativeGasUsed": "18939225", - "status": 1, - "byzantium": true - }, - "args": ["0x1F98431c8aD98523631AE4a59f267346ea31F984"], - "solcInputHash": "5b7722421ca04d0a130cd8a2a08f9ec3", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_uniswapV3Factory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"uniPool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previosGelatoDeployer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newGelatoDeployer\",\"type\":\"address\"}],\"name\":\"UpdateGelatoDeployer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"UpdatePoolImplementation\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createManagedPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDeployers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGelatoPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"getTokenName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gelatoDeployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isPoolImmutable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"makePoolsImmutable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numDeployers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextGelatoDeployer\",\"type\":\"address\"}],\"name\":\"setGelatoDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextImplementation\",\"type\":\"address\"}],\"name\":\"setPoolImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"upgradePools\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"bytes[]\",\"name\":\"datas\",\"type\":\"bytes[]\"}],\"name\":\"upgradePoolsAndCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"managerFee\":\"proportion of earned fees that go to pool manager in Basis Points\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"createPool(address,address,uint24,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"getDeployers()\":{\"returns\":{\"_0\":\"deployers the list of deployer addresses\"}},\"getGelatoPools()\":{\"returns\":{\"_0\":\"list of Gelato managed G-UNI pool addresses\"}},\"getPools(address)\":{\"params\":{\"deployer\":\"address that has potentially deployed G-UNI pools (can return empty array)\"},\"returns\":{\"_0\":\"pools the list of G-UNI pool addresses deployed by `deployer`\"}},\"getProxyAdmin(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"address that controls the G-UNI implementation (has power to upgrade it)\"}},\"isPoolImmutable(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"bool signaling if pool is immutable (true) or not (false)\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"numDeployers()\":{\"returns\":{\"_0\":\"total number of G-UNI pool deployer addresses\"}},\"numPools()\":{\"returns\":{\"result\":\"total number of G-UNI pools deployed\"}},\"numPools(address)\":{\"params\":{\"deployer\":\"deployer address\"},\"returns\":{\"_0\":\"total number of G-UNI pools deployed by `deployer`\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"createManagedPool(address,address,uint24,uint16,int24,int24)\":{\"notice\":\"createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`\"},\"createPool(address,address,uint24,int24,int24)\":{\"notice\":\"createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`\"},\"getDeployers()\":{\"notice\":\"getDeployers fetches all addresses that have deployed a G-UNI pool\"},\"getGelatoPools()\":{\"notice\":\"getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)\"},\"getPools(address)\":{\"notice\":\"getPools fetches all the G-UNI pool addresses deployed by `deployer`\"},\"getProxyAdmin(address)\":{\"notice\":\"getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address).\"},\"isPoolImmutable(address)\":{\"notice\":\"isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\"},\"numDeployers()\":{\"notice\":\"numDeployers counts the total number of G-UNI pool deployer addresses\"},\"numPools()\":{\"notice\":\"numPools counts the total number of G-UNI pools in existence\"},\"numPools(address)\":{\"notice\":\"numPools counts the total number of G-UNI pools deployed by `deployer`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniFactory.sol\":\"GUniFactory\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\\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\":\"0x4878ef6c288f4cef3c2a288d32cc548c648831cc55503ad3d9a581ed3b93aad9\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title The interface for the Uniswap V3 Factory\\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\\ninterface IUniswapV3Factory {\\n /// @notice Emitted when the owner of the factory is changed\\n /// @param oldOwner The owner before the owner was changed\\n /// @param newOwner The owner after the owner was changed\\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\\n\\n /// @notice Emitted when a pool is created\\n /// @param token0 The first token of the pool by address sort order\\n /// @param token1 The second token of the pool by address sort order\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks\\n /// @param pool The address of the created pool\\n event PoolCreated(\\n address indexed token0,\\n address indexed token1,\\n uint24 indexed fee,\\n int24 tickSpacing,\\n address pool\\n );\\n\\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\\n /// @param fee The enabled fee, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\\n\\n /// @notice Returns the current owner of the factory\\n /// @dev Can be changed by the current owner via setOwner\\n /// @return The address of the factory owner\\n function owner() external view returns (address);\\n\\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\\n /// @return The tick spacing\\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\\n\\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\\n /// @param tokenA The contract address of either token0 or token1\\n /// @param tokenB The contract address of the other token\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @return pool The pool address\\n function getPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external view returns (address pool);\\n\\n /// @notice Creates a pool for the given two tokens and fee\\n /// @param tokenA One of the two tokens in the desired pool\\n /// @param tokenB The other of the two tokens in the desired pool\\n /// @param fee The desired fee for the pool\\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\\n /// are invalid.\\n /// @return pool The address of the newly created pool\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external returns (address pool);\\n\\n /// @notice Updates the owner of the factory\\n /// @dev Must be called by the current owner\\n /// @param _owner The new owner of the factory\\n function setOwner(address _owner) external;\\n\\n /// @notice Enables a fee amount with the given tickSpacing\\n /// @dev Fee amounts may never be removed once enabled\\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\\n}\\n\",\"keccak256\":\"0xcc3d0c93fc9ac0febbe09f941b465b57f750bcf3b48432da0b97dc289cfdc489\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\nimport {\\n IUniswapV3Factory\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\\\";\\nimport {IUniswapV3TickSpacing} from \\\"./interfaces/IUniswapV3TickSpacing.sol\\\";\\nimport {IGUniFactory} from \\\"./interfaces/IGUniFactory.sol\\\";\\nimport {IGUniPoolStorage} from \\\"./interfaces/IGUniPoolStorage.sol\\\";\\nimport {GUniFactoryStorage} from \\\"./abstract/GUniFactoryStorage.sol\\\";\\nimport {EIP173Proxy} from \\\"./vendor/proxy/EIP173Proxy.sol\\\";\\nimport {IEIP173Proxy} from \\\"./interfaces/IEIP173Proxy.sol\\\";\\nimport {\\n IERC20Metadata\\n} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n constructor(address _uniswapV3Factory)\\n GUniFactoryStorage(_uniswapV3Factory)\\n {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n managerFee,\\n lowerTick,\\n upperTick,\\n msg.sender\\n );\\n }\\n\\n /// @notice createPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n return\\n _createPool(\\n tokenA,\\n tokenB,\\n uniFee,\\n 0,\\n lowerTick,\\n upperTick,\\n address(0)\\n );\\n }\\n\\n function _createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick,\\n address manager\\n ) internal returns (address pool) {\\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\\n\\n pool = address(new EIP173Proxy(poolImplementation, address(this), \\\"\\\"));\\n\\n string memory name = \\\"Gelato Uniswap LP\\\";\\n try this.getTokenName(token0, token1) returns (string memory result) {\\n name = result;\\n } catch {} // solhint-disable-line no-empty-blocks\\n\\n address uniPool =\\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\\n require(uniPool != address(0), \\\"uniswap pool does not exist\\\");\\n require(\\n _validateTickSpacing(uniPool, lowerTick, upperTick),\\n \\\"tickSpacing mismatch\\\"\\n );\\n\\n IGUniPoolStorage(pool).initialize(\\n name,\\n \\\"G-UNI\\\",\\n uniPool,\\n managerFee,\\n lowerTick,\\n upperTick,\\n manager\\n );\\n _deployers.add(msg.sender);\\n _pools[msg.sender].add(pool);\\n emit PoolCreated(uniPool, manager, pool);\\n }\\n\\n function _validateTickSpacing(\\n address uniPool,\\n int24 lowerTick,\\n int24 upperTick\\n ) internal view returns (bool) {\\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\\n return\\n lowerTick < upperTick &&\\n lowerTick % spacing == 0 &&\\n upperTick % spacing == 0;\\n }\\n\\n function getTokenName(address token0, address token1)\\n external\\n view\\n returns (string memory)\\n {\\n string memory symbol0 = IERC20Metadata(token0).symbol();\\n string memory symbol1 = IERC20Metadata(token1).symbol();\\n\\n return _append(\\\"Gelato Uniswap \\\", symbol0, \\\"/\\\", symbol1, \\\" LP\\\");\\n }\\n\\n function upgradePools(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\\n }\\n }\\n\\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\\n external\\n onlyManager\\n {\\n require(pools.length == datas.length, \\\"mismatching array length\\\");\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeToAndCall(\\n poolImplementation,\\n datas[i]\\n );\\n }\\n }\\n\\n function makePoolsImmutable(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\\n }\\n }\\n\\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the\\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\\n /// @param pool address of the G-UNI pool\\n /// @return bool signaling if pool is immutable (true) or not (false)\\n function isPoolImmutable(address pool) external view returns (bool) {\\n return address(0) == getProxyAdmin(pool);\\n }\\n\\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\\n /// @return list of Gelato managed G-UNI pool addresses\\n function getGelatoPools() external view returns (address[] memory) {\\n return getPools(gelatoDeployer);\\n }\\n\\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\\n /// @return deployers the list of deployer addresses\\n function getDeployers() public view returns (address[] memory) {\\n uint256 length = numDeployers();\\n address[] memory deployers = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n deployers[i] = _getDeployer(i);\\n }\\n\\n return deployers;\\n }\\n\\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\\n function getPools(address deployer) public view returns (address[] memory) {\\n uint256 length = numPools(deployer);\\n address[] memory pools = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n pools[i] = _getPool(deployer, i);\\n }\\n\\n return pools;\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools in existence\\n /// @return result total number of G-UNI pools deployed\\n function numPools() public view returns (uint256 result) {\\n address[] memory deployers = getDeployers();\\n for (uint256 i = 0; i < deployers.length; i++) {\\n result += numPools(deployers[i]);\\n }\\n }\\n\\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\\n /// @return total number of G-UNI pool deployer addresses\\n function numDeployers() public view returns (uint256) {\\n return _deployers.length();\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\\n /// @param deployer deployer address\\n /// @return total number of G-UNI pools deployed by `deployer`\\n function numPools(address deployer) public view returns (uint256) {\\n return _pools[deployer].length();\\n }\\n\\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\\n /// no longer upgradable (no one owns the zero address).\\n /// @param pool address of the G-UNI pool\\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\\n function getProxyAdmin(address pool) public view returns (address) {\\n return IEIP173Proxy(pool).proxyAdmin();\\n }\\n\\n function _getDeployer(uint256 index) internal view returns (address) {\\n return _deployers.at(index);\\n }\\n\\n function _getPool(address deployer, uint256 index)\\n internal\\n view\\n returns (address)\\n {\\n return _pools[deployer].at(index);\\n }\\n\\n function _getTokenOrder(address tokenA, address tokenB)\\n internal\\n pure\\n returns (address token0, address token1)\\n {\\n require(tokenA != tokenB, \\\"same token\\\");\\n (token0, token1) = tokenA < tokenB\\n ? (tokenA, tokenB)\\n : (tokenB, tokenA);\\n require(token0 != address(0), \\\"no address zero\\\");\\n }\\n\\n function _append(\\n string memory a,\\n string memory b,\\n string memory c,\\n string memory d,\\n string memory e\\n ) internal pure returns (string memory) {\\n return string(abi.encodePacked(a, b, c, d, e));\\n }\\n}\\n\",\"keccak256\":\"0x476238c3222674c2c192a71fed95dbf9a54ac2b0f09867b7dbae7cd56bc52942\",\"license\":\"MIT\"},\"contracts/abstract/GUniFactoryStorage.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n Initializable\\n} from \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\n// solhint-disable-next-line max-states-count\\ncontract GUniFactoryStorage is\\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\\n Initializable\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n address public immutable factory;\\n address public poolImplementation;\\n address public gelatoDeployer;\\n EnumerableSet.AddressSet internal _deployers;\\n mapping(address => EnumerableSet.AddressSet) internal _pools;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdatePoolImplementation(\\n address previousImplementation,\\n address newImplementation\\n );\\n\\n event UpdateGelatoDeployer(\\n address previosGelatoDeployer,\\n address newGelatoDeployer\\n );\\n\\n constructor(address _uniswapV3Factory) {\\n factory = _uniswapV3Factory;\\n }\\n\\n function initialize(\\n address _implementation,\\n address _gelatoDeployer,\\n address _manager_\\n ) external initializer {\\n poolImplementation = _implementation;\\n gelatoDeployer = _gelatoDeployer;\\n _manager = _manager_;\\n }\\n\\n function setPoolImplementation(address nextImplementation)\\n external\\n onlyManager\\n {\\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\\n poolImplementation = nextImplementation;\\n }\\n\\n function setGelatoDeployer(address nextGelatoDeployer)\\n external\\n onlyManager\\n {\\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\\n gelatoDeployer = nextGelatoDeployer;\\n }\\n}\\n\",\"keccak256\":\"0x81b65c0b1c660c0935d6c40310b19e62df7fdd7c0af94915afcc600bdb647fb0\",\"license\":\"MIT\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.4;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x81d888640e2261ac5189e6061a0cf4a7f3cec5994be1859ba60ffeb961f70c01\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IEIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\ninterface IEIP173Proxy {\\n function proxyAdmin() external view returns (address);\\n\\n function transferProxyAdmin(address newAdmin) external;\\n\\n function upgradeTo(address newImplementation) external;\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable;\\n}\\n\",\"keccak256\":\"0x3ff5ed428adeaaa9ba05a91b4ccec7df22cd5de80a53a7bff109543bdebe1a68\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IGUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\ninterface IGUniFactory {\\n event PoolCreated(\\n address indexed uniPool,\\n address indexed manager,\\n address indexed pool\\n );\\n\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n\\n function createManagedPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n}\\n\",\"keccak256\":\"0xd284f6caaca9268dbe508b0ceae918eedcf96d3a7beee2b19f3b57e732deba66\",\"license\":\"MIT\"},\"contracts/interfaces/IGUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\ninterface IGUniPoolStorage {\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external;\\n}\\n\",\"keccak256\":\"0x39f4bc4e8684c9674e1967a3ac4ea5531f45492266586c4e6e9eb2f6d9108ced\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IUniswapV3TickSpacing.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\ninterface IUniswapV3TickSpacing {\\n function tickSpacing() external view returns (int24);\\n}\\n\",\"keccak256\":\"0x3fa60458d5f66e28118c971b0bcf2d2ef25d28383f1ce94f2f1d4c02643cd7af\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x4ad41656a53bc38d766197d9974be4be70f506b1d1f78def2c3726e8d580a3f5\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x00dbb59cf486ff9a2930fb588ef70d761dbf439aa05d48ef0001a0448769ec11\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b5060405161281e38038061281e83398101604081905261002f91610044565b60601b6001600160601b031916608052610072565b600060208284031215610055578081fd5b81516001600160a01b038116811461006b578182fd5b9392505050565b60805160601c6127876100976000396000818161031201526110e201526127876000f3fe60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e6200015836600462001692565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e366004620018a6565b62000448565b6200015e620001a536600462001868565b620005c8565b6200016a620006ae565b6200015e620001c636600462001868565b62000725565b6200016a620001dd36600462001692565b6200080f565b620001ed62000838565b60405162000174919062001a9d565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001b5a565b6200023a62000847565b60405162000174919062001b0b565b6200023a6200025a36600462001692565b6200085c565b6200023a62000931565b6200015e62000a03565b620001ed62000285366004620017d7565b62000a70565b600254620001ed906001600160a01b031681565b620002b6620002b036600462001692565b62000a8e565b604051901515815260200162000174565b620001ed620002d83660046200175e565b62000aab565b62000221620002ef366004620016d0565b62000aca565b6200015e620003063660046200170d565b62000c39565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e6200035936600462001692565b62000d43565b6200015e6200037036600462001692565b62000de2565b620001ed6200038736600462001692565b62000ec9565b336200039862000838565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001be4565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b0390911690849062001ab1565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000f40565b905090565b336200045362000838565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001be4565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005c257838181518110620004f757634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200054457634e487b7160e01b600052603260045260246000fd5b905060200281019062000558919062001c26565b6040518463ffffffff1660e01b8152600401620005789392919062001acb565b600060405180830381600087803b1580156200059357600080fd5b505af1158015620005a8573d6000803e3d6000fd5b505050508080620005b99062001cea565b915050620004cc565b50505050565b33620005d362000838565b6001600160a01b031614620005fc5760405162461bcd60e51b8152600401620003c19062001be4565b60005b8151811015620006aa578181815181106200062a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b815260040162000660919062001a9d565b600060405180830381600087803b1580156200067b57600080fd5b505af115801562000690573d6000803e3d6000fd5b505050508080620006a19062001cea565b915050620005ff565b5050565b600080620006bb62000931565b905060005b81518110156200072057620006fd828281518110620006ef57634e487b7160e01b600052603260045260246000fd5b60200260200101516200080f565b62000709908462001ca0565b925080620007178162001cea565b915050620006c0565b505090565b336200073062000838565b6001600160a01b031614620007595760405162461bcd60e51b8152600401620003c19062001be4565b60005b8151811015620006aa578181815181106200078757634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe692620007c59291169060040162001a9d565b600060405180830381600087803b158015620007e057600080fd5b505af1158015620007f5573d6000803e3d6000fd5b505050508080620008069062001cea565b9150506200075c565b6001600160a01b0381166000908152600560205260408120620008329062000f40565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200086b836200080f565b90506000816001600160401b038111156200089657634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015620008c0578160200160208202803683370190505b50905060005b828110156200092957620008db858262000f4b565b828281518110620008fc57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280620009208162001cea565b915050620008c6565b509392505050565b606060006200093f62000435565b90506000816001600160401b038111156200096a57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000994578160200160208202803683370190505b50905060005b82811015620009fc57620009ae8162000f76565b828281518110620009cf57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280620009f38162001cea565b9150506200099a565b5092915050565b3362000a0e62000838565b6001600160a01b03161462000a375760405162461bcd60e51b8152600401620003c19062001be4565b600080546040516001600160a01b039091169060008051602062002732833981519152908390a3600080546001600160a01b0319169055565b600062000a838787878787873362000f85565b979650505050505050565b600062000a9b8262000ec9565b6001600160a01b03161592915050565b600062000ac086868660008787600062000f85565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000b0857600080fd5b505afa15801562000b1d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b47919081019062001960565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000b8557600080fd5b505afa15801562000b9a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000bc4919081019062001960565b905062000c306040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001304565b95945050505050565b600054600160a81b900460ff168062000c5c5750600054600160a01b900460ff16155b62000cc15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000cec576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005c2576000805460ff60a81b1916905550505050565b3362000d4e62000838565b6001600160a01b03161462000d775760405162461bcd60e51b8152600401620003c19062001be4565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000db8916001600160a01b0390911690849062001ab1565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000ded62000838565b6001600160a01b03161462000e165760405162461bcd60e51b8152600401620003c19062001be4565b6001600160a01b03811662000e7f5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200273283398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000f0557600080fd5b505afa15801562000f1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620008329190620016b1565b600062000832825490565b6001600160a01b038216600090815260056020526040812062000f6f90836200133b565b9392505050565b6000620008326003836200133b565b600080600062000f968a8a62001349565b6001546040519294509092506001600160a01b031690309062000fb990620015d5565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000ffc573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb9906200104e908690869060040162001ab1565b60006040518083038186803b1580156200106757600080fd5b505afa9250505080156200109f57506040513d6000823e601f3d908101601f191682016040526200109c919081019062001960565b60015b620010aa57620010ad565b90505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee829060640160206040518083038186803b1580156200112757600080fd5b505afa1580156200113c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011629190620016b1565b90506001600160a01b038116620011ba5760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b620011c781898962001418565b6200120c5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200124490859085908e908e908e908e9060040162001b6f565b600060405180830381600087803b1580156200125f57600080fd5b505af115801562001274573d6000803e3d6000fd5b505050506200128e336003620014d590919063ffffffff16565b50336000908152600560205260409020620012aa9086620014d5565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200132195949392919062001a28565b604051602081830303815290604052905095945050505050565b600062000f6f8383620014ec565b600080826001600160a01b0316846001600160a01b031614156200139d5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620013bf578284620013c2565b83835b90925090506001600160a01b038216620014115760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200145557600080fd5b505afa1580156200146a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001490919062001941565b90508260020b8460020b128015620014b45750620014af818562001d08565b60020b155b801562000c305750620014c8818462001d08565b60020b1595945050505050565b600062000f6f836001600160a01b03841662001583565b815460009082106200154c5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b8260000182815481106200157057634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b6000818152600183016020526040812054620015cc5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000832565b50600062000832565b6109a58062001d8d83390190565b600082601f830112620015f4578081fd5b813560206001600160401b0382111562001612576200161262001d4d565b8160051b6200162382820162001c6d565b8381528281019086840183880185018910156200163e578687fd5b8693505b858410156200166d578035620016588162001d63565b83526001939093019291840191840162001642565b50979650505050505050565b803562ffffff811681146200168d57600080fd5b919050565b600060208284031215620016a4578081fd5b813562000f6f8162001d63565b600060208284031215620016c3578081fd5b815162000f6f8162001d63565b60008060408385031215620016e3578081fd5b8235620016f08162001d63565b91506020830135620017028162001d63565b809150509250929050565b60008060006060848603121562001722578081fd5b83356200172f8162001d63565b92506020840135620017418162001d63565b91506040840135620017538162001d63565b809150509250925092565b600080600080600060a0868803121562001776578081fd5b8535620017838162001d63565b94506020860135620017958162001d63565b9350620017a56040870162001679565b92506060860135620017b78162001d7c565b91506080860135620017c98162001d7c565b809150509295509295909350565b60008060008060008060c08789031215620017f0578081fd5b8635620017fd8162001d63565b955060208701356200180f8162001d63565b94506200181f6040880162001679565b9350606087013561ffff8116811462001836578182fd5b92506080870135620018488162001d7c565b915060a08701356200185a8162001d7c565b809150509295509295509295565b6000602082840312156200187a578081fd5b81356001600160401b0381111562001890578182fd5b6200189e84828501620015e3565b949350505050565b600080600060408486031215620018bb578283fd5b83356001600160401b0380821115620018d2578485fd5b620018e087838801620015e3565b94506020860135915080821115620018f6578384fd5b818601915086601f8301126200190a578384fd5b81358181111562001919578485fd5b8760208260051b85010111156200192e578485fd5b6020830194508093505050509250925092565b60006020828403121562001953578081fd5b815162000f6f8162001d7c565b60006020828403121562001972578081fd5b81516001600160401b038082111562001989578283fd5b818401915084601f8301126200199d578283fd5b815181811115620019b257620019b262001d4d565b620019c7601f8201601f191660200162001c6d565b9150808252856020828501011115620019de578384fd5b620019f181602084016020860162001cbb565b50949350505050565b6000815180845262001a1481602086016020860162001cbb565b601f01601f19169290920160200192915050565b6000865162001a3c818460208b0162001cbb565b86519083019062001a52818360208b0162001cbb565b865191019062001a67818360208a0162001cbb565b855191019062001a7c81836020890162001cbb565b845191019062001a9181836020880162001cbb565b01979650505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b6020808252825182820181905260009190848201906040850190845b8181101562001b4e5783516001600160a01b03168352928401929184019160010162001b27565b50909695505050505050565b60208152600062000f6f6020830184620019fa565b60e08152600062001b8460e0830189620019fa565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6000808335601e1984360301811262001c3d578283fd5b8301803591506001600160401b0382111562001c57578283fd5b6020019150368190038213156200141157600080fd5b604051601f8201601f191681016001600160401b038111828210171562001c985762001c9862001d4d565b604052919050565b6000821982111562001cb65762001cb662001d37565b500190565b60005b8381101562001cd857818101518382015260200162001cbe565b83811115620005c25750506000910152565b600060001982141562001d015762001d0162001d37565b5060010190565b60008260020b8062001d2857634e487b7160e01b82526012600452602482fd5b808360020b0791505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811462001d7957600080fd5b50565b8060020b811462001d7957600080fdfe60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a26469706673582212202e6ff5d3661cc2336a91145498f5e5e835222f3bed72d3235d7e02f381e1b62564736f6c63430008040033", - "deployedBytecode": "0x60806040523480156200001157600080fd5b5060043610620001425760003560e01c8063088933281462000147578063098eddb114620001605780630dfc574b146200017d578063260fc2b8146200019457806335c62bc214620001ab57806340aee04114620001b557806342f5de9914620001cc578063481c6a7514620001e357806354fd4d5014620001fc578063562b810314620002305780635c39f4671462000249578063607c12b51462000260578063715018a6146200026a57806383c60ac4146200027457806386238765146200028b57806395d807f1146200029f578063a958b89514620002c7578063bd30dfb914620002de578063c0c53b8b14620002f5578063c45a0155146200030c578063cefa77991462000334578063d6f748981462000348578063f2fde38b146200035f578063f3b7dead1462000376575b600080fd5b6200015e6200015836600462001692565b6200038d565b005b6200016a62000435565b6040519081526020015b60405180910390f35b6200015e6200018e366004620018a6565b62000448565b6200015e620001a536600462001868565b620005c8565b6200016a620006ae565b6200015e620001c636600462001868565b62000725565b6200016a620001dd36600462001692565b6200080f565b620001ed62000838565b60405162000174919062001a9d565b62000221604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000174919062001b5a565b6200023a62000847565b60405162000174919062001b0b565b6200023a6200025a36600462001692565b6200085c565b6200023a62000931565b6200015e62000a03565b620001ed62000285366004620017d7565b62000a70565b600254620001ed906001600160a01b031681565b620002b6620002b036600462001692565b62000a8e565b604051901515815260200162000174565b620001ed620002d83660046200175e565b62000aab565b62000221620002ef366004620016d0565b62000aca565b6200015e620003063660046200170d565b62000c39565b620001ed7f000000000000000000000000000000000000000000000000000000000000000081565b600154620001ed906001600160a01b031681565b6200015e6200035936600462001692565b62000d43565b6200015e6200037036600462001692565b62000de2565b620001ed6200038736600462001692565b62000ec9565b336200039862000838565b6001600160a01b031614620003ca5760405162461bcd60e51b8152600401620003c19062001be4565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c9085916200040b916001600160a01b0390911690849062001ab1565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600062000443600362000f40565b905090565b336200045362000838565b6001600160a01b0316146200047c5760405162461bcd60e51b8152600401620003c19062001be4565b82518114620004c95760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b6044820152606401620003c1565b60005b8351811015620005c257838181518110620004f757634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b03168585858181106200054457634e487b7160e01b600052603260045260246000fd5b905060200281019062000558919062001c26565b6040518463ffffffff1660e01b8152600401620005789392919062001acb565b600060405180830381600087803b1580156200059357600080fd5b505af1158015620005a8573d6000803e3d6000fd5b505050508080620005b99062001cea565b915050620004cc565b50505050565b33620005d362000838565b6001600160a01b031614620005fc5760405162461bcd60e51b8152600401620003c19062001be4565b60005b8151811015620006aa578181815181106200062a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b815260040162000660919062001a9d565b600060405180830381600087803b1580156200067b57600080fd5b505af115801562000690573d6000803e3d6000fd5b505050508080620006a19062001cea565b915050620005ff565b5050565b600080620006bb62000931565b905060005b81518110156200072057620006fd828281518110620006ef57634e487b7160e01b600052603260045260246000fd5b60200260200101516200080f565b62000709908462001ca0565b925080620007178162001cea565b915050620006c0565b505090565b336200073062000838565b6001600160a01b031614620007595760405162461bcd60e51b8152600401620003c19062001be4565b60005b8151811015620006aa578181815181106200078757634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe692620007c59291169060040162001a9d565b600060405180830381600087803b158015620007e057600080fd5b505af1158015620007f5573d6000803e3d6000fd5b505050508080620008069062001cea565b9150506200075c565b6001600160a01b0381166000908152600560205260408120620008329062000f40565b92915050565b6000546001600160a01b031690565b60025460609062000443906001600160a01b03165b606060006200086b836200080f565b90506000816001600160401b038111156200089657634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015620008c0578160200160208202803683370190505b50905060005b828110156200092957620008db858262000f4b565b828281518110620008fc57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280620009208162001cea565b915050620008c6565b509392505050565b606060006200093f62000435565b90506000816001600160401b038111156200096a57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000994578160200160208202803683370190505b50905060005b82811015620009fc57620009ae8162000f76565b828281518110620009cf57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280620009f38162001cea565b9150506200099a565b5092915050565b3362000a0e62000838565b6001600160a01b03161462000a375760405162461bcd60e51b8152600401620003c19062001be4565b600080546040516001600160a01b039091169060008051602062002732833981519152908390a3600080546001600160a01b0319169055565b600062000a838787878787873362000f85565b979650505050505050565b600062000a9b8262000ec9565b6001600160a01b03161592915050565b600062000ac086868660008787600062000f85565b9695505050505050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000b0857600080fd5b505afa15801562000b1d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000b47919081019062001960565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000b8557600080fd5b505afa15801562000b9a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000bc4919081019062001960565b905062000c306040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001304565b95945050505050565b600054600160a81b900460ff168062000c5c5750600054600160a01b900460ff16155b62000cc15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620003c1565b600054600160a81b900460ff1615801562000cec576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620005c2576000805460ff60a81b1916905550505050565b3362000d4e62000838565b6001600160a01b03161462000d775760405162461bcd60e51b8152600401620003c19062001be4565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000db8916001600160a01b0390911690849062001ab1565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362000ded62000838565b6001600160a01b03161462000e165760405162461bcd60e51b8152600401620003c19062001be4565b6001600160a01b03811662000e7f5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401620003c1565b600080546040516001600160a01b03808516939216916000805160206200273283398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000f0557600080fd5b505afa15801562000f1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620008329190620016b1565b600062000832825490565b6001600160a01b038216600090815260056020526040812062000f6f90836200133b565b9392505050565b6000620008326003836200133b565b600080600062000f968a8a62001349565b6001546040519294509092506001600160a01b031690309062000fb990620015d5565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000ffc573d6000803e3d6000fd5b506040805180820182526011815270047656c61746f20556e6973776170204c5607c1b6020820152905163bd30dfb960e01b815291945090309063bd30dfb9906200104e908690869060040162001ab1565b60006040518083038186803b1580156200106757600080fd5b505afa9250505080156200109f57506040513d6000823e601f3d908101601f191682016040526200109c919081019062001960565b60015b620010aa57620010ad565b90505b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8b1660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee829060640160206040518083038186803b1580156200112757600080fd5b505afa1580156200113c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011629190620016b1565b90506001600160a01b038116620011ba5760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b6044820152606401620003c1565b620011c781898962001418565b6200120c5760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b6044820152606401620003c1565b60405163e25e15e360e01b81526001600160a01b0386169063e25e15e3906200124490859085908e908e908e908e9060040162001b6f565b600060405180830381600087803b1580156200125f57600080fd5b505af115801562001274573d6000803e3d6000fd5b505050506200128e336003620014d590919063ffffffff16565b50336000908152600560205260409020620012aa9086620014d5565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a450505050979650505050505050565b606085858585856040516020016200132195949392919062001a28565b604051602081830303815290604052905095945050505050565b600062000f6f8383620014ec565b600080826001600160a01b0316846001600160a01b031614156200139d5760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b6044820152606401620003c1565b826001600160a01b0316846001600160a01b031610620013bf578284620013c2565b83835b90925090506001600160a01b038216620014115760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b6044820152606401620003c1565b9250929050565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200145557600080fd5b505afa1580156200146a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001490919062001941565b90508260020b8460020b128015620014b45750620014af818562001d08565b60020b155b801562000c305750620014c8818462001d08565b60020b1595945050505050565b600062000f6f836001600160a01b03841662001583565b815460009082106200154c5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401620003c1565b8260000182815481106200157057634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b6000818152600183016020526040812054620015cc5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000832565b50600062000832565b6109a58062001d8d83390190565b600082601f830112620015f4578081fd5b813560206001600160401b0382111562001612576200161262001d4d565b8160051b6200162382820162001c6d565b8381528281019086840183880185018910156200163e578687fd5b8693505b858410156200166d578035620016588162001d63565b83526001939093019291840191840162001642565b50979650505050505050565b803562ffffff811681146200168d57600080fd5b919050565b600060208284031215620016a4578081fd5b813562000f6f8162001d63565b600060208284031215620016c3578081fd5b815162000f6f8162001d63565b60008060408385031215620016e3578081fd5b8235620016f08162001d63565b91506020830135620017028162001d63565b809150509250929050565b60008060006060848603121562001722578081fd5b83356200172f8162001d63565b92506020840135620017418162001d63565b91506040840135620017538162001d63565b809150509250925092565b600080600080600060a0868803121562001776578081fd5b8535620017838162001d63565b94506020860135620017958162001d63565b9350620017a56040870162001679565b92506060860135620017b78162001d7c565b91506080860135620017c98162001d7c565b809150509295509295909350565b60008060008060008060c08789031215620017f0578081fd5b8635620017fd8162001d63565b955060208701356200180f8162001d63565b94506200181f6040880162001679565b9350606087013561ffff8116811462001836578182fd5b92506080870135620018488162001d7c565b915060a08701356200185a8162001d7c565b809150509295509295509295565b6000602082840312156200187a578081fd5b81356001600160401b0381111562001890578182fd5b6200189e84828501620015e3565b949350505050565b600080600060408486031215620018bb578283fd5b83356001600160401b0380821115620018d2578485fd5b620018e087838801620015e3565b94506020860135915080821115620018f6578384fd5b818601915086601f8301126200190a578384fd5b81358181111562001919578485fd5b8760208260051b85010111156200192e578485fd5b6020830194508093505050509250925092565b60006020828403121562001953578081fd5b815162000f6f8162001d7c565b60006020828403121562001972578081fd5b81516001600160401b038082111562001989578283fd5b818401915084601f8301126200199d578283fd5b815181811115620019b257620019b262001d4d565b620019c7601f8201601f191660200162001c6d565b9150808252856020828501011115620019de578384fd5b620019f181602084016020860162001cbb565b50949350505050565b6000815180845262001a1481602086016020860162001cbb565b601f01601f19169290920160200192915050565b6000865162001a3c818460208b0162001cbb565b86519083019062001a52818360208b0162001cbb565b865191019062001a67818360208a0162001cbb565b855191019062001a7c81836020890162001cbb565b845191019062001a9181836020880162001cbb565b01979650505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b6020808252825182820181905260009190848201906040850190845b8181101562001b4e5783516001600160a01b03168352928401929184019160010162001b27565b50909695505050505050565b60208152600062000f6f6020830184620019fa565b60e08152600062001b8460e0830189620019fa565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6000808335601e1984360301811262001c3d578283fd5b8301803591506001600160401b0382111562001c57578283fd5b6020019150368190038213156200141157600080fd5b604051601f8201601f191681016001600160401b038111828210171562001c985762001c9862001d4d565b604052919050565b6000821982111562001cb65762001cb662001d37565b500190565b60005b8381101562001cd857818101518382015260200162001cbe565b83811115620005c25750506000910152565b600060001982141562001d015762001d0162001d37565b5060010190565b60008260020b8062001d2857634e487b7160e01b82526012600452602482fd5b808360020b0791505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811462001d7957600080fd5b50565b8060020b811462001d7957600080fdfe60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a26469706673582212202e6ff5d3661cc2336a91145498f5e5e835222f3bed72d3235d7e02f381e1b62564736f6c63430008040033", - "devdoc": { - "kind": "dev", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "managerFee": "proportion of earned fees that go to pool manager in Basis Points", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "createPool(address,address,uint24,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "getDeployers()": { - "returns": { - "_0": "deployers the list of deployer addresses" - } - }, - "getGelatoPools()": { - "returns": { - "_0": "list of Gelato managed G-UNI pool addresses" - } - }, - "getPools(address)": { - "params": { - "deployer": "address that has potentially deployed G-UNI pools (can return empty array)" - }, - "returns": { - "_0": "pools the list of G-UNI pool addresses deployed by `deployer`" - } - }, - "getProxyAdmin(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "address that controls the G-UNI implementation (has power to upgrade it)" - } - }, - "isPoolImmutable(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "bool signaling if pool is immutable (true) or not (false)" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "numDeployers()": { - "returns": { - "_0": "total number of G-UNI pool deployer addresses" - } - }, - "numPools()": { - "returns": { - "result": "total number of G-UNI pools deployed" - } - }, - "numPools(address)": { - "params": { - "deployer": "deployer address" - }, - "returns": { - "_0": "total number of G-UNI pools deployed by `deployer`" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "createManagedPool(address,address,uint24,uint16,int24,int24)": { - "notice": "createManagedPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`" - }, - "createPool(address,address,uint24,int24,int24)": { - "notice": "createPool creates a new instance of a G-UNI token on a specified UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still forever be associated with the G-UNI pool as it's `deployer`" - }, - "getDeployers()": { - "notice": "getDeployers fetches all addresses that have deployed a G-UNI pool" - }, - "getGelatoPools()": { - "notice": "getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)" - }, - "getPools(address)": { - "notice": "getPools fetches all the G-UNI pool addresses deployed by `deployer`" - }, - "getProxyAdmin(address)": { - "notice": "getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address)." - }, - "isPoolImmutable(address)": { - "notice": "isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded" - }, - "numDeployers()": { - "notice": "numDeployers counts the total number of G-UNI pool deployer addresses" - }, - "numPools()": { - "notice": "numPools counts the total number of G-UNI pools in existence" - }, - "numPools(address)": { - "notice": "numPools counts the total number of G-UNI pools deployed by `deployer`" - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6441, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_manager", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 5, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initialized", - "offset": 20, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initializing", - "offset": 21, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 5909, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "poolImplementation", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 5911, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "gelatoDeployer", - "offset": 0, - "slot": "2", - "type": "t_address" - }, - { - "astId": 5914, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_deployers", - "offset": 0, - "slot": "3", - "type": "t_struct(AddressSet)2007_storage" - }, - { - "astId": 5919, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_pools", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_struct(AddressSet)2007_storage)" - } - ], - "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_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(AddressSet)2007_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.AddressSet)", - "numberOfBytes": "32", - "value": "t_struct(AddressSet)2007_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(AddressSet)2007_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.AddressSet", - "members": [ - { - "astId": 2006, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1732_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Set)1732_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 1727, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 1731, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_indexes", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_uint256)" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} diff --git a/lib/g-uni-v1-core/deployments/polygon/GUniFactory_Proxy.json b/lib/g-uni-v1-core/deployments/polygon/GUniFactory_Proxy.json deleted file mode 100644 index 9f0021274..000000000 --- a/lib/g-uni-v1-core/deployments/polygon/GUniFactory_Proxy.json +++ /dev/null @@ -1,232 +0,0 @@ -{ - "address": "0x37265A834e95D11c36527451c7844eF346dC342a", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "adminAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x1d83eb9d3f492db769ae53cbd5ff25ac56d319d639f4692ac493c98dfb762856", - "receipt": { - "to": null, - "from": "0x88215a2794ddC031439C72922EC8983bDE831c78", - "contractAddress": "0x37265A834e95D11c36527451c7844eF346dC342a", - "transactionIndex": 29, - "gasUsed": "554844", - "logsBloom": "0x40100000000020000000000000000000000000000820000000000020000000000000000000000000000400000001000010008000000000000000000000000000000004100000000000000000000800800004000000000000000100000010000000000000020000000000000000000800000000000000000080000000000000000000000000000000800000000000000000000000000000000000000000000000200000000044000000000000000200000000000000000000000000000000004000000000000000000001000000000010000000000000000000100000004020000000000000000000000400000000000000000000000000000000000000100000", - "blockHash": "0xa6612969aff697c0aa435d3f074dbd27eecee86098411de26b31376bb85360e6", - "transactionHash": "0x1d83eb9d3f492db769ae53cbd5ff25ac56d319d639f4692ac493c98dfb762856", - "logs": [ - { - "transactionIndex": 29, - "blockNumber": 22840132, - "transactionHash": "0x1d83eb9d3f492db769ae53cbd5ff25ac56d319d639f4692ac493c98dfb762856", - "address": "0x37265A834e95D11c36527451c7844eF346dC342a", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000033f054051f2cd19fd53eaf33e33f7faad7c15e86" - ], - "data": "0x", - "logIndex": 215, - "blockHash": "0xa6612969aff697c0aa435d3f074dbd27eecee86098411de26b31376bb85360e6" - }, - { - "transactionIndex": 29, - "blockNumber": 22840132, - "transactionHash": "0x1d83eb9d3f492db769ae53cbd5ff25ac56d319d639f4692ac493c98dfb762856", - "address": "0x37265A834e95D11c36527451c7844eF346dC342a", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000002864b9a53fd250900ba74de507a56503c3dc90b" - ], - "data": "0x", - "logIndex": 216, - "blockHash": "0xa6612969aff697c0aa435d3f074dbd27eecee86098411de26b31376bb85360e6" - }, - { - "transactionIndex": 29, - "blockNumber": 22840132, - "transactionHash": "0x1d83eb9d3f492db769ae53cbd5ff25ac56d319d639f4692ac493c98dfb762856", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x00000000000000000000000088215a2794ddc031439c72922ec8983bde831c78", - "0x0000000000000000000000007b5000af8ab69fd59eb0d4f5762bff57c9c04385" - ], - "data": "0x000000000000000000000000000000000000000000000000003d1b75414c680000000000000000000000000000000000000000000000000037a7c767e8eb27000000000000000000000000000000000000000000000000ff9fb5a7760b0e849e000000000000000000000000000000000000000000000000376aabf2a79ebf000000000000000000000000000000000000000000000000ff9ff2c2eb4c5aec9e", - "logIndex": 217, - "blockHash": "0xa6612969aff697c0aa435d3f074dbd27eecee86098411de26b31376bb85360e6" - } - ], - "blockNumber": 22840132, - "cumulativeGasUsed": "7101065", - "status": 1, - "byzantium": true - }, - "args": [ - "0x33F054051f2Cd19fD53EAf33e33f7fAad7c15e86", - "0x02864B9A53fd250900Ba74De507a56503C3DC90b", - "0xc0c53b8b000000000000000000000000d2bb190dd88e7af5df176064ec42f6dfa8672f4000000000000000000000000002864b9a53fd250900ba74de507a56503c3dc90b00000000000000000000000002864b9a53fd250900ba74de507a56503c3dc90b" - ], - "solcInputHash": "5b7722421ca04d0a130cd8a2a08f9ec3", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adminAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":\"EIP173Proxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x4ad41656a53bc38d766197d9974be4be70f506b1d1f78def2c3726e8d580a3f5\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x00dbb59cf486ff9a2930fb588ef70d761dbf439aa05d48ef0001a0448769ec11\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} diff --git a/lib/g-uni-v1-core/deployments/polygon/GUniPool.json b/lib/g-uni-v1-core/deployments/polygon/GUniPool.json deleted file mode 100644 index 9e4aad279..000000000 --- a/lib/g-uni-v1-core/deployments/polygon/GUniPool.json +++ /dev/null @@ -1,1655 +0,0 @@ -{ - "address": "0xd2Bb190dD88e7Af5DF176064Ec42f6dfA8672F40", - "abi": [ - { - "inputs": [ - { - "internalType": "address payable", - "name": "_gelato", - "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": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned0", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feesEarned1", - "type": "uint256" - } - ], - "name": "FeesEarned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int24", - "name": "lowerTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "int24", - "name": "upperTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBefore", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityAfter", - "type": "uint128" - } - ], - "name": "Rebalance", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - } - ], - "name": "SetManagerFee", - "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" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldAdminTreasury", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdminTreasury", - "type": "address" - } - ], - "name": "UpdateAdminTreasury", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoRebalanceBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoWithdrawBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoSlippageBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "gelatoSlippageInterval", - "type": "uint32" - } - ], - "name": "UpdateGelatoParams", - "type": "event" - }, - { - "inputs": [], - "name": "GELATO", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "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": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "burn", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "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": [ - { - "internalType": "int24", - "name": "newLowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "newUpperTick", - "type": "int24" - }, - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - } - ], - "name": "executiveRebalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoRebalanceBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageInterval", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoWithdrawBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Max", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Max", - "type": "uint256" - } - ], - "name": "getMintAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPositionID", - "outputs": [ - { - "internalType": "bytes32", - "name": "positionID", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUnderlyingBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "sqrtRatioX96", - "type": "uint160" - } - ], - "name": "getUnderlyingBalancesAtPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "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": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "address", - "name": "_pool", - "type": "address" - }, - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "_lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "_upperTick", - "type": "int24" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - } - ], - "name": "initializeManagerFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "lowerTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerTreasury", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pool", - "outputs": [ - { - "internalType": "contract IUniswapV3Pool", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "paymentToken", - "type": "address" - } - ], - "name": "rebalance", - "outputs": [], - "stateMutability": "nonpayable", - "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": "token0", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token1", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Owed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Owed", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3MintCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amount0Delta", - "type": "int256" - }, - { - "internalType": "int256", - "name": "amount1Delta", - "type": "int256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3SwapCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "newRebalanceBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newWithdrawBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newSlippageBPS", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "newSlippageInterval", - "type": "uint32" - }, - { - "internalType": "address", - "name": "newTreasury", - "type": "address" - } - ], - "name": "updateGelatoParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "upperTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawGelatoBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawManagerBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x67d570f461a8ec73396215a97bd801c8510feeb50a32a2a624d6bcc2855a4e45", - "receipt": { - "to": null, - "from": "0x88215a2794ddC031439C72922EC8983bDE831c78", - "contractAddress": "0xd2Bb190dD88e7Af5DF176064Ec42f6dfA8672F40", - "transactionIndex": 37, - "gasUsed": "5359747", - "logsBloom": "0x00000000000000000000000000000000000000000800000000000000000000400000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000400000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000004000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000100000004000000000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x2b6bda02e0cb2c618a869282f42be22c7f06ae8893341a919ff988e2d9998583", - "transactionHash": "0x67d570f461a8ec73396215a97bd801c8510feeb50a32a2a624d6bcc2855a4e45", - "logs": [ - { - "transactionIndex": 37, - "blockNumber": 22839724, - "transactionHash": "0x67d570f461a8ec73396215a97bd801c8510feeb50a32a2a624d6bcc2855a4e45", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x00000000000000000000000088215a2794ddc031439c72922ec8983bde831c78", - "0x0000000000000000000000007c7379531b2aee82e4ca06d4175d13b9cbeafd49" - ], - "data": "0x000000000000000000000000000000000000000000000000024e4a81a8a662000000000000000000000000000000000000000000000000003b7830061f887300000000000000000000000000000000000000000000005a32df75902bece79b9e0000000000000000000000000000000000000000000000003929e58476e21100000000000000000000000000000000000000000000005a32e1c3daad958dfd9e", - "logIndex": 183, - "blockHash": "0x2b6bda02e0cb2c618a869282f42be22c7f06ae8893341a919ff988e2d9998583" - } - ], - "blockNumber": 22839724, - "cumulativeGasUsed": "12053559", - "status": 1, - "byzantium": true - }, - "args": ["0x7598e84B2E114AB62CAB288CE5f7d5f6bad35BbA"], - "solcInputHash": "5b7722421ca04d0a130cd8a2a08f9ec3", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_gelato\",\"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\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feesEarned1\",\"type\":\"uint256\"}],\"name\":\"FeesEarned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"lowerTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"upperTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBefore\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityAfter\",\"type\":\"uint128\"}],\"name\":\"Rebalance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"}],\"name\":\"SetManagerFee\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAdminTreasury\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdminTreasury\",\"type\":\"address\"}],\"name\":\"UpdateAdminTreasury\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoRebalanceBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoWithdrawBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoSlippageBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gelatoSlippageInterval\",\"type\":\"uint32\"}],\"name\":\"UpdateGelatoParams\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GELATO\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"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\":[{\"internalType\":\"int24\",\"name\":\"newLowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"newUpperTick\",\"type\":\"int24\"},{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"}],\"name\":\"executiveRebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoRebalanceBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageInterval\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoWithdrawBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Max\",\"type\":\"uint256\"}],\"name\":\"getMintAmounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPositionID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"positionID\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUnderlyingBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtRatioX96\",\"type\":\"uint160\"}],\"name\":\"getUnderlyingBalancesAtPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"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\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_pool\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"_lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"_upperTick\",\"type\":\"int24\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"}],\"name\":\"initializeManagerFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lowerTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pool\",\"outputs\":[{\"internalType\":\"contract IUniswapV3Pool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"}],\"name\":\"rebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"token0\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newRebalanceBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newWithdrawBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newSlippageBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"newSlippageInterval\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateGelatoParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upperTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawGelatoBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawManagerBalance\",\"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}.\"},\"burn(uint256,address)\":{\"params\":{\"burnAmount\":\"The number of G-UNI tokens to burn\",\"receiver\":\"The account to receive the underlying amounts of token0 and token1\"},\"returns\":{\"amount0\":\"amount of token0 transferred to receiver for burning `burnAmount`\",\"amount1\":\"amount of token1 transferred to receiver for burning `burnAmount`\",\"liquidityBurned\":\"amount of liquidity removed from the underlying Uniswap V3 position\"}},\"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 this function is overridden; 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`.\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"details\":\"When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.\",\"params\":{\"newLowerTick\":\"The new lower bound of the position's range\",\"newUpperTick\":\"The new upper bound of the position's range\",\"swapAmountBPS\":\"amount of token to swap as proportion of total. Pass 0 to ignore swap.\",\"swapThresholdPrice\":\"slippage parameter on the swap as a max or min sqrtPriceX96\",\"zeroForOne\":\"Which token to input into the swap (true = token0, false = token1)\"}},\"getMintAmounts(uint256,uint256)\":{\"params\":{\"amount0Max\":\"The maximum amount of token1 to forward on mint\"},\"returns\":{\"amount0\":\"actual amount of token0 to forward when minting `mintAmount`\",\"amount1\":\"actual amount of token1 to forward when minting `mintAmount`\",\"mintAmount\":\"maximum number of G-UNI tokens to mint\"}},\"getUnderlyingBalances()\":{\"returns\":{\"amount0Current\":\"current total underlying balance of token0\",\"amount1Current\":\"current total underlying balance of token1\"}},\"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.\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"params\":{\"_lowerTick\":\"initial upperTick (only changeable with executiveRebalance)\",\"_managerFeeBPS\":\"proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\",\"_manager_\":\"address of manager (ownership can be transferred)\",\"_name\":\"name of G-UNI token\",\"_pool\":\"address of Uniswap V3 pool\",\"_symbol\":\"symbol of G-UNI token\"}},\"initializeManagerFee(uint16)\":{\"params\":{\"_managerFeeBPS\":\"proportion of fees earned that are credited to manager in Basis Points\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"mint(uint256,address)\":{\"details\":\"to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\",\"params\":{\"mintAmount\":\"The number of G-UNI tokens to mint\",\"receiver\":\"The account to receive the minted tokens\"},\"returns\":{\"amount0\":\"amount of token0 transferred from msg.sender to mint `mintAmount`\",\"amount1\":\"amount of token1 transferred from msg.sender to mint `mintAmount`\",\"liquidityMinted\":\"amount of liquidity added to the underlying Uniswap V3 position\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"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 manager.\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"params\":{\"newRebalanceBPS\":\"controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\",\"newSlippageBPS\":\"maximum slippage on swaps during gelato rebalance\",\"newSlippageInterval\":\"length of time for TWAP used in computing slippage on swaps\",\"newTreasury\":\"address where managerFee withdrawals are sent\",\"newWithdrawBPS\":\"controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(uint256,address)\":{\"notice\":\"burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"notice\":\"Change the range of underlying UniswapV3 position, only manager can call\"},\"getMintAmounts(uint256,uint256)\":{\"notice\":\"compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\"},\"getUnderlyingBalances()\":{\"notice\":\"compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"notice\":\"initialize storage variables on a new G-UNI pool, only called once\"},\"initializeManagerFee(uint16)\":{\"notice\":\"initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\"},\"mint(uint256,address)\":{\"notice\":\"mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\"},\"rebalance(uint160,uint256,bool,uint256,address)\":{\"notice\":\"Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\"},\"uniswapV3MintCallback(uint256,uint256,bytes)\":{\"notice\":\"Uniswap V3 callback fn, called back on pool.mint\"},\"uniswapV3SwapCallback(int256,int256,bytes)\":{\"notice\":\"Uniswap v3 callback fn, called back on pool.swap\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"notice\":\"change configurable parameters, only manager can call\"},\"withdrawGelatoBalance(uint256,address)\":{\"notice\":\"withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"},\"withdrawManagerBalance(uint256,address)\":{\"notice\":\"withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniPool.sol\":\"GUniPool\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal initializer {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal initializer {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and make it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x89fa60d14355f7ae06af11e28fce2bb90c5c6186645d681a30e1b36234a4c210\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\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\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The defaut value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\\n __Context_init_unchained();\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override 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 override 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 this function is\\n * overridden;\\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 override returns (uint8) {\\n return 18;\\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\\n uint256 currentAllowance = _allowances[sender][_msgSender()];\\n require(currentAllowance >= amount, \\\"ERC20: transfer amount exceeds allowance\\\");\\n _approve(sender, _msgSender(), currentAllowance - amount);\\n\\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\\n\\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 uint256 senderBalance = _balances[sender];\\n require(senderBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n _balances[sender] = senderBalance - amount;\\n _balances[recipient] += amount;\\n\\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 += amount;\\n _balances[account] += 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 uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n _balances[account] = accountBalance - amount;\\n _totalSupply -= amount;\\n\\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 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 uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0x9c2d7425f3343ea340d6ea67e9d90109d4d846bb013c2572096ec88c9e74946b\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\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\":\"0x8d4a0f2b5b760b5e2c19ed3c108d83897a4dfd5bfed97a93867918df19191e5e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x6795c369a4eefa78468e38966f7851fbc2dda5e5b9ccd3fa2b45970e2e4d3abd\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../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 initializer {\\n __Context_init_unchained();\\n }\\n\\n function __Context_init_unchained() internal initializer {\\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x8e9eb503de1189f50c5f16fef327da310b11898d6b9ab3ca937df07c35233b9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.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 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) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\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\":\"0x99f5c21018d796db7833a2100bb0e7411999e248a3c950fb526eee5d2bf47cb7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0x069b2631bb5b5193a58ccf7a06266c7361bd2c20095667af4402817605627f45\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCast {\\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 require(value < 2**128, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return uint128(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 require(value < 2**64, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return uint64(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 require(value < 2**32, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return uint32(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 require(value < 2**16, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\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 require(value < 2**8, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\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 require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n return uint256(value);\\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 * _Available since v3.1._\\n */\\n function toInt128(int256 value) internal pure returns (int128) {\\n require(value >= -2**127 && value < 2**127, \\\"SafeCast: value doesn\\\\'t fit in 128 bits\\\");\\n return int128(value);\\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 * _Available since v3.1._\\n */\\n function toInt64(int256 value) internal pure returns (int64) {\\n require(value >= -2**63 && value < 2**63, \\\"SafeCast: value doesn\\\\'t fit in 64 bits\\\");\\n return int64(value);\\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 * _Available since v3.1._\\n */\\n function toInt32(int256 value) internal pure returns (int32) {\\n require(value >= -2**31 && value < 2**31, \\\"SafeCast: value doesn\\\\'t fit in 32 bits\\\");\\n return int32(value);\\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 * _Available since v3.1._\\n */\\n function toInt16(int256 value) internal pure returns (int16) {\\n require(value >= -2**15 && value < 2**15, \\\"SafeCast: value doesn\\\\'t fit in 16 bits\\\");\\n return int16(value);\\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 * _Available since v3.1._\\n */\\n function toInt8(int256 value) internal pure returns (int8) {\\n require(value >= -2**7 && value < 2**7, \\\"SafeCast: value doesn\\\\'t fit in 8 bits\\\");\\n return int8(value);\\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 require(value < 2**255, \\\"SafeCast: value doesn't fit in an int256\\\");\\n return int256(value);\\n }\\n}\\n\",\"keccak256\":\"0xc37d85b96c2a8d7bc09f25958e0a81394bf5780286444147ddf875fa628d53ce\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\nimport './pool/IUniswapV3PoolImmutables.sol';\\nimport './pool/IUniswapV3PoolState.sol';\\nimport './pool/IUniswapV3PoolDerivedState.sol';\\nimport './pool/IUniswapV3PoolActions.sol';\\nimport './pool/IUniswapV3PoolOwnerActions.sol';\\nimport './pool/IUniswapV3PoolEvents.sol';\\n\\n/// @title The interface for a Uniswap V3 Pool\\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\\n/// to the ERC20 specification\\n/// @dev The pool interface is broken up into many smaller pieces\\ninterface IUniswapV3Pool is\\n IUniswapV3PoolImmutables,\\n IUniswapV3PoolState,\\n IUniswapV3PoolDerivedState,\\n IUniswapV3PoolActions,\\n IUniswapV3PoolOwnerActions,\\n IUniswapV3PoolEvents\\n{\\n\\n}\\n\",\"keccak256\":\"0xfe6113d518466cd6652c85b111e01f33eb62157f49ae5ed7d5a3947a2044adb1\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#mint\\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\\ninterface IUniswapV3MintCallback {\\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x27a9725b8f831a92d16380860c3d348a0b926a7f01b34a54ea6eea78cbdbcd6a\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#swap\\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\\ninterface IUniswapV3SwapCallback {\\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x3f485fb1a44e8fbeadefb5da07d66edab3cfe809f0ac4074b1e54e3eb3c4cf69\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissionless pool actions\\n/// @notice Contains pool methods that can be called by anyone\\ninterface IUniswapV3PoolActions {\\n /// @notice Sets the initial price for the pool\\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\\n function initialize(uint160 sqrtPriceX96) external;\\n\\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\\n /// @param recipient The address for which the liquidity will be created\\n /// @param tickLower The lower tick of the position in which to add liquidity\\n /// @param tickUpper The upper tick of the position in which to add liquidity\\n /// @param amount The amount of liquidity to mint\\n /// @param data Any data that should be passed through to the callback\\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n function mint(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount,\\n bytes calldata data\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Collects tokens owed to a position\\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\\n /// @param recipient The address which should receive the fees collected\\n /// @param tickLower The lower tick of the position for which to collect fees\\n /// @param tickUpper The upper tick of the position for which to collect fees\\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\\n /// @return amount0 The amount of fees collected in token0\\n /// @return amount1 The amount of fees collected in token1\\n function collect(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n\\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\\n /// @dev Fees must be collected separately via a call to #collect\\n /// @param tickLower The lower tick of the position for which to burn liquidity\\n /// @param tickUpper The upper tick of the position for which to burn liquidity\\n /// @param amount How much liquidity to burn\\n /// @return amount0 The amount of token0 sent to the recipient\\n /// @return amount1 The amount of token1 sent to the recipient\\n function burn(\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Swap token0 for token1, or token1 for token0\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\\n /// @param recipient The address to receive the output of the swap\\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\\n /// @param data Any data to be passed through to the callback\\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\\n function swap(\\n address recipient,\\n bool zeroForOne,\\n int256 amountSpecified,\\n uint160 sqrtPriceLimitX96,\\n bytes calldata data\\n ) external returns (int256 amount0, int256 amount1);\\n\\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\\n /// @param recipient The address which will receive the token0 and token1 amounts\\n /// @param amount0 The amount of token0 to send\\n /// @param amount1 The amount of token1 to send\\n /// @param data Any data to be passed through to the callback\\n function flash(\\n address recipient,\\n uint256 amount0,\\n uint256 amount1,\\n bytes calldata data\\n ) external;\\n\\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\\n /// the input observationCardinalityNext.\\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0x9453dd0e7442188667d01d9b65de3f1e14e9511ff3e303179a15f6fc267f7634\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that is not stored\\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\\n/// blockchain. The functions here may have variable gas costs.\\ninterface IUniswapV3PoolDerivedState {\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\\n /// you must call it with secondsAgos = [3600, 0].\\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\\n /// timestamp\\n function observe(uint32[] calldata secondsAgos)\\n external\\n view\\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\\n\\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\\n /// snapshot is taken and the second snapshot is taken.\\n /// @param tickLower The lower tick of the range\\n /// @param tickUpper The upper tick of the range\\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\\n /// @return secondsInside The snapshot of seconds per liquidity for the range\\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\\n external\\n view\\n returns (\\n int56 tickCumulativeInside,\\n uint160 secondsPerLiquidityInsideX128,\\n uint32 secondsInside\\n );\\n}\\n\",\"keccak256\":\"0xe603ac5b17ecdee73ba2b27efdf386c257a19c14206e87eee77e2017b742d9e5\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Events emitted by a pool\\n/// @notice Contains all events emitted by the pool\\ninterface IUniswapV3PoolEvents {\\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\\n event Initialize(uint160 sqrtPriceX96, int24 tick);\\n\\n /// @notice Emitted when liquidity is minted for a given position\\n /// @param sender The address that minted the liquidity\\n /// @param owner The owner of the position and recipient of any minted liquidity\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity minted to the position range\\n /// @param amount0 How much token0 was required for the minted liquidity\\n /// @param amount1 How much token1 was required for the minted liquidity\\n event Mint(\\n address sender,\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted when fees are collected by the owner of a position\\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\\n /// @param owner The owner of the position for which fees are collected\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount0 The amount of token0 fees collected\\n /// @param amount1 The amount of token1 fees collected\\n event Collect(\\n address indexed owner,\\n address recipient,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount0,\\n uint128 amount1\\n );\\n\\n /// @notice Emitted when a position's liquidity is removed\\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\\n /// @param owner The owner of the position for which liquidity is removed\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity to remove\\n /// @param amount0 The amount of token0 withdrawn\\n /// @param amount1 The amount of token1 withdrawn\\n event Burn(\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted by the pool for any swaps between token0 and token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the output of the swap\\n /// @param amount0 The delta of the token0 balance of the pool\\n /// @param amount1 The delta of the token1 balance of the pool\\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param liquidity The liquidity of the pool after the swap\\n /// @param tick The log base 1.0001 of price of the pool after the swap\\n event Swap(\\n address indexed sender,\\n address indexed recipient,\\n int256 amount0,\\n int256 amount1,\\n uint160 sqrtPriceX96,\\n uint128 liquidity,\\n int24 tick\\n );\\n\\n /// @notice Emitted by the pool for any flashes of token0/token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the tokens from flash\\n /// @param amount0 The amount of token0 that was flashed\\n /// @param amount1 The amount of token1 that was flashed\\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\\n event Flash(\\n address indexed sender,\\n address indexed recipient,\\n uint256 amount0,\\n uint256 amount1,\\n uint256 paid0,\\n uint256 paid1\\n );\\n\\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\\n /// just before a mint/swap/burn.\\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(\\n uint16 observationCardinalityNextOld,\\n uint16 observationCardinalityNextNew\\n );\\n\\n /// @notice Emitted when the protocol fee is changed by the pool\\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\\n /// @param feeProtocol0New The updated value of the token0 protocol fee\\n /// @param feeProtocol1New The updated value of the token1 protocol fee\\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\\n\\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\\n /// @param sender The address that collects the protocol fees\\n /// @param recipient The address that receives the collected protocol fees\\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x8071514d0fe5d17d6fbd31c191cdfb703031c24e0ece3621d88ab10e871375cd\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that never changes\\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\\ninterface IUniswapV3PoolImmutables {\\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\\n /// @return The contract address\\n function factory() external view returns (address);\\n\\n /// @notice The first of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token0() external view returns (address);\\n\\n /// @notice The second of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token1() external view returns (address);\\n\\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\\n /// @return The fee\\n function fee() external view returns (uint24);\\n\\n /// @notice The pool tick spacing\\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\\n /// This value is an int24 to avoid casting even though it is always positive.\\n /// @return The tick spacing\\n function tickSpacing() external view returns (int24);\\n\\n /// @notice The maximum amount of position liquidity that can use any tick in the range\\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\\n /// @return The max amount of liquidity per tick\\n function maxLiquidityPerTick() external view returns (uint128);\\n}\\n\",\"keccak256\":\"0xf6e5d2cd1139c4c276bdbc8e1d2b256e456c866a91f1b868da265c6d2685c3f7\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissioned pool actions\\n/// @notice Contains pool methods that may only be called by the factory owner\\ninterface IUniswapV3PoolOwnerActions {\\n /// @notice Set the denominator of the protocol's % share of the fees\\n /// @param feeProtocol0 new protocol fee for token0 of the pool\\n /// @param feeProtocol1 new protocol fee for token1 of the pool\\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\\n\\n /// @notice Collect the protocol fee accrued to the pool\\n /// @param recipient The address to which collected protocol fees should be sent\\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\\n /// @return amount0 The protocol fee collected in token0\\n /// @return amount1 The protocol fee collected in token1\\n function collectProtocol(\\n address recipient,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x759b78a2918af9e99e246dc3af084f654e48ef32bb4e4cb8a966aa3dcaece235\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that can change\\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\\n/// per transaction\\ninterface IUniswapV3PoolState {\\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\\n /// when accessed externally.\\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\\n /// boundary.\\n /// observationIndex The index of the last oracle observation that was written,\\n /// observationCardinality The current maximum number of observations stored in the pool,\\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// feeProtocol The protocol fee for both tokens of the pool.\\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\\n /// unlocked Whether the pool is currently locked to reentrancy\\n function slot0()\\n external\\n view\\n returns (\\n uint160 sqrtPriceX96,\\n int24 tick,\\n uint16 observationIndex,\\n uint16 observationCardinality,\\n uint16 observationCardinalityNext,\\n uint8 feeProtocol,\\n bool unlocked\\n );\\n\\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal0X128() external view returns (uint256);\\n\\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal1X128() external view returns (uint256);\\n\\n /// @notice The amounts of token0 and token1 that are owed to the protocol\\n /// @dev Protocol fees will never exceed uint128 max in either token\\n function protocolFees() external view returns (uint128 token0, uint128 token1);\\n\\n /// @notice The currently in range liquidity available to the pool\\n /// @dev This value has no relationship to the total liquidity across all ticks\\n function liquidity() external view returns (uint128);\\n\\n /// @notice Look up information about a specific tick in the pool\\n /// @param tick The tick to look up\\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\\n /// tick upper,\\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\\n /// a specific position.\\n function ticks(int24 tick)\\n external\\n view\\n returns (\\n uint128 liquidityGross,\\n int128 liquidityNet,\\n uint256 feeGrowthOutside0X128,\\n uint256 feeGrowthOutside1X128,\\n int56 tickCumulativeOutside,\\n uint160 secondsPerLiquidityOutsideX128,\\n uint32 secondsOutside,\\n bool initialized\\n );\\n\\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\\n function tickBitmap(int16 wordPosition) external view returns (uint256);\\n\\n /// @notice Returns the information about a position by the position's key\\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\\n /// @return _liquidity The amount of liquidity in the position,\\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\\n function positions(bytes32 key)\\n external\\n view\\n returns (\\n uint128 _liquidity,\\n uint256 feeGrowthInside0LastX128,\\n uint256 feeGrowthInside1LastX128,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param index The element of the observations array to fetch\\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\\n /// ago, rather than at a specific index in the array.\\n /// @return blockTimestamp The timestamp of the observation,\\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// Returns initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 index)\\n external\\n view\\n returns (\\n uint32 blockTimestamp,\\n int56 tickCumulative,\\n uint160 secondsPerLiquidityCumulativeX128,\\n bool initialized\\n );\\n}\\n\",\"keccak256\":\"0x852dc1f5df7dcf7f11e7bb3eed79f0cea72ad4b25f6a9d2c35aafb48925fd49f\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.4.0;\\n\\n/// @title FixedPoint96\\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\\n/// @dev Used in SqrtPriceMath.sol\\nlibrary FixedPoint96 {\\n uint8 internal constant RESOLUTION = 96;\\n uint256 internal constant Q96 = 0x1000000000000000000000000;\\n}\\n\",\"keccak256\":\"0x0ba8a9b95a956a4050749c0158e928398c447c91469682ca8a7cc7e77a7fe032\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {\\n IUniswapV3MintCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\\\";\\nimport {\\n IUniswapV3SwapCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\\\";\\nimport {GUniPoolStorage} from \\\"./abstract/GUniPoolStorage.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {TickMath} from \\\"./vendor/uniswap/TickMath.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {SafeCast} from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport {\\n FullMath,\\n LiquidityAmounts\\n} from \\\"./vendor/uniswap/LiquidityAmounts.sol\\\";\\n\\ncontract GUniPool is\\n IUniswapV3MintCallback,\\n IUniswapV3SwapCallback,\\n GUniPoolStorage\\n{\\n using SafeERC20 for IERC20;\\n using TickMath for int24;\\n\\n event Minted(\\n address receiver,\\n uint256 mintAmount,\\n uint256 amount0In,\\n uint256 amount1In,\\n uint128 liquidityMinted\\n );\\n\\n event Burned(\\n address receiver,\\n uint256 burnAmount,\\n uint256 amount0Out,\\n uint256 amount1Out,\\n uint128 liquidityBurned\\n );\\n\\n event Rebalance(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidityBefore,\\n uint128 liquidityAfter\\n );\\n\\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice Uniswap V3 callback fn, called back on pool.mint\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata /*_data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\\n }\\n\\n /// @notice Uniswap v3 callback fn, called back on pool.swap\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata /*data*/\\n ) external override {\\n require(msg.sender == address(pool), \\\"callback caller\\\");\\n\\n if (amount0Delta > 0)\\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\\n else if (amount1Delta > 0)\\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\\n }\\n\\n // User functions => Should be called via a Router\\n\\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\\n /// @param mintAmount The number of G-UNI tokens to mint\\n /// @param receiver The account to receive the minted tokens\\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function mint(uint256 mintAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityMinted\\n )\\n {\\n require(mintAmount > 0, \\\"mint 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n\\n if (totalSupply > 0) {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n amount0 = FullMath.mulDivRoundingUp(\\n amount0Current,\\n mintAmount,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n amount1Current,\\n mintAmount,\\n totalSupply\\n );\\n } else {\\n // if supply is 0 mintAmount == liquidity to deposit\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n SafeCast.toUint128(mintAmount)\\n );\\n }\\n\\n // transfer amounts owed to contract\\n if (amount0 > 0) {\\n token0.safeTransferFrom(msg.sender, address(this), amount0);\\n }\\n if (amount1 > 0) {\\n token1.safeTransferFrom(msg.sender, address(this), amount1);\\n }\\n\\n // deposit as much new liquidity as possible\\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n\\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \\\"\\\");\\n\\n _mint(receiver, mintAmount);\\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\\n }\\n\\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\\n /// @param burnAmount The number of G-UNI tokens to burn\\n /// @param receiver The account to receive the underlying amounts of token0 and token1\\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines\\n function burn(uint256 burnAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityBurned\\n )\\n {\\n require(burnAmount > 0, \\\"burn 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n\\n _burn(msg.sender, burnAmount);\\n\\n uint256 liquidityBurned_ =\\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidityBurned);\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n\\n amount0 =\\n burn0 +\\n FullMath.mulDiv(\\n token0.balanceOf(address(this)) -\\n burn0 -\\n managerBalance0 -\\n gelatoBalance0,\\n burnAmount,\\n totalSupply\\n );\\n amount1 =\\n burn1 +\\n FullMath.mulDiv(\\n token1.balanceOf(address(this)) -\\n burn1 -\\n managerBalance1 -\\n gelatoBalance1,\\n burnAmount,\\n totalSupply\\n );\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(receiver, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(receiver, amount1);\\n }\\n\\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\\n }\\n\\n // Manager Functions => Called by Pool Manager\\n\\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\\n /// any leftover will be unused and sit idle until the next rebalance.\\n /// @param newLowerTick The new lower bound of the position's range\\n /// @param newUpperTick The new upper bound of the position's range\\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\\n // solhint-disable-next-line function-max-lines\\n function executiveRebalance(\\n int24 newLowerTick,\\n int24 newUpperTick,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) external onlyManager {\\n uint128 liquidity;\\n uint128 newLiquidity;\\n if (totalSupply() > 0) {\\n (liquidity, , , , ) = pool.positions(_getPositionID());\\n if (liquidity > 0) {\\n (, , uint256 fee0, uint256 fee1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n\\n _applyFees(fee0, fee1);\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n emit FeesEarned(fee0, fee1);\\n }\\n\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n\\n uint256 reinvest0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n uint256 reinvest1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n\\n _deposit(\\n newLowerTick,\\n newUpperTick,\\n reinvest0,\\n reinvest1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n\\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > 0, \\\"new position 0\\\");\\n } else {\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n }\\n\\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\\n }\\n\\n // Gelatofied functions => Automatically called by Gelato\\n\\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\\n function rebalance(\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) external gelatofy(feeAmount, paymentToken) {\\n if (swapAmountBPS > 0) {\\n _checkSlippage(swapThresholdPrice, zeroForOne);\\n }\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n _rebalance(\\n liquidity,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne,\\n feeAmount,\\n paymentToken\\n );\\n\\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\\n require(newLiquidity > liquidity, \\\"liquidity must increase\\\");\\n\\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\\n }\\n\\n /// @notice withdraw manager fees accrued, only gelato executors can call.\\n /// Target account to receive fees is managerTreasury, alterable by manager.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n managerBalance0,\\n managerBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(managerTreasury, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(managerTreasury, amount1);\\n }\\n }\\n\\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n gelatoBalance0,\\n gelatoBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n gelatoBalance0 = 0;\\n gelatoBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(GELATO, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(GELATO, amount1);\\n }\\n }\\n\\n function _balancesToWithdraw(\\n uint256 balance0,\\n uint256 balance1,\\n uint256 feeAmount,\\n address feeToken\\n ) internal view returns (uint256 amount0, uint256 amount1) {\\n if (feeToken == address(token0)) {\\n require(\\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount0 = balance0 - feeAmount;\\n amount1 = balance1;\\n } else if (feeToken == address(token1)) {\\n require(\\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount1 = balance1 - feeAmount;\\n amount0 = balance0;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n }\\n\\n // View functions\\n\\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\\n /// @param amount0Max The maximum amount of token0 to forward on mint\\n /// @param amount0Max The maximum amount of token1 to forward on mint\\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\\n /// @return mintAmount maximum number of G-UNI tokens to mint\\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\\n external\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n uint256 totalSupply = totalSupply();\\n if (totalSupply > 0) {\\n (amount0, amount1, mintAmount) = _computeMintAmounts(\\n totalSupply,\\n amount0Max,\\n amount1Max\\n );\\n } else {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 newLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0Max,\\n amount1Max\\n );\\n mintAmount = uint256(newLiquidity);\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n newLiquidity\\n );\\n }\\n }\\n\\n /// @notice compute total underlying holdings of the G-UNI token supply\\n /// includes current liquidity invested in uniswap position, current fees earned\\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\\n /// @return amount0Current current total underlying balance of token0\\n /// @return amount1Current current total underlying balance of token1\\n function getUnderlyingBalances()\\n public\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\\n external\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (, int24 tick, , , , , ) = pool.slot0();\\n return _getUnderlyingBalances(sqrtRatioX96, tick);\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\\n internal\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (\\n uint128 liquidity,\\n uint256 feeGrowthInside0Last,\\n uint256 feeGrowthInside1Last,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n ) = pool.positions(_getPositionID());\\n\\n // compute current holdings from liquidity\\n (amount0Current, amount1Current) = LiquidityAmounts\\n .getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n liquidity\\n );\\n\\n // compute current fees earned\\n uint256 fee0 =\\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\\n uint256(tokensOwed0);\\n uint256 fee1 =\\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\\n uint256(tokensOwed1);\\n\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n\\n // add any leftover in contract to current holdings\\n amount0Current +=\\n fee0 +\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n amount1Current +=\\n fee1 +\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n }\\n\\n // Private functions\\n\\n // solhint-disable-next-line function-max-lines\\n function _rebalance(\\n uint128 liquidity,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) private {\\n uint256 leftover0 =\\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\\n uint256 leftover1 =\\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\\n\\n (, , uint256 feesEarned0, uint256 feesEarned1) =\\n _withdraw(lowerTick, upperTick, liquidity);\\n _applyFees(feesEarned0, feesEarned1);\\n (feesEarned0, feesEarned1) = _subtractAdminFees(\\n feesEarned0,\\n feesEarned1\\n );\\n emit FeesEarned(feesEarned0, feesEarned1);\\n feesEarned0 += leftover0;\\n feesEarned1 += leftover1;\\n\\n if (paymentToken == address(token0)) {\\n require(\\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0 -\\n feeAmount;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n } else if (paymentToken == address(token1)) {\\n require(\\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n leftover0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n leftover1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1 -\\n feeAmount;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n\\n _deposit(\\n lowerTick,\\n upperTick,\\n leftover0,\\n leftover1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _withdraw(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidity\\n )\\n private\\n returns (\\n uint256 burn0,\\n uint256 burn1,\\n uint256 fee0,\\n uint256 fee1\\n )\\n {\\n uint256 preBalance0 = token0.balanceOf(address(this));\\n uint256 preBalance1 = token1.balanceOf(address(this));\\n\\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\\n\\n pool.collect(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n type(uint128).max,\\n type(uint128).max\\n );\\n\\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _deposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) private {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n // First, deposit as much as we can\\n uint128 baseLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n if (baseLiquidity > 0) {\\n (uint256 amountDeposited0, uint256 amountDeposited1) =\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n baseLiquidity,\\n \\\"\\\"\\n );\\n\\n amount0 -= amountDeposited0;\\n amount1 -= amountDeposited1;\\n }\\n int256 swapAmount =\\n SafeCast.toInt256(\\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\\n );\\n if (swapAmount > 0) {\\n _swapAndDeposit(\\n lowerTick_,\\n upperTick_,\\n amount0,\\n amount1,\\n swapAmount,\\n swapThresholdPrice,\\n zeroForOne\\n );\\n }\\n }\\n\\n function _swapAndDeposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n int256 swapAmount,\\n uint160 swapThresholdPrice,\\n bool zeroForOne\\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\\n (int256 amount0Delta, int256 amount1Delta) =\\n pool.swap(\\n address(this),\\n zeroForOne,\\n swapAmount,\\n swapThresholdPrice,\\n \\\"\\\"\\n );\\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\\n\\n // Add liquidity a second time\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 liquidityAfterSwap =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n finalAmount0,\\n finalAmount1\\n );\\n if (liquidityAfterSwap > 0) {\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n liquidityAfterSwap,\\n \\\"\\\"\\n );\\n }\\n }\\n\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function _computeMintAmounts(\\n uint256 totalSupply,\\n uint256 amount0Max,\\n uint256 amount1Max\\n )\\n private\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n // compute proportional amount of tokens to mint\\n if (amount0Current == 0 && amount1Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount1Max,\\n totalSupply,\\n amount1Current\\n );\\n } else if (amount1Current == 0 && amount0Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount0Max,\\n totalSupply,\\n amount0Current\\n );\\n } else if (amount0Current == 0 && amount1Current == 0) {\\n revert(\\\"\\\");\\n } else {\\n // only if both are non-zero\\n uint256 amount0Mint =\\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\\n uint256 amount1Mint =\\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\\n require(amount0Mint > 0 && amount1Mint > 0, \\\"mint 0\\\");\\n\\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\\n }\\n\\n // compute amounts owed to contract\\n amount0 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount0Current,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount1Current,\\n totalSupply\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _computeFeesEarned(\\n bool isZero,\\n uint256 feeGrowthInsideLast,\\n int24 tick,\\n uint128 liquidity\\n ) private view returns (uint256 fee) {\\n uint256 feeGrowthOutsideLower;\\n uint256 feeGrowthOutsideUpper;\\n uint256 feeGrowthGlobal;\\n if (isZero) {\\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\\n } else {\\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\\n }\\n\\n unchecked {\\n // calculate fee growth below\\n uint256 feeGrowthBelow;\\n if (tick >= lowerTick) {\\n feeGrowthBelow = feeGrowthOutsideLower;\\n } else {\\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\\n }\\n\\n // calculate fee growth above\\n uint256 feeGrowthAbove;\\n if (tick < upperTick) {\\n feeGrowthAbove = feeGrowthOutsideUpper;\\n } else {\\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\\n }\\n\\n uint256 feeGrowthInside =\\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\\n fee = FullMath.mulDiv(\\n liquidity,\\n feeGrowthInside - feeGrowthInsideLast,\\n 0x100000000000000000000000000000000\\n );\\n }\\n }\\n\\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\\n }\\n\\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\\n private\\n view\\n returns (uint256 fee0, uint256 fee1)\\n {\\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n fee0 = rawFee0 - deduct0;\\n fee1 = rawFee1 - deduct1;\\n }\\n\\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\\n private\\n view\\n {\\n uint32[] memory secondsAgo = new uint32[](2);\\n secondsAgo[0] = gelatoSlippageInterval;\\n secondsAgo[1] = 0;\\n\\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\\n\\n require(tickCumulatives.length == 2, \\\"array len\\\");\\n uint160 avgSqrtRatioX96;\\n unchecked {\\n int24 avgTick =\\n int24(\\n (tickCumulatives[1] - tickCumulatives[0]) /\\n int56(uint56(gelatoSlippageInterval))\\n );\\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\\n }\\n\\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\\n if (zeroForOne) {\\n require(\\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\\n \\\"high slippage\\\"\\n );\\n } else {\\n require(\\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\\n \\\"high slippage\\\"\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x57283d620777e122c97c6ca2c10a442c125cc72b07fd8b5c192104aa3279d1e3\",\"license\":\"GPL-3.0\"},\"contracts/abstract/GUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {Gelatofied} from \\\"./Gelatofied.sol\\\";\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {\\n ReentrancyGuardUpgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport {\\n ERC20Upgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\n\\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\\n/// @dev ERC20Upgradable Includes Initialize\\n// solhint-disable-next-line max-states-count\\nabstract contract GUniPoolStorage is\\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\\n ReentrancyGuardUpgradeable,\\n OwnableUninitialized,\\n Gelatofied\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n // solhint-disable-next-line const-name-snakecase\\n uint16 public constant gelatoFeeBPS = 250;\\n\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n int24 public lowerTick;\\n int24 public upperTick;\\n\\n uint16 public gelatoRebalanceBPS;\\n uint16 public gelatoWithdrawBPS;\\n uint16 public gelatoSlippageBPS;\\n uint32 public gelatoSlippageInterval;\\n\\n uint16 public managerFeeBPS;\\n address public managerTreasury;\\n\\n uint256 public managerBalance0;\\n uint256 public managerBalance1;\\n uint256 public gelatoBalance0;\\n uint256 public gelatoBalance1;\\n\\n IUniswapV3Pool public pool;\\n IERC20 public token0;\\n IERC20 public token1;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdateAdminTreasury(\\n address oldAdminTreasury,\\n address newAdminTreasury\\n );\\n\\n event UpdateGelatoParams(\\n uint16 gelatoRebalanceBPS,\\n uint16 gelatoWithdrawBPS,\\n uint16 gelatoSlippageBPS,\\n uint32 gelatoSlippageInterval\\n );\\n\\n event SetManagerFee(uint16 managerFee);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice initialize storage variables on a new G-UNI pool, only called once\\n /// @param _name name of G-UNI token\\n /// @param _symbol symbol of G-UNI token\\n /// @param _pool address of Uniswap V3 pool\\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\\n /// @param _manager_ address of manager (ownership can be transferred)\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external initializer {\\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \\\"mBPS\\\");\\n\\n // these variables are immutable after initialization\\n pool = IUniswapV3Pool(_pool);\\n token0 = IERC20(pool.token0());\\n token1 = IERC20(pool.token1());\\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\\n\\n // these variables can be udpated by the manager\\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\\n gelatoSlippageBPS = 500; // default: 5% slippage\\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\\n managerTreasury = _manager_; // default: treasury is admin\\n lowerTick = _lowerTick;\\n upperTick = _upperTick;\\n _manager = _manager_;\\n\\n // e.g. \\\"Gelato Uniswap V3 USDC/DAI LP\\\" and \\\"G-UNI\\\"\\n __ERC20_init(_name, _symbol);\\n __ReentrancyGuard_init();\\n }\\n\\n /// @notice change configurable parameters, only manager can call\\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\\n /// @param newTreasury address where managerFee withdrawals are sent\\n // solhint-disable-next-line code-complexity\\n function updateGelatoParams(\\n uint16 newRebalanceBPS,\\n uint16 newWithdrawBPS,\\n uint16 newSlippageBPS,\\n uint32 newSlippageInterval,\\n address newTreasury\\n ) external onlyManager {\\n require(newWithdrawBPS <= 10000, \\\"BPS\\\");\\n require(newRebalanceBPS <= 10000, \\\"BPS\\\");\\n require(newSlippageBPS <= 10000, \\\"BPS\\\");\\n emit UpdateGelatoParams(\\n newRebalanceBPS,\\n newWithdrawBPS,\\n newSlippageBPS,\\n newSlippageInterval\\n );\\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\\n if (newSlippageInterval != 0)\\n gelatoSlippageInterval = newSlippageInterval;\\n if (newTreasury != address(0)) managerTreasury = newTreasury;\\n }\\n\\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\\n /// If a manager fee was not set in the initialize function it can be set here\\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\\n require(managerFeeBPS == 0, \\\"fee\\\");\\n require(\\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\\n \\\"mBPS\\\"\\n );\\n emit SetManagerFee(_managerFeeBPS);\\n managerFeeBPS = _managerFeeBPS;\\n }\\n\\n function renounceOwnership() public virtual override onlyManager {\\n managerTreasury = address(0);\\n managerFeeBPS = 0;\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n super.renounceOwnership();\\n }\\n\\n function getPositionID() external view returns (bytes32 positionID) {\\n return _getPositionID();\\n }\\n\\n function _getPositionID() internal view returns (bytes32 positionID) {\\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\\n }\\n}\\n\",\"keccak256\":\"0xd641844e84406e827578ae316c8690b05db17ac84ee5a6b235228b3605ea46de\",\"license\":\"GPL-3.0\"},\"contracts/abstract/Gelatofied.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract Gelatofied {\\n using Address for address payable;\\n using SafeERC20 for IERC20;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n address payable public immutable GELATO;\\n\\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n constructor(address payable _gelato) {\\n GELATO = _gelato;\\n }\\n\\n modifier gelatofy(uint256 _amount, address _paymentToken) {\\n require(msg.sender == GELATO, \\\"Gelatofied: Only gelato\\\");\\n _;\\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x31ddffff0545c4342d3cea88f4d2af520057f467f5e550e4e7166d24cc911cf1\",\"license\":\"GPL-3.0\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.4;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x81d888640e2261ac5189e6061a0cf4a7f3cec5994be1859ba60ffeb961f70c01\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/FullMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.4;\\n\\n/// @title Contains 512-bit math functions\\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\\n/// @dev Handles \\\"phantom overflow\\\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\\nlibrary FullMath {\\n /// @notice Calculates floor(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\\n function mulDiv(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = a * b\\n // Compute the product mod 2**256 and mod 2**256 - 1\\n // then use the Chinese Remainder Theorem to reconstruct\\n // the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2**256 + prod0\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(a, b, not(0))\\n prod0 := mul(a, b)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division\\n if (prod1 == 0) {\\n require(denominator > 0);\\n assembly {\\n result := div(prod0, denominator)\\n }\\n return result;\\n }\\n\\n // Make sure the result is less than 2**256.\\n // Also prevents denominator == 0\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0]\\n // Compute remainder using mulmod\\n uint256 remainder;\\n assembly {\\n remainder := mulmod(a, b, denominator)\\n }\\n // Subtract 256 bit number from 512 bit number\\n assembly {\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator\\n // Compute largest power of two divisor of denominator.\\n // Always >= 1.\\n // EDIT for 0.8 compatibility:\\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\\n uint256 twos = denominator & (~denominator + 1);\\n\\n // Divide denominator by power of two\\n assembly {\\n denominator := div(denominator, twos)\\n }\\n\\n // Divide [prod1 prod0] by the factors of two\\n assembly {\\n prod0 := div(prod0, twos)\\n }\\n // Shift in bits from prod1 into prod0. For this we need\\n // to flip `twos` such that it is 2**256 / twos.\\n // If twos is zero, then it becomes one\\n assembly {\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2**256\\n // Now that denominator is an odd number, it has an inverse\\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\\n // Compute the inverse by starting with a seed that is correct\\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\\n uint256 inv = (3 * denominator) ^ 2;\\n // Now use Newton-Raphson iteration to improve the precision.\\n // Thanks to Hensel's lifting lemma, this also works in modular\\n // arithmetic, doubling the correct bits in each step.\\n inv *= 2 - denominator * inv; // inverse mod 2**8\\n inv *= 2 - denominator * inv; // inverse mod 2**16\\n inv *= 2 - denominator * inv; // inverse mod 2**32\\n inv *= 2 - denominator * inv; // inverse mod 2**64\\n inv *= 2 - denominator * inv; // inverse mod 2**128\\n inv *= 2 - denominator * inv; // inverse mod 2**256\\n\\n // Because the division is now exact we can divide by multiplying\\n // with the modular inverse of denominator. This will give us the\\n // correct result modulo 2**256. Since the precoditions guarantee\\n // that the outcome is less than 2**256, this is the final result.\\n // We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inv;\\n return result;\\n }\\n }\\n\\n /// @notice Calculates ceil(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n function mulDivRoundingUp(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n result = mulDiv(a, b, denominator);\\n if (mulmod(a, b, denominator) > 0) {\\n require(result < type(uint256).max);\\n result++;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3fa0efa3eea2a84bd6ab7e55badd61f97069a6c50780059b036c810427a9740c\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/LiquidityAmounts.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.5.0;\\n\\nimport {FullMath} from \\\"./FullMath.sol\\\";\\nimport \\\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\\\";\\n\\n/// @title Liquidity amount functions\\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\\nlibrary LiquidityAmounts {\\n function toUint128(uint256 x) private pure returns (uint128 y) {\\n require((y = uint128(x)) == x);\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount0 The amount0 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount0(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n uint256 intermediate =\\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount0,\\n intermediate,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount1 The amount1 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount1(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount1,\\n FixedPoint96.Q96,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\\n /// pool prices and the prices at the tick boundaries\\n function getLiquidityForAmounts(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n liquidity = getLiquidityForAmount0(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount0\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n uint128 liquidity0 =\\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\\n uint128 liquidity1 =\\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\\n\\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\\n } else {\\n liquidity = getLiquidityForAmount1(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount1\\n );\\n }\\n }\\n\\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount0 The amount0\\n function getAmount0ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n uint256(liquidity) << FixedPoint96.RESOLUTION,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n sqrtRatioBX96\\n ) / sqrtRatioAX96;\\n }\\n\\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount1 The amount1\\n function getAmount1ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n liquidity,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n FixedPoint96.Q96\\n );\\n }\\n\\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\\n /// pool prices and the prices at the tick boundaries\\n function getAmountsForLiquidity(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0, uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 <= sqrtRatioAX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioX96,\\n liquidity\\n );\\n } else {\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x6205f6409d42fc9565530d2a69819bf8c4e4c66b7a4c61d0827e81c084df6832\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/TickMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\n/// prices between 2**-128 and 2**128\\nlibrary TickMath {\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\n int24 internal constant MIN_TICK = -887272;\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\n int24 internal constant MAX_TICK = -MIN_TICK;\\n\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\n uint160 internal constant MAX_SQRT_RATIO =\\n 1461446703485210103287273052203988822378723970342;\\n\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\n /// @dev Throws if |tick| > max tick\\n /// @param tick The input tick for the above formula\\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\n /// at the given tick\\n function getSqrtRatioAtTick(int24 tick)\\n internal\\n pure\\n returns (uint160 sqrtPriceX96)\\n {\\n uint256 absTick =\\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\\n\\n // EDIT: 0.8 compatibility\\n require(absTick <= uint256(int256(MAX_TICK)), \\\"T\\\");\\n\\n uint256 ratio =\\n absTick & 0x1 != 0\\n ? 0xfffcb933bd6fad37aa2d162d1a594001\\n : 0x100000000000000000000000000000000;\\n if (absTick & 0x2 != 0)\\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\\n if (absTick & 0x4 != 0)\\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\\n if (absTick & 0x8 != 0)\\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\\n if (absTick & 0x10 != 0)\\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\\n if (absTick & 0x20 != 0)\\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\\n if (absTick & 0x40 != 0)\\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\\n if (absTick & 0x80 != 0)\\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\\n if (absTick & 0x100 != 0)\\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\\n if (absTick & 0x200 != 0)\\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\\n if (absTick & 0x400 != 0)\\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\\n if (absTick & 0x800 != 0)\\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\\n if (absTick & 0x1000 != 0)\\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\\n if (absTick & 0x2000 != 0)\\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\\n if (absTick & 0x4000 != 0)\\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\\n if (absTick & 0x8000 != 0)\\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\\n if (absTick & 0x10000 != 0)\\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\\n if (absTick & 0x20000 != 0)\\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\\n if (absTick & 0x40000 != 0)\\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\\n if (absTick & 0x80000 != 0)\\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\\n\\n if (tick > 0) ratio = type(uint256).max / ratio;\\n\\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\n sqrtPriceX96 = uint160(\\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\\n );\\n }\\n\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\n /// ever return.\\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\\n internal\\n pure\\n returns (int24 tick)\\n {\\n // second inequality must be < because the price can never reach the price at the max tick\\n require(\\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\\n \\\"R\\\"\\n );\\n uint256 ratio = uint256(sqrtPriceX96) << 32;\\n\\n uint256 r = ratio;\\n uint256 msb = 0;\\n\\n assembly {\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(4, gt(r, 0xFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(3, gt(r, 0xFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(2, gt(r, 0xF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(1, gt(r, 0x3))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := gt(r, 0x1)\\n msb := or(msb, f)\\n }\\n\\n if (msb >= 128) r = ratio >> (msb - 127);\\n else r = ratio << (127 - msb);\\n\\n int256 log_2 = (int256(msb) - 128) << 64;\\n\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(63, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(62, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(61, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(60, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(59, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(58, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(57, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(56, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(55, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(54, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(53, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(52, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(51, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(50, f))\\n }\\n\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\n\\n int24 tickLow =\\n int24(\\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\\n );\\n int24 tickHi =\\n int24(\\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\\n );\\n\\n tick = tickLow == tickHi\\n ? tickLow\\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\\n ? tickHi\\n : tickLow;\\n }\\n}\\n\",\"keccak256\":\"0xc0faed28071dc68a5f4b03abbb6115759824980feb95a7fcf3b66ae7e1bab58f\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b50604051620060d1380380620060d183398101604081905262000034916200004a565b60601b6001600160601b0319166080526200007a565b6000602082840312156200005c578081fd5b81516001600160a01b038116811462000073578182fd5b9392505050565b60805160601c615ff9620000d8600039600081816105f801528181610d3f01528181610e2801528181610e620152818161154901528181611795015281816117cf015281816118b10152818161192801526119650152615ff96000f3fe608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190615a02565b61026e610269366004615353565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d91906158ef565b6102a66106fb565b60405161023d929190615bfa565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004615313565b6107a4565b6102f56102f036600461545d565b61085c565b005b6102ff60fa81565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004615353565b610c96565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610ccd565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b13660046152a3565b6001600160a01b031660009081526033602052604090205490565b6102f5610cdc565b6097546103e890600160b81b900460020b81565b60405161023d91906159c6565b6102f561040336600461588e565b610d32565b61041b61041636600461588e565b610e8d565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e611173565b61045a6104553660046158b2565b611182565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004615814565b6112d4565b6097546103e890600160a01b900460020b81565b61026e6104aa366004615353565b611494565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004615353565b61152f565b6102f56104e53660046157c4565b61153c565b610233609b5481565b6102a66105013660046152a3565b6117fd565b6102f561051436600461588e565b6118a4565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046154e7565b61198a565b6097546102ff90600160f01b900461ffff1681565b61023361059a3660046152db565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6102336119ee565b6102f56105db366004615537565b6119fd565b6102f56105ee366004615718565b611c9a565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f56106283660046152a3565b611da7565b6102f561063b3660046154e7565b611e87565b61041b61064e36600461588e565b611ef1565b60606036805461066290615e08565b80601f016020809104026020016040519081016040528092919081815260200182805461068e90615e08565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f233848461222a565b50600192915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190615734565b50505050509150915061079a828261234f565b9350935050509091565b60006107b1848484612600565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561083b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61084f853361084a8685615dc5565b61222a565b60019150505b9392505050565b33610865610ccd565b6001600160a01b03161461088b5760405162461bcd60e51b815260040161083290615b61565b600080600061089960355490565b1115610c1d57609d546001600160a01b031663514ea4bf6108b86127c6565b6040518263ffffffff1660e01b81526004016108d691815260200190565b60a06040518083038186803b1580156108ee57600080fd5b505afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092691906156c2565b5092945050506001600160801b0383161590506109af57609754600090819061096590600160a01b8104600290810b91600160b81b9004900b8661282c565b9350935050506109758282612bb9565b61097f8282612c92565b6040519193509150600080516020615fa4833981519152906109a49084908490615bfa565b60405180910390a150505b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a2c9030906004016158ef565b60206040518083038186803b158015610a4457600080fd5b505afa158015610a58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7c9190615876565b610a869190615dc5565b610a909190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610acc9030906004016158ef565b60206040518083038186803b158015610ae457600080fd5b505afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c9190615876565b610b269190615dc5565b610b309190615dc5565b9050610b41898984848b8b8b612d2d565b609d546001600160a01b031663514ea4bf610b5a6127c6565b6040518263ffffffff1660e01b8152600401610b7891815260200190565b60a06040518083038186803b158015610b9057600080fd5b505afa158015610ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc891906156c2565b509295505050506001600160801b038316610c165760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610832565b5050610c62565b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615f4483398151915287878484604051610c8594939291906159d4565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061084a908690615ca3565b6097546001600160a01b031690565b33610ce5610ccd565b6001600160a01b031614610d0b5760405162461bcd60e51b815260040161083290615b61565b60988054600160201b600160d01b031916905560006099819055609a55610d30612eec565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d7c5760405162461bcd60e51b815260040161083290615a35565b600080610d8f609954609a548888612f53565b60006099819055609a5590925090508115610dc957609854609e54610dc9916001600160a01b0391821691600160301b9091041684613077565b8015610df457609854609f54610df4916001600160a01b0391821691600160301b9091041683613077565b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610e5357610e4e6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b610e87565b610e876001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050565b600080600060026065541415610eb55760405162461bcd60e51b815260040161083290615bc3565b600260655584610ed75760405162461bcd60e51b815260040161083290615ba3565b6000610ee260355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610f3457600080fd5b505afa158015610f48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6c9190615734565b50505050505090506000821115610fad57600080610f886106fb565b91509150610f97828a866131f5565b9650610fa4818a866131f5565b95505050610ffa565b610ff481610fcc609760149054906101000a900460020b60020b61324c565b609754610fe690600160b81b9004600290810b900b61324c565b610fef8b61365e565b6136c7565b90955093505b841561101857609e54611018906001600160a01b0316333088613762565b831561103657609f54611036906001600160a01b0316333087613762565b61107681611055609760149054906101000a900460020b60020b61324c565b60975461106f90600160b81b9004600290810b900b61324c565b888861379a565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d916110c6913091600160a01b8104600290810b92600160b81b909204900b908990600401615903565b6040805180830381600087803b1580156110df57600080fd5b505af11580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111791906154c4565b5050611123868861385c565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e7868887878760405161115a959493929190615945565b60405180910390a1505060016065819055509250925092565b60606037805461066290615e08565b60008060008061119160355490565b905080156111b0576111a4818787613929565b919550935091506112cc565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b1580156111f557600080fd5b505afa158015611209573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122d9190615734565b5050505050509050600061127782611256609760149054906101000a900460020b60020b61324c565b60975461127090600160b81b9004600290810b900b61324c565b8b8b61379a565b9050806001600160801b031693506112c4826112a4609760149054906101000a900460020b60020b61324c565b6097546112be90600160b81b9004600290810b900b61324c565b846136c7565b909650945050505b509250925092565b336112dd610ccd565b6001600160a01b0316146113035760405162461bcd60e51b815260040161083290615b61565b6127108461ffff1611156113295760405162461bcd60e51b815260040161083290615b44565b6127108561ffff16111561134f5760405162461bcd60e51b815260040161083290615b44565b6127108361ffff1611156113755760405162461bcd60e51b815260040161083290615b44565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff8516156113ec576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff841615611411576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561143757609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff821615611459576098805463ffffffff191663ffffffff84161790555b6001600160a01b0381161561148d5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156115165760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610832565b611525338561084a8685615dc5565b5060019392505050565b60006106f2338484612600565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146115865760405162461bcd60e51b815260040161083290615a35565b8515611596576115968786613a38565b609d546000906001600160a01b031663514ea4bf6115b26127c6565b6040518263ffffffff1660e01b81526004016115d091815260200190565b60a06040518083038186803b1580156115e857600080fd5b505afa1580156115fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162091906156c2565b505050509050611634818989898989613ce6565b609d546000906001600160a01b031663514ea4bf6116506127c6565b6040518263ffffffff1660e01b815260040161166e91815260200190565b60a06040518083038186803b15801561168657600080fd5b505afa15801561169a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116be91906156c2565b505050509050816001600160801b0316816001600160801b03161161171f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610832565b609754604051600080516020615f448339815191529161175991600160a01b8204600290810b92600160b81b9004900b90869086906159d4565b60405180910390a150506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156117c0576117bb6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b6117f4565b6117f46001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561185057600080fd5b505afa158015611864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118889190615734565b505050505091505061189a848261234f565b9250925050915091565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118ee5760405162461bcd60e51b815260040161083290615a35565b600080611901609b54609c548888612f53565b6000609b819055609c559092509050811561194d57609e5461194d906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084613077565b8015610df457609f54610df4906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083613077565b609d546001600160a01b031633146119b45760405162461bcd60e51b815260040161083290615a84565b83156119d157609e546119d1906001600160a01b03163386613077565b8215610e8757609f54610e87906001600160a01b03163385613077565b60006119f86127c6565b905090565b600054610100900460ff1680611a16575060005460ff16155b611a325760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015611a54576000805461ffff19166101011790555b611a6160fa612710615d82565b61ffff168561ffff161115611a885760405162461bcd60e51b815260040161083290615a66565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe168191600480820192602092909190829003018186803b158015611adc57600080fd5b505afa158015611af0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1491906152bf565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611b6d57600080fd5b505afa158015611b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba591906152bf565b609f80546001600160a01b03199081166001600160a01b0393841617909155609880546097805461012c65ffffffffffff19909316600160201b61ffff8d160263ffffffff19161792909217600160301b600160d01b031916600160301b95881695860217909255643e800c801960d31b600165ffffff00000160a01b03909116600160a01b60028a810b62ffffff908116929092029290921792909217600165ffffff00000160a01b031916600160b81b9189900b9290921602909216919091179091179055611c768888614208565b611c7e614287565b8015611c90576000805461ff00191690555b5050505050505050565b33611ca3610ccd565b6001600160a01b031614611cc95760405162461bcd60e51b815260040161083290615b61565b609854600160201b900461ffff1615611d0a5760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610832565b60008161ffff16118015611d325750611d2660fa612710615d82565b61ffff168161ffff1611155b611d4e5760405162461bcd60e51b815260040161083290615a66565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611db0610ccd565b6001600160a01b031614611dd65760405162461bcd60e51b815260040161083290615b61565b6001600160a01b038116611e3d5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610832565b6097546040516001600160a01b03808416921690600080516020615f6483398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611eb15760405162461bcd60e51b815260040161083290615a84565b6000841315611ed157609e54610e4e906001600160a01b03163386613077565b6000831315610e8757609f54610e87906001600160a01b03163385613077565b600080600060026065541415611f195760405162461bcd60e51b815260040161083290615bc3565b600260655584611f545760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610832565b6000611f5f60355490565b609d549091506000906001600160a01b031663514ea4bf611f7e6127c6565b6040518263ffffffff1660e01b8152600401611f9c91815260200190565b60a06040518083038186803b158015611fb457600080fd5b505afa158015611fc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fec91906156c2565b505050509050611ffc33886142fb565b600061201288836001600160801b031685614438565b905061201d8161365e565b60975490945060009081908190819061204c90600160a01b8104600290810b91600160b81b9004900b8a61282c565b935093509350935061205e8282612bb9565b6120688282612c92565b6040519193509150600080516020615fa48339815191529061208d9084908490615bfa565b60405180910390a1609b54609954609e546040516370a0823160e01b815261214893929188916001600160a01b03909116906370a08231906120d39030906004016158ef565b60206040518083038186803b1580156120eb57600080fd5b505afa1580156120ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121239190615876565b61212d9190615dc5565b6121379190615dc5565b6121419190615dc5565b8d89614438565b6121529085615ca3565b609c54609a54609f546040516370a0823160e01b8152939d5061218f9387916001600160a01b0316906370a08231906120d39030906004016158ef565b6121999084615ca3565b985089156121b857609e546121b8906001600160a01b03168c8c613077565b88156121d557609f546121d5906001600160a01b03168c8b613077565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c60405161220c959493929190615945565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b03831661228c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610832565b6001600160a01b0382166122ed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610832565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf6123776127c6565b6040518263ffffffff1660e01b815260040161239591815260200190565b60a06040518083038186803b1580156123ad57600080fd5b505afa1580156123c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e591906156c2565b9450945094509450945061242e8961240e609760149054906101000a900460020b60020b61324c565b60975461242890600160b81b9004600290810b900b61324c565b886136c7565b909750955060006001600160801b03831661244c6001878c8a6144e7565b6124569190615ca3565b90506000826001600160801b03166124716000878d8b6144e7565b61247b9190615ca3565b90506124878282612c92565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a08231906124c59030906004016158ef565b60206040518083038186803b1580156124dd57600080fd5b505afa1580156124f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125159190615876565b61251f9085615ca3565b6125299190615dc5565b6125339190615dc5565b61253d908a615ca3565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a08231906125789030906004016158ef565b60206040518083038186803b15801561259057600080fd5b505afa1580156125a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c89190615876565b6125d29084615ca3565b6125dc9190615dc5565b6125e69190615dc5565b6125f09089615ca3565b9750505050505050509250929050565b6001600160a01b0383166126645760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610832565b6001600160a01b0382166126c65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610832565b6001600160a01b0383166000908152603360205260409020548181101561273e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610832565b6127488282615dc5565b6001600160a01b03808616600090815260336020526040808220939093559085168152908120805484929061277e908490615ca3565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615f84833981519152846040516127b891815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b8204600290810b810b60e890811b6034840152600160b81b909304810b900b90911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a08231906128659030906004016158ef565b60206040518083038186803b15801561287d57600080fd5b505afa158015612891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b59190615876565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a08231906128eb9030906004016158ef565b60206040518083038186803b15801561290357600080fd5b505afa158015612917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293b9190615876565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a7906064016040805180830381600087803b15801561299b57600080fd5b505af11580156129af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d391906154c4565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a4016040805180830381600087803b158015612a4157600080fd5b505af1158015612a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a799190615690565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612aaf9030906004016158ef565b60206040518083038186803b158015612ac757600080fd5b505afa158015612adb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aff9190615876565b612b099190615dc5565b612b139190615dc5565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a0823190612b489030906004016158ef565b60206040518083038186803b158015612b6057600080fd5b505afa158015612b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b989190615876565b612ba29190615dc5565b612bac9190615dc5565b9250505093509350935093565b612710612bc760fa84615d24565b612bd19190615ce1565b609b6000828254612be29190615ca3565b909155506127109050612bf660fa83615d24565b612c009190615ce1565b609c6000828254612c119190615ca3565b909155505060985461271090612c3290600160201b900461ffff1684615d24565b612c3c9190615ce1565b60996000828254612c4d9190615ca3565b909155505060985461271090612c6e90600160201b900461ffff1683615d24565b612c789190615ce1565b609a6000828254612c899190615ca3565b90915550505050565b6000806000612710609860049054906101000a900461ffff1660fa612cb79190615c5b565b612cc59061ffff1687615d24565b612ccf9190615ce1565b60985490915060009061271090612cf290600160201b900461ffff1660fa615c5b565b612d009061ffff1687615d24565b612d0a9190615ce1565b9050612d168287615dc5565b9350612d228186615dc5565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b158015612d7257600080fd5b505afa158015612d86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612daa9190615734565b50505050505090506000612dd782612dc48b60020b61324c565b612dd08b60020b61324c565b8a8a61379a565b90506001600160801b03811615612e9457609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612e239030908f908f908990600401615903565b6040805180830381600087803b158015612e3c57600080fd5b505af1158015612e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7491906154c4565b9092509050612e83828a615dc5565b9850612e8f8189615dc5565b975050505b6000612ec36127108686612ea85789612eaa565b8a5b612eb49190615d24565b612ebe9190615ce1565b6148f3565b90506000811315612ee057612edd8a8a8a8a858b8a614959565b50505b50505050505050505050565b33612ef5610ccd565b6001600160a01b031614612f1b5760405162461bcd60e51b815260040161083290615b61565b6097546040516000916001600160a01b031690600080516020615f64833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0384811691161415612fc857609754849061271090612f8c90600160e01b900461ffff1689615d24565b612f969190615ce1565b1015612fb45760405162461bcd60e51b815260040161083290615afb565b612fbe8487615dc5565b915084905061306e565b609f546001600160a01b038481169116141561303857609754849061271090612ffc90600160e01b900461ffff1688615d24565b6130069190615ce1565b10156130245760405162461bcd60e51b815260040161083290615afb565b61302e8486615dc5565b905085915061306e565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610832565b94509492505050565b6040516001600160a01b0383166024820152604481018290526130da90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614ba2565b505050565b8047101561312f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610832565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461317c576040519150601f19603f3d011682016040523d82523d6000602084013e613181565b606091505b50509050806130da5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610832565b6000613202848484614438565b90506000828061322257634e487b7160e01b600052601260045260246000fd5b848609111561085557600019811061323957600080fd5b8061324381615e43565b95945050505050565b60008060008360020b12613263578260020b613270565b8260020b61327090615e93565b905061327f620d89e719615e72565b60020b8111156132b55760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610832565b6000600182166132c957600160801b6132db565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561331057608061330b826ffff97272373d413259a46990580e213a615d24565b901c90505b600482161561333a576080613335826ffff2e50f5f656932ef12357cf3c7fdcc615d24565b901c90505b600882161561336457608061335f826fffe5caca7e10e4e61c3624eaa0941cd0615d24565b901c90505b601082161561338e576080613389826fffcb9843d60f6159c9db58835c926644615d24565b901c90505b60208216156133b85760806133b3826fff973b41fa98c081472e6896dfb254c0615d24565b901c90505b60408216156133e25760806133dd826fff2ea16466c96a3843ec78b326b52861615d24565b901c90505b608082161561340c576080613407826ffe5dee046a99a2a811c461f1969c3053615d24565b901c90505b610100821615613437576080613432826ffcbe86c7900a88aedcffc83b479aa3a4615d24565b901c90505b61020082161561346257608061345d826ff987a7253ac413176f2b074cf7815e54615d24565b901c90505b61040082161561348d576080613488826ff3392b0822b70005940c7a398e4b70f3615d24565b901c90505b6108008216156134b85760806134b3826fe7159475a2c29b7443b29c7fa6e889d9615d24565b901c90505b6110008216156134e35760806134de826fd097f3bdfd2022b8845ad8f792aa5825615d24565b901c90505b61200082161561350e576080613509826fa9f746462d870fdf8a65dc1f90e061e5615d24565b901c90505b614000821615613539576080613534826f70d869a156d2a1b890bb3df62baf32f7615d24565b901c90505b61800082161561356457608061355f826f31be135f97d08fd981231505542fcfa6615d24565b901c90505b6201000082161561359057608061358b826f09aa508b5b7a84e1c677de54f3e99bc9615d24565b901c90505b620200008216156135bb5760806135b6826e5d6af8dedb81196699c329225ee604615d24565b901c90505b620400008216156135e55760806135e0826d2216e584f5fa1ea926041bedfe98615d24565b901c90505b6208000082161561360d576080613608826b048a170391f7dc42444e8fa2615d24565b901c90505b60008460020b13156136285761362581600019615ce1565b90505b613636600160201b82615e5e565b15613642576001613645565b60005b6136569060ff16602083901c615ca3565b949350505050565b6000600160801b82106136c35760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610832565b5090565b600080836001600160a01b0316856001600160a01b031611156136e8579293925b846001600160a01b0316866001600160a01b0316116137135761370c858585614c74565b915061306e565b836001600160a01b0316866001600160a01b0316101561374c57613738868585614c74565b9150613745858785614cde565b905061306e565b613757858585614cde565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e879085906323b872dd60e01b906084016130a3565b6000836001600160a01b0316856001600160a01b031611156137ba579293925b846001600160a01b0316866001600160a01b0316116137e5576137de858585614d28565b9050613243565b836001600160a01b0316866001600160a01b0316101561384757600061380c878686614d28565b9050600061381b878986614d92565b9050806001600160801b0316826001600160801b03161061383c578061383e565b815b92505050613243565b613852858584614d92565b9695505050505050565b6001600160a01b0382166138b25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610832565b80603560008282546138c49190615ca3565b90915550506001600160a01b038216600090815260336020526040812080548392906138f1908490615ca3565b90915550506040518181526001600160a01b03831690600090600080516020615f848339815191529060200160405180910390a35050565b60008060008060006139396106fb565b9150915081600014801561394d5750600081115b156139645761395d868983614438565b9250613a13565b801580156139725750600082115b156139825761395d878984614438565b8115801561398e575080155b156139b55760405162461bcd60e51b81526020600482015260006024820152604401610832565b60006139c2888a85614438565b905060006139d1888b85614438565b90506000821180156139e35750600081115b6139ff5760405162461bcd60e51b815260040161083290615ba3565b808210613a0c5780613a0e565b815b945050505b613a1e83838a6131f5565b9450613a2b83828a6131f5565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff1691839150600090613a8457634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110613ac157634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613b0790859060040161597c565b60006040518083038186803b158015613b1f57600080fd5b505afa158015613b33573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613b5b919081019061537e565b5090508051600214613b9b5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610832565b6098548151600091829163ffffffff90911660060b9084908390613bcf57634e487b7160e01b600052603260045260246000fd5b602002602001015184600181518110613bf857634e487b7160e01b600052603260045260246000fd5b60200260200101510360060b81613c1f57634e487b7160e01b600052601260045260246000fd5b059050613c2e8160020b61324c565b6097549092506000915061271090613c5190600160f01b900461ffff1684615cf5565b613c5b9190615cbb565b90508415613ca357613c6d8183615da5565b6001600160a01b0316866001600160a01b03161015613c9e5760405162461bcd60e51b815260040161083290615b1d565b613cde565b613cad8183615c81565b6001600160a01b0316866001600160a01b03161115613cde5760405162461bcd60e51b815260040161083290615b1d565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613d1f9030906004016158ef565b60206040518083038186803b158015613d3757600080fd5b505afa158015613d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d6f9190615876565b613d799190615dc5565b613d839190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613dbf9030906004016158ef565b60206040518083038186803b158015613dd757600080fd5b505afa158015613deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0f9190615876565b613e199190615dc5565b613e239190615dc5565b6097549091506000908190613e4e90600160a01b8104600290810b91600160b81b9004900b8c61282c565b935093505050613e5e8282612bb9565b613e688282612c92565b6040519193509150600080516020615fa483398151915290613e8d9084908490615bfa565b60405180910390a1613e9f8483615ca3565b9150613eab8382615ca3565b609e549091506001600160a01b038681169116141561405657609754869061271090613ee290600160d01b900461ffff1685615d24565b613eec9190615ce1565b1015613f0a5760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613f429030906004016158ef565b60206040518083038186803b158015613f5a57600080fd5b505afa158015613f6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f929190615876565b613f9c9190615dc5565b613fa69190615dc5565b613fb09190615dc5565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613feb9030906004016158ef565b60206040518083038186803b15801561400357600080fd5b505afa158015614017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061403b9190615876565b6140459190615dc5565b61404f9190615dc5565b92506141e1565b609f546001600160a01b03868116911614156130385760975486906127109061408a90600160d01b900461ffff1684615d24565b6140949190615ce1565b10156140b25760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a08231906140e89030906004016158ef565b60206040518083038186803b15801561410057600080fd5b505afa158015614114573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141389190615876565b6141429190615dc5565b61414c9190615dc5565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a08231906141879030906004016158ef565b60206040518083038186803b15801561419f57600080fd5b505afa1580156141b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141d79190615876565b61403b9190615dc5565b609754612ee090600160a01b8104600290810b91600160b81b9004900b86868d8d8d612d2d565b600054610100900460ff1680614221575060005460ff16155b61423d5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff1615801561425f576000805461ffff19166101011790555b614267614dc8565b6142718383614e32565b80156130da576000805461ff0019169055505050565b600054610100900460ff16806142a0575060005460ff16155b6142bc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142de576000805461ffff19166101011790555b6142e6614ec7565b80156142f8576000805461ff00191690555b50565b6001600160a01b03821661435b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610832565b6001600160a01b038216600090815260336020526040902054818110156143cf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610832565b6143d98282615dc5565b6001600160a01b03841660009081526033602052604081209190915560358054849290614407908490615dc5565b90915550506040518281526000906001600160a01b03851690600080516020615f8483398151915290602001612342565b600080806000198587098587029250828110838203039150508060001415614472576000841161446757600080fd5b508290049050610855565b80841161447e57600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b60008060008087156146b457609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b815260040160206040518083038186803b15801561454157600080fd5b505afa158015614555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145799190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916145b991600160a01b90910460020b906004016159c6565b6101006040518083038186803b1580156145d257600080fd5b505afa1580156145e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061460a91906155f6565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba93955061465394600160b81b90910460020b935060040191506159c69050565b6101006040518083038186803b15801561466c57600080fd5b505afa158015614680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146a491906155f6565b5093975061486f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b815260040160206040518083038186803b15801561470257600080fd5b505afa158015614716573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061473a9190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161477a91600160a01b90910460020b906004016159c6565b6101006040518083038186803b15801561479357600080fd5b505afa1580156147a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147cb91906155f6565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506148139450600160b81b900460020b9260040191506159c69050565b6101006040518083038186803b15801561482c57600080fd5b505afa158015614840573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061486491906155f6565b509297505050505050505b6000609760149054906101000a900460020b60020b8760020b12614894575082614899565b508281035b6000609760179054906101000a900460020b60020b8860020b12156148bf5750826148c4565b508282035b8183038190036148e46001600160801b0389168b8303600160801b614438565b9b9a5050505050505050505050565b6000600160ff1b82106136c35760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610832565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c4016040805180830381600087803b1580156149c957600080fd5b505af11580156149dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a0191906154c4565b9150915081614a0f8a6148f3565b614a199190615d43565b935080614a25896148f3565b614a2f9190615d43565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015614a8157600080fd5b505afa158015614a95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ab99190615734565b50505050505090506000614ae682614ad38f60020b61324c565b614adf8f60020b61324c565b898961379a565b90506001600160801b03811615614b9257609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b8152600401614b3e9493929190615903565b6040805180830381600087803b158015614b5757600080fd5b505af1158015614b6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b8f91906154c4565b50505b5050505097509795505050505050565b6000614bf7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614f379092919063ffffffff16565b8051909150156130da5780806020019051810190614c159190615441565b6130da5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610832565b6000826001600160a01b0316846001600160a01b03161115614c94579192915b6001600160a01b038416614cd4600160601b600160e01b03606085901b16614cbc8787615da5565b6001600160a01b0316866001600160a01b0316614438565b6136569190615ce1565b6000826001600160a01b0316846001600160a01b03161115614cfe579192915b6136566001600160801b038316614d158686615da5565b6001600160a01b0316600160601b614438565b6000826001600160a01b0316846001600160a01b03161115614d48579192915b6000614d6b856001600160a01b0316856001600160a01b0316600160601b614438565b9050613243614d8d8483614d7f8989615da5565b6001600160a01b0316614438565b614f46565b6000826001600160a01b0316846001600160a01b03161115614db2579192915b613656614d8d83600160601b614d7f8888615da5565b600054610100900460ff1680614de1575060005460ff16155b614dfd5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142e6576000805461ffff191661010117905580156142f8576000805461ff001916905550565b600054610100900460ff1680614e4b575060005460ff16155b614e675760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614e89576000805461ffff19166101011790555b8251614e9c9060369060208601906150c2565b508151614eb09060379060208501906150c2565b5080156130da576000805461ff0019169055505050565b600054610100900460ff1680614ee0575060005460ff16155b614efc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614f1e576000805461ffff19166101011790555b600160655580156142f8576000805461ff001916905550565b60606136568484600085614f61565b806001600160801b0381168114614f5c57600080fd5b919050565b606082471015614fc25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610832565b843b6150105760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610832565b600080866001600160a01b0316858760405161502c91906158d3565b60006040518083038185875af1925050503d8060008114615069576040519150601f19603f3d011682016040523d82523d6000602084013e61506e565b606091505b509150915061507e828286615089565b979650505050505050565b60608315615098575081610855565b8251156150a85782518084602001fd5b8160405162461bcd60e51b81526004016108329190615a02565b8280546150ce90615e08565b90600052602060002090601f0160209004810192826150f05760008555615136565b82601f1061510957805160ff1916838001178555615136565b82800160010185558215615136579182015b8281111561513657825182559160200191906001019061511b565b506136c39291505b808211156136c3576000815560010161513e565b600082601f830112615162578081fd5b8151602061517761517283615c38565b615c08565b80838252828201915082860187848660051b8901011115615196578586fd5b855b858110156151bd5781516151ab81615eef565b84529284019290840190600101615198565b5090979650505050505050565b60008083601f8401126151db578182fd5b5081356001600160401b038111156151f1578182fd5b60208301915083602082850101111561520957600080fd5b9250929050565b8051600681900b8114614f5c57600080fd5b600082601f830112615232578081fd5b81356001600160401b0381111561524b5761524b615ed9565b61525e601f8201601f1916602001615c08565b818152846020838601011115615272578283fd5b816020850160208301379081016020019190915292915050565b80516001600160801b0381168114614f5c57600080fd5b6000602082840312156152b4578081fd5b813561085581615eef565b6000602082840312156152d0578081fd5b815161085581615eef565b600080604083850312156152ed578081fd5b82356152f881615eef565b9150602083013561530881615eef565b809150509250929050565b600080600060608486031215615327578081fd5b833561533281615eef565b9250602084013561534281615eef565b929592945050506040919091013590565b60008060408385031215615365578182fd5b823561537081615eef565b946020939093013593505050565b60008060408385031215615390578182fd5b82516001600160401b03808211156153a6578384fd5b818501915085601f8301126153b9578384fd5b815160206153c961517283615c38565b8083825282820191508286018a848660051b89010111156153e8578889fd5b8896505b84871015615411576153fd81615210565b8352600196909601959183019183016153ec565b509188015191965090935050508082111561542a578283fd5b5061543785828601615152565b9150509250929050565b600060208284031215615452578081fd5b815161085581615f04565b600080600080600060a08688031215615474578283fd5b853561547f81615f12565b9450602086013561548f81615f12565b9350604086013561549f81615eef565b92506060860135915060808601356154b681615f04565b809150509295509295909350565b600080604083850312156154d6578182fd5b505080516020909101519092909150565b600080600080606085870312156154fc578182fd5b843593506020850135925060408501356001600160401b0381111561551f578283fd5b61552b878288016151ca565b95989497509550505050565b600080600080600080600060e0888a031215615551578485fd5b87356001600160401b0380821115615567578687fd5b6155738b838c01615222565b985060208a0135915080821115615588578687fd5b506155958a828b01615222565b96505060408801356155a681615eef565b945060608801356155b681615f21565b935060808801356155c681615f12565b925060a08801356155d681615f12565b915060c08801356155e681615eef565b8091505092959891949750929550565b600080600080600080600080610100898b031215615612578182fd5b61561b8961528c565b9750602089015180600f0b8114615630578283fd5b60408a015160608b01519198509650945061564d60808a01615210565b935060a089015161565d81615eef565b60c08a015190935061566e81615f31565b60e08a015190925061567f81615f04565b809150509295985092959890939650565b600080604083850312156156a2578182fd5b6156ab8361528c565b91506156b96020840161528c565b90509250929050565b600080600080600060a086880312156156d9578283fd5b6156e28661528c565b945060208601519350604086015192506156fe6060870161528c565b915061570c6080870161528c565b90509295509295909350565b600060208284031215615729578081fd5b813561085581615f21565b600080600080600080600060e0888a03121561574e578081fd5b875161575981615eef565b602089015190975061576a81615f12565b604089015190965061577b81615f21565b606089015190955061578c81615f21565b608089015190945061579d81615f21565b60a089015190935060ff811681146157b3578182fd5b60c08901519092506155e681615f04565b600080600080600060a086880312156157db578283fd5b85356157e681615eef565b94506020860135935060408601356157fd81615f04565b92506060860135915060808601356154b681615eef565b600080600080600060a0868803121561582b578283fd5b853561583681615f21565b9450602086013561584681615f21565b9350604086013561585681615f21565b9250606086013561586681615f31565b915060808601356154b681615eef565b600060208284031215615887578081fd5b5051919050565b600080604083850312156158a0578182fd5b82359150602083013561530881615eef565b600080604083850312156158c4578182fd5b50508035926020909101359150565b600082516158e5818460208701615ddc565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b6020808252825182820181905260009190848201906040850190845b818110156159ba57835163ffffffff1683529284019291840191600101615998565b50909695505050505050565b60029190910b815260200190565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b6020815260008251806020840152615a21816040850160208701615ddc565b601f01601f19169190910160400192915050565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252600490820152636d42505360e01b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260089082015267686967682066656560c01b604082015260600190565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b60208082526003908201526242505360e81b604082015260600190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b918252602082015260400190565b604051601f8201601f191681016001600160401b0381118282101715615c3057615c30615ed9565b604052919050565b60006001600160401b03821115615c5157615c51615ed9565b5060051b60200190565b600061ffff808316818516808303821115615c7857615c78615ead565b01949350505050565b60006001600160a01b03828116848216808303821115615c7857615c78615ead565b60008219821115615cb657615cb6615ead565b500190565b60006001600160a01b0383811680615cd557615cd5615ec3565b92169190910492915050565b600082615cf057615cf0615ec3565b500490565b60006001600160a01b0382811684821681151582840482111615615d1b57615d1b615ead565b02949350505050565b6000816000190483118215151615615d3e57615d3e615ead565b500290565b60008083128015600160ff1b850184121615615d6157615d61615ead565b6001600160ff1b0384018313811615615d7c57615d7c615ead565b50500390565b600061ffff83811690831681811015615d9d57615d9d615ead565b039392505050565b60006001600160a01b0383811690831681811015615d9d57615d9d615ead565b600082821015615dd757615dd7615ead565b500390565b60005b83811015615df7578181015183820152602001615ddf565b83811115610e875750506000910152565b600181811c90821680615e1c57607f821691505b60208210811415615e3d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615e5757615e57615ead565b5060010190565b600082615e6d57615e6d615ec3565b500690565b60008160020b627fffff19811415615e8c57615e8c615ead565b9003919050565b6000600160ff1b821415615ea957615ea9615ead565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146142f857600080fd5b80151581146142f857600080fd5b8060020b81146142f857600080fd5b61ffff811681146142f857600080fd5b63ffffffff811681146142f857600080fdfec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a26469706673582212200d68bbc56177fb98dc03b8435a294744f29eb4d74dbc9371fa03141fd2efac7464736f6c63430008040033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190615a02565b61026e610269366004615353565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d91906158ef565b6102a66106fb565b60405161023d929190615bfa565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004615313565b6107a4565b6102f56102f036600461545d565b61085c565b005b6102ff60fa81565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004615353565b610c96565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610ccd565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b13660046152a3565b6001600160a01b031660009081526033602052604090205490565b6102f5610cdc565b6097546103e890600160b81b900460020b81565b60405161023d91906159c6565b6102f561040336600461588e565b610d32565b61041b61041636600461588e565b610e8d565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e611173565b61045a6104553660046158b2565b611182565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004615814565b6112d4565b6097546103e890600160a01b900460020b81565b61026e6104aa366004615353565b611494565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004615353565b61152f565b6102f56104e53660046157c4565b61153c565b610233609b5481565b6102a66105013660046152a3565b6117fd565b6102f561051436600461588e565b6118a4565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046154e7565b61198a565b6097546102ff90600160f01b900461ffff1681565b61023361059a3660046152db565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6102336119ee565b6102f56105db366004615537565b6119fd565b6102f56105ee366004615718565b611c9a565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f56106283660046152a3565b611da7565b6102f561063b3660046154e7565b611e87565b61041b61064e36600461588e565b611ef1565b60606036805461066290615e08565b80601f016020809104026020016040519081016040528092919081815260200182805461068e90615e08565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f233848461222a565b50600192915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190615734565b50505050509150915061079a828261234f565b9350935050509091565b60006107b1848484612600565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561083b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61084f853361084a8685615dc5565b61222a565b60019150505b9392505050565b33610865610ccd565b6001600160a01b03161461088b5760405162461bcd60e51b815260040161083290615b61565b600080600061089960355490565b1115610c1d57609d546001600160a01b031663514ea4bf6108b86127c6565b6040518263ffffffff1660e01b81526004016108d691815260200190565b60a06040518083038186803b1580156108ee57600080fd5b505afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092691906156c2565b5092945050506001600160801b0383161590506109af57609754600090819061096590600160a01b8104600290810b91600160b81b9004900b8661282c565b9350935050506109758282612bb9565b61097f8282612c92565b6040519193509150600080516020615fa4833981519152906109a49084908490615bfa565b60405180910390a150505b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a2c9030906004016158ef565b60206040518083038186803b158015610a4457600080fd5b505afa158015610a58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7c9190615876565b610a869190615dc5565b610a909190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610acc9030906004016158ef565b60206040518083038186803b158015610ae457600080fd5b505afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c9190615876565b610b269190615dc5565b610b309190615dc5565b9050610b41898984848b8b8b612d2d565b609d546001600160a01b031663514ea4bf610b5a6127c6565b6040518263ffffffff1660e01b8152600401610b7891815260200190565b60a06040518083038186803b158015610b9057600080fd5b505afa158015610ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc891906156c2565b509295505050506001600160801b038316610c165760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610832565b5050610c62565b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615f4483398151915287878484604051610c8594939291906159d4565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061084a908690615ca3565b6097546001600160a01b031690565b33610ce5610ccd565b6001600160a01b031614610d0b5760405162461bcd60e51b815260040161083290615b61565b60988054600160201b600160d01b031916905560006099819055609a55610d30612eec565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d7c5760405162461bcd60e51b815260040161083290615a35565b600080610d8f609954609a548888612f53565b60006099819055609a5590925090508115610dc957609854609e54610dc9916001600160a01b0391821691600160301b9091041684613077565b8015610df457609854609f54610df4916001600160a01b0391821691600160301b9091041683613077565b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610e5357610e4e6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b610e87565b610e876001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050565b600080600060026065541415610eb55760405162461bcd60e51b815260040161083290615bc3565b600260655584610ed75760405162461bcd60e51b815260040161083290615ba3565b6000610ee260355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610f3457600080fd5b505afa158015610f48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6c9190615734565b50505050505090506000821115610fad57600080610f886106fb565b91509150610f97828a866131f5565b9650610fa4818a866131f5565b95505050610ffa565b610ff481610fcc609760149054906101000a900460020b60020b61324c565b609754610fe690600160b81b9004600290810b900b61324c565b610fef8b61365e565b6136c7565b90955093505b841561101857609e54611018906001600160a01b0316333088613762565b831561103657609f54611036906001600160a01b0316333087613762565b61107681611055609760149054906101000a900460020b60020b61324c565b60975461106f90600160b81b9004600290810b900b61324c565b888861379a565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d916110c6913091600160a01b8104600290810b92600160b81b909204900b908990600401615903565b6040805180830381600087803b1580156110df57600080fd5b505af11580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111791906154c4565b5050611123868861385c565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e7868887878760405161115a959493929190615945565b60405180910390a1505060016065819055509250925092565b60606037805461066290615e08565b60008060008061119160355490565b905080156111b0576111a4818787613929565b919550935091506112cc565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b1580156111f557600080fd5b505afa158015611209573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122d9190615734565b5050505050509050600061127782611256609760149054906101000a900460020b60020b61324c565b60975461127090600160b81b9004600290810b900b61324c565b8b8b61379a565b9050806001600160801b031693506112c4826112a4609760149054906101000a900460020b60020b61324c565b6097546112be90600160b81b9004600290810b900b61324c565b846136c7565b909650945050505b509250925092565b336112dd610ccd565b6001600160a01b0316146113035760405162461bcd60e51b815260040161083290615b61565b6127108461ffff1611156113295760405162461bcd60e51b815260040161083290615b44565b6127108561ffff16111561134f5760405162461bcd60e51b815260040161083290615b44565b6127108361ffff1611156113755760405162461bcd60e51b815260040161083290615b44565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff8516156113ec576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff841615611411576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561143757609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff821615611459576098805463ffffffff191663ffffffff84161790555b6001600160a01b0381161561148d5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156115165760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610832565b611525338561084a8685615dc5565b5060019392505050565b60006106f2338484612600565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146115865760405162461bcd60e51b815260040161083290615a35565b8515611596576115968786613a38565b609d546000906001600160a01b031663514ea4bf6115b26127c6565b6040518263ffffffff1660e01b81526004016115d091815260200190565b60a06040518083038186803b1580156115e857600080fd5b505afa1580156115fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162091906156c2565b505050509050611634818989898989613ce6565b609d546000906001600160a01b031663514ea4bf6116506127c6565b6040518263ffffffff1660e01b815260040161166e91815260200190565b60a06040518083038186803b15801561168657600080fd5b505afa15801561169a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116be91906156c2565b505050509050816001600160801b0316816001600160801b03161161171f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610832565b609754604051600080516020615f448339815191529161175991600160a01b8204600290810b92600160b81b9004900b90869086906159d4565b60405180910390a150506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156117c0576117bb6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b6117f4565b6117f46001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561185057600080fd5b505afa158015611864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118889190615734565b505050505091505061189a848261234f565b9250925050915091565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118ee5760405162461bcd60e51b815260040161083290615a35565b600080611901609b54609c548888612f53565b6000609b819055609c559092509050811561194d57609e5461194d906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084613077565b8015610df457609f54610df4906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083613077565b609d546001600160a01b031633146119b45760405162461bcd60e51b815260040161083290615a84565b83156119d157609e546119d1906001600160a01b03163386613077565b8215610e8757609f54610e87906001600160a01b03163385613077565b60006119f86127c6565b905090565b600054610100900460ff1680611a16575060005460ff16155b611a325760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015611a54576000805461ffff19166101011790555b611a6160fa612710615d82565b61ffff168561ffff161115611a885760405162461bcd60e51b815260040161083290615a66565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe168191600480820192602092909190829003018186803b158015611adc57600080fd5b505afa158015611af0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1491906152bf565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611b6d57600080fd5b505afa158015611b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba591906152bf565b609f80546001600160a01b03199081166001600160a01b0393841617909155609880546097805461012c65ffffffffffff19909316600160201b61ffff8d160263ffffffff19161792909217600160301b600160d01b031916600160301b95881695860217909255643e800c801960d31b600165ffffff00000160a01b03909116600160a01b60028a810b62ffffff908116929092029290921792909217600165ffffff00000160a01b031916600160b81b9189900b9290921602909216919091179091179055611c768888614208565b611c7e614287565b8015611c90576000805461ff00191690555b5050505050505050565b33611ca3610ccd565b6001600160a01b031614611cc95760405162461bcd60e51b815260040161083290615b61565b609854600160201b900461ffff1615611d0a5760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610832565b60008161ffff16118015611d325750611d2660fa612710615d82565b61ffff168161ffff1611155b611d4e5760405162461bcd60e51b815260040161083290615a66565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611db0610ccd565b6001600160a01b031614611dd65760405162461bcd60e51b815260040161083290615b61565b6001600160a01b038116611e3d5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610832565b6097546040516001600160a01b03808416921690600080516020615f6483398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611eb15760405162461bcd60e51b815260040161083290615a84565b6000841315611ed157609e54610e4e906001600160a01b03163386613077565b6000831315610e8757609f54610e87906001600160a01b03163385613077565b600080600060026065541415611f195760405162461bcd60e51b815260040161083290615bc3565b600260655584611f545760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610832565b6000611f5f60355490565b609d549091506000906001600160a01b031663514ea4bf611f7e6127c6565b6040518263ffffffff1660e01b8152600401611f9c91815260200190565b60a06040518083038186803b158015611fb457600080fd5b505afa158015611fc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fec91906156c2565b505050509050611ffc33886142fb565b600061201288836001600160801b031685614438565b905061201d8161365e565b60975490945060009081908190819061204c90600160a01b8104600290810b91600160b81b9004900b8a61282c565b935093509350935061205e8282612bb9565b6120688282612c92565b6040519193509150600080516020615fa48339815191529061208d9084908490615bfa565b60405180910390a1609b54609954609e546040516370a0823160e01b815261214893929188916001600160a01b03909116906370a08231906120d39030906004016158ef565b60206040518083038186803b1580156120eb57600080fd5b505afa1580156120ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121239190615876565b61212d9190615dc5565b6121379190615dc5565b6121419190615dc5565b8d89614438565b6121529085615ca3565b609c54609a54609f546040516370a0823160e01b8152939d5061218f9387916001600160a01b0316906370a08231906120d39030906004016158ef565b6121999084615ca3565b985089156121b857609e546121b8906001600160a01b03168c8c613077565b88156121d557609f546121d5906001600160a01b03168c8b613077565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c60405161220c959493929190615945565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b03831661228c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610832565b6001600160a01b0382166122ed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610832565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf6123776127c6565b6040518263ffffffff1660e01b815260040161239591815260200190565b60a06040518083038186803b1580156123ad57600080fd5b505afa1580156123c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e591906156c2565b9450945094509450945061242e8961240e609760149054906101000a900460020b60020b61324c565b60975461242890600160b81b9004600290810b900b61324c565b886136c7565b909750955060006001600160801b03831661244c6001878c8a6144e7565b6124569190615ca3565b90506000826001600160801b03166124716000878d8b6144e7565b61247b9190615ca3565b90506124878282612c92565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a08231906124c59030906004016158ef565b60206040518083038186803b1580156124dd57600080fd5b505afa1580156124f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125159190615876565b61251f9085615ca3565b6125299190615dc5565b6125339190615dc5565b61253d908a615ca3565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a08231906125789030906004016158ef565b60206040518083038186803b15801561259057600080fd5b505afa1580156125a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c89190615876565b6125d29084615ca3565b6125dc9190615dc5565b6125e69190615dc5565b6125f09089615ca3565b9750505050505050509250929050565b6001600160a01b0383166126645760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610832565b6001600160a01b0382166126c65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610832565b6001600160a01b0383166000908152603360205260409020548181101561273e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610832565b6127488282615dc5565b6001600160a01b03808616600090815260336020526040808220939093559085168152908120805484929061277e908490615ca3565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615f84833981519152846040516127b891815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b8204600290810b810b60e890811b6034840152600160b81b909304810b900b90911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a08231906128659030906004016158ef565b60206040518083038186803b15801561287d57600080fd5b505afa158015612891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b59190615876565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a08231906128eb9030906004016158ef565b60206040518083038186803b15801561290357600080fd5b505afa158015612917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293b9190615876565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a7906064016040805180830381600087803b15801561299b57600080fd5b505af11580156129af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d391906154c4565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a4016040805180830381600087803b158015612a4157600080fd5b505af1158015612a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a799190615690565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612aaf9030906004016158ef565b60206040518083038186803b158015612ac757600080fd5b505afa158015612adb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aff9190615876565b612b099190615dc5565b612b139190615dc5565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a0823190612b489030906004016158ef565b60206040518083038186803b158015612b6057600080fd5b505afa158015612b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b989190615876565b612ba29190615dc5565b612bac9190615dc5565b9250505093509350935093565b612710612bc760fa84615d24565b612bd19190615ce1565b609b6000828254612be29190615ca3565b909155506127109050612bf660fa83615d24565b612c009190615ce1565b609c6000828254612c119190615ca3565b909155505060985461271090612c3290600160201b900461ffff1684615d24565b612c3c9190615ce1565b60996000828254612c4d9190615ca3565b909155505060985461271090612c6e90600160201b900461ffff1683615d24565b612c789190615ce1565b609a6000828254612c899190615ca3565b90915550505050565b6000806000612710609860049054906101000a900461ffff1660fa612cb79190615c5b565b612cc59061ffff1687615d24565b612ccf9190615ce1565b60985490915060009061271090612cf290600160201b900461ffff1660fa615c5b565b612d009061ffff1687615d24565b612d0a9190615ce1565b9050612d168287615dc5565b9350612d228186615dc5565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b158015612d7257600080fd5b505afa158015612d86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612daa9190615734565b50505050505090506000612dd782612dc48b60020b61324c565b612dd08b60020b61324c565b8a8a61379a565b90506001600160801b03811615612e9457609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612e239030908f908f908990600401615903565b6040805180830381600087803b158015612e3c57600080fd5b505af1158015612e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7491906154c4565b9092509050612e83828a615dc5565b9850612e8f8189615dc5565b975050505b6000612ec36127108686612ea85789612eaa565b8a5b612eb49190615d24565b612ebe9190615ce1565b6148f3565b90506000811315612ee057612edd8a8a8a8a858b8a614959565b50505b50505050505050505050565b33612ef5610ccd565b6001600160a01b031614612f1b5760405162461bcd60e51b815260040161083290615b61565b6097546040516000916001600160a01b031690600080516020615f64833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0384811691161415612fc857609754849061271090612f8c90600160e01b900461ffff1689615d24565b612f969190615ce1565b1015612fb45760405162461bcd60e51b815260040161083290615afb565b612fbe8487615dc5565b915084905061306e565b609f546001600160a01b038481169116141561303857609754849061271090612ffc90600160e01b900461ffff1688615d24565b6130069190615ce1565b10156130245760405162461bcd60e51b815260040161083290615afb565b61302e8486615dc5565b905085915061306e565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610832565b94509492505050565b6040516001600160a01b0383166024820152604481018290526130da90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614ba2565b505050565b8047101561312f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610832565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461317c576040519150601f19603f3d011682016040523d82523d6000602084013e613181565b606091505b50509050806130da5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610832565b6000613202848484614438565b90506000828061322257634e487b7160e01b600052601260045260246000fd5b848609111561085557600019811061323957600080fd5b8061324381615e43565b95945050505050565b60008060008360020b12613263578260020b613270565b8260020b61327090615e93565b905061327f620d89e719615e72565b60020b8111156132b55760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610832565b6000600182166132c957600160801b6132db565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561331057608061330b826ffff97272373d413259a46990580e213a615d24565b901c90505b600482161561333a576080613335826ffff2e50f5f656932ef12357cf3c7fdcc615d24565b901c90505b600882161561336457608061335f826fffe5caca7e10e4e61c3624eaa0941cd0615d24565b901c90505b601082161561338e576080613389826fffcb9843d60f6159c9db58835c926644615d24565b901c90505b60208216156133b85760806133b3826fff973b41fa98c081472e6896dfb254c0615d24565b901c90505b60408216156133e25760806133dd826fff2ea16466c96a3843ec78b326b52861615d24565b901c90505b608082161561340c576080613407826ffe5dee046a99a2a811c461f1969c3053615d24565b901c90505b610100821615613437576080613432826ffcbe86c7900a88aedcffc83b479aa3a4615d24565b901c90505b61020082161561346257608061345d826ff987a7253ac413176f2b074cf7815e54615d24565b901c90505b61040082161561348d576080613488826ff3392b0822b70005940c7a398e4b70f3615d24565b901c90505b6108008216156134b85760806134b3826fe7159475a2c29b7443b29c7fa6e889d9615d24565b901c90505b6110008216156134e35760806134de826fd097f3bdfd2022b8845ad8f792aa5825615d24565b901c90505b61200082161561350e576080613509826fa9f746462d870fdf8a65dc1f90e061e5615d24565b901c90505b614000821615613539576080613534826f70d869a156d2a1b890bb3df62baf32f7615d24565b901c90505b61800082161561356457608061355f826f31be135f97d08fd981231505542fcfa6615d24565b901c90505b6201000082161561359057608061358b826f09aa508b5b7a84e1c677de54f3e99bc9615d24565b901c90505b620200008216156135bb5760806135b6826e5d6af8dedb81196699c329225ee604615d24565b901c90505b620400008216156135e55760806135e0826d2216e584f5fa1ea926041bedfe98615d24565b901c90505b6208000082161561360d576080613608826b048a170391f7dc42444e8fa2615d24565b901c90505b60008460020b13156136285761362581600019615ce1565b90505b613636600160201b82615e5e565b15613642576001613645565b60005b6136569060ff16602083901c615ca3565b949350505050565b6000600160801b82106136c35760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610832565b5090565b600080836001600160a01b0316856001600160a01b031611156136e8579293925b846001600160a01b0316866001600160a01b0316116137135761370c858585614c74565b915061306e565b836001600160a01b0316866001600160a01b0316101561374c57613738868585614c74565b9150613745858785614cde565b905061306e565b613757858585614cde565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e879085906323b872dd60e01b906084016130a3565b6000836001600160a01b0316856001600160a01b031611156137ba579293925b846001600160a01b0316866001600160a01b0316116137e5576137de858585614d28565b9050613243565b836001600160a01b0316866001600160a01b0316101561384757600061380c878686614d28565b9050600061381b878986614d92565b9050806001600160801b0316826001600160801b03161061383c578061383e565b815b92505050613243565b613852858584614d92565b9695505050505050565b6001600160a01b0382166138b25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610832565b80603560008282546138c49190615ca3565b90915550506001600160a01b038216600090815260336020526040812080548392906138f1908490615ca3565b90915550506040518181526001600160a01b03831690600090600080516020615f848339815191529060200160405180910390a35050565b60008060008060006139396106fb565b9150915081600014801561394d5750600081115b156139645761395d868983614438565b9250613a13565b801580156139725750600082115b156139825761395d878984614438565b8115801561398e575080155b156139b55760405162461bcd60e51b81526020600482015260006024820152604401610832565b60006139c2888a85614438565b905060006139d1888b85614438565b90506000821180156139e35750600081115b6139ff5760405162461bcd60e51b815260040161083290615ba3565b808210613a0c5780613a0e565b815b945050505b613a1e83838a6131f5565b9450613a2b83828a6131f5565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff1691839150600090613a8457634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110613ac157634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613b0790859060040161597c565b60006040518083038186803b158015613b1f57600080fd5b505afa158015613b33573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613b5b919081019061537e565b5090508051600214613b9b5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610832565b6098548151600091829163ffffffff90911660060b9084908390613bcf57634e487b7160e01b600052603260045260246000fd5b602002602001015184600181518110613bf857634e487b7160e01b600052603260045260246000fd5b60200260200101510360060b81613c1f57634e487b7160e01b600052601260045260246000fd5b059050613c2e8160020b61324c565b6097549092506000915061271090613c5190600160f01b900461ffff1684615cf5565b613c5b9190615cbb565b90508415613ca357613c6d8183615da5565b6001600160a01b0316866001600160a01b03161015613c9e5760405162461bcd60e51b815260040161083290615b1d565b613cde565b613cad8183615c81565b6001600160a01b0316866001600160a01b03161115613cde5760405162461bcd60e51b815260040161083290615b1d565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613d1f9030906004016158ef565b60206040518083038186803b158015613d3757600080fd5b505afa158015613d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d6f9190615876565b613d799190615dc5565b613d839190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613dbf9030906004016158ef565b60206040518083038186803b158015613dd757600080fd5b505afa158015613deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0f9190615876565b613e199190615dc5565b613e239190615dc5565b6097549091506000908190613e4e90600160a01b8104600290810b91600160b81b9004900b8c61282c565b935093505050613e5e8282612bb9565b613e688282612c92565b6040519193509150600080516020615fa483398151915290613e8d9084908490615bfa565b60405180910390a1613e9f8483615ca3565b9150613eab8382615ca3565b609e549091506001600160a01b038681169116141561405657609754869061271090613ee290600160d01b900461ffff1685615d24565b613eec9190615ce1565b1015613f0a5760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613f429030906004016158ef565b60206040518083038186803b158015613f5a57600080fd5b505afa158015613f6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f929190615876565b613f9c9190615dc5565b613fa69190615dc5565b613fb09190615dc5565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613feb9030906004016158ef565b60206040518083038186803b15801561400357600080fd5b505afa158015614017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061403b9190615876565b6140459190615dc5565b61404f9190615dc5565b92506141e1565b609f546001600160a01b03868116911614156130385760975486906127109061408a90600160d01b900461ffff1684615d24565b6140949190615ce1565b10156140b25760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a08231906140e89030906004016158ef565b60206040518083038186803b15801561410057600080fd5b505afa158015614114573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141389190615876565b6141429190615dc5565b61414c9190615dc5565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a08231906141879030906004016158ef565b60206040518083038186803b15801561419f57600080fd5b505afa1580156141b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141d79190615876565b61403b9190615dc5565b609754612ee090600160a01b8104600290810b91600160b81b9004900b86868d8d8d612d2d565b600054610100900460ff1680614221575060005460ff16155b61423d5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff1615801561425f576000805461ffff19166101011790555b614267614dc8565b6142718383614e32565b80156130da576000805461ff0019169055505050565b600054610100900460ff16806142a0575060005460ff16155b6142bc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142de576000805461ffff19166101011790555b6142e6614ec7565b80156142f8576000805461ff00191690555b50565b6001600160a01b03821661435b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610832565b6001600160a01b038216600090815260336020526040902054818110156143cf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610832565b6143d98282615dc5565b6001600160a01b03841660009081526033602052604081209190915560358054849290614407908490615dc5565b90915550506040518281526000906001600160a01b03851690600080516020615f8483398151915290602001612342565b600080806000198587098587029250828110838203039150508060001415614472576000841161446757600080fd5b508290049050610855565b80841161447e57600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b60008060008087156146b457609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b815260040160206040518083038186803b15801561454157600080fd5b505afa158015614555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145799190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916145b991600160a01b90910460020b906004016159c6565b6101006040518083038186803b1580156145d257600080fd5b505afa1580156145e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061460a91906155f6565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba93955061465394600160b81b90910460020b935060040191506159c69050565b6101006040518083038186803b15801561466c57600080fd5b505afa158015614680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146a491906155f6565b5093975061486f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b815260040160206040518083038186803b15801561470257600080fd5b505afa158015614716573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061473a9190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161477a91600160a01b90910460020b906004016159c6565b6101006040518083038186803b15801561479357600080fd5b505afa1580156147a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147cb91906155f6565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506148139450600160b81b900460020b9260040191506159c69050565b6101006040518083038186803b15801561482c57600080fd5b505afa158015614840573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061486491906155f6565b509297505050505050505b6000609760149054906101000a900460020b60020b8760020b12614894575082614899565b508281035b6000609760179054906101000a900460020b60020b8860020b12156148bf5750826148c4565b508282035b8183038190036148e46001600160801b0389168b8303600160801b614438565b9b9a5050505050505050505050565b6000600160ff1b82106136c35760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610832565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c4016040805180830381600087803b1580156149c957600080fd5b505af11580156149dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a0191906154c4565b9150915081614a0f8a6148f3565b614a199190615d43565b935080614a25896148f3565b614a2f9190615d43565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015614a8157600080fd5b505afa158015614a95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ab99190615734565b50505050505090506000614ae682614ad38f60020b61324c565b614adf8f60020b61324c565b898961379a565b90506001600160801b03811615614b9257609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b8152600401614b3e9493929190615903565b6040805180830381600087803b158015614b5757600080fd5b505af1158015614b6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b8f91906154c4565b50505b5050505097509795505050505050565b6000614bf7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614f379092919063ffffffff16565b8051909150156130da5780806020019051810190614c159190615441565b6130da5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610832565b6000826001600160a01b0316846001600160a01b03161115614c94579192915b6001600160a01b038416614cd4600160601b600160e01b03606085901b16614cbc8787615da5565b6001600160a01b0316866001600160a01b0316614438565b6136569190615ce1565b6000826001600160a01b0316846001600160a01b03161115614cfe579192915b6136566001600160801b038316614d158686615da5565b6001600160a01b0316600160601b614438565b6000826001600160a01b0316846001600160a01b03161115614d48579192915b6000614d6b856001600160a01b0316856001600160a01b0316600160601b614438565b9050613243614d8d8483614d7f8989615da5565b6001600160a01b0316614438565b614f46565b6000826001600160a01b0316846001600160a01b03161115614db2579192915b613656614d8d83600160601b614d7f8888615da5565b600054610100900460ff1680614de1575060005460ff16155b614dfd5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142e6576000805461ffff191661010117905580156142f8576000805461ff001916905550565b600054610100900460ff1680614e4b575060005460ff16155b614e675760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614e89576000805461ffff19166101011790555b8251614e9c9060369060208601906150c2565b508151614eb09060379060208501906150c2565b5080156130da576000805461ff0019169055505050565b600054610100900460ff1680614ee0575060005460ff16155b614efc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614f1e576000805461ffff19166101011790555b600160655580156142f8576000805461ff001916905550565b60606136568484600085614f61565b806001600160801b0381168114614f5c57600080fd5b919050565b606082471015614fc25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610832565b843b6150105760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610832565b600080866001600160a01b0316858760405161502c91906158d3565b60006040518083038185875af1925050503d8060008114615069576040519150601f19603f3d011682016040523d82523d6000602084013e61506e565b606091505b509150915061507e828286615089565b979650505050505050565b60608315615098575081610855565b8251156150a85782518084602001fd5b8160405162461bcd60e51b81526004016108329190615a02565b8280546150ce90615e08565b90600052602060002090601f0160209004810192826150f05760008555615136565b82601f1061510957805160ff1916838001178555615136565b82800160010185558215615136579182015b8281111561513657825182559160200191906001019061511b565b506136c39291505b808211156136c3576000815560010161513e565b600082601f830112615162578081fd5b8151602061517761517283615c38565b615c08565b80838252828201915082860187848660051b8901011115615196578586fd5b855b858110156151bd5781516151ab81615eef565b84529284019290840190600101615198565b5090979650505050505050565b60008083601f8401126151db578182fd5b5081356001600160401b038111156151f1578182fd5b60208301915083602082850101111561520957600080fd5b9250929050565b8051600681900b8114614f5c57600080fd5b600082601f830112615232578081fd5b81356001600160401b0381111561524b5761524b615ed9565b61525e601f8201601f1916602001615c08565b818152846020838601011115615272578283fd5b816020850160208301379081016020019190915292915050565b80516001600160801b0381168114614f5c57600080fd5b6000602082840312156152b4578081fd5b813561085581615eef565b6000602082840312156152d0578081fd5b815161085581615eef565b600080604083850312156152ed578081fd5b82356152f881615eef565b9150602083013561530881615eef565b809150509250929050565b600080600060608486031215615327578081fd5b833561533281615eef565b9250602084013561534281615eef565b929592945050506040919091013590565b60008060408385031215615365578182fd5b823561537081615eef565b946020939093013593505050565b60008060408385031215615390578182fd5b82516001600160401b03808211156153a6578384fd5b818501915085601f8301126153b9578384fd5b815160206153c961517283615c38565b8083825282820191508286018a848660051b89010111156153e8578889fd5b8896505b84871015615411576153fd81615210565b8352600196909601959183019183016153ec565b509188015191965090935050508082111561542a578283fd5b5061543785828601615152565b9150509250929050565b600060208284031215615452578081fd5b815161085581615f04565b600080600080600060a08688031215615474578283fd5b853561547f81615f12565b9450602086013561548f81615f12565b9350604086013561549f81615eef565b92506060860135915060808601356154b681615f04565b809150509295509295909350565b600080604083850312156154d6578182fd5b505080516020909101519092909150565b600080600080606085870312156154fc578182fd5b843593506020850135925060408501356001600160401b0381111561551f578283fd5b61552b878288016151ca565b95989497509550505050565b600080600080600080600060e0888a031215615551578485fd5b87356001600160401b0380821115615567578687fd5b6155738b838c01615222565b985060208a0135915080821115615588578687fd5b506155958a828b01615222565b96505060408801356155a681615eef565b945060608801356155b681615f21565b935060808801356155c681615f12565b925060a08801356155d681615f12565b915060c08801356155e681615eef565b8091505092959891949750929550565b600080600080600080600080610100898b031215615612578182fd5b61561b8961528c565b9750602089015180600f0b8114615630578283fd5b60408a015160608b01519198509650945061564d60808a01615210565b935060a089015161565d81615eef565b60c08a015190935061566e81615f31565b60e08a015190925061567f81615f04565b809150509295985092959890939650565b600080604083850312156156a2578182fd5b6156ab8361528c565b91506156b96020840161528c565b90509250929050565b600080600080600060a086880312156156d9578283fd5b6156e28661528c565b945060208601519350604086015192506156fe6060870161528c565b915061570c6080870161528c565b90509295509295909350565b600060208284031215615729578081fd5b813561085581615f21565b600080600080600080600060e0888a03121561574e578081fd5b875161575981615eef565b602089015190975061576a81615f12565b604089015190965061577b81615f21565b606089015190955061578c81615f21565b608089015190945061579d81615f21565b60a089015190935060ff811681146157b3578182fd5b60c08901519092506155e681615f04565b600080600080600060a086880312156157db578283fd5b85356157e681615eef565b94506020860135935060408601356157fd81615f04565b92506060860135915060808601356154b681615eef565b600080600080600060a0868803121561582b578283fd5b853561583681615f21565b9450602086013561584681615f21565b9350604086013561585681615f21565b9250606086013561586681615f31565b915060808601356154b681615eef565b600060208284031215615887578081fd5b5051919050565b600080604083850312156158a0578182fd5b82359150602083013561530881615eef565b600080604083850312156158c4578182fd5b50508035926020909101359150565b600082516158e5818460208701615ddc565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b6020808252825182820181905260009190848201906040850190845b818110156159ba57835163ffffffff1683529284019291840191600101615998565b50909695505050505050565b60029190910b815260200190565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b6020815260008251806020840152615a21816040850160208701615ddc565b601f01601f19169190910160400192915050565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252600490820152636d42505360e01b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260089082015267686967682066656560c01b604082015260600190565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b60208082526003908201526242505360e81b604082015260600190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b918252602082015260400190565b604051601f8201601f191681016001600160401b0381118282101715615c3057615c30615ed9565b604052919050565b60006001600160401b03821115615c5157615c51615ed9565b5060051b60200190565b600061ffff808316818516808303821115615c7857615c78615ead565b01949350505050565b60006001600160a01b03828116848216808303821115615c7857615c78615ead565b60008219821115615cb657615cb6615ead565b500190565b60006001600160a01b0383811680615cd557615cd5615ec3565b92169190910492915050565b600082615cf057615cf0615ec3565b500490565b60006001600160a01b0382811684821681151582840482111615615d1b57615d1b615ead565b02949350505050565b6000816000190483118215151615615d3e57615d3e615ead565b500290565b60008083128015600160ff1b850184121615615d6157615d61615ead565b6001600160ff1b0384018313811615615d7c57615d7c615ead565b50500390565b600061ffff83811690831681811015615d9d57615d9d615ead565b039392505050565b60006001600160a01b0383811690831681811015615d9d57615d9d615ead565b600082821015615dd757615dd7615ead565b500390565b60005b83811015615df7578181015183820152602001615ddf565b83811115610e875750506000910152565b600181811c90821680615e1c57607f821691505b60208210811415615e3d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615e5757615e57615ead565b5060010190565b600082615e6d57615e6d615ec3565b500690565b60008160020b627fffff19811415615e8c57615e8c615ead565b9003919050565b6000600160ff1b821415615ea957615ea9615ead565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146142f857600080fd5b80151581146142f857600080fd5b8060020b81146142f857600080fd5b61ffff811681146142f857600080fd5b63ffffffff811681146142f857600080fdfec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a26469706673582212200d68bbc56177fb98dc03b8435a294744f29eb4d74dbc9371fa03141fd2efac7464736f6c63430008040033", - "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}." - }, - "burn(uint256,address)": { - "params": { - "burnAmount": "The number of G-UNI tokens to burn", - "receiver": "The account to receive the underlying amounts of token0 and token1" - }, - "returns": { - "amount0": "amount of token0 transferred to receiver for burning `burnAmount`", - "amount1": "amount of token1 transferred to receiver for burning `burnAmount`", - "liquidityBurned": "amount of liquidity removed from the underlying Uniswap V3 position" - } - }, - "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 this function is overridden; 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`." - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "details": "When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.", - "params": { - "newLowerTick": "The new lower bound of the position's range", - "newUpperTick": "The new upper bound of the position's range", - "swapAmountBPS": "amount of token to swap as proportion of total. Pass 0 to ignore swap.", - "swapThresholdPrice": "slippage parameter on the swap as a max or min sqrtPriceX96", - "zeroForOne": "Which token to input into the swap (true = token0, false = token1)" - } - }, - "getMintAmounts(uint256,uint256)": { - "params": { - "amount0Max": "The maximum amount of token1 to forward on mint" - }, - "returns": { - "amount0": "actual amount of token0 to forward when minting `mintAmount`", - "amount1": "actual amount of token1 to forward when minting `mintAmount`", - "mintAmount": "maximum number of G-UNI tokens to mint" - } - }, - "getUnderlyingBalances()": { - "returns": { - "amount0Current": "current total underlying balance of token0", - "amount1Current": "current total underlying balance of token1" - } - }, - "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." - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "params": { - "_lowerTick": "initial upperTick (only changeable with executiveRebalance)", - "_managerFeeBPS": "proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION", - "_manager_": "address of manager (ownership can be transferred)", - "_name": "name of G-UNI token", - "_pool": "address of Uniswap V3 pool", - "_symbol": "symbol of G-UNI token" - } - }, - "initializeManagerFee(uint16)": { - "params": { - "_managerFeeBPS": "proportion of fees earned that are credited to manager in Basis Points" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "mint(uint256,address)": { - "details": "to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts", - "params": { - "mintAmount": "The number of G-UNI tokens to mint", - "receiver": "The account to receive the minted tokens" - }, - "returns": { - "amount0": "amount of token0 transferred from msg.sender to mint `mintAmount`", - "amount1": "amount of token1 transferred from msg.sender to mint `mintAmount`", - "liquidityMinted": "amount of liquidity added to the underlying Uniswap V3 position" - } - }, - "name()": { - "details": "Returns the name of the token." - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "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 manager." - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "params": { - "newRebalanceBPS": "controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance", - "newSlippageBPS": "maximum slippage on swaps during gelato rebalance", - "newSlippageInterval": "length of time for TWAP used in computing slippage on swaps", - "newTreasury": "address where managerFee withdrawals are sent", - "newWithdrawBPS": "controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "burn(uint256,address)": { - "notice": "burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens" - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "notice": "Change the range of underlying UniswapV3 position, only manager can call" - }, - "getMintAmounts(uint256,uint256)": { - "notice": "compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`" - }, - "getUnderlyingBalances()": { - "notice": "compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)" - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "notice": "initialize storage variables on a new G-UNI pool, only called once" - }, - "initializeManagerFee(uint16)": { - "notice": "initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again." - }, - "mint(uint256,address)": { - "notice": "mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position" - }, - "rebalance(uint160,uint256,bool,uint256,address)": { - "notice": "Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager." - }, - "uniswapV3MintCallback(uint256,uint256,bytes)": { - "notice": "Uniswap V3 callback fn, called back on pool.mint" - }, - "uniswapV3SwapCallback(int256,int256,bytes)": { - "notice": "Uniswap v3 callback fn, called back on pool.swap" - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "notice": "change configurable parameters, only manager can call" - }, - "withdrawGelatoBalance(uint256,address)": { - "notice": "withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - }, - "withdrawManagerBalance(uint256,address)": { - "notice": "withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 5, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 784, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage" - }, - { - "astId": 122, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_balances", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 128, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_allowances", - "offset": 0, - "slot": "52", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 130, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_totalSupply", - "offset": 0, - "slot": "53", - "type": "t_uint256" - }, - { - "astId": 132, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_name", - "offset": 0, - "slot": "54", - "type": "t_string_storage" - }, - { - "astId": 134, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_symbol", - "offset": 0, - "slot": "55", - "type": "t_string_storage" - }, - { - "astId": 636, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "56", - "type": "t_array(t_uint256)45_storage" - }, - { - "astId": 59, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_status", - "offset": 0, - "slot": "101", - "type": "t_uint256" - }, - { - "astId": 102, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "102", - "type": "t_array(t_uint256)49_storage" - }, - { - "astId": 6441, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_manager", - "offset": 0, - "slot": "151", - "type": "t_address" - }, - { - "astId": 6031, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "lowerTick", - "offset": 20, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6033, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "upperTick", - "offset": 23, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 6035, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoRebalanceBPS", - "offset": 26, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6037, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoWithdrawBPS", - "offset": 28, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6039, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageBPS", - "offset": 30, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 6041, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageInterval", - "offset": 0, - "slot": "152", - "type": "t_uint32" - }, - { - "astId": 6043, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerFeeBPS", - "offset": 4, - "slot": "152", - "type": "t_uint16" - }, - { - "astId": 6045, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerTreasury", - "offset": 6, - "slot": "152", - "type": "t_address" - }, - { - "astId": 6047, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance0", - "offset": 0, - "slot": "153", - "type": "t_uint256" - }, - { - "astId": 6049, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance1", - "offset": 0, - "slot": "154", - "type": "t_uint256" - }, - { - "astId": 6051, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance0", - "offset": 0, - "slot": "155", - "type": "t_uint256" - }, - { - "astId": 6053, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance1", - "offset": 0, - "slot": "156", - "type": "t_uint256" - }, - { - "astId": 6056, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "pool", - "offset": 0, - "slot": "157", - "type": "t_contract(IUniswapV3Pool)2339" - }, - { - "astId": 6059, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token0", - "offset": 0, - "slot": "158", - "type": "t_contract(IERC20)863" - }, - { - "astId": 6062, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token1", - "offset": 0, - "slot": "159", - "type": "t_contract(IERC20)863" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)45_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)49_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "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)863": { - "encoding": "inplace", - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_contract(IUniswapV3Pool)2339": { - "encoding": "inplace", - "label": "contract IUniswapV3Pool", - "numberOfBytes": "20" - }, - "t_int24": { - "encoding": "inplace", - "label": "int24", - "numberOfBytes": "3" - }, - "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_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} diff --git a/lib/g-uni-v1-core/deployments/polygon/solcInputs/5b7722421ca04d0a130cd8a2a08f9ec3.json b/lib/g-uni-v1-core/deployments/polygon/solcInputs/5b7722421ca04d0a130cd8a2a08f9ec3.json deleted file mode 100644 index fe2c0f2c9..000000000 --- a/lib/g-uni-v1-core/deployments/polygon/solcInputs/5b7722421ca04d0a130cd8a2a08f9ec3.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 250;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n event SetManagerFee(uint16 managerFee);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n emit SetManagerFee(_managerFeeBPS);\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.4;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidityBefore,\n uint128 liquidityAfter\n );\n\n event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool), \"callback caller\");\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n SafeCast.toUint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n liquidityBurned = SafeCast.toUint128(liquidityBurned_);\n (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidityBurned);\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n\n amount0 =\n burn0 +\n FullMath.mulDiv(\n token0.balanceOf(address(this)) -\n burn0 -\n managerBalance0 -\n gelatoBalance0,\n burnAmount,\n totalSupply\n );\n amount1 =\n burn1 +\n FullMath.mulDiv(\n token1.balanceOf(address(this)) -\n burn1 -\n managerBalance1 -\n gelatoBalance1,\n burnAmount,\n totalSupply\n );\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n // solhint-disable-next-line function-max-lines\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n uint128 liquidity;\n uint128 newLiquidity;\n if (totalSupply() > 0) {\n (liquidity, , , , ) = pool.positions(_getPositionID());\n if (liquidity > 0) {\n (, , uint256 fee0, uint256 fee1) =\n _withdraw(lowerTick, upperTick, liquidity);\n\n _applyFees(fee0, fee1);\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n emit FeesEarned(fee0, fee1);\n }\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n (newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > 0, \"new position 0\");\n } else {\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n }\n\n emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n _rebalance(\n liquidity,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());\n require(newLiquidity > liquidity, \"liquidity must increase\");\n\n emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)\n external\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (, int24 tick, , , , , ) = pool.slot0();\n return _getUnderlyingBalances(sqrtRatioX96, tick);\n }\n\n // solhint-disable-next-line function-max-lines\n function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)\n internal\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint128 liquidity,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n uint256 leftover0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 leftover1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n (, , uint256 feesEarned0, uint256 feesEarned1) =\n _withdraw(lowerTick, upperTick, liquidity);\n _applyFees(feesEarned0, feesEarned1);\n (feesEarned0, feesEarned1) = _subtractAdminFees(\n feesEarned0,\n feesEarned1\n );\n emit FeesEarned(feesEarned0, feesEarned1);\n feesEarned0 += leftover0;\n feesEarned1 += leftover1;\n\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n leftover0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n leftover1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n leftover0,\n leftover1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdraw(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n )\n private\n returns (\n uint256 burn0,\n uint256 burn1,\n uint256 fee0,\n uint256 fee1\n )\n {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;\n fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n SafeCast.toInt256(\n ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000\n );\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);\n finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _applyFees(uint256 _fee0, uint256 _fee1) private {\n gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;\n managerBalance0 += (_fee0 * managerFeeBPS) / 10000;\n managerBalance1 += (_fee1 * managerFeeBPS) / 10000;\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array len\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"high slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"high slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\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 require(value < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return uint128(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 require(value < 2**64, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return uint64(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 require(value < 2**32, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return uint32(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 require(value < 2**16, \"SafeCast: value doesn\\'t fit in 16 bits\");\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 require(value < 2**8, \"SafeCast: value doesn\\'t fit in 8 bits\");\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 require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= -2**127 && value < 2**127, \"SafeCast: value doesn\\'t fit in 128 bits\");\n return int128(value);\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= -2**63 && value < 2**63, \"SafeCast: value doesn\\'t fit in 64 bits\");\n return int64(value);\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= -2**31 && value < 2**31, \"SafeCast: value doesn\\'t fit in 32 bits\");\n return int32(value);\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= -2**15 && value < 2**15, \"SafeCast: value doesn\\'t fit in 16 bits\");\n return int16(value);\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= -2**7 && value < 2**7, \"SafeCast: value doesn\\'t fit in 8 bits\");\n return int8(value);\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 require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 <= sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IUniswapV3TickSpacing} from \"./interfaces/IUniswapV3TickSpacing.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createManagedPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n }\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3Pool. Here the manager role is immediately burned, however msg.sender will still\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n return\n _createPool(\n tokenA,\n tokenB,\n uniFee,\n 0,\n lowerTick,\n upperTick,\n address(0)\n );\n }\n\n function _createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n address manager\n ) internal returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory name = \"Gelato Uniswap LP\";\n try this.getTokenName(token0, token1) returns (string memory result) {\n name = result;\n } catch {} // solhint-disable-line no-empty-blocks\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n require(uniPool != address(0), \"uniswap pool does not exist\");\n require(\n _validateTickSpacing(uniPool, lowerTick, upperTick),\n \"tickSpacing mismatch\"\n );\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n manager\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, manager, pool);\n }\n\n function _validateTickSpacing(\n address uniPool,\n int24 lowerTick,\n int24 upperTick\n ) internal view returns (bool) {\n int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();\n return\n lowerTick < upperTick &&\n lowerTick % spacing == 0 &&\n upperTick % spacing == 0;\n }\n\n function getTokenName(address token0, address token1)\n external\n view\n returns (string memory)\n {\n string memory symbol0 = IERC20Metadata(token0).symbol();\n string memory symbol1 = IERC20Metadata(token1).symbol();\n\n return _append(\"Gelato Uniswap \", symbol0, \"/\", symbol1, \" LP\");\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IUniswapV3TickSpacing.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IUniswapV3TickSpacing {\n function tickSpacing() external view returns (int24);\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n\n function createManagedPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": ["ast"] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} diff --git a/lib/g-uni-v1-core/deployments/ropsten/.chainId b/lib/g-uni-v1-core/deployments/ropsten/.chainId deleted file mode 100644 index e440e5c84..000000000 --- a/lib/g-uni-v1-core/deployments/ropsten/.chainId +++ /dev/null @@ -1 +0,0 @@ -3 \ No newline at end of file diff --git a/lib/g-uni-v1-core/deployments/ropsten/GUniFactory.json b/lib/g-uni-v1-core/deployments/ropsten/GUniFactory.json deleted file mode 100644 index 746b8d17e..000000000 --- a/lib/g-uni-v1-core/deployments/ropsten/GUniFactory.json +++ /dev/null @@ -1,650 +0,0 @@ -{ - "address": "0x04C92df23A7eCbe38b31BC30F7D4B65617740de8", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - } - ], - "transactionHash": "0x085c79cd087db50e402a40915d05fa37469a77b865817436b14d1c21c942375d", - "receipt": { - "to": null, - "from": "0x4B5BaD436CcA8df3bD39A095b84991fAc9A226F1", - "contractAddress": "0x04C92df23A7eCbe38b31BC30F7D4B65617740de8", - "transactionIndex": 4, - "gasUsed": "470944", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000080000000000000000000000000400000000000000000000000000000000800000000000000000000000000000200000000000000000000000000000000004000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000010000000000000800000000000000020000000000200000008000400000000000000080000000000000000000000000000", - "blockHash": "0xb20de93f79b0932a1cc708affc5433ebdde4eb7cdf1c9cdbc756256d56b8cd9e", - "transactionHash": "0x085c79cd087db50e402a40915d05fa37469a77b865817436b14d1c21c942375d", - "logs": [ - { - "transactionIndex": 4, - "blockNumber": 10541309, - "transactionHash": "0x085c79cd087db50e402a40915d05fa37469a77b865817436b14d1c21c942375d", - "address": "0x04C92df23A7eCbe38b31BC30F7D4B65617740de8", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000553447e91c4dd1f634d6dc787485ac52987035c5" - ], - "data": "0x", - "logIndex": 9, - "blockHash": "0xb20de93f79b0932a1cc708affc5433ebdde4eb7cdf1c9cdbc756256d56b8cd9e" - }, - { - "transactionIndex": 4, - "blockNumber": 10541309, - "transactionHash": "0x085c79cd087db50e402a40915d05fa37469a77b865817436b14d1c21c942375d", - "address": "0x04C92df23A7eCbe38b31BC30F7D4B65617740de8", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004b5bad436cca8df3bd39a095b84991fac9a226f1" - ], - "data": "0x", - "logIndex": 10, - "blockHash": "0xb20de93f79b0932a1cc708affc5433ebdde4eb7cdf1c9cdbc756256d56b8cd9e" - } - ], - "blockNumber": 10541309, - "cumulativeGasUsed": "735427", - "status": 1, - "byzantium": true - }, - "args": [ - "0x553447E91C4dd1F634D6dc787485ac52987035C5", - "0x4B5BaD436CcA8df3bD39A095b84991fAc9A226F1", - "0x" - ], - "solcInputHash": "07200b0d23a751835ce93ba1686cbb62", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management that accept ETH via receive\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173ProxyWithReceive.sol\":\"EIP173ProxyWithReceive\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x4ad41656a53bc38d766197d9974be4be70f506b1d1f78def2c3726e8d580a3f5\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173ProxyWithReceive.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./EIP173Proxy.sol\\\";\\n\\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\\ncontract EIP173ProxyWithReceive is EIP173Proxy {\\n constructor(\\n address implementationAddress,\\n address ownerAddress,\\n bytes memory data\\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\\n\\n receive() external payable override {}\\n}\\n\",\"keccak256\":\"0x7f0dea5e3cba284c86fe466d7f39ff6b8584c8134c69203a896410d679222414\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x00dbb59cf486ff9a2930fb588ef70d761dbf439aa05d48ef0001a0448769ec11\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610978380380610978833981016040819052610022916101aa565b82828261002f8382610043565b6100388261011f565b5050505050506102d4565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561011a576000836001600160a01b0316836040516100c49190610276565b600060405180830381855af49150503d80600081146100ff576040519150601f19603f3d011682016040523d82523d6000602084013e610104565b606091505b5050905080610118573d806000803e806000fd5b505b505050565b60006101376000805160206109588339815191525490565b90508160008051602061095883398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b03811681146101a557600080fd5b919050565b6000806000606084860312156101be578283fd5b6101c78461018e565b92506101d56020850161018e565b60408501519092506001600160401b03808211156101f1578283fd5b818601915086601f830112610204578283fd5b815181811115610216576102166102be565b604051601f8201601f19908116603f0116810190838211818310171561023e5761023e6102be565b81604052828152896020848701011115610256578586fd5b610267836020830160208801610292565b80955050505050509250925092565b60008251610288818460208701610292565b9190910192915050565b60005b838110156102ad578181015183820152602001610295565b838111156101185750506000910152565b634e487b7160e01b600052604160045260246000fd5b610675806102e36000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461005f5780633659cfe6146100945780633e47158c146100b45780634f1ef286146100e15780638356ca4f146100f457610055565b3661005557005b61005d610114565b005b34801561006b57600080fd5b5061007f61007a366004610576565b61014d565b60405190151581526020015b60405180910390f35b3480156100a057600080fd5b5061005d6100af3660046104bf565b610242565b3480156100c057600080fd5b506100c961029f565b6040516001600160a01b03909116815260200161008b565b61005d6100ef3660046104d9565b6102ae565b34801561010057600080fd5b5061005d61010f3660046104bf565b61032b565b6000805160206106208339815191525460003681823780813683855af491503d8082833e828015610143578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b03198316148061017e57506307f5828d60e41b6001600160e01b03198316145b1561018b57506001919050565b6001600160e01b031980831614156101a557506000919050565b600080516020610620833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b1580156101fe57600080fd5b505afa92505050801561022e575060408051601f3d908101601f1916820190925261022b91810190610556565b60015b61023b5750600092915050565b9392505050565b61024a61036c565b6001600160a01b0316336001600160a01b0316146102835760405162461bcd60e51b815260040161027a906105d7565b60405180910390fd5b61029c816040518060200160405280600081525061037f565b50565b60006102a961036c565b905090565b6102b661036c565b6001600160a01b0316336001600160a01b0316146102e65760405162461bcd60e51b815260040161027a906105d7565b6103268383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061037f92505050565b505050565b61033361036c565b6001600160a01b0316336001600160a01b0316146103635760405162461bcd60e51b815260040161027a906105d7565b61029c81610442565b6000805160206106008339815191525490565b6000805160206106208339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610326576000836001600160a01b0316836040516103ee919061059e565b600060405180830381855af49150503d8060008114610429576040519150601f19603f3d011682016040523d82523d6000602084013e61042e565b606091505b5050905080610147573d806000803e806000fd5b600061044c61036c565b90508160008051602061060083398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ba57600080fd5b919050565b6000602082840312156104d0578081fd5b61023b826104a3565b6000806000604084860312156104ed578182fd5b6104f6846104a3565b925060208401356001600160401b0380821115610511578384fd5b818601915086601f830112610524578384fd5b813581811115610532578485fd5b876020828501011115610543578485fd5b6020830194508093505050509250925092565b600060208284031215610567578081fd5b8151801515811461023b578182fd5b600060208284031215610587578081fd5b81356001600160e01b03198116811461023b578182fd5b60008251815b818110156105be57602081860181015185830152016105a4565b818111156105cc5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220b98e06a95fa86acb89692e6d911ca1aec63357dba2aa77647751548c0ff4a4b764736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461005f5780633659cfe6146100945780633e47158c146100b45780634f1ef286146100e15780638356ca4f146100f457610055565b3661005557005b61005d610114565b005b34801561006b57600080fd5b5061007f61007a366004610576565b61014d565b60405190151581526020015b60405180910390f35b3480156100a057600080fd5b5061005d6100af3660046104bf565b610242565b3480156100c057600080fd5b506100c961029f565b6040516001600160a01b03909116815260200161008b565b61005d6100ef3660046104d9565b6102ae565b34801561010057600080fd5b5061005d61010f3660046104bf565b61032b565b6000805160206106208339815191525460003681823780813683855af491503d8082833e828015610143578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b03198316148061017e57506307f5828d60e41b6001600160e01b03198316145b1561018b57506001919050565b6001600160e01b031980831614156101a557506000919050565b600080516020610620833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b1580156101fe57600080fd5b505afa92505050801561022e575060408051601f3d908101601f1916820190925261022b91810190610556565b60015b61023b5750600092915050565b9392505050565b61024a61036c565b6001600160a01b0316336001600160a01b0316146102835760405162461bcd60e51b815260040161027a906105d7565b60405180910390fd5b61029c816040518060200160405280600081525061037f565b50565b60006102a961036c565b905090565b6102b661036c565b6001600160a01b0316336001600160a01b0316146102e65760405162461bcd60e51b815260040161027a906105d7565b6103268383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061037f92505050565b505050565b61033361036c565b6001600160a01b0316336001600160a01b0316146103635760405162461bcd60e51b815260040161027a906105d7565b61029c81610442565b6000805160206106008339815191525490565b6000805160206106208339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610326576000836001600160a01b0316836040516103ee919061059e565b600060405180830381855af49150503d8060008114610429576040519150601f19603f3d011682016040523d82523d6000602084013e61042e565b606091505b5050905080610147573d806000803e806000fd5b600061044c61036c565b90508160008051602061060083398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ba57600080fd5b919050565b6000602082840312156104d0578081fd5b61023b826104a3565b6000806000604084860312156104ed578182fd5b6104f6846104a3565b925060208401356001600160401b0380821115610511578384fd5b818601915086601f830112610524578384fd5b813581811115610532578485fd5b876020828501011115610543578485fd5b6020830194508093505050509250925092565b600060208284031215610567578081fd5b8151801515811461023b578182fd5b600060208284031215610587578081fd5b81356001600160e01b03198116811461023b578182fd5b60008251815b818110156105be57602081860181015185830152016105a4565b818111156105cc5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220b98e06a95fa86acb89692e6d911ca1aec63357dba2aa77647751548c0ff4a4b764736f6c63430008040033", - "implementation": "0x553447E91C4dd1F634D6dc787485ac52987035C5", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management that accept ETH via receive", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} diff --git a/lib/g-uni-v1-core/deployments/ropsten/GUniFactory_Implementation.json b/lib/g-uni-v1-core/deployments/ropsten/GUniFactory_Implementation.json deleted file mode 100644 index ae3ae26dd..000000000 --- a/lib/g-uni-v1-core/deployments/ropsten/GUniFactory_Implementation.json +++ /dev/null @@ -1,722 +0,0 @@ -{ - "address": "0x553447E91C4dd1F634D6dc787485ac52987035C5", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_uniswapV3Factory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "uniPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previosGelatoDeployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newGelatoDeployer", - "type": "address" - } - ], - "name": "UpdateGelatoDeployer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "UpdatePoolImplementation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "uniFee", - "type": "uint24" - }, - { - "internalType": "uint16", - "name": "managerFee", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "upperTick", - "type": "int24" - } - ], - "name": "createPool", - "outputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoDeployer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDeployers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGelatoPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_implementation", - "type": "address" - }, - { - "internalType": "address", - "name": "_gelatoDeployer", - "type": "address" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "isPoolImmutable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "makePoolsImmutable", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numDeployers", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "deployer", - "type": "address" - } - ], - "name": "numPools", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextGelatoDeployer", - "type": "address" - } - ], - "name": "setGelatoDeployer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nextImplementation", - "type": "address" - } - ], - "name": "setPoolImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - } - ], - "name": "upgradePools", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "datas", - "type": "bytes[]" - } - ], - "name": "upgradePoolsAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xb2ea3776dcd38198c6adaffb5ec2c6f60b94691e5f133481c91b526e031a238b", - "receipt": { - "to": null, - "from": "0x4B5BaD436CcA8df3bD39A095b84991fAc9A226F1", - "contractAddress": "0x553447E91C4dd1F634D6dc787485ac52987035C5", - "transactionIndex": 6, - "gasUsed": "2059778", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xec822d8dea0135012b565f94ef6d38926bd91901af4c000efe45f7c93edb9d54", - "transactionHash": "0xb2ea3776dcd38198c6adaffb5ec2c6f60b94691e5f133481c91b526e031a238b", - "logs": [], - "blockNumber": 10541308, - "cumulativeGasUsed": "4884041", - "status": 1, - "byzantium": true - }, - "args": ["0x273Edaa13C845F605b5886Dd66C89AB497A6B17b"], - "solcInputHash": "07200b0d23a751835ce93ba1686cbb62", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_uniswapV3Factory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"uniPool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previosGelatoDeployer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newGelatoDeployer\",\"type\":\"address\"}],\"name\":\"UpdateGelatoDeployer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"UpdatePoolImplementation\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"uniFee\",\"type\":\"uint24\"},{\"internalType\":\"uint16\",\"name\":\"managerFee\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"upperTick\",\"type\":\"int24\"}],\"name\":\"createPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDeployers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGelatoPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gelatoDeployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isPoolImmutable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"makePoolsImmutable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numDeployers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"numPools\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextGelatoDeployer\",\"type\":\"address\"}],\"name\":\"setGelatoDeployer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nextImplementation\",\"type\":\"address\"}],\"name\":\"setPoolImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"name\":\"upgradePools\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"bytes[]\",\"name\":\"datas\",\"type\":\"bytes[]\"}],\"name\":\"upgradePoolsAndCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"createPool(address,address,uint24,uint16,int24,int24)\":{\"params\":{\"lowerTick\":\"initial lower bound of the Uniswap V3 position\",\"managerFee\":\"proportion of earned fees that go to pool manager in Basis Points\",\"tokenA\":\"one of the tokens in the uniswap pair\",\"tokenB\":\"the other token in the uniswap pair\",\"uniFee\":\"fee tier of the uniswap pair\",\"upperTick\":\"initial upper bound of the Uniswap V3 position\"},\"returns\":{\"pool\":\"the address of the newly created G-UNI pool (proxy)\"}},\"getDeployers()\":{\"returns\":{\"_0\":\"deployers the list of deployer addresses\"}},\"getGelatoPools()\":{\"returns\":{\"_0\":\"list of Gelato managed G-UNI pool addresses\"}},\"getPools(address)\":{\"params\":{\"deployer\":\"address that has potentially deployed G-UNI pools (can return empty array)\"},\"returns\":{\"_0\":\"pools the list of G-UNI pool addresses deployed by `deployer`\"}},\"getProxyAdmin(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"address that controls the G-UNI implementation (has power to upgrade it)\"}},\"isPoolImmutable(address)\":{\"params\":{\"pool\":\"address of the G-UNI pool\"},\"returns\":{\"_0\":\"bool signaling if pool is immutable (true) or not (false)\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"numDeployers()\":{\"returns\":{\"_0\":\"total number of G-UNI pool deployer addresses\"}},\"numPools()\":{\"returns\":{\"result\":\"total number of G-UNI pools deployed\"}},\"numPools(address)\":{\"params\":{\"deployer\":\"deployer address\"},\"returns\":{\"_0\":\"total number of G-UNI pools deployed by `deployer`\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"createPool(address,address,uint24,uint16,int24,int24)\":{\"notice\":\"createPool creates a new instance of a G-UNI token on a specified UniswapV3 pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`\"},\"getDeployers()\":{\"notice\":\"getDeployers fetches all addresses that have deployed a G-UNI pool\"},\"getGelatoPools()\":{\"notice\":\"getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)\"},\"getPools(address)\":{\"notice\":\"getPools fetches all the G-UNI pool addresses deployed by `deployer`\"},\"getProxyAdmin(address)\":{\"notice\":\"getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address).\"},\"isPoolImmutable(address)\":{\"notice\":\"isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\"},\"numDeployers()\":{\"notice\":\"numDeployers counts the total number of G-UNI pool deployer addresses\"},\"numPools()\":{\"notice\":\"numPools counts the total number of G-UNI pools in existence\"},\"numPools(address)\":{\"notice\":\"numPools counts the total number of G-UNI pools deployed by `deployer`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniFactory.sol\":\"GUniFactory\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\\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\":\"0x4878ef6c288f4cef3c2a288d32cc548c648831cc55503ad3d9a581ed3b93aad9\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title The interface for the Uniswap V3 Factory\\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\\ninterface IUniswapV3Factory {\\n /// @notice Emitted when the owner of the factory is changed\\n /// @param oldOwner The owner before the owner was changed\\n /// @param newOwner The owner after the owner was changed\\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\\n\\n /// @notice Emitted when a pool is created\\n /// @param token0 The first token of the pool by address sort order\\n /// @param token1 The second token of the pool by address sort order\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks\\n /// @param pool The address of the created pool\\n event PoolCreated(\\n address indexed token0,\\n address indexed token1,\\n uint24 indexed fee,\\n int24 tickSpacing,\\n address pool\\n );\\n\\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\\n /// @param fee The enabled fee, denominated in hundredths of a bip\\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\\n\\n /// @notice Returns the current owner of the factory\\n /// @dev Can be changed by the current owner via setOwner\\n /// @return The address of the factory owner\\n function owner() external view returns (address);\\n\\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\\n /// @return The tick spacing\\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\\n\\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\\n /// @param tokenA The contract address of either token0 or token1\\n /// @param tokenB The contract address of the other token\\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\\n /// @return pool The pool address\\n function getPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external view returns (address pool);\\n\\n /// @notice Creates a pool for the given two tokens and fee\\n /// @param tokenA One of the two tokens in the desired pool\\n /// @param tokenB The other of the two tokens in the desired pool\\n /// @param fee The desired fee for the pool\\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\\n /// are invalid.\\n /// @return pool The address of the newly created pool\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 fee\\n ) external returns (address pool);\\n\\n /// @notice Updates the owner of the factory\\n /// @dev Must be called by the current owner\\n /// @param _owner The new owner of the factory\\n function setOwner(address _owner) external;\\n\\n /// @notice Enables a fee amount with the given tickSpacing\\n /// @dev Fee amounts may never be removed once enabled\\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\\n}\\n\",\"keccak256\":\"0xcc3d0c93fc9ac0febbe09f941b465b57f750bcf3b48432da0b97dc289cfdc489\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\nimport {\\n IUniswapV3Factory\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\\\";\\nimport {IGUniFactory} from \\\"./interfaces/IGUniFactory.sol\\\";\\nimport {IGUniPoolStorage} from \\\"./interfaces/IGUniPoolStorage.sol\\\";\\nimport {GUniFactoryStorage} from \\\"./abstract/GUniFactoryStorage.sol\\\";\\nimport {EIP173Proxy} from \\\"./vendor/proxy/EIP173Proxy.sol\\\";\\nimport {IEIP173Proxy} from \\\"./interfaces/IEIP173Proxy.sol\\\";\\nimport {\\n IERC20Metadata\\n} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n constructor(address _uniswapV3Factory)\\n GUniFactoryStorage(_uniswapV3Factory)\\n {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice createPool creates a new instance of a G-UNI token on a specified\\n /// UniswapV3 pool. The msg.sender is the initial manager of the pool and will\\n /// forever be associated with the G-UNI pool as it's `deployer`\\n /// @param tokenA one of the tokens in the uniswap pair\\n /// @param tokenB the other token in the uniswap pair\\n /// @param uniFee fee tier of the uniswap pair\\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\\n /// @param lowerTick initial lower bound of the Uniswap V3 position\\n /// @param upperTick initial upper bound of the Uniswap V3 position\\n /// @return pool the address of the newly created G-UNI pool (proxy)\\n // solhint-disable-next-line function-max-lines\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external override returns (address pool) {\\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\\n\\n pool = address(new EIP173Proxy(poolImplementation, address(this), \\\"\\\"));\\n\\n string memory symbol0 = \\\"?\\\";\\n string memory symbol1 = \\\"?\\\";\\n try IERC20Metadata(token0).symbol() returns (string memory sym0) {\\n symbol0 = sym0;\\n } catch {} // solhint-disable-line no-empty-blocks\\n try IERC20Metadata(token1).symbol() returns (string memory sym1) {\\n symbol1 = sym1;\\n } catch {} // solhint-disable-line no-empty-blocks\\n\\n string memory name =\\n _append(\\n \\\"Gelato Uniswap \\\",\\n symbol0,\\n \\\"/\\\",\\n symbol1,\\n \\\" LP\\\"\\n );\\n\\n address uniPool =\\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\\n\\n require(uniPool != address(0), \\\"uniswap pool does not exist\\\");\\n\\n IGUniPoolStorage(pool).initialize(\\n name,\\n \\\"G-UNI\\\",\\n uniPool,\\n managerFee,\\n lowerTick,\\n upperTick,\\n msg.sender\\n );\\n _deployers.add(msg.sender);\\n _pools[msg.sender].add(pool);\\n emit PoolCreated(uniPool, msg.sender, pool);\\n }\\n\\n function upgradePools(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\\n }\\n }\\n\\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\\n external\\n onlyManager\\n {\\n require(pools.length == datas.length, \\\"mismatching array length\\\");\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).upgradeToAndCall(\\n poolImplementation,\\n datas[i]\\n );\\n }\\n }\\n\\n function makePoolsImmutable(address[] memory pools) external onlyManager {\\n for (uint256 i = 0; i < pools.length; i++) {\\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\\n }\\n }\\n\\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \\\"immutable\\\" i.e. that the\\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\\n /// @param pool address of the G-UNI pool\\n /// @return bool signaling if pool is immutable (true) or not (false)\\n function isPoolImmutable(address pool) external view returns (bool) {\\n return address(0) == getProxyAdmin(pool);\\n }\\n\\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\\n /// @return list of Gelato managed G-UNI pool addresses\\n function getGelatoPools() external view returns (address[] memory) {\\n return getPools(gelatoDeployer);\\n }\\n\\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\\n /// @return deployers the list of deployer addresses\\n function getDeployers() public view returns (address[] memory) {\\n uint256 length = numDeployers();\\n address[] memory deployers = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n deployers[i] = _getDeployer(i);\\n }\\n\\n return deployers;\\n }\\n\\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\\n function getPools(address deployer) public view returns (address[] memory) {\\n uint256 length = numPools(deployer);\\n address[] memory pools = new address[](length);\\n for (uint256 i = 0; i < length; i++) {\\n pools[i] = _getPool(deployer, i);\\n }\\n\\n return pools;\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools in existence\\n /// @return result total number of G-UNI pools deployed\\n function numPools() public view returns (uint256 result) {\\n address[] memory deployers = getDeployers();\\n for (uint256 i = 0; i < deployers.length; i++) {\\n result += numPools(deployers[i]);\\n }\\n }\\n\\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\\n /// @return total number of G-UNI pool deployer addresses\\n function numDeployers() public view returns (uint256) {\\n return _deployers.length();\\n }\\n\\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\\n /// @param deployer deployer address\\n /// @return total number of G-UNI pools deployed by `deployer`\\n function numPools(address deployer) public view returns (uint256) {\\n return _pools[deployer].length();\\n }\\n\\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\\n /// no longer upgradable (no one owns the zero address).\\n /// @param pool address of the G-UNI pool\\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\\n function getProxyAdmin(address pool) public view returns (address) {\\n return IEIP173Proxy(pool).proxyAdmin();\\n }\\n\\n function _getDeployer(uint256 index) internal view returns (address) {\\n return _deployers.at(index);\\n }\\n\\n function _getPool(address deployer, uint256 index)\\n internal\\n view\\n returns (address)\\n {\\n return _pools[deployer].at(index);\\n }\\n\\n function _getTokenOrder(address tokenA, address tokenB)\\n internal\\n pure\\n returns (address token0, address token1)\\n {\\n require(tokenA != tokenB, \\\"same token\\\");\\n (token0, token1) = tokenA < tokenB\\n ? (tokenA, tokenB)\\n : (tokenB, tokenA);\\n require(token0 != address(0), \\\"no address zero\\\");\\n }\\n\\n function _append(\\n string memory a,\\n string memory b,\\n string memory c,\\n string memory d,\\n string memory e\\n ) internal pure returns (string memory) {\\n return string(abi.encodePacked(a, b, c, d, e));\\n }\\n}\\n\",\"keccak256\":\"0x04f4732e4dbb7842e49078a06b4f5830500b4eb855d44d9edf3784667d791da2\",\"license\":\"MIT\"},\"contracts/abstract/GUniFactoryStorage.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n Initializable\\n} from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport {\\n EnumerableSet\\n} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\n// solhint-disable-next-line max-states-count\\ncontract GUniFactoryStorage is\\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\\n Initializable\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n address public immutable factory;\\n address public poolImplementation;\\n address public gelatoDeployer;\\n EnumerableSet.AddressSet internal _deployers;\\n mapping(address => EnumerableSet.AddressSet) internal _pools;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdatePoolImplementation(\\n address previousImplementation,\\n address newImplementation\\n );\\n\\n event UpdateGelatoDeployer(\\n address previosGelatoDeployer,\\n address newGelatoDeployer\\n );\\n\\n constructor(address _uniswapV3Factory) {\\n factory = _uniswapV3Factory;\\n }\\n\\n function initialize(\\n address _implementation,\\n address _gelatoDeployer,\\n address _manager_\\n ) external initializer {\\n poolImplementation = _implementation;\\n gelatoDeployer = _gelatoDeployer;\\n _manager = _manager_;\\n }\\n\\n function setPoolImplementation(address nextImplementation)\\n external\\n onlyManager\\n {\\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\\n poolImplementation = nextImplementation;\\n }\\n\\n function setGelatoDeployer(address nextGelatoDeployer)\\n external\\n onlyManager\\n {\\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\\n gelatoDeployer = nextGelatoDeployer;\\n }\\n}\\n\",\"keccak256\":\"0x857825c59937570d3301568064da0f5e20ecfb88dae75bf1a8b7d38f745866e6\",\"license\":\"MIT\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.4;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x81d888640e2261ac5189e6061a0cf4a7f3cec5994be1859ba60ffeb961f70c01\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IEIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\ninterface IEIP173Proxy {\\n function proxyAdmin() external view returns (address);\\n\\n function transferProxyAdmin(address newAdmin) external;\\n\\n function upgradeTo(address newImplementation) external;\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable;\\n}\\n\",\"keccak256\":\"0x3ff5ed428adeaaa9ba05a91b4ccec7df22cd5de80a53a7bff109543bdebe1a68\",\"license\":\"GPL-3.0\"},\"contracts/interfaces/IGUniFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.4;\\n\\ninterface IGUniFactory {\\n event PoolCreated(\\n address indexed uniPool,\\n address indexed manager,\\n address indexed pool\\n );\\n\\n function createPool(\\n address tokenA,\\n address tokenB,\\n uint24 uniFee,\\n uint16 managerFee,\\n int24 lowerTick,\\n int24 upperTick\\n ) external returns (address pool);\\n}\\n\",\"keccak256\":\"0xd3a394c8b7a3961b2c0420b846dbaa35739f28be9ea300bbf084d62c23a92e03\",\"license\":\"MIT\"},\"contracts/interfaces/IGUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\ninterface IGUniPoolStorage {\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external;\\n}\\n\",\"keccak256\":\"0x39f4bc4e8684c9674e1967a3ac4ea5531f45492266586c4e6e9eb2f6d9108ced\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x4ad41656a53bc38d766197d9974be4be70f506b1d1f78def2c3726e8d580a3f5\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x00dbb59cf486ff9a2930fb588ef70d761dbf439aa05d48ef0001a0448769ec11\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b506040516124f03803806124f083398101604081905261002f91610044565b60601b6001600160601b031916608052610072565b600060208284031215610055578081fd5b81516001600160a01b038116811461006b578182fd5b9392505050565b60805160601c612459610097600039600081816102cc0152610a5b01526124596000f3fe60806040523480156200001157600080fd5b50600436106200012a5760003560e01c806308893328146200012f578063098eddb114620001485780630dfc574b1462000165578063260fc2b8146200017c57806335c62bc2146200019357806340aee041146200019d57806342f5de9914620001b4578063481c6a7514620001cb578063483248ca14620001e457806354fd4d5014620001fb578063562b8103146200022f5780635c39f4671462000248578063607c12b5146200025f578063715018a6146200026957806386238765146200027357806395d807f11462000287578063c0c53b8b14620002af578063c45a015514620002c6578063cefa779914620002ee578063d6f748981462000302578063f2fde38b1462000319578063f3b7dead1462000330575b600080fd5b620001466200014036600462001476565b62000347565b005b62000152620003ef565b6040519081526020015b60405180910390f35b6200014662000176366004620015d6565b62000402565b620001466200018d36600462001598565b62000582565b6200015262000668565b62000146620001ae36600462001598565b620006df565b62000152620001c536600462001476565b620007c9565b620001d5620007f2565b6040516200015c9190620017ae565b620001d5620001f536600462001505565b62000801565b62000220604051806040016040528060058152602001640312e302e360dc1b81525081565b6040516200015c91906200186b565b6200023962000c1a565b6040516200015c91906200181c565b620002396200025936600462001476565b62000c2f565b6200023962000d04565b6200014662000dd6565b600254620001d5906001600160a01b031681565b6200029e6200029836600462001476565b62000e43565b60405190151581526020016200015c565b62000146620002c0366004620014b4565b62000e60565b620001d57f000000000000000000000000000000000000000000000000000000000000000081565b600154620001d5906001600160a01b031681565b620001466200031336600462001476565b62000f6a565b620001466200032a36600462001476565b62001009565b620001d56200034136600462001476565b620010f0565b3362000352620007f2565b6001600160a01b031614620003845760405162461bcd60e51b81526004016200037b90620018f5565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c908591620003c5916001600160a01b03909116908490620017c2565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000620003fd600362001167565b905090565b336200040d620007f2565b6001600160a01b031614620004365760405162461bcd60e51b81526004016200037b90620018f5565b82518114620004835760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b60448201526064016200037b565b60005b83518110156200057c57838181518110620004b157634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b0316858585818110620004fe57634e487b7160e01b600052603260045260246000fd5b905060200281019062000512919062001937565b6040518463ffffffff1660e01b81526004016200053293929190620017dc565b600060405180830381600087803b1580156200054d57600080fd5b505af115801562000562573d6000803e3d6000fd5b5050505080806200057390620019fb565b91505062000486565b50505050565b336200058d620007f2565b6001600160a01b031614620005b65760405162461bcd60e51b81526004016200037b90620018f5565b60005b81518110156200066457818181518110620005e457634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200061a9190620017ae565b600060405180830381600087803b1580156200063557600080fd5b505af11580156200064a573d6000803e3d6000fd5b5050505080806200065b90620019fb565b915050620005b9565b5050565b6000806200067562000d04565b905060005b8151811015620006da57620006b7828281518110620006a957634e487b7160e01b600052603260045260246000fd5b6020026020010151620007c9565b620006c39084620019b1565b925080620006d181620019fb565b9150506200067a565b505090565b33620006ea620007f2565b6001600160a01b031614620007135760405162461bcd60e51b81526004016200037b90620018f5565b60005b815181101562000664578181815181106200074157634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200077f92911690600401620017ae565b600060405180830381600087803b1580156200079a57600080fd5b505af1158015620007af573d6000803e3d6000fd5b505050508080620007c090620019fb565b91505062000716565b6001600160a01b0381166000908152600560205260408120620007ec9062001167565b92915050565b6000546001600160a01b031690565b600080600062000812898962001172565b6001546040519294509092506001600160a01b03169030906200083590620013ba565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000878573d6000803e3d6000fd5b5092506000604051806040016040528060018152602001603f60f81b81525090506000604051806040016040528060018152602001603f60f81b8152509050836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015620008f157600080fd5b505afa9250505080156200092957506040513d6000823e601f3d908101601f1916820160405262000926919081019062001671565b60015b620009345762000937565b91505b826001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b1580156200097157600080fd5b505afa925050508015620009a957506040513d6000823e601f3d908101601f19168201604052620009a6919081019062001671565b60015b620009b457620009b7565b90505b600062000a236040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525084604051806040016040528060018152602001602f60f81b81525085604051806040016040528060038152602001620204c560ec1b81525062001241565b604051630b4c774160e11b81526001600160a01b038781166004830152868116602483015262ffffff8d1660448301529192506000917f00000000000000000000000000000000000000000000000000000000000000001690631698ee829060640160206040518083038186803b15801562000a9e57600080fd5b505afa15801562000ab3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ad9919062001495565b90506001600160a01b03811662000b315760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b60448201526064016200037b565b60405163e25e15e360e01b81526001600160a01b0388169063e25e15e39062000b6990859085908f908f908f90339060040162001880565b600060405180830381600087803b15801562000b8457600080fd5b505af115801562000b99573d6000803e3d6000fd5b5050505062000bb33360036200127890919063ffffffff16565b5033600090815260056020526040902062000bcf908862001278565b506040516001600160a01b038089169133918416907f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b90600090a45050505050509695505050505050565b600254606090620003fd906001600160a01b03165b6060600062000c3e83620007c9565b90506000816001600160401b0381111562000c6957634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000c93578160200160208202803683370190505b50905060005b8281101562000cfc5762000cae858262001296565b82828151811062000ccf57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101528062000cf381620019fb565b91505062000c99565b509392505050565b6060600062000d12620003ef565b90506000816001600160401b0381111562000d3d57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000d67578160200160208202803683370190505b50905060005b8281101562000dcf5762000d8181620012ba565b82828151811062000da257634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101528062000dc681620019fb565b91505062000d6d565b5092915050565b3362000de1620007f2565b6001600160a01b03161462000e0a5760405162461bcd60e51b81526004016200037b90620018f5565b600080546040516001600160a01b039091169060008051602062002404833981519152908390a3600080546001600160a01b0319169055565b600062000e5082620010f0565b6001600160a01b03161592915050565b600054600160a81b900460ff168062000e835750600054600160a01b900460ff16155b62000ee85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200037b565b600054600160a81b900460ff1615801562000f13576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b03199283161790925560028054868416908316179055600080549285169290911691909117905580156200057c576000805460ff60a81b1916905550505050565b3362000f75620007f2565b6001600160a01b03161462000f9e5760405162461bcd60e51b81526004016200037b90620018f5565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000fdf916001600160a01b03909116908490620017c2565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362001014620007f2565b6001600160a01b0316146200103d5760405162461bcd60e51b81526004016200037b90620018f5565b6001600160a01b038116620010a65760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b60648201526084016200037b565b600080546040516001600160a01b03808516939216916000805160206200240483398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200112c57600080fd5b505afa15801562001141573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007ec919062001495565b6000620007ec825490565b600080826001600160a01b0316846001600160a01b03161415620011c65760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b60448201526064016200037b565b826001600160a01b0316846001600160a01b031610620011e8578284620011eb565b83835b90925090506001600160a01b0382166200123a5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b60448201526064016200037b565b9250929050565b606085858585856040516020016200125e95949392919062001739565b604051602081830303815290604052905095945050505050565b60006200128f836001600160a01b038416620012c9565b9392505050565b6001600160a01b03821660009081526005602052604081206200128f90836200131b565b6000620007ec6003836200131b565b60008181526001830160205260408120546200131257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007ec565b506000620007ec565b60006200128f838381546000908210620013835760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b60648201526084016200037b565b826000018281548110620013a757634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b6109a58062001a5f83390190565b600082601f830112620013d9578081fd5b813560206001600160401b03821115620013f757620013f762001a2f565b8160051b620014088282016200197e565b83815282810190868401838801850189101562001423578687fd5b8693505b85841015620014525780356200143d8162001a45565b83526001939093019291840191840162001427565b50979650505050505050565b8035600281900b81146200147157600080fd5b919050565b60006020828403121562001488578081fd5b81356200128f8162001a45565b600060208284031215620014a7578081fd5b81516200128f8162001a45565b600080600060608486031215620014c9578182fd5b8335620014d68162001a45565b92506020840135620014e88162001a45565b91506040840135620014fa8162001a45565b809150509250925092565b60008060008060008060c087890312156200151e578182fd5b86356200152b8162001a45565b955060208701356200153d8162001a45565b9450604087013562ffffff8116811462001555578283fd5b9350606087013561ffff811681146200156c578283fd5b92506200157c608088016200145e565b91506200158c60a088016200145e565b90509295509295509295565b600060208284031215620015aa578081fd5b81356001600160401b03811115620015c0578182fd5b620015ce84828501620013c8565b949350505050565b600080600060408486031215620015eb578283fd5b83356001600160401b038082111562001602578485fd5b6200161087838801620013c8565b9450602086013591508082111562001626578384fd5b818601915086601f8301126200163a578384fd5b81358181111562001649578485fd5b8760208260051b85010111156200165e578485fd5b6020830194508093505050509250925092565b60006020828403121562001683578081fd5b81516001600160401b03808211156200169a578283fd5b818401915084601f830112620016ae578283fd5b815181811115620016c357620016c362001a2f565b620016d8601f8201601f19166020016200197e565b9150808252856020828501011115620016ef578384fd5b62001702816020840160208601620019cc565b50949350505050565b6000815180845262001725816020860160208601620019cc565b601f01601f19169290920160200192915050565b600086516200174d818460208b01620019cc565b86519083019062001763818360208b01620019cc565b865191019062001778818360208a01620019cc565b85519101906200178d818360208901620019cc565b8451910190620017a2818360208801620019cc565b01979650505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b6020808252825182820181905260009190848201906040850190845b818110156200185f5783516001600160a01b03168352928401929184019160010162001838565b50909695505050505050565b6020815260006200128f60208301846200170b565b60e0815260006200189560e08301896200170b565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6000808335601e198436030181126200194e578283fd5b8301803591506001600160401b0382111562001968578283fd5b6020019150368190038213156200123a57600080fd5b604051601f8201601f191681016001600160401b0381118282101715620019a957620019a962001a2f565b604052919050565b60008219821115620019c757620019c762001a19565b500190565b60005b83811015620019e9578181015183820152602001620019cf565b838111156200057c5750506000910152565b600060001982141562001a125762001a1262001a19565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811462001a5b57600080fd5b5056fe60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a26469706673582212207c6179e464a0c317191f9da090adad7dcf9f58cae09d904a5c2fe10e8f2dd90164736f6c63430008040033", - "deployedBytecode": "0x60806040523480156200001157600080fd5b50600436106200012a5760003560e01c806308893328146200012f578063098eddb114620001485780630dfc574b1462000165578063260fc2b8146200017c57806335c62bc2146200019357806340aee041146200019d57806342f5de9914620001b4578063481c6a7514620001cb578063483248ca14620001e457806354fd4d5014620001fb578063562b8103146200022f5780635c39f4671462000248578063607c12b5146200025f578063715018a6146200026957806386238765146200027357806395d807f11462000287578063c0c53b8b14620002af578063c45a015514620002c6578063cefa779914620002ee578063d6f748981462000302578063f2fde38b1462000319578063f3b7dead1462000330575b600080fd5b620001466200014036600462001476565b62000347565b005b62000152620003ef565b6040519081526020015b60405180910390f35b6200014662000176366004620015d6565b62000402565b620001466200018d36600462001598565b62000582565b6200015262000668565b62000146620001ae36600462001598565b620006df565b62000152620001c536600462001476565b620007c9565b620001d5620007f2565b6040516200015c9190620017ae565b620001d5620001f536600462001505565b62000801565b62000220604051806040016040528060058152602001640312e302e360dc1b81525081565b6040516200015c91906200186b565b6200023962000c1a565b6040516200015c91906200181c565b620002396200025936600462001476565b62000c2f565b6200023962000d04565b6200014662000dd6565b600254620001d5906001600160a01b031681565b6200029e6200029836600462001476565b62000e43565b60405190151581526020016200015c565b62000146620002c0366004620014b4565b62000e60565b620001d57f000000000000000000000000000000000000000000000000000000000000000081565b600154620001d5906001600160a01b031681565b620001466200031336600462001476565b62000f6a565b620001466200032a36600462001476565b62001009565b620001d56200034136600462001476565b620010f0565b3362000352620007f2565b6001600160a01b031614620003845760405162461bcd60e51b81526004016200037b90620018f5565b60405180910390fd5b6002546040517fb316078581b0eaf0714b47d13192560506acc3e23b5bf3b72d27248f173c908591620003c5916001600160a01b03909116908490620017c2565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000620003fd600362001167565b905090565b336200040d620007f2565b6001600160a01b031614620004365760405162461bcd60e51b81526004016200037b90620018f5565b82518114620004835760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b60448201526064016200037b565b60005b83518110156200057c57838181518110620004b157634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b0316858585818110620004fe57634e487b7160e01b600052603260045260246000fd5b905060200281019062000512919062001937565b6040518463ffffffff1660e01b81526004016200053293929190620017dc565b600060405180830381600087803b1580156200054d57600080fd5b505af115801562000562573d6000803e3d6000fd5b5050505080806200057390620019fb565b91505062000486565b50505050565b336200058d620007f2565b6001600160a01b031614620005b65760405162461bcd60e51b81526004016200037b90620018f5565b60005b81518110156200066457818181518110620005e457634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200061a9190620017ae565b600060405180830381600087803b1580156200063557600080fd5b505af11580156200064a573d6000803e3d6000fd5b5050505080806200065b90620019fb565b915050620005b9565b5050565b6000806200067562000d04565b905060005b8151811015620006da57620006b7828281518110620006a957634e487b7160e01b600052603260045260246000fd5b6020026020010151620007c9565b620006c39084620019b1565b925080620006d181620019fb565b9150506200067a565b505090565b33620006ea620007f2565b6001600160a01b031614620007135760405162461bcd60e51b81526004016200037b90620018f5565b60005b815181101562000664578181815181106200074157634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe6926200077f92911690600401620017ae565b600060405180830381600087803b1580156200079a57600080fd5b505af1158015620007af573d6000803e3d6000fd5b505050508080620007c090620019fb565b91505062000716565b6001600160a01b0381166000908152600560205260408120620007ec9062001167565b92915050565b6000546001600160a01b031690565b600080600062000812898962001172565b6001546040519294509092506001600160a01b03169030906200083590620013ba565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f08015801562000878573d6000803e3d6000fd5b5092506000604051806040016040528060018152602001603f60f81b81525090506000604051806040016040528060018152602001603f60f81b8152509050836001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015620008f157600080fd5b505afa9250505080156200092957506040513d6000823e601f3d908101601f1916820160405262000926919081019062001671565b60015b620009345762000937565b91505b826001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b1580156200097157600080fd5b505afa925050508015620009a957506040513d6000823e601f3d908101601f19168201604052620009a6919081019062001671565b60015b620009b457620009b7565b90505b600062000a236040518060400160405280600f81526020016e023b2b630ba37902ab734b9bbb0b81608d1b81525084604051806040016040528060018152602001602f60f81b81525085604051806040016040528060038152602001620204c560ec1b81525062001241565b604051630b4c774160e11b81526001600160a01b038781166004830152868116602483015262ffffff8d1660448301529192506000917f00000000000000000000000000000000000000000000000000000000000000001690631698ee829060640160206040518083038186803b15801562000a9e57600080fd5b505afa15801562000ab3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ad9919062001495565b90506001600160a01b03811662000b315760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b60448201526064016200037b565b60405163e25e15e360e01b81526001600160a01b0388169063e25e15e39062000b6990859085908f908f908f90339060040162001880565b600060405180830381600087803b15801562000b8457600080fd5b505af115801562000b99573d6000803e3d6000fd5b5050505062000bb33360036200127890919063ffffffff16565b5033600090815260056020526040902062000bcf908862001278565b506040516001600160a01b038089169133918416907f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b90600090a45050505050509695505050505050565b600254606090620003fd906001600160a01b03165b6060600062000c3e83620007c9565b90506000816001600160401b0381111562000c6957634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000c93578160200160208202803683370190505b50905060005b8281101562000cfc5762000cae858262001296565b82828151811062000ccf57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101528062000cf381620019fb565b91505062000c99565b509392505050565b6060600062000d12620003ef565b90506000816001600160401b0381111562000d3d57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801562000d67578160200160208202803683370190505b50905060005b8281101562000dcf5762000d8181620012ba565b82828151811062000da257634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101528062000dc681620019fb565b91505062000d6d565b5092915050565b3362000de1620007f2565b6001600160a01b03161462000e0a5760405162461bcd60e51b81526004016200037b90620018f5565b600080546040516001600160a01b039091169060008051602062002404833981519152908390a3600080546001600160a01b0319169055565b600062000e5082620010f0565b6001600160a01b03161592915050565b600054600160a81b900460ff168062000e835750600054600160a01b900460ff16155b62000ee85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200037b565b600054600160a81b900460ff1615801562000f13576000805461ffff60a01b191661010160a01b1790555b600180546001600160a01b038087166001600160a01b03199283161790925560028054868416908316179055600080549285169290911691909117905580156200057c576000805460ff60a81b1916905550505050565b3362000f75620007f2565b6001600160a01b03161462000f9e5760405162461bcd60e51b81526004016200037b90620018f5565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa9162000fdf916001600160a01b03909116908490620017c2565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b3362001014620007f2565b6001600160a01b0316146200103d5760405162461bcd60e51b81526004016200037b90620018f5565b6001600160a01b038116620010a65760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b60648201526084016200037b565b600080546040516001600160a01b03808516939216916000805160206200240483398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200112c57600080fd5b505afa15801562001141573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007ec919062001495565b6000620007ec825490565b600080826001600160a01b0316846001600160a01b03161415620011c65760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b60448201526064016200037b565b826001600160a01b0316846001600160a01b031610620011e8578284620011eb565b83835b90925090506001600160a01b0382166200123a5760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b60448201526064016200037b565b9250929050565b606085858585856040516020016200125e95949392919062001739565b604051602081830303815290604052905095945050505050565b60006200128f836001600160a01b038416620012c9565b9392505050565b6001600160a01b03821660009081526005602052604081206200128f90836200131b565b6000620007ec6003836200131b565b60008181526001830160205260408120546200131257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007ec565b506000620007ec565b60006200128f838381546000908210620013835760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b60648201526084016200037b565b826000018281548110620013a757634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b6109a58062001a5f83390190565b600082601f830112620013d9578081fd5b813560206001600160401b03821115620013f757620013f762001a2f565b8160051b620014088282016200197e565b83815282810190868401838801850189101562001423578687fd5b8693505b85841015620014525780356200143d8162001a45565b83526001939093019291840191840162001427565b50979650505050505050565b8035600281900b81146200147157600080fd5b919050565b60006020828403121562001488578081fd5b81356200128f8162001a45565b600060208284031215620014a7578081fd5b81516200128f8162001a45565b600080600060608486031215620014c9578182fd5b8335620014d68162001a45565b92506020840135620014e88162001a45565b91506040840135620014fa8162001a45565b809150509250925092565b60008060008060008060c087890312156200151e578182fd5b86356200152b8162001a45565b955060208701356200153d8162001a45565b9450604087013562ffffff8116811462001555578283fd5b9350606087013561ffff811681146200156c578283fd5b92506200157c608088016200145e565b91506200158c60a088016200145e565b90509295509295509295565b600060208284031215620015aa578081fd5b81356001600160401b03811115620015c0578182fd5b620015ce84828501620013c8565b949350505050565b600080600060408486031215620015eb578283fd5b83356001600160401b038082111562001602578485fd5b6200161087838801620013c8565b9450602086013591508082111562001626578384fd5b818601915086601f8301126200163a578384fd5b81358181111562001649578485fd5b8760208260051b85010111156200165e578485fd5b6020830194508093505050509250925092565b60006020828403121562001683578081fd5b81516001600160401b03808211156200169a578283fd5b818401915084601f830112620016ae578283fd5b815181811115620016c357620016c362001a2f565b620016d8601f8201601f19166020016200197e565b9150808252856020828501011115620016ef578384fd5b62001702816020840160208601620019cc565b50949350505050565b6000815180845262001725816020860160208601620019cc565b601f01601f19169290920160200192915050565b600086516200174d818460208b01620019cc565b86519083019062001763818360208b01620019cc565b865191019062001778818360208a01620019cc565b85519101906200178d818360208901620019cc565b8451910190620017a2818360208801620019cc565b01979650505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b6020808252825182820181905260009190848201906040850190845b818110156200185f5783516001600160a01b03168352928401929184019160010162001838565b50909695505050505050565b6020815260006200128f60208301846200170b565b60e0815260006200189560e08301896200170b565b82810360208401526005815264472d554e4960d81b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b6000808335601e198436030181126200194e578283fd5b8301803591506001600160401b0382111562001968578283fd5b6020019150368190038213156200123a57600080fd5b604051601f8201601f191681016001600160401b0381118282101715620019a957620019a962001a2f565b604052919050565b60008219821115620019c757620019c762001a19565b500190565b60005b83811015620019e9578181015183820152602001620019cf565b838111156200057c5750506000910152565b600060001982141562001a125762001a1262001a19565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811462001a5b57600080fd5b5056fe60806040526040516109a53803806109a5833981016040819052610022916101a4565b61002c838261003d565b61003582610119565b5050506102ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be9190610270565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109858339815191525490565b90508160008051602061098583398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b6000806000606084860312156101b8578283fd5b6101c184610188565b92506101cf60208501610188565b60408501519092506001600160401b03808211156101eb578283fd5b818601915086601f8301126101fe578283fd5b815181811115610210576102106102b8565b604051601f8201601f19908116603f01168101908382118183101715610238576102386102b8565b81604052828152896020848701011115610250578586fd5b61026183602083016020880161028c565b80955050505050509250925092565b6000825161028281846020870161028c565b9190910192915050565b60005b838110156102a757818101518382015260200161028f565b838111156101125750506000910152565b634e487b7160e01b600052604160045260246000fd5b6106a8806102dd6000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046105a9565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb3660046104f2565b61027e565b3480156100fc57600080fd5b506101056102d2565b6040516001600160a01b0390911681526020016100c7565b61009961012b36600461050c565b6102e1565b34801561013c57600080fd5b5061009961014b3660046104f2565b61035e565b6000805160206106538339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610653833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561023a57600080fd5b505afa92505050801561026a575060408051601f3d908101601f1916820190925261026791810190610589565b60015b6102775750600092915050565b9392505050565b61028661039f565b6001600160a01b0316336001600160a01b0316146102b65760405162461bcd60e51b81526004016100889061060a565b6102cf81604051806020016040528060008152506103b2565b50565b60006102dc61039f565b905090565b6102e961039f565b6001600160a01b0316336001600160a01b0316146103195760405162461bcd60e51b81526004016100889061060a565b6103598383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103b292505050565b505050565b61036661039f565b6001600160a01b0316336001600160a01b0316146103965760405162461bcd60e51b81526004016100889061060a565b6102cf81610475565b6000805160206106338339815191525490565b6000805160206106538339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610359576000836001600160a01b03168360405161042191906105d1565b600060405180830381855af49150503d806000811461045c576040519150601f19603f3d011682016040523d82523d6000602084013e610461565b606091505b5050905080610183573d806000803e806000fd5b600061047f61039f565b90508160008051602061063383398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ed57600080fd5b919050565b600060208284031215610503578081fd5b610277826104d6565b600080600060408486031215610520578182fd5b610529846104d6565b925060208401356001600160401b0380821115610544578384fd5b818601915086601f830112610557578384fd5b813581811115610565578485fd5b876020828501011115610576578485fd5b6020830194508093505050509250925092565b60006020828403121561059a578081fd5b81518015158114610277578182fd5b6000602082840312156105ba578081fd5b81356001600160e01b031981168114610277578182fd5b60008251815b818110156105f157602081860181015185830152016105d7565b818111156105ff5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220730effc08e7ae1c19f69ae08dd52de483b649ded49db9428e4ced9875431474364736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a26469706673582212207c6179e464a0c317191f9da090adad7dcf9f58cae09d904a5c2fe10e8f2dd90164736f6c63430008040033", - "devdoc": { - "kind": "dev", - "methods": { - "createPool(address,address,uint24,uint16,int24,int24)": { - "params": { - "lowerTick": "initial lower bound of the Uniswap V3 position", - "managerFee": "proportion of earned fees that go to pool manager in Basis Points", - "tokenA": "one of the tokens in the uniswap pair", - "tokenB": "the other token in the uniswap pair", - "uniFee": "fee tier of the uniswap pair", - "upperTick": "initial upper bound of the Uniswap V3 position" - }, - "returns": { - "pool": "the address of the newly created G-UNI pool (proxy)" - } - }, - "getDeployers()": { - "returns": { - "_0": "deployers the list of deployer addresses" - } - }, - "getGelatoPools()": { - "returns": { - "_0": "list of Gelato managed G-UNI pool addresses" - } - }, - "getPools(address)": { - "params": { - "deployer": "address that has potentially deployed G-UNI pools (can return empty array)" - }, - "returns": { - "_0": "pools the list of G-UNI pool addresses deployed by `deployer`" - } - }, - "getProxyAdmin(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "address that controls the G-UNI implementation (has power to upgrade it)" - } - }, - "isPoolImmutable(address)": { - "params": { - "pool": "address of the G-UNI pool" - }, - "returns": { - "_0": "bool signaling if pool is immutable (true) or not (false)" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "numDeployers()": { - "returns": { - "_0": "total number of G-UNI pool deployer addresses" - } - }, - "numPools()": { - "returns": { - "result": "total number of G-UNI pools deployed" - } - }, - "numPools(address)": { - "params": { - "deployer": "deployer address" - }, - "returns": { - "_0": "total number of G-UNI pools deployed by `deployer`" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current manager." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "createPool(address,address,uint24,uint16,int24,int24)": { - "notice": "createPool creates a new instance of a G-UNI token on a specified UniswapV3 pool. The msg.sender is the initial manager of the pool and will forever be associated with the G-UNI pool as it's `deployer`" - }, - "getDeployers()": { - "notice": "getDeployers fetches all addresses that have deployed a G-UNI pool" - }, - "getGelatoPools()": { - "notice": "getGelatoPools gets all the G-UNI pools deployed by Gelato's default deployer address (since anyone can deploy and manage G-UNI pools)" - }, - "getPools(address)": { - "notice": "getPools fetches all the G-UNI pool addresses deployed by `deployer`" - }, - "getProxyAdmin(address)": { - "notice": "getProxyAdmin gets the current address who controls the underlying implementation of a G-UNI pool. For most all pools either this contract address or the zero address will be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally no longer upgradable (no one owns the zero address)." - }, - "isPoolImmutable(address)": { - "notice": "isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded" - }, - "numDeployers()": { - "notice": "numDeployers counts the total number of G-UNI pool deployer addresses" - }, - "numPools()": { - "notice": "numPools counts the total number of G-UNI pools in existence" - }, - "numPools(address)": { - "notice": "numPools counts the total number of G-UNI pools deployed by `deployer`" - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6087, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_manager", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 791, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initialized", - "offset": 20, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 794, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_initializing", - "offset": 21, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 5563, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "poolImplementation", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 5565, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "gelatoDeployer", - "offset": 0, - "slot": "2", - "type": "t_address" - }, - { - "astId": 5568, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_deployers", - "offset": 0, - "slot": "3", - "type": "t_struct(AddressSet)1740_storage" - }, - { - "astId": 5573, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_pools", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_struct(AddressSet)1740_storage)" - } - ], - "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_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(AddressSet)1740_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.AddressSet)", - "numberOfBytes": "32", - "value": "t_struct(AddressSet)1740_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(AddressSet)1740_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.AddressSet", - "members": [ - { - "astId": 1739, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1465_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Set)1465_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 1460, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 1464, - "contract": "contracts/GUniFactory.sol:GUniFactory", - "label": "_indexes", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_uint256)" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} diff --git a/lib/g-uni-v1-core/deployments/ropsten/GUniFactory_Proxy.json b/lib/g-uni-v1-core/deployments/ropsten/GUniFactory_Proxy.json deleted file mode 100644 index dfed900f1..000000000 --- a/lib/g-uni-v1-core/deployments/ropsten/GUniFactory_Proxy.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "address": "0x04C92df23A7eCbe38b31BC30F7D4B65617740de8", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementationAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "ProxyAdminTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousImplementation", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "ProxyImplementationUpdated", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "proxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "id", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x085c79cd087db50e402a40915d05fa37469a77b865817436b14d1c21c942375d", - "receipt": { - "to": null, - "from": "0x4B5BaD436CcA8df3bD39A095b84991fAc9A226F1", - "contractAddress": "0x04C92df23A7eCbe38b31BC30F7D4B65617740de8", - "transactionIndex": 4, - "gasUsed": "470944", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000080000000000000000000000000400000000000000000000000000000000800000000000000000000000000000200000000000000000000000000000000004000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000010000000000000800000000000000020000000000200000008000400000000000000080000000000000000000000000000", - "blockHash": "0xb20de93f79b0932a1cc708affc5433ebdde4eb7cdf1c9cdbc756256d56b8cd9e", - "transactionHash": "0x085c79cd087db50e402a40915d05fa37469a77b865817436b14d1c21c942375d", - "logs": [ - { - "transactionIndex": 4, - "blockNumber": 10541309, - "transactionHash": "0x085c79cd087db50e402a40915d05fa37469a77b865817436b14d1c21c942375d", - "address": "0x04C92df23A7eCbe38b31BC30F7D4B65617740de8", - "topics": [ - "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000553447e91c4dd1f634d6dc787485ac52987035c5" - ], - "data": "0x", - "logIndex": 9, - "blockHash": "0xb20de93f79b0932a1cc708affc5433ebdde4eb7cdf1c9cdbc756256d56b8cd9e" - }, - { - "transactionIndex": 4, - "blockNumber": 10541309, - "transactionHash": "0x085c79cd087db50e402a40915d05fa37469a77b865817436b14d1c21c942375d", - "address": "0x04C92df23A7eCbe38b31BC30F7D4B65617740de8", - "topics": [ - "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004b5bad436cca8df3bd39a095b84991fac9a226f1" - ], - "data": "0x", - "logIndex": 10, - "blockHash": "0xb20de93f79b0932a1cc708affc5433ebdde4eb7cdf1c9cdbc756256d56b8cd9e" - } - ], - "blockNumber": 10541309, - "cumulativeGasUsed": "735427", - "status": 1, - "byzantium": true - }, - "args": [ - "0x553447E91C4dd1F634D6dc787485ac52987035C5", - "0x4B5BaD436CcA8df3bD39A095b84991fAc9A226F1", - "0x" - ], - "solcInputHash": "07200b0d23a751835ce93ba1686cbb62", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ProxyAdminTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"ProxyImplementationUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"id\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Proxy implementing EIP173 for ownership management that accept ETH via receive\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/vendor/proxy/EIP173ProxyWithReceive.sol\":\"EIP173ProxyWithReceive\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"contracts/vendor/proxy/EIP173Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\ninterface ERC165 {\\n function supportsInterface(bytes4 id) external view returns (bool);\\n}\\n\\n///@notice Proxy implementing EIP173 for ownership management\\ncontract EIP173Proxy is Proxy {\\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\\n\\n event ProxyAdminTransferred(\\n address indexed previousAdmin,\\n address indexed newAdmin\\n );\\n\\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\\n\\n constructor(\\n address implementationAddress,\\n address adminAddress,\\n bytes memory data\\n ) payable {\\n _setImplementation(implementationAddress, data);\\n _setProxyAdmin(adminAddress);\\n }\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n function proxyAdmin() external view returns (address) {\\n return _proxyAdmin();\\n }\\n\\n function supportsInterface(bytes4 id) external view returns (bool) {\\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\\n return true;\\n }\\n if (id == 0xFFFFFFFF) {\\n return false;\\n }\\n\\n ERC165 implementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n implementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\\n // In practise this is unlikely to be an issue.\\n try implementation.supportsInterface(id) returns (bool support) {\\n return support;\\n } catch {\\n return false;\\n }\\n }\\n\\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\\n _setProxyAdmin(newAdmin);\\n }\\n\\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\\n _setImplementation(newImplementation, \\\"\\\");\\n }\\n\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyProxyAdmin\\n {\\n _setImplementation(newImplementation, data);\\n }\\n\\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\\n\\n modifier onlyProxyAdmin() {\\n require(msg.sender == _proxyAdmin(), \\\"NOT_AUTHORIZED\\\");\\n _;\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _proxyAdmin() internal view returns (address adminAddress) {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n adminAddress := sload(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\\n )\\n }\\n }\\n\\n function _setProxyAdmin(address newAdmin) internal {\\n address previousAdmin = _proxyAdmin();\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\\n newAdmin\\n )\\n }\\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\\n }\\n}\\n\",\"keccak256\":\"0x4ad41656a53bc38d766197d9974be4be70f506b1d1f78def2c3726e8d580a3f5\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/EIP173ProxyWithReceive.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport \\\"./EIP173Proxy.sol\\\";\\n\\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\\ncontract EIP173ProxyWithReceive is EIP173Proxy {\\n constructor(\\n address implementationAddress,\\n address ownerAddress,\\n bytes memory data\\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\\n\\n receive() external payable override {}\\n}\\n\",\"keccak256\":\"0x7f0dea5e3cba284c86fe466d7f39ff6b8584c8134c69203a896410d679222414\",\"license\":\"GPL-3.0\"},\"contracts/vendor/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n// EIP-1967\\nabstract contract Proxy {\\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\\n\\n event ProxyImplementationUpdated(\\n address indexed previousImplementation,\\n address indexed newImplementation\\n );\\n\\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\\n\\n // prettier-ignore\\n receive() external payable virtual {\\n revert(\\\"ETHER_REJECTED\\\"); // explicit reject by default\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\\n\\n function _fallback() internal {\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n let implementationAddress := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n calldatacopy(0x0, 0x0, calldatasize())\\n let success := delegatecall(\\n gas(),\\n implementationAddress,\\n 0x0,\\n calldatasize(),\\n 0,\\n 0\\n )\\n let retSz := returndatasize()\\n returndatacopy(0, 0, retSz)\\n switch success\\n case 0 {\\n revert(0, retSz)\\n }\\n default {\\n return(0, retSz)\\n }\\n }\\n }\\n\\n function _setImplementation(address newImplementation, bytes memory data)\\n internal\\n {\\n address previousImplementation;\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n previousImplementation := sload(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\\n )\\n }\\n\\n // solhint-disable-next-line security/no-inline-assembly\\n assembly {\\n sstore(\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\\n newImplementation\\n )\\n }\\n\\n emit ProxyImplementationUpdated(\\n previousImplementation,\\n newImplementation\\n );\\n\\n if (data.length > 0) {\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n assembly {\\n // This assembly ensure the revert contains the exact string data\\n let returnDataSize := returndatasize()\\n returndatacopy(0, 0, returnDataSize)\\n revert(0, returnDataSize)\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x00dbb59cf486ff9a2930fb588ef70d761dbf439aa05d48ef0001a0448769ec11\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6080604052604051610978380380610978833981016040819052610022916101aa565b82828261002f8382610043565b6100388261011f565b5050505050506102d4565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561011a576000836001600160a01b0316836040516100c49190610276565b600060405180830381855af49150503d80600081146100ff576040519150601f19603f3d011682016040523d82523d6000602084013e610104565b606091505b5050905080610118573d806000803e806000fd5b505b505050565b60006101376000805160206109588339815191525490565b90508160008051602061095883398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b03811681146101a557600080fd5b919050565b6000806000606084860312156101be578283fd5b6101c78461018e565b92506101d56020850161018e565b60408501519092506001600160401b03808211156101f1578283fd5b818601915086601f830112610204578283fd5b815181811115610216576102166102be565b604051601f8201601f19908116603f0116810190838211818310171561023e5761023e6102be565b81604052828152896020848701011115610256578586fd5b610267836020830160208801610292565b80955050505050509250925092565b60008251610288818460208701610292565b9190910192915050565b60005b838110156102ad578181015183820152602001610295565b838111156101185750506000910152565b634e487b7160e01b600052604160045260246000fd5b610675806102e36000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461005f5780633659cfe6146100945780633e47158c146100b45780634f1ef286146100e15780638356ca4f146100f457610055565b3661005557005b61005d610114565b005b34801561006b57600080fd5b5061007f61007a366004610576565b61014d565b60405190151581526020015b60405180910390f35b3480156100a057600080fd5b5061005d6100af3660046104bf565b610242565b3480156100c057600080fd5b506100c961029f565b6040516001600160a01b03909116815260200161008b565b61005d6100ef3660046104d9565b6102ae565b34801561010057600080fd5b5061005d61010f3660046104bf565b61032b565b6000805160206106208339815191525460003681823780813683855af491503d8082833e828015610143578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b03198316148061017e57506307f5828d60e41b6001600160e01b03198316145b1561018b57506001919050565b6001600160e01b031980831614156101a557506000919050565b600080516020610620833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b1580156101fe57600080fd5b505afa92505050801561022e575060408051601f3d908101601f1916820190925261022b91810190610556565b60015b61023b5750600092915050565b9392505050565b61024a61036c565b6001600160a01b0316336001600160a01b0316146102835760405162461bcd60e51b815260040161027a906105d7565b60405180910390fd5b61029c816040518060200160405280600081525061037f565b50565b60006102a961036c565b905090565b6102b661036c565b6001600160a01b0316336001600160a01b0316146102e65760405162461bcd60e51b815260040161027a906105d7565b6103268383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061037f92505050565b505050565b61033361036c565b6001600160a01b0316336001600160a01b0316146103635760405162461bcd60e51b815260040161027a906105d7565b61029c81610442565b6000805160206106008339815191525490565b6000805160206106208339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610326576000836001600160a01b0316836040516103ee919061059e565b600060405180830381855af49150503d8060008114610429576040519150601f19603f3d011682016040523d82523d6000602084013e61042e565b606091505b5050905080610147573d806000803e806000fd5b600061044c61036c565b90508160008051602061060083398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ba57600080fd5b919050565b6000602082840312156104d0578081fd5b61023b826104a3565b6000806000604084860312156104ed578182fd5b6104f6846104a3565b925060208401356001600160401b0380821115610511578384fd5b818601915086601f830112610524578384fd5b813581811115610532578485fd5b876020828501011115610543578485fd5b6020830194508093505050509250925092565b600060208284031215610567578081fd5b8151801515811461023b578182fd5b600060208284031215610587578081fd5b81356001600160e01b03198116811461023b578182fd5b60008251815b818110156105be57602081860181015185830152016105a4565b818111156105cc5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220b98e06a95fa86acb89692e6d911ca1aec63357dba2aa77647751548c0ff4a4b764736f6c63430008040033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c806301ffc9a71461005f5780633659cfe6146100945780633e47158c146100b45780634f1ef286146100e15780638356ca4f146100f457610055565b3661005557005b61005d610114565b005b34801561006b57600080fd5b5061007f61007a366004610576565b61014d565b60405190151581526020015b60405180910390f35b3480156100a057600080fd5b5061005d6100af3660046104bf565b610242565b3480156100c057600080fd5b506100c961029f565b6040516001600160a01b03909116815260200161008b565b61005d6100ef3660046104d9565b6102ae565b34801561010057600080fd5b5061005d61010f3660046104bf565b61032b565b6000805160206106208339815191525460003681823780813683855af491503d8082833e828015610143578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b03198316148061017e57506307f5828d60e41b6001600160e01b03198316145b1561018b57506001919050565b6001600160e01b031980831614156101a557506000919050565b600080516020610620833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b1580156101fe57600080fd5b505afa92505050801561022e575060408051601f3d908101601f1916820190925261022b91810190610556565b60015b61023b5750600092915050565b9392505050565b61024a61036c565b6001600160a01b0316336001600160a01b0316146102835760405162461bcd60e51b815260040161027a906105d7565b60405180910390fd5b61029c816040518060200160405280600081525061037f565b50565b60006102a961036c565b905090565b6102b661036c565b6001600160a01b0316336001600160a01b0316146102e65760405162461bcd60e51b815260040161027a906105d7565b6103268383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061037f92505050565b505050565b61033361036c565b6001600160a01b0316336001600160a01b0316146103635760405162461bcd60e51b815260040161027a906105d7565b61029c81610442565b6000805160206106008339815191525490565b6000805160206106208339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610326576000836001600160a01b0316836040516103ee919061059e565b600060405180830381855af49150503d8060008114610429576040519150601f19603f3d011682016040523d82523d6000602084013e61042e565b606091505b5050905080610147573d806000803e806000fd5b600061044c61036c565b90508160008051602061060083398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80356001600160a01b03811681146104ba57600080fd5b919050565b6000602082840312156104d0578081fd5b61023b826104a3565b6000806000604084860312156104ed578182fd5b6104f6846104a3565b925060208401356001600160401b0380821115610511578384fd5b818601915086601f830112610524578384fd5b813581811115610532578485fd5b876020828501011115610543578485fd5b6020830194508093505050509250925092565b600060208284031215610567578081fd5b8151801515811461023b578182fd5b600060208284031215610587578081fd5b81356001600160e01b03198116811461023b578182fd5b60008251815b818110156105be57602081860181015185830152016105a4565b818111156105cc5782828501525b509190910192915050565b6020808252600e908201526d1393d517d055551213d49256915160921b60408201526060019056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220b98e06a95fa86acb89692e6d911ca1aec63357dba2aa77647751548c0ff4a4b764736f6c63430008040033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "Proxy implementing EIP173 for ownership management that accept ETH via receive", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} diff --git a/lib/g-uni-v1-core/deployments/ropsten/GUniPool.json b/lib/g-uni-v1-core/deployments/ropsten/GUniPool.json deleted file mode 100644 index 53a71194c..000000000 --- a/lib/g-uni-v1-core/deployments/ropsten/GUniPool.json +++ /dev/null @@ -1,1571 +0,0 @@ -{ - "address": "0xE6dbcC12016005f3a199BDFF8bee3e3b3C48Cfc5", - "abi": [ - { - "inputs": [ - { - "internalType": "address payable", - "name": "_gelato", - "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": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1Out", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount0In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount1In", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousManager", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newManager", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int24", - "name": "lowerTick_", - "type": "int24" - }, - { - "indexed": false, - "internalType": "int24", - "name": "upperTick_", - "type": "int24" - } - ], - "name": "Rebalance", - "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" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldAdminTreasury", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdminTreasury", - "type": "address" - } - ], - "name": "UpdateAdminTreasury", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoRebalanceBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoWithdrawBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "gelatoSlippageBPS", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "gelatoSlippageInterval", - "type": "uint32" - } - ], - "name": "UpdateGelatoParams", - "type": "event" - }, - { - "inputs": [], - "name": "GELATO", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "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": "uint256", - "name": "burnAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "burn", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityBurned", - "type": "uint128" - } - ], - "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": [ - { - "internalType": "int24", - "name": "newLowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "newUpperTick", - "type": "int24" - }, - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - } - ], - "name": "executiveRebalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoRebalanceBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoSlippageInterval", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gelatoWithdrawBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Max", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Max", - "type": "uint256" - } - ], - "name": "getMintAmounts", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPositionID", - "outputs": [ - { - "internalType": "bytes32", - "name": "positionID", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUnderlyingBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0Current", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Current", - "type": "uint256" - } - ], - "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": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "address", - "name": "_pool", - "type": "address" - }, - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - }, - { - "internalType": "int24", - "name": "_lowerTick", - "type": "int24" - }, - { - "internalType": "int24", - "name": "_upperTick", - "type": "int24" - }, - { - "internalType": "address", - "name": "_manager_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_managerFeeBPS", - "type": "uint16" - } - ], - "name": "initializeManagerFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "lowerTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance0", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerBalance1", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerFeeBPS", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "managerTreasury", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "amount0", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1", - "type": "uint256" - }, - { - "internalType": "uint128", - "name": "liquidityMinted", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pool", - "outputs": [ - { - "internalType": "contract IUniswapV3Pool", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint160", - "name": "swapThresholdPrice", - "type": "uint160" - }, - { - "internalType": "uint256", - "name": "swapAmountBPS", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "zeroForOne", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "paymentToken", - "type": "address" - } - ], - "name": "rebalance", - "outputs": [], - "stateMutability": "nonpayable", - "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": "token0", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token1", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount0Owed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount1Owed", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3MintCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amount0Delta", - "type": "int256" - }, - { - "internalType": "int256", - "name": "amount1Delta", - "type": "int256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "uniswapV3SwapCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "newRebalanceBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newWithdrawBPS", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "newSlippageBPS", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "newSlippageInterval", - "type": "uint32" - }, - { - "internalType": "address", - "name": "newTreasury", - "type": "address" - } - ], - "name": "updateGelatoParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "upperTick", - "outputs": [ - { - "internalType": "int24", - "name": "", - "type": "int24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawGelatoBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - } - ], - "name": "withdrawManagerBalance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xf3c969c640c13c6e6f6ec84ff005fcfaaacceeb132da37b18b35542134cfecfb", - "receipt": { - "to": null, - "from": "0x4B5BaD436CcA8df3bD39A095b84991fAc9A226F1", - "contractAddress": "0xE6dbcC12016005f3a199BDFF8bee3e3b3C48Cfc5", - "transactionIndex": 49, - "gasUsed": "5360191", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x1bd86fc0ccdba82c896e2d9594ca1a3a84a946e0a9919436e2e665a850ec71a9", - "transactionHash": "0xf3c969c640c13c6e6f6ec84ff005fcfaaacceeb132da37b18b35542134cfecfb", - "logs": [], - "blockNumber": 10536137, - "cumulativeGasUsed": "8829492", - "status": 1, - "byzantium": true - }, - "args": ["0xCc4CcD69D31F9FfDBD3BFfDe49c6aA886DaB98d9"], - "solcInputHash": "0cce3fad8f3de16d15d2c077c292658d", - "metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_gelato\",\"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\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"lowerTick_\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"upperTick_\",\"type\":\"int24\"}],\"name\":\"Rebalance\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAdminTreasury\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdminTreasury\",\"type\":\"address\"}],\"name\":\"UpdateAdminTreasury\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoRebalanceBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoWithdrawBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"gelatoSlippageBPS\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gelatoSlippageInterval\",\"type\":\"uint32\"}],\"name\":\"UpdateGelatoParams\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GELATO\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"uint256\",\"name\":\"burnAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityBurned\",\"type\":\"uint128\"}],\"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\":[{\"internalType\":\"int24\",\"name\":\"newLowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"newUpperTick\",\"type\":\"int24\"},{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"}],\"name\":\"executiveRebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoRebalanceBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoSlippageInterval\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gelatoWithdrawBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Max\",\"type\":\"uint256\"}],\"name\":\"getMintAmounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPositionID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"positionID\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUnderlyingBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Current\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Current\",\"type\":\"uint256\"}],\"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\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_pool\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"},{\"internalType\":\"int24\",\"name\":\"_lowerTick\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"_upperTick\",\"type\":\"int24\"},{\"internalType\":\"address\",\"name\":\"_manager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_managerFeeBPS\",\"type\":\"uint16\"}],\"name\":\"initializeManagerFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lowerTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance0\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerBalance1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerFeeBPS\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"mintAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidityMinted\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pool\",\"outputs\":[{\"internalType\":\"contract IUniswapV3Pool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"swapThresholdPrice\",\"type\":\"uint160\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountBPS\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"}],\"name\":\"rebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"token0\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3MintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"amount0Delta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1Delta\",\"type\":\"int256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"uniswapV3SwapCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newRebalanceBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newWithdrawBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"newSlippageBPS\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"newSlippageInterval\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateGelatoParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upperTick\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawGelatoBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"withdrawManagerBalance\",\"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}.\"},\"burn(uint256,address)\":{\"params\":{\"burnAmount\":\"The number of G-UNI tokens to burn\",\"receiver\":\"The account to receive the underlying amounts of token0 and token1\"},\"returns\":{\"amount0\":\"amount of token0 transferred to receiver for burning `burnAmount`\",\"amount1\":\"amount of token1 transferred to receiver for burning `burnAmount`\",\"liquidityBurned\":\"amount of liquidity removed from the underlying Uniswap V3 position\"}},\"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 this function is overridden; 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`.\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"details\":\"When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.\",\"params\":{\"newLowerTick\":\"The new lower bound of the position's range\",\"newUpperTick\":\"The new upper bound of the position's range\",\"swapAmountBPS\":\"amount of token to swap as proportion of total. Pass 0 to ignore swap.\",\"swapThresholdPrice\":\"slippage parameter on the swap as a max or min sqrtPriceX96\",\"zeroForOne\":\"Which token to input into the swap (true = token0, false = token1)\"}},\"getMintAmounts(uint256,uint256)\":{\"params\":{\"amount0Max\":\"The maximum amount of token1 to forward on mint\"},\"returns\":{\"amount0\":\"actual amount of token0 to forward when minting `mintAmount`\",\"amount1\":\"actual amount of token1 to forward when minting `mintAmount`\",\"mintAmount\":\"maximum number of G-UNI tokens to mint\"}},\"getUnderlyingBalances()\":{\"returns\":{\"amount0Current\":\"current total underlying balance of token0\",\"amount1Current\":\"current total underlying balance of token1\"}},\"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.\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"params\":{\"_lowerTick\":\"initial upperTick (only changeable with executiveRebalance)\",\"_managerFeeBPS\":\"proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\",\"_manager_\":\"address of manager (ownership can be transferred)\",\"_name\":\"name of G-UNI token\",\"_pool\":\"address of Uniswap V3 pool\",\"_symbol\":\"symbol of G-UNI token\"}},\"initializeManagerFee(uint16)\":{\"params\":{\"_managerFeeBPS\":\"proportion of fees earned that are credited to manager in Basis Points\"}},\"manager()\":{\"details\":\"Returns the address of the current manager.\"},\"mint(uint256,address)\":{\"details\":\"to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\",\"params\":{\"mintAmount\":\"The number of G-UNI tokens to mint\",\"receiver\":\"The account to receive the minted tokens\"},\"returns\":{\"amount0\":\"amount of token0 transferred from msg.sender to mint `mintAmount`\",\"amount1\":\"amount of token1 transferred from msg.sender to mint `mintAmount`\",\"liquidityMinted\":\"amount of liquidity added to the underlying Uniswap V3 position\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager.\"},\"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 manager.\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"params\":{\"newRebalanceBPS\":\"controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\",\"newSlippageBPS\":\"maximum slippage on swaps during gelato rebalance\",\"newSlippageInterval\":\"length of time for TWAP used in computing slippage on swaps\",\"newTreasury\":\"address where managerFee withdrawals are sent\",\"newWithdrawBPS\":\"controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(uint256,address)\":{\"notice\":\"burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\"},\"executiveRebalance(int24,int24,uint160,uint256,bool)\":{\"notice\":\"Change the range of underlying UniswapV3 position, only manager can call\"},\"getMintAmounts(uint256,uint256)\":{\"notice\":\"compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\"},\"getUnderlyingBalances()\":{\"notice\":\"compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)\"},\"initialize(string,string,address,uint16,int24,int24,address)\":{\"notice\":\"initialize storage variables on a new G-UNI pool, only called once\"},\"initializeManagerFee(uint16)\":{\"notice\":\"initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\"},\"mint(uint256,address)\":{\"notice\":\"mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\"},\"rebalance(uint160,uint256,bool,uint256,address)\":{\"notice\":\"Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\"},\"uniswapV3MintCallback(uint256,uint256,bytes)\":{\"notice\":\"Uniswap V3 callback fn, called back on pool.mint\"},\"uniswapV3SwapCallback(int256,int256,bytes)\":{\"notice\":\"Uniswap v3 callback fn, called back on pool.swap\"},\"updateGelatoParams(uint16,uint16,uint16,uint32,address)\":{\"notice\":\"change configurable parameters, only manager can call\"},\"withdrawGelatoBalance(uint256,address)\":{\"notice\":\"withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"},\"withdrawManagerBalance(uint256,address)\":{\"notice\":\"withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GUniPool.sol\":\"GUniPool\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity ^0.8.0;\\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 {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 */\\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 || !_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\",\"keccak256\":\"0x67d2f282a9678e58e878a0b774041ba7a01e2740a262aea97a3f681339914713\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal initializer {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal initializer {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and make it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x89fa60d14355f7ae06af11e28fce2bb90c5c6186645d681a30e1b36234a4c210\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\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\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The defaut value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\\n __Context_init_unchained();\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override 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 override 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 this function is\\n * overridden;\\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 override returns (uint8) {\\n return 18;\\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\\n uint256 currentAllowance = _allowances[sender][_msgSender()];\\n require(currentAllowance >= amount, \\\"ERC20: transfer amount exceeds allowance\\\");\\n _approve(sender, _msgSender(), currentAllowance - amount);\\n\\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\\n\\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 uint256 senderBalance = _balances[sender];\\n require(senderBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n _balances[sender] = senderBalance - amount;\\n _balances[recipient] += amount;\\n\\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 += amount;\\n _balances[account] += 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 uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n _balances[account] = accountBalance - amount;\\n _totalSupply -= amount;\\n\\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 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 uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0x9c2d7425f3343ea340d6ea67e9d90109d4d846bb013c2572096ec88c9e74946b\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\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\":\"0x8d4a0f2b5b760b5e2c19ed3c108d83897a4dfd5bfed97a93867918df19191e5e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x6795c369a4eefa78468e38966f7851fbc2dda5e5b9ccd3fa2b45970e2e4d3abd\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\nimport \\\"../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 initializer {\\n __Context_init_unchained();\\n }\\n\\n function __Context_init_unchained() internal initializer {\\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x8e9eb503de1189f50c5f16fef327da310b11898d6b9ab3ca937df07c35233b9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0xf8e8d118a7a8b2e134181f7da655f6266aa3a0f9134b2605747139fcb0c5d835\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.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 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) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\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\":\"0x99f5c21018d796db7833a2100bb0e7411999e248a3c950fb526eee5d2bf47cb7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^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\":\"0x069b2631bb5b5193a58ccf7a06266c7361bd2c20095667af4402817605627f45\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\nimport './pool/IUniswapV3PoolImmutables.sol';\\nimport './pool/IUniswapV3PoolState.sol';\\nimport './pool/IUniswapV3PoolDerivedState.sol';\\nimport './pool/IUniswapV3PoolActions.sol';\\nimport './pool/IUniswapV3PoolOwnerActions.sol';\\nimport './pool/IUniswapV3PoolEvents.sol';\\n\\n/// @title The interface for a Uniswap V3 Pool\\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\\n/// to the ERC20 specification\\n/// @dev The pool interface is broken up into many smaller pieces\\ninterface IUniswapV3Pool is\\n IUniswapV3PoolImmutables,\\n IUniswapV3PoolState,\\n IUniswapV3PoolDerivedState,\\n IUniswapV3PoolActions,\\n IUniswapV3PoolOwnerActions,\\n IUniswapV3PoolEvents\\n{\\n\\n}\\n\",\"keccak256\":\"0xfe6113d518466cd6652c85b111e01f33eb62157f49ae5ed7d5a3947a2044adb1\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#mint\\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\\ninterface IUniswapV3MintCallback {\\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x27a9725b8f831a92d16380860c3d348a0b926a7f01b34a54ea6eea78cbdbcd6a\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Callback for IUniswapV3PoolActions#swap\\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\\ninterface IUniswapV3SwapCallback {\\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x3f485fb1a44e8fbeadefb5da07d66edab3cfe809f0ac4074b1e54e3eb3c4cf69\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissionless pool actions\\n/// @notice Contains pool methods that can be called by anyone\\ninterface IUniswapV3PoolActions {\\n /// @notice Sets the initial price for the pool\\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\\n function initialize(uint160 sqrtPriceX96) external;\\n\\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\\n /// @param recipient The address for which the liquidity will be created\\n /// @param tickLower The lower tick of the position in which to add liquidity\\n /// @param tickUpper The upper tick of the position in which to add liquidity\\n /// @param amount The amount of liquidity to mint\\n /// @param data Any data that should be passed through to the callback\\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\\n function mint(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount,\\n bytes calldata data\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Collects tokens owed to a position\\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\\n /// @param recipient The address which should receive the fees collected\\n /// @param tickLower The lower tick of the position for which to collect fees\\n /// @param tickUpper The upper tick of the position for which to collect fees\\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\\n /// @return amount0 The amount of fees collected in token0\\n /// @return amount1 The amount of fees collected in token1\\n function collect(\\n address recipient,\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n\\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\\n /// @dev Fees must be collected separately via a call to #collect\\n /// @param tickLower The lower tick of the position for which to burn liquidity\\n /// @param tickUpper The upper tick of the position for which to burn liquidity\\n /// @param amount How much liquidity to burn\\n /// @return amount0 The amount of token0 sent to the recipient\\n /// @return amount1 The amount of token1 sent to the recipient\\n function burn(\\n int24 tickLower,\\n int24 tickUpper,\\n uint128 amount\\n ) external returns (uint256 amount0, uint256 amount1);\\n\\n /// @notice Swap token0 for token1, or token1 for token0\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\\n /// @param recipient The address to receive the output of the swap\\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\\n /// @param data Any data to be passed through to the callback\\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\\n function swap(\\n address recipient,\\n bool zeroForOne,\\n int256 amountSpecified,\\n uint160 sqrtPriceLimitX96,\\n bytes calldata data\\n ) external returns (int256 amount0, int256 amount1);\\n\\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\\n /// @param recipient The address which will receive the token0 and token1 amounts\\n /// @param amount0 The amount of token0 to send\\n /// @param amount1 The amount of token1 to send\\n /// @param data Any data to be passed through to the callback\\n function flash(\\n address recipient,\\n uint256 amount0,\\n uint256 amount1,\\n bytes calldata data\\n ) external;\\n\\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\\n /// the input observationCardinalityNext.\\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0x9453dd0e7442188667d01d9b65de3f1e14e9511ff3e303179a15f6fc267f7634\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that is not stored\\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\\n/// blockchain. The functions here may have variable gas costs.\\ninterface IUniswapV3PoolDerivedState {\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\\n /// you must call it with secondsAgos = [3600, 0].\\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\\n /// timestamp\\n function observe(uint32[] calldata secondsAgos)\\n external\\n view\\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\\n\\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\\n /// snapshot is taken and the second snapshot is taken.\\n /// @param tickLower The lower tick of the range\\n /// @param tickUpper The upper tick of the range\\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\\n /// @return secondsInside The snapshot of seconds per liquidity for the range\\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\\n external\\n view\\n returns (\\n int56 tickCumulativeInside,\\n uint160 secondsPerLiquidityInsideX128,\\n uint32 secondsInside\\n );\\n}\\n\",\"keccak256\":\"0xe603ac5b17ecdee73ba2b27efdf386c257a19c14206e87eee77e2017b742d9e5\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Events emitted by a pool\\n/// @notice Contains all events emitted by the pool\\ninterface IUniswapV3PoolEvents {\\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\\n event Initialize(uint160 sqrtPriceX96, int24 tick);\\n\\n /// @notice Emitted when liquidity is minted for a given position\\n /// @param sender The address that minted the liquidity\\n /// @param owner The owner of the position and recipient of any minted liquidity\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity minted to the position range\\n /// @param amount0 How much token0 was required for the minted liquidity\\n /// @param amount1 How much token1 was required for the minted liquidity\\n event Mint(\\n address sender,\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted when fees are collected by the owner of a position\\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\\n /// @param owner The owner of the position for which fees are collected\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount0 The amount of token0 fees collected\\n /// @param amount1 The amount of token1 fees collected\\n event Collect(\\n address indexed owner,\\n address recipient,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount0,\\n uint128 amount1\\n );\\n\\n /// @notice Emitted when a position's liquidity is removed\\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\\n /// @param owner The owner of the position for which liquidity is removed\\n /// @param tickLower The lower tick of the position\\n /// @param tickUpper The upper tick of the position\\n /// @param amount The amount of liquidity to remove\\n /// @param amount0 The amount of token0 withdrawn\\n /// @param amount1 The amount of token1 withdrawn\\n event Burn(\\n address indexed owner,\\n int24 indexed tickLower,\\n int24 indexed tickUpper,\\n uint128 amount,\\n uint256 amount0,\\n uint256 amount1\\n );\\n\\n /// @notice Emitted by the pool for any swaps between token0 and token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the output of the swap\\n /// @param amount0 The delta of the token0 balance of the pool\\n /// @param amount1 The delta of the token1 balance of the pool\\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param liquidity The liquidity of the pool after the swap\\n /// @param tick The log base 1.0001 of price of the pool after the swap\\n event Swap(\\n address indexed sender,\\n address indexed recipient,\\n int256 amount0,\\n int256 amount1,\\n uint160 sqrtPriceX96,\\n uint128 liquidity,\\n int24 tick\\n );\\n\\n /// @notice Emitted by the pool for any flashes of token0/token1\\n /// @param sender The address that initiated the swap call, and that received the callback\\n /// @param recipient The address that received the tokens from flash\\n /// @param amount0 The amount of token0 that was flashed\\n /// @param amount1 The amount of token1 that was flashed\\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\\n event Flash(\\n address indexed sender,\\n address indexed recipient,\\n uint256 amount0,\\n uint256 amount1,\\n uint256 paid0,\\n uint256 paid1\\n );\\n\\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\\n /// just before a mint/swap/burn.\\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(\\n uint16 observationCardinalityNextOld,\\n uint16 observationCardinalityNextNew\\n );\\n\\n /// @notice Emitted when the protocol fee is changed by the pool\\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\\n /// @param feeProtocol0New The updated value of the token0 protocol fee\\n /// @param feeProtocol1New The updated value of the token1 protocol fee\\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\\n\\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\\n /// @param sender The address that collects the protocol fees\\n /// @param recipient The address that receives the collected protocol fees\\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x8071514d0fe5d17d6fbd31c191cdfb703031c24e0ece3621d88ab10e871375cd\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that never changes\\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\\ninterface IUniswapV3PoolImmutables {\\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\\n /// @return The contract address\\n function factory() external view returns (address);\\n\\n /// @notice The first of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token0() external view returns (address);\\n\\n /// @notice The second of the two tokens of the pool, sorted by address\\n /// @return The token contract address\\n function token1() external view returns (address);\\n\\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\\n /// @return The fee\\n function fee() external view returns (uint24);\\n\\n /// @notice The pool tick spacing\\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\\n /// This value is an int24 to avoid casting even though it is always positive.\\n /// @return The tick spacing\\n function tickSpacing() external view returns (int24);\\n\\n /// @notice The maximum amount of position liquidity that can use any tick in the range\\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\\n /// @return The max amount of liquidity per tick\\n function maxLiquidityPerTick() external view returns (uint128);\\n}\\n\",\"keccak256\":\"0xf6e5d2cd1139c4c276bdbc8e1d2b256e456c866a91f1b868da265c6d2685c3f7\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Permissioned pool actions\\n/// @notice Contains pool methods that may only be called by the factory owner\\ninterface IUniswapV3PoolOwnerActions {\\n /// @notice Set the denominator of the protocol's % share of the fees\\n /// @param feeProtocol0 new protocol fee for token0 of the pool\\n /// @param feeProtocol1 new protocol fee for token1 of the pool\\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\\n\\n /// @notice Collect the protocol fee accrued to the pool\\n /// @param recipient The address to which collected protocol fees should be sent\\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\\n /// @return amount0 The protocol fee collected in token0\\n /// @return amount1 The protocol fee collected in token1\\n function collectProtocol(\\n address recipient,\\n uint128 amount0Requested,\\n uint128 amount1Requested\\n ) external returns (uint128 amount0, uint128 amount1);\\n}\\n\",\"keccak256\":\"0x759b78a2918af9e99e246dc3af084f654e48ef32bb4e4cb8a966aa3dcaece235\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.5.0;\\n\\n/// @title Pool state that can change\\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\\n/// per transaction\\ninterface IUniswapV3PoolState {\\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\\n /// when accessed externally.\\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\\n /// boundary.\\n /// observationIndex The index of the last oracle observation that was written,\\n /// observationCardinality The current maximum number of observations stored in the pool,\\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// feeProtocol The protocol fee for both tokens of the pool.\\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\\n /// unlocked Whether the pool is currently locked to reentrancy\\n function slot0()\\n external\\n view\\n returns (\\n uint160 sqrtPriceX96,\\n int24 tick,\\n uint16 observationIndex,\\n uint16 observationCardinality,\\n uint16 observationCardinalityNext,\\n uint8 feeProtocol,\\n bool unlocked\\n );\\n\\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal0X128() external view returns (uint256);\\n\\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\\n /// @dev This value can overflow the uint256\\n function feeGrowthGlobal1X128() external view returns (uint256);\\n\\n /// @notice The amounts of token0 and token1 that are owed to the protocol\\n /// @dev Protocol fees will never exceed uint128 max in either token\\n function protocolFees() external view returns (uint128 token0, uint128 token1);\\n\\n /// @notice The currently in range liquidity available to the pool\\n /// @dev This value has no relationship to the total liquidity across all ticks\\n function liquidity() external view returns (uint128);\\n\\n /// @notice Look up information about a specific tick in the pool\\n /// @param tick The tick to look up\\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\\n /// tick upper,\\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\\n /// a specific position.\\n function ticks(int24 tick)\\n external\\n view\\n returns (\\n uint128 liquidityGross,\\n int128 liquidityNet,\\n uint256 feeGrowthOutside0X128,\\n uint256 feeGrowthOutside1X128,\\n int56 tickCumulativeOutside,\\n uint160 secondsPerLiquidityOutsideX128,\\n uint32 secondsOutside,\\n bool initialized\\n );\\n\\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\\n function tickBitmap(int16 wordPosition) external view returns (uint256);\\n\\n /// @notice Returns the information about a position by the position's key\\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\\n /// @return _liquidity The amount of liquidity in the position,\\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\\n function positions(bytes32 key)\\n external\\n view\\n returns (\\n uint128 _liquidity,\\n uint256 feeGrowthInside0LastX128,\\n uint256 feeGrowthInside1LastX128,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param index The element of the observations array to fetch\\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\\n /// ago, rather than at a specific index in the array.\\n /// @return blockTimestamp The timestamp of the observation,\\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// Returns initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 index)\\n external\\n view\\n returns (\\n uint32 blockTimestamp,\\n int56 tickCumulative,\\n uint160 secondsPerLiquidityCumulativeX128,\\n bool initialized\\n );\\n}\\n\",\"keccak256\":\"0x852dc1f5df7dcf7f11e7bb3eed79f0cea72ad4b25f6a9d2c35aafb48925fd49f\",\"license\":\"GPL-2.0-or-later\"},\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity >=0.4.0;\\n\\n/// @title FixedPoint96\\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\\n/// @dev Used in SqrtPriceMath.sol\\nlibrary FixedPoint96 {\\n uint8 internal constant RESOLUTION = 96;\\n uint256 internal constant Q96 = 0x1000000000000000000000000;\\n}\\n\",\"keccak256\":\"0x0ba8a9b95a956a4050749c0158e928398c447c91469682ca8a7cc7e77a7fe032\",\"license\":\"GPL-2.0-or-later\"},\"contracts/GUniPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {\\n IUniswapV3MintCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\\\";\\nimport {\\n IUniswapV3SwapCallback\\n} from \\\"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\\\";\\nimport {GUniPoolStorage} from \\\"./abstract/GUniPoolStorage.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {TickMath} from \\\"./vendor/uniswap/TickMath.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {\\n FullMath,\\n LiquidityAmounts\\n} from \\\"./vendor/uniswap/LiquidityAmounts.sol\\\";\\n\\ncontract GUniPool is\\n IUniswapV3MintCallback,\\n IUniswapV3SwapCallback,\\n GUniPoolStorage\\n{\\n using SafeERC20 for IERC20;\\n using TickMath for int24;\\n\\n event Minted(\\n address receiver,\\n uint256 mintAmount,\\n uint256 amount0In,\\n uint256 amount1In,\\n uint128 liquidityMinted\\n );\\n\\n event Burned(\\n address receiver,\\n uint256 burnAmount,\\n uint256 amount0Out,\\n uint256 amount1Out,\\n uint128 liquidityBurned\\n );\\n\\n event Rebalance(int24 lowerTick_, int24 upperTick_);\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice Uniswap V3 callback fn, called back on pool.mint\\n function uniswapV3MintCallback(\\n uint256 amount0Owed,\\n uint256 amount1Owed,\\n bytes calldata /*_data*/\\n ) external override {\\n require(msg.sender == address(pool));\\n\\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\\n }\\n\\n /// @notice Uniswap v3 callback fn, called back on pool.swap\\n function uniswapV3SwapCallback(\\n int256 amount0Delta,\\n int256 amount1Delta,\\n bytes calldata /*data*/\\n ) external override {\\n require(msg.sender == address(pool));\\n\\n if (amount0Delta > 0)\\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\\n else if (amount1Delta > 0)\\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\\n }\\n\\n // User functions => Should be called via a Router\\n\\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\\n /// @param mintAmount The number of G-UNI tokens to mint\\n /// @param receiver The account to receive the minted tokens\\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function mint(uint256 mintAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityMinted\\n )\\n {\\n require(mintAmount > 0, \\\"mint 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n\\n if (totalSupply > 0) {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n amount0 = FullMath.mulDivRoundingUp(\\n amount0Current,\\n mintAmount,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n amount1Current,\\n mintAmount,\\n totalSupply\\n );\\n } else {\\n // if supply is 0 mintAmount == liquidity to deposit\\n require(mintAmount <= type(uint128).max);\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n uint128(mintAmount)\\n );\\n }\\n\\n // transfer amounts owed to contract\\n if (amount0 > 0) {\\n token0.safeTransferFrom(msg.sender, address(this), amount0);\\n }\\n if (amount1 > 0) {\\n token1.safeTransferFrom(msg.sender, address(this), amount1);\\n }\\n\\n // deposit as much new liquidity as possible\\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0,\\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1\\n );\\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \\\"\\\");\\n\\n _mint(receiver, mintAmount);\\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\\n }\\n\\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\\n /// @param burnAmount The number of G-UNI tokens to burn\\n /// @param receiver The account to receive the underlying amounts of token0 and token1\\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\\n // solhint-disable-next-line function-max-lines\\n function burn(uint256 burnAmount, address receiver)\\n external\\n nonReentrant\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint128 liquidityBurned\\n )\\n {\\n require(burnAmount > 0, \\\"burn 0\\\");\\n\\n uint256 totalSupply = totalSupply();\\n\\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\\n\\n _burn(msg.sender, burnAmount);\\n\\n uint256 _liquidityBurned_ =\\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\\n require(_liquidityBurned_ < type(uint128).max);\\n liquidityBurned = uint128(_liquidityBurned_);\\n\\n uint256 preBalance0 = token0.balanceOf(address(this));\\n uint256 preBalance1 = token1.balanceOf(address(this));\\n uint256 leftoverShare0 =\\n FullMath.mulDiv(\\n burnAmount,\\n preBalance0 - managerBalance0 - gelatoBalance0,\\n totalSupply\\n );\\n uint256 leftoverShare1 =\\n FullMath.mulDiv(\\n burnAmount,\\n preBalance1 - managerBalance1 - gelatoBalance1,\\n totalSupply\\n );\\n\\n _withdrawExact(\\n lowerTick,\\n upperTick,\\n burnAmount,\\n totalSupply,\\n liquidityBurned\\n );\\n\\n amount0 =\\n (token0.balanceOf(address(this)) - preBalance0) +\\n leftoverShare0;\\n amount1 =\\n (token1.balanceOf(address(this)) - preBalance1) +\\n leftoverShare1;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(receiver, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(receiver, amount1);\\n }\\n\\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\\n }\\n\\n // Manager Functions => Called by Pool Manager\\n\\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\\n /// any leftover will be unused and sit idle until the next rebalance.\\n /// @param newLowerTick The new lower bound of the position's range\\n /// @param newUpperTick The new upper bound of the position's range\\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\\n function executiveRebalance(\\n int24 newLowerTick,\\n int24 newUpperTick,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) external onlyManager {\\n (uint128 _liquidity, , , , ) = pool.positions(_getPositionID());\\n (uint256 feesEarned0, uint256 feesEarned1) =\\n _withdrawAll(lowerTick, upperTick, _liquidity);\\n\\n managerBalance0 += (feesEarned0 * managerFeeBPS) / 10000;\\n managerBalance1 += (feesEarned1 * managerFeeBPS) / 10000;\\n gelatoBalance0 += (feesEarned0 * gelatoFeeBPS) / 10000;\\n gelatoBalance1 += (feesEarned1 * gelatoFeeBPS) / 10000;\\n\\n lowerTick = newLowerTick;\\n upperTick = newUpperTick;\\n\\n uint256 reinvest0 =\\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\\n uint256 reinvest1 =\\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\\n\\n _deposit(\\n newLowerTick,\\n newUpperTick,\\n reinvest0,\\n reinvest1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n\\n emit Rebalance(newLowerTick, newUpperTick);\\n }\\n\\n // Gelatofied functions => Automatically called by Gelato\\n\\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\\n function rebalance(\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) external gelatofy(feeAmount, paymentToken) {\\n if (swapAmountBPS > 0) {\\n _checkSlippage(swapThresholdPrice, zeroForOne);\\n }\\n _rebalance(\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne,\\n feeAmount,\\n paymentToken\\n );\\n\\n emit Rebalance(lowerTick, upperTick);\\n }\\n\\n /// @notice withdraw manager fees accrued, only gelato executors can call.\\n /// Target account to receive fees is managerTreasury, alterable by manager.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n managerBalance0,\\n managerBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(managerTreasury, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(managerTreasury, amount1);\\n }\\n }\\n\\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\\n external\\n gelatofy(feeAmount, feeToken)\\n {\\n (uint256 amount0, uint256 amount1) =\\n _balancesToWithdraw(\\n gelatoBalance0,\\n gelatoBalance1,\\n feeAmount,\\n feeToken\\n );\\n\\n gelatoBalance0 = 0;\\n gelatoBalance1 = 0;\\n\\n if (amount0 > 0) {\\n token0.safeTransfer(GELATO, amount0);\\n }\\n\\n if (amount1 > 0) {\\n token1.safeTransfer(GELATO, amount1);\\n }\\n }\\n\\n function _balancesToWithdraw(\\n uint256 balance0,\\n uint256 balance1,\\n uint256 feeAmount,\\n address feeToken\\n ) internal view returns (uint256 amount0, uint256 amount1) {\\n if (feeToken == address(token0)) {\\n require(\\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount0 = balance0 - feeAmount;\\n amount1 = balance1;\\n } else if (feeToken == address(token1)) {\\n require(\\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n amount1 = balance1 - feeAmount;\\n amount0 = balance0;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n }\\n\\n // View functions\\n\\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\\n /// @param amount0Max The maximum amount of token0 to forward on mint\\n /// @param amount0Max The maximum amount of token1 to forward on mint\\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\\n /// @return mintAmount maximum number of G-UNI tokens to mint\\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\\n external\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n uint256 totalSupply = totalSupply();\\n if (totalSupply > 0) {\\n (amount0, amount1, mintAmount) = _computeMintAmounts(\\n totalSupply,\\n amount0Max,\\n amount1Max\\n );\\n } else {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 newLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n amount0Max,\\n amount1Max\\n );\\n mintAmount = uint256(newLiquidity);\\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n newLiquidity\\n );\\n }\\n }\\n\\n /// @notice compute total underlying holdings of the G-UNI token supply\\n /// includes current liquidity invested in uniswap position, current fees earned\\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\\n /// @return amount0Current current total underlying balance of token0\\n /// @return amount1Current current total underlying balance of token1\\n // solhint-disable-next-line function-max-lines\\n function getUnderlyingBalances()\\n public\\n view\\n returns (uint256 amount0Current, uint256 amount1Current)\\n {\\n (\\n uint128 _liquidity,\\n uint256 feeGrowthInside0Last,\\n uint256 feeGrowthInside1Last,\\n uint128 tokensOwed0,\\n uint128 tokensOwed1\\n ) = pool.positions(_getPositionID());\\n\\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\\n\\n // compute current holdings from liquidity\\n (amount0Current, amount1Current) = LiquidityAmounts\\n .getAmountsForLiquidity(\\n sqrtRatioX96,\\n lowerTick.getSqrtRatioAtTick(),\\n upperTick.getSqrtRatioAtTick(),\\n _liquidity\\n );\\n\\n // compute current fees earned\\n uint256 fee0 =\\n _computeFeesEarned(true, feeGrowthInside0Last, tick, _liquidity) +\\n uint256(tokensOwed0);\\n uint256 fee1 =\\n _computeFeesEarned(false, feeGrowthInside1Last, tick, _liquidity) +\\n uint256(tokensOwed1);\\n\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n\\n // add any leftover in contract to current holdings\\n amount0Current +=\\n fee0 +\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n amount1Current +=\\n fee1 +\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n }\\n\\n // Private functions\\n\\n // solhint-disable-next-line function-max-lines\\n function _rebalance(\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne,\\n uint256 feeAmount,\\n address paymentToken\\n ) private {\\n (uint128 _liquidity, , , , ) = pool.positions(_getPositionID());\\n\\n (uint256 feesEarned0, uint256 feesEarned1) =\\n _withdrawAll(lowerTick, upperTick, _liquidity);\\n\\n uint256 reinvest0;\\n uint256 reinvest1;\\n if (paymentToken == address(token0)) {\\n require(\\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n managerBalance0 +=\\n ((feesEarned0 - feeAmount) * managerFeeBPS) /\\n 10000;\\n managerBalance1 += (feesEarned1 * managerFeeBPS) / 10000;\\n gelatoBalance0 +=\\n ((feesEarned0 - feeAmount) * gelatoFeeBPS) /\\n 10000;\\n gelatoBalance1 += (feesEarned1 * gelatoFeeBPS) / 10000;\\n reinvest0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0 -\\n feeAmount;\\n reinvest1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1;\\n } else if (paymentToken == address(token1)) {\\n require(\\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\\n \\\"high fee\\\"\\n );\\n managerBalance0 += (feesEarned0 * managerFeeBPS) / 10000;\\n managerBalance1 +=\\n ((feesEarned1 - feeAmount) * managerFeeBPS) /\\n 10000;\\n gelatoBalance0 += (feesEarned0 * gelatoFeeBPS) / 10000;\\n gelatoBalance1 +=\\n ((feesEarned1 - feeAmount) * gelatoFeeBPS) /\\n 10000;\\n reinvest0 =\\n token0.balanceOf(address(this)) -\\n managerBalance0 -\\n gelatoBalance0;\\n reinvest1 =\\n token1.balanceOf(address(this)) -\\n managerBalance1 -\\n gelatoBalance1 -\\n feeAmount;\\n } else {\\n revert(\\\"wrong token\\\");\\n }\\n\\n _deposit(\\n lowerTick,\\n upperTick,\\n reinvest0,\\n reinvest1,\\n swapThresholdPrice,\\n swapAmountBPS,\\n zeroForOne\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _withdrawAll(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint128 liquidity\\n ) private returns (uint256 amountEarned0, uint256 amountEarned1) {\\n uint256 preBalance0 = token0.balanceOf(address(this));\\n uint256 preBalance1 = token1.balanceOf(address(this));\\n\\n (uint256 amount0Burned, uint256 amount1Burned) =\\n pool.burn(lowerTick_, upperTick_, liquidity);\\n\\n pool.collect(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n type(uint128).max,\\n type(uint128).max\\n );\\n\\n amountEarned0 =\\n token0.balanceOf(address(this)) -\\n preBalance0 -\\n amount0Burned;\\n amountEarned1 =\\n token1.balanceOf(address(this)) -\\n preBalance1 -\\n amount1Burned;\\n }\\n\\n function _withdrawExact(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 burnAmount,\\n uint256 supply,\\n uint128 liquidityBurned\\n ) private {\\n (uint256 burn0, uint256 burn1) =\\n pool.burn(lowerTick_, upperTick_, liquidityBurned);\\n\\n (, , , uint128 tokensOwed0, uint128 tokensOwed1) =\\n pool.positions(_getPositionID());\\n uint256 fee0 = uint256(tokensOwed0) - burn0;\\n uint256 fee1 = uint256(tokensOwed1) - burn1;\\n\\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\\n\\n burn0 += FullMath.mulDiv(burnAmount, fee0, supply);\\n burn1 += FullMath.mulDiv(burnAmount, fee1, supply);\\n\\n // Withdraw tokens to user\\n pool.collect(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n uint128(burn0), // cast can't overflow\\n uint128(burn1) // cast can't overflow\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _deposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n uint160 swapThresholdPrice,\\n uint256 swapAmountBPS,\\n bool zeroForOne\\n ) private {\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n // First, deposit as much as we can\\n uint128 baseLiquidity =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n amount0,\\n amount1\\n );\\n if (baseLiquidity > 0) {\\n (uint256 amountDeposited0, uint256 amountDeposited1) =\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n baseLiquidity,\\n \\\"\\\"\\n );\\n\\n amount0 -= amountDeposited0;\\n amount1 -= amountDeposited1;\\n }\\n int256 swapAmount =\\n int256(((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000);\\n if (swapAmount > 0) {\\n _swapAndDeposit(\\n lowerTick_,\\n upperTick_,\\n amount0,\\n amount1,\\n swapAmount,\\n swapThresholdPrice,\\n zeroForOne\\n );\\n }\\n }\\n\\n function _swapAndDeposit(\\n int24 lowerTick_,\\n int24 upperTick_,\\n uint256 amount0,\\n uint256 amount1,\\n int256 swapAmount,\\n uint160 swapThresholdPrice,\\n bool zeroForOne\\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\\n (int256 amount0Delta, int256 amount1Delta) =\\n pool.swap(\\n address(this),\\n zeroForOne,\\n swapAmount,\\n swapThresholdPrice,\\n \\\"\\\"\\n );\\n finalAmount0 = uint256(int256(amount0) - amount0Delta);\\n finalAmount1 = uint256(int256(amount1) - amount1Delta);\\n\\n // Add liquidity a second time\\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\\n uint128 liquidityAfterSwap =\\n LiquidityAmounts.getLiquidityForAmounts(\\n sqrtRatioX96,\\n lowerTick_.getSqrtRatioAtTick(),\\n upperTick_.getSqrtRatioAtTick(),\\n finalAmount0,\\n finalAmount1\\n );\\n if (liquidityAfterSwap > 0) {\\n pool.mint(\\n address(this),\\n lowerTick_,\\n upperTick_,\\n liquidityAfterSwap,\\n \\\"\\\"\\n );\\n }\\n }\\n\\n // solhint-disable-next-line function-max-lines, code-complexity\\n function _computeMintAmounts(\\n uint256 totalSupply,\\n uint256 amount0Max,\\n uint256 amount1Max\\n )\\n private\\n view\\n returns (\\n uint256 amount0,\\n uint256 amount1,\\n uint256 mintAmount\\n )\\n {\\n (uint256 amount0Current, uint256 amount1Current) =\\n getUnderlyingBalances();\\n\\n // compute proportional amount of tokens to mint\\n if (amount0Current == 0 && amount1Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount1Max,\\n totalSupply,\\n amount1Current\\n );\\n } else if (amount1Current == 0 && amount0Current > 0) {\\n mintAmount = FullMath.mulDiv(\\n amount0Max,\\n totalSupply,\\n amount0Current\\n );\\n } else if (amount0Current == 0 && amount1Current == 0) {\\n revert(\\\"\\\");\\n } else {\\n // only if both are non-zero\\n uint256 amount0Mint =\\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\\n uint256 amount1Mint =\\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\\n require(amount0Mint > 0 && amount1Mint > 0, \\\"mint 0\\\");\\n\\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\\n }\\n\\n // compute amounts owed to contract\\n amount0 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount0Current,\\n totalSupply\\n );\\n amount1 = FullMath.mulDivRoundingUp(\\n mintAmount,\\n amount1Current,\\n totalSupply\\n );\\n }\\n\\n // solhint-disable-next-line function-max-lines\\n function _computeFeesEarned(\\n bool isZero,\\n uint256 feeGrowthInsideLast,\\n int24 tick,\\n uint128 liquidity\\n ) private view returns (uint256 fee) {\\n uint256 feeGrowthOutsideLower;\\n uint256 feeGrowthOutsideUpper;\\n uint256 feeGrowthGlobal;\\n if (isZero) {\\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\\n } else {\\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\\n }\\n\\n unchecked {\\n // calculate fee growth below\\n uint256 feeGrowthBelow;\\n if (tick >= lowerTick) {\\n feeGrowthBelow = feeGrowthOutsideLower;\\n } else {\\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\\n }\\n\\n // calculate fee growth above\\n uint256 feeGrowthAbove;\\n if (tick < upperTick) {\\n feeGrowthAbove = feeGrowthOutsideUpper;\\n } else {\\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\\n }\\n\\n uint256 feeGrowthInside =\\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\\n fee = FullMath.mulDiv(\\n liquidity,\\n feeGrowthInside - feeGrowthInsideLast,\\n 0x100000000000000000000000000000000\\n );\\n }\\n }\\n\\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\\n private\\n view\\n returns (uint256 fee0, uint256 fee1)\\n {\\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\\n fee0 = rawFee0 - deduct0;\\n fee1 = rawFee1 - deduct1;\\n }\\n\\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\\n private\\n view\\n {\\n uint32[] memory secondsAgo = new uint32[](2);\\n secondsAgo[0] = gelatoSlippageInterval;\\n secondsAgo[1] = 0;\\n\\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\\n\\n require(tickCumulatives.length == 2, \\\"array length\\\");\\n uint160 avgSqrtRatioX96;\\n unchecked {\\n int24 avgTick =\\n int24(\\n (tickCumulatives[1] - tickCumulatives[0]) /\\n int56(uint56(gelatoSlippageInterval))\\n );\\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\\n }\\n\\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\\n if (zeroForOne) {\\n require(\\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\\n \\\"unacceptable slippage\\\"\\n );\\n } else {\\n require(\\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\\n \\\"unacceptable slippage\\\"\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x44e0b80685a12fe075f41122233bc4de7d58bdaf3c1a934a973e29f98e964377\",\"license\":\"GPL-3.0\"},\"contracts/abstract/GUniPoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {Gelatofied} from \\\"./Gelatofied.sol\\\";\\nimport {OwnableUninitialized} from \\\"./OwnableUninitialized.sol\\\";\\nimport {\\n IUniswapV3Pool\\n} from \\\"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {\\n ReentrancyGuardUpgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport {\\n ERC20Upgradeable\\n} from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\n\\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\\n/// @dev ERC20Upgradable Includes Initialize\\n// solhint-disable-next-line max-states-count\\nabstract contract GUniPoolStorage is\\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\\n ReentrancyGuardUpgradeable,\\n OwnableUninitialized,\\n Gelatofied\\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\\n // XXXX DONT MODIFY ORDERING XXXX\\n{\\n // solhint-disable-next-line const-name-snakecase\\n string public constant version = \\\"1.0.0\\\";\\n // solhint-disable-next-line const-name-snakecase\\n uint16 public constant gelatoFeeBPS = 100;\\n\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n int24 public lowerTick;\\n int24 public upperTick;\\n\\n uint16 public gelatoRebalanceBPS;\\n uint16 public gelatoWithdrawBPS;\\n uint16 public gelatoSlippageBPS;\\n uint32 public gelatoSlippageInterval;\\n\\n uint16 public managerFeeBPS;\\n address public managerTreasury;\\n\\n uint256 public managerBalance0;\\n uint256 public managerBalance1;\\n uint256 public gelatoBalance0;\\n uint256 public gelatoBalance1;\\n\\n IUniswapV3Pool public pool;\\n IERC20 public token0;\\n IERC20 public token1;\\n // APPPEND ADDITIONAL STATE VARS BELOW:\\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\\n\\n event UpdateAdminTreasury(\\n address oldAdminTreasury,\\n address newAdminTreasury\\n );\\n\\n event UpdateGelatoParams(\\n uint16 gelatoRebalanceBPS,\\n uint16 gelatoWithdrawBPS,\\n uint16 gelatoSlippageBPS,\\n uint32 gelatoSlippageInterval\\n );\\n\\n // solhint-disable-next-line max-line-length\\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\\n\\n /// @notice initialize storage variables on a new G-UNI pool, only called once\\n /// @param _name name of G-UNI token\\n /// @param _symbol symbol of G-UNI token\\n /// @param _pool address of Uniswap V3 pool\\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\\n /// @param _manager_ address of manager (ownership can be transferred)\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n address _pool,\\n uint16 _managerFeeBPS,\\n int24 _lowerTick,\\n int24 _upperTick,\\n address _manager_\\n ) external initializer {\\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \\\"mBPS\\\");\\n\\n // these variables are immutable after initialization\\n pool = IUniswapV3Pool(_pool);\\n token0 = IERC20(pool.token0());\\n token1 = IERC20(pool.token1());\\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\\n\\n // these variables can be udpated by the manager\\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\\n gelatoSlippageBPS = 500; // default: 5% slippage\\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\\n managerTreasury = _manager_; // default: treasury is admin\\n lowerTick = _lowerTick;\\n upperTick = _upperTick;\\n _manager = _manager_;\\n\\n // e.g. \\\"Gelato Uniswap V3 USDC/DAI LP\\\" and \\\"G-UNI\\\"\\n __ERC20_init(_name, _symbol);\\n __ReentrancyGuard_init();\\n }\\n\\n /// @notice change configurable parameters, only manager can call\\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\\n /// @param newTreasury address where managerFee withdrawals are sent\\n // solhint-disable-next-line code-complexity\\n function updateGelatoParams(\\n uint16 newRebalanceBPS,\\n uint16 newWithdrawBPS,\\n uint16 newSlippageBPS,\\n uint32 newSlippageInterval,\\n address newTreasury\\n ) external onlyManager {\\n require(newWithdrawBPS <= 10000, \\\"BPS\\\");\\n require(newRebalanceBPS <= 10000, \\\"BPS\\\");\\n require(newSlippageBPS <= 10000, \\\"BPS\\\");\\n emit UpdateGelatoParams(\\n newRebalanceBPS,\\n newWithdrawBPS,\\n newSlippageBPS,\\n newSlippageInterval\\n );\\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\\n if (newSlippageInterval != 0)\\n gelatoSlippageInterval = newSlippageInterval;\\n if (newTreasury != address(0)) managerTreasury = newTreasury;\\n }\\n\\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\\n /// If a manager fee was not set in the initialize function it can be set here\\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\\n require(managerFeeBPS == 0, \\\"fee\\\");\\n require(\\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\\n \\\"mBPS\\\"\\n );\\n managerFeeBPS = _managerFeeBPS;\\n }\\n\\n function renounceOwnership() public virtual override onlyManager {\\n managerTreasury = address(0);\\n managerFeeBPS = 0;\\n managerBalance0 = 0;\\n managerBalance1 = 0;\\n super.renounceOwnership();\\n }\\n\\n function getPositionID() external view returns (bytes32 positionID) {\\n return _getPositionID();\\n }\\n\\n function _getPositionID() internal view returns (bytes32 positionID) {\\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\\n }\\n}\\n\",\"keccak256\":\"0xf7c87dad152062d3035ee74c14dc186831ea7e4d64777862593e884f7fa4242e\",\"license\":\"GPL-3.0\"},\"contracts/abstract/Gelatofied.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport {\\n IERC20,\\n SafeERC20\\n} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract Gelatofied {\\n using Address for address payable;\\n using SafeERC20 for IERC20;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n address payable public immutable GELATO;\\n\\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n constructor(address payable _gelato) {\\n GELATO = _gelato;\\n }\\n\\n modifier gelatofy(uint256 _amount, address _paymentToken) {\\n require(msg.sender == GELATO, \\\"Gelatofied: Only gelato\\\");\\n _;\\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x31ddffff0545c4342d3cea88f4d2af520057f467f5e550e4e7166d24cc911cf1\",\"license\":\"GPL-3.0\"},\"contracts/abstract/OwnableUninitialized.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.4;\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an manager) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\\nabstract contract OwnableUninitialized {\\n address internal _manager;\\n\\n event OwnershipTransferred(\\n address indexed previousManager,\\n address indexed newManager\\n );\\n\\n /// @dev Initializes the contract setting the deployer as the initial manager.\\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\\n // solhint-disable-next-line no-empty-blocks\\n constructor() {}\\n\\n /**\\n * @dev Returns the address of the current manager.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Ownable: caller is not the manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without manager. It will not be possible to call\\n * `onlyManager` functions anymore. Can only be called by the current manager.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an manager,\\n * thereby removing any functionality that is only available to the manager.\\n */\\n function renounceOwnership() public virtual onlyManager {\\n emit OwnershipTransferred(_manager, address(0));\\n _manager = 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 manager.\\n */\\n function transferOwnership(address newOwner) public virtual onlyManager {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new manager is the zero address\\\"\\n );\\n emit OwnershipTransferred(_manager, newOwner);\\n _manager = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x81d888640e2261ac5189e6061a0cf4a7f3cec5994be1859ba60ffeb961f70c01\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/FullMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.4;\\n\\n/// @title Contains 512-bit math functions\\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\\n/// @dev Handles \\\"phantom overflow\\\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\\nlibrary FullMath {\\n /// @notice Calculates floor(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\\n function mulDiv(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = a * b\\n // Compute the product mod 2**256 and mod 2**256 - 1\\n // then use the Chinese Remainder Theorem to reconstruct\\n // the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2**256 + prod0\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(a, b, not(0))\\n prod0 := mul(a, b)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division\\n if (prod1 == 0) {\\n require(denominator > 0);\\n assembly {\\n result := div(prod0, denominator)\\n }\\n return result;\\n }\\n\\n // Make sure the result is less than 2**256.\\n // Also prevents denominator == 0\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0]\\n // Compute remainder using mulmod\\n uint256 remainder;\\n assembly {\\n remainder := mulmod(a, b, denominator)\\n }\\n // Subtract 256 bit number from 512 bit number\\n assembly {\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator\\n // Compute largest power of two divisor of denominator.\\n // Always >= 1.\\n // EDIT for 0.8 compatibility:\\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\\n uint256 twos = denominator & (~denominator + 1);\\n\\n // Divide denominator by power of two\\n assembly {\\n denominator := div(denominator, twos)\\n }\\n\\n // Divide [prod1 prod0] by the factors of two\\n assembly {\\n prod0 := div(prod0, twos)\\n }\\n // Shift in bits from prod1 into prod0. For this we need\\n // to flip `twos` such that it is 2**256 / twos.\\n // If twos is zero, then it becomes one\\n assembly {\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2**256\\n // Now that denominator is an odd number, it has an inverse\\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\\n // Compute the inverse by starting with a seed that is correct\\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\\n uint256 inv = (3 * denominator) ^ 2;\\n // Now use Newton-Raphson iteration to improve the precision.\\n // Thanks to Hensel's lifting lemma, this also works in modular\\n // arithmetic, doubling the correct bits in each step.\\n inv *= 2 - denominator * inv; // inverse mod 2**8\\n inv *= 2 - denominator * inv; // inverse mod 2**16\\n inv *= 2 - denominator * inv; // inverse mod 2**32\\n inv *= 2 - denominator * inv; // inverse mod 2**64\\n inv *= 2 - denominator * inv; // inverse mod 2**128\\n inv *= 2 - denominator * inv; // inverse mod 2**256\\n\\n // Because the division is now exact we can divide by multiplying\\n // with the modular inverse of denominator. This will give us the\\n // correct result modulo 2**256. Since the precoditions guarantee\\n // that the outcome is less than 2**256, this is the final result.\\n // We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inv;\\n return result;\\n }\\n }\\n\\n /// @notice Calculates ceil(a\\u00d7b\\u00f7denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n /// @param a The multiplicand\\n /// @param b The multiplier\\n /// @param denominator The divisor\\n /// @return result The 256-bit result\\n function mulDivRoundingUp(\\n uint256 a,\\n uint256 b,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n result = mulDiv(a, b, denominator);\\n if (mulmod(a, b, denominator) > 0) {\\n require(result < type(uint256).max);\\n result++;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3fa0efa3eea2a84bd6ab7e55badd61f97069a6c50780059b036c810427a9740c\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/LiquidityAmounts.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.5.0;\\n\\nimport {FullMath} from \\\"./FullMath.sol\\\";\\nimport \\\"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\\\";\\n\\n/// @title Liquidity amount functions\\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\\nlibrary LiquidityAmounts {\\n function toUint128(uint256 x) private pure returns (uint128 y) {\\n require((y = uint128(x)) == x);\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount0 The amount0 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount0(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n uint256 intermediate =\\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount0,\\n intermediate,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param amount1 The amount1 being sent in\\n /// @return liquidity The amount of returned liquidity\\n function getLiquidityForAmount1(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n return\\n toUint128(\\n FullMath.mulDiv(\\n amount1,\\n FixedPoint96.Q96,\\n sqrtRatioBX96 - sqrtRatioAX96\\n )\\n );\\n }\\n\\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\\n /// pool prices and the prices at the tick boundaries\\n function getLiquidityForAmounts(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint256 amount0,\\n uint256 amount1\\n ) internal pure returns (uint128 liquidity) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 < sqrtRatioAX96) {\\n liquidity = getLiquidityForAmount0(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount0\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n uint128 liquidity0 =\\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\\n uint128 liquidity1 =\\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\\n\\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\\n } else {\\n liquidity = getLiquidityForAmount1(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n amount1\\n );\\n }\\n }\\n\\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount0 The amount0\\n function getAmount0ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n uint256(liquidity) << FixedPoint96.RESOLUTION,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n sqrtRatioBX96\\n ) / sqrtRatioAX96;\\n }\\n\\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\\n /// @param sqrtRatioAX96 A sqrt price\\n /// @param sqrtRatioBX96 Another sqrt price\\n /// @param liquidity The liquidity being valued\\n /// @return amount1 The amount1\\n function getAmount1ForLiquidity(\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n return\\n FullMath.mulDiv(\\n liquidity,\\n sqrtRatioBX96 - sqrtRatioAX96,\\n FixedPoint96.Q96\\n );\\n }\\n\\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\\n /// pool prices and the prices at the tick boundaries\\n function getAmountsForLiquidity(\\n uint160 sqrtRatioX96,\\n uint160 sqrtRatioAX96,\\n uint160 sqrtRatioBX96,\\n uint128 liquidity\\n ) internal pure returns (uint256 amount0, uint256 amount1) {\\n if (sqrtRatioAX96 > sqrtRatioBX96)\\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\n\\n if (sqrtRatioX96 < sqrtRatioAX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\\n amount0 = getAmount0ForLiquidity(\\n sqrtRatioX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioX96,\\n liquidity\\n );\\n } else {\\n amount1 = getAmount1ForLiquidity(\\n sqrtRatioAX96,\\n sqrtRatioBX96,\\n liquidity\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd851a36c694e1b7d99d3f8b7d941418ad7a563079343616e54a0a548b057aabb\",\"license\":\"GPL-3.0\"},\"contracts/vendor/uniswap/TickMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.4;\\n\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\n/// prices between 2**-128 and 2**128\\nlibrary TickMath {\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\n int24 internal constant MIN_TICK = -887272;\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\n int24 internal constant MAX_TICK = -MIN_TICK;\\n\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\n uint160 internal constant MAX_SQRT_RATIO =\\n 1461446703485210103287273052203988822378723970342;\\n\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\n /// @dev Throws if |tick| > max tick\\n /// @param tick The input tick for the above formula\\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\n /// at the given tick\\n function getSqrtRatioAtTick(int24 tick)\\n internal\\n pure\\n returns (uint160 sqrtPriceX96)\\n {\\n uint256 absTick =\\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\\n\\n // EDIT: 0.8 compatibility\\n require(absTick <= uint256(int256(MAX_TICK)), \\\"T\\\");\\n\\n uint256 ratio =\\n absTick & 0x1 != 0\\n ? 0xfffcb933bd6fad37aa2d162d1a594001\\n : 0x100000000000000000000000000000000;\\n if (absTick & 0x2 != 0)\\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\\n if (absTick & 0x4 != 0)\\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\\n if (absTick & 0x8 != 0)\\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\\n if (absTick & 0x10 != 0)\\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\\n if (absTick & 0x20 != 0)\\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\\n if (absTick & 0x40 != 0)\\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\\n if (absTick & 0x80 != 0)\\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\\n if (absTick & 0x100 != 0)\\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\\n if (absTick & 0x200 != 0)\\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\\n if (absTick & 0x400 != 0)\\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\\n if (absTick & 0x800 != 0)\\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\\n if (absTick & 0x1000 != 0)\\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\\n if (absTick & 0x2000 != 0)\\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\\n if (absTick & 0x4000 != 0)\\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\\n if (absTick & 0x8000 != 0)\\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\\n if (absTick & 0x10000 != 0)\\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\\n if (absTick & 0x20000 != 0)\\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\\n if (absTick & 0x40000 != 0)\\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\\n if (absTick & 0x80000 != 0)\\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\\n\\n if (tick > 0) ratio = type(uint256).max / ratio;\\n\\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\n sqrtPriceX96 = uint160(\\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\\n );\\n }\\n\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\n /// ever return.\\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\\n internal\\n pure\\n returns (int24 tick)\\n {\\n // second inequality must be < because the price can never reach the price at the max tick\\n require(\\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\\n \\\"R\\\"\\n );\\n uint256 ratio = uint256(sqrtPriceX96) << 32;\\n\\n uint256 r = ratio;\\n uint256 msb = 0;\\n\\n assembly {\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(4, gt(r, 0xFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(3, gt(r, 0xFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(2, gt(r, 0xF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(1, gt(r, 0x3))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := gt(r, 0x1)\\n msb := or(msb, f)\\n }\\n\\n if (msb >= 128) r = ratio >> (msb - 127);\\n else r = ratio << (127 - msb);\\n\\n int256 log_2 = (int256(msb) - 128) << 64;\\n\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(63, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(62, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(61, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(60, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(59, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(58, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(57, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(56, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(55, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(54, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(53, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(52, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(51, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(50, f))\\n }\\n\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\n\\n int24 tickLow =\\n int24(\\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\\n );\\n int24 tickHi =\\n int24(\\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\\n );\\n\\n tick = tickLow == tickHi\\n ? tickLow\\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\\n ? tickHi\\n : tickLow;\\n }\\n}\\n\",\"keccak256\":\"0xc0faed28071dc68a5f4b03abbb6115759824980feb95a7fcf3b66ae7e1bab58f\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b50604051620060d4380380620060d483398101604081905262000034916200004a565b60601b6001600160601b0319166080526200007a565b6000602082840312156200005c578081fd5b81516001600160a01b038116811462000073578182fd5b9392505050565b60805160601c615ffc620000d8600039600081816105e101528181610f1401528181610ffd015281816110370152818161183c0152818161190a015281816119440152818161197f015281816119f60152611a330152615ffc6000f3fe608060405234801561001057600080fd5b506004361061021a5760003560e01c8063065756db1461021f57806306fdde031461023b578063095ea7b3146102505780630dfe1681146102735780631322d9541461029357806316f0115b146102b057806318160ddd146102c357806323b872dd146102cb57806324b8fd1b146102de57806331366be4146102f3578063313ce5671461030e578063395093511461031d5780633d8b30e11461033057806342fb9d4414610345578063481c6a751461034e57806354fd4d5014610356578063672152bd1461037a57806370a082311461039f578063715018a6146103c8578063727dd228146103d057806378ac6357146103f157806394bf804d1461040457806395d89b411461043b5780639894f21a1461044357806399fd808c146104715780639b1344ac14610484578063a457c2d714610498578063a50b1fe7146104ab578063a9059cbb146104c0578063b135c99f146104d3578063b536bd12146104e6578063be93dd5f146104ef578063c345445914610502578063cc95353e1461050b578063ccdf7a0214610525578063d21220a71461053a578063d34879971461054d578063d6e7ff3914610560578063dd62ed3e14610575578063df28408a146105ae578063e25e15e3146105b6578063e4077894146105c9578063eff557a7146105dc578063f2fde38b14610603578063fa461e3314610616578063fcd3533c14610629575b600080fd5b61022860995481565b6040519081526020015b60405180910390f35b61024361063c565b6040516102329190615a54565b61026361025e366004615370565b6106ce565b6040519015158152602001610232565b609e54610286906001600160a01b031681565b604051610232919061590c565b61029b6106e4565b60408051928352602083019190915201610232565b609d54610286906001600160a01b031681565b603554610228565b6102636102d9366004615330565b610a26565b6102f16102ec36600461547a565b610ade565b005b6102fb606481565b60405161ffff9091168152602001610232565b60405160128152602001610232565b61026361032b366004615370565b610e6b565b6097546102fb90600160e01b900461ffff1681565b610228609a5481565b610286610ea2565b610243604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038a9063ffffffff1681565b60405163ffffffff9091168152602001610232565b6102286103ad3660046152c0565b6001600160a01b031660009081526033602052604090205490565b6102f1610eb1565b6097546103e490600160b81b900460020b81565b6040516102329190615a20565b6102f16103ff3660046158ab565b610f07565b6104176104123660046158ab565b611062565b6040805193845260208401929092526001600160801b031690820152606001610232565b610243611466565b6104566104513660046158cf565b611475565b60408051938452602084019290925290820152606001610232565b6102f161047f366004615831565b6115c7565b6097546103e490600160a01b900460020b81565b6102636104a6366004615370565b611787565b6097546102fb90600160d01b900461ffff1681565b6102636104ce366004615370565b611822565b6102f16104e13660046157e1565b61182f565b610228609b5481565b6102f16104fd3660046158ab565b611972565b610228609c5481565b60985461028690600160301b90046001600160a01b031681565b6098546102fb90600160201b900461ffff1681565b609f54610286906001600160a01b031681565b6102f161055b366004615504565b611a58565b6097546102fb90600160f01b900461ffff1681565b6102286105833660046152f8565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b610228611aa9565b6102f16105c4366004615554565b611ab8565b6102f16105d7366004615735565b611d55565b6102867f000000000000000000000000000000000000000000000000000000000000000081565b6102f16106113660046152c0565b611e2b565b6102f1610624366004615504565b611f0b565b6104176106373660046158ab565b611f62565b60606036805461064b90615e2b565b80601f016020809104026020016040519081016040528092919081815260200182805461067790615e2b565b80156106c45780601f10610699576101008083540402835291602001916106c4565b820191906000526020600020905b8154815290600101906020018083116106a757829003601f168201915b5050505050905090565b60006106db3384846123e0565b50600192915050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61070c612505565b6040518263ffffffff1660e01b815260040161072a91815260200190565b60a06040518083038186803b15801561074257600080fd5b505afa158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a91906156df565b94509450945094509450600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b1580156107d557600080fd5b505afa1580156107e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080d9190615751565b50505050509150915061085582610835609760149054906101000a900460020b60020b61256b565b60975461084f90600160b81b9004600290810b900b61256b565b8a61297d565b909950975060006001600160801b038516610873600189858c612a1a565b61087d9190615cc6565b90506000846001600160801b0316610898600089868d612a1a565b6108a29190615cc6565b90506108ae8282612e26565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a08231906108ec90309060040161590c565b60206040518083038186803b15801561090457600080fd5b505afa158015610918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c9190615893565b6109469085615cc6565b6109509190615de8565b61095a9190615de8565b610964908c615cc6565b609c54609a54609f546040516370a0823160e01b8152939e50919290916001600160a01b0316906370a082319061099f90309060040161590c565b60206040518083038186803b1580156109b757600080fd5b505afa1580156109cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ef9190615893565b6109f99084615cc6565b610a039190615de8565b610a0d9190615de8565b610a17908b615cc6565b99505050505050505050509091565b6000610a33848484612ec1565b6001600160a01b038416600090815260346020908152604080832033845290915290205482811015610abd5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610ad18533610acc8685615de8565b6123e0565b60019150505b9392505050565b33610ae7610ea2565b6001600160a01b031614610b0d5760405162461bcd60e51b8152600401610ab490615b92565b609d546000906001600160a01b031663514ea4bf610b29612505565b6040518263ffffffff1660e01b8152600401610b4791815260200190565b60a06040518083038186803b158015610b5f57600080fd5b505afa158015610b73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9791906156df565b5050609754929350600092839250610bc69150600160a01b8104600290810b91600160b81b9004900b85613087565b609854919350915061271090610be790600160201b900461ffff1684615d47565b610bf19190615d04565b60996000828254610c029190615cc6565b909155505060985461271090610c2390600160201b900461ffff1683615d47565b610c2d9190615d04565b609a6000828254610c3e9190615cc6565b909155506127109050610c52606484615d47565b610c5c9190615d04565b609b6000828254610c6d9190615cc6565b909155506127109050610c81606483615d47565b610c8b9190615d04565b609c6000828254610c9c9190615cc6565b909155505060978054600289810b62ffffff908116600160b81b0262ffffff60b81b19928d900b909116600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610d1e90309060040161590c565b60206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e9190615893565b610d789190615de8565b610d829190615de8565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610dbe90309060040161590c565b60206040518083038186803b158015610dd657600080fd5b505afa158015610dea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0e9190615893565b610e189190615de8565b610e229190615de8565b9050610e338a8a84848c8c8c6133f2565b6040805160028c810b82528b900b6020820152600080516020615f67833981519152910160405180910390a150505050505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106db918590610acc908690615cc6565b6097546001600160a01b031690565b33610eba610ea2565b6001600160a01b031614610ee05760405162461bcd60e51b8152600401610ab490615b92565b60988054600160201b600160d01b031916905560006099819055609a55610f056135a9565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f515760405162461bcd60e51b8152600401610ab490615a87565b600080610f64609954609a548888613610565b60006099819055609a5590925090508115610f9e57609854609e54610f9e916001600160a01b0391821691600160301b909104168461372b565b8015610fc957609854609f54610fc9916001600160a01b0391821691600160301b909104168361372b565b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611028576110236001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683613793565b61105c565b61105c6001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000008461372b565b50505050565b60008060006002606554141561108a5760405162461bcd60e51b8152600401610ab490615bf4565b6002606555846110ac5760405162461bcd60e51b8152600401610ab490615bd4565b60006110b760355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561110957600080fd5b505afa15801561111d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111419190615751565b505050505050905060008211156111825760008061115d6106e4565b9150915061116c828a866138a9565b9650611179818a866138a9565b955050506111bb565b6001600160801b0387111561119657600080fd5b6111b581610835609760149054906101000a900460020b60020b61256b565b90955093505b84156111d957609e546111d9906001600160a01b0316333088613900565b83156111f757609f546111f7906001600160a01b0316333087613900565b61136981611216609760149054906101000a900460020b60020b61256b565b60975461123090600160b81b9004600290810b900b61256b565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a082319061126690309060040161590c565b60206040518083038186803b15801561127e57600080fd5b505afa158015611292573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b69190615893565b6112c09190615de8565b6112ca9190615de8565b609c54609a54609f546040516370a0823160e01b81526001600160a01b03909116906370a082319061130090309060040161590c565b60206040518083038186803b15801561131857600080fd5b505afa15801561132c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113509190615893565b61135a9190615de8565b6113649190615de8565b613938565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d916113b9913091600160a01b8104600290810b92600160b81b909204900b908990600401615920565b6040805180830381600087803b1580156113d257600080fd5b505af11580156113e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140a91906154e1565b505061141686886139fb565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e7868887878760405161144d95949392919061599f565b60405180910390a1505060016065819055509250925092565b60606037805461064b90615e2b565b60008060008061148460355490565b905080156114a357611497818787613ac8565b919550935091506115bf565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b1580156114e857600080fd5b505afa1580156114fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115209190615751565b5050505050509050600061156a82611549609760149054906101000a900460020b60020b61256b565b60975461156390600160b81b9004600290810b900b61256b565b8b8b613938565b9050806001600160801b031693506115b782611597609760149054906101000a900460020b60020b61256b565b6097546115b190600160b81b9004600290810b900b61256b565b8461297d565b909650945050505b509250925092565b336115d0610ea2565b6001600160a01b0316146115f65760405162461bcd60e51b8152600401610ab490615b92565b6127108461ffff16111561161c5760405162461bcd60e51b8152600401610ab490615b75565b6127108561ffff1611156116425760405162461bcd60e51b8152600401610ab490615b75565b6127108361ffff1611156116685760405162461bcd60e51b8152600401610ab490615b75565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff8516156116df576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff841615611704576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561172a57609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff82161561174c576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156117805760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156118095760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610ab4565b6118183385610acc8685615de8565b5060019392505050565b60006106db338484612ec1565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118795760405162461bcd60e51b8152600401610ab490615a87565b8515611889576118898786613bd7565b6118968787878787613e88565b60975460408051600160a01b8304600290810b810b8252600160b81b909304830b90920b6020830152600080516020615f67833981519152910160405180910390a16001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611935576119306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683613793565b611969565b6119696001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000008461372b565b50505050505050565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146119bc5760405162461bcd60e51b8152600401610ab490615a87565b6000806119cf609b54609c548888613610565b6000609b819055609c5590925090508115611a1b57609e54611a1b906001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000008461372b565b8015610fc957609f54610fc9906001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000008361372b565b609d546001600160a01b03163314611a6f57600080fd5b8315611a8c57609e54611a8c906001600160a01b0316338661372b565b821561105c57609f5461105c906001600160a01b0316338561372b565b6000611ab3612505565b905090565b600054610100900460ff1680611ad1575060005460ff16155b611aed5760405162461bcd60e51b8152600401610ab490615b05565b600054610100900460ff16158015611b0f576000805461ffff19166101011790555b611b1c6064612710615da5565b61ffff168561ffff161115611b435760405162461bcd60e51b8152600401610ab490615ab8565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe168191600480820192602092909190829003018186803b158015611b9757600080fd5b505afa158015611bab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bcf91906152dc565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611c2857600080fd5b505afa158015611c3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6091906152dc565b609f80546001600160a01b03199081166001600160a01b0393841617909155609880546097805461012c65ffffffffffff19909316600160201b61ffff8d160263ffffffff19161792909217600160301b600160d01b031916600160301b95881695860217909255643e800c801960d31b600165ffffff00000160a01b03909116600160a01b60028a810b62ffffff908116929092029290921792909217600165ffffff00000160a01b031916600160b81b9189900b9290921602909216919091179091179055611d31888861447b565b611d396144fa565b8015611d4b576000805461ff00191690555b5050505050505050565b33611d5e610ea2565b6001600160a01b031614611d845760405162461bcd60e51b8152600401610ab490615b92565b609854600160201b900461ffff1615611dc55760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610ab4565b60008161ffff16118015611ded5750611de16064612710615da5565b61ffff168161ffff1611155b611e095760405162461bcd60e51b8152600401610ab490615ab8565b6098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611e34610ea2565b6001600160a01b031614611e5a5760405162461bcd60e51b8152600401610ab490615b92565b6001600160a01b038116611ec15760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610ab4565b6097546040516001600160a01b03808416921690600080516020615f8783398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611f2257600080fd5b6000841315611f4257609e54611023906001600160a01b0316338661372b565b600083131561105c57609f5461105c906001600160a01b0316338561372b565b600080600060026065541415611f8a5760405162461bcd60e51b8152600401610ab490615bf4565b600260655584611fc55760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610ab4565b6000611fd060355490565b609d549091506000906001600160a01b031663514ea4bf611fef612505565b6040518263ffffffff1660e01b815260040161200d91815260200190565b60a06040518083038186803b15801561202557600080fd5b505afa158015612039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061205d91906156df565b50505050905061206d338861456e565b600061208388836001600160801b0316856146ab565b90506001600160801b03811061209857600080fd5b609e546040516370a0823160e01b815291945084916000916001600160a01b0316906370a08231906120ce90309060040161590c565b60206040518083038186803b1580156120e657600080fd5b505afa1580156120fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061211e9190615893565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061215490309060040161590c565b60206040518083038186803b15801561216c57600080fd5b505afa158015612180573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121a49190615893565b905060006121cd8b609b54609954866121bd9190615de8565b6121c79190615de8565b886146ab565b905060006121f68c609c54609a54866121e69190615de8565b6121f09190615de8565b896146ab565b60975490915061221e90600160a01b8104600290810b91600160b81b9004900b8e8a8c61475a565b609e546040516370a0823160e01b8152839186916001600160a01b03909116906370a082319061225290309060040161590c565b60206040518083038186803b15801561226a57600080fd5b505afa15801561227e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122a29190615893565b6122ac9190615de8565b6122b69190615cc6565b609f546040516370a0823160e01b8152919b50829185916001600160a01b0316906370a08231906122eb90309060040161590c565b60206040518083038186803b15801561230357600080fd5b505afa158015612317573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233b9190615893565b6123459190615de8565b61234f9190615cc6565b9850891561236e57609e5461236e906001600160a01b03168c8c61372b565b881561238b57609f5461238b906001600160a01b03168c8b61372b565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516123c295949392919061599f565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166124425760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610ab4565b6001600160a01b0382166124a35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610ab4565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6097546040516001600160601b03193060601b166020820152600160a01b8204600290810b810b60e890811b6034840152600160b81b909304810b900b90911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b60008060008360020b12612582578260020b61258f565b8260020b61258f90615eb6565b905061259e620d89e719615e95565b60020b8111156125d45760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610ab4565b6000600182166125e857600160801b6125fa565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561262f57608061262a826ffff97272373d413259a46990580e213a615d47565b901c90505b6004821615612659576080612654826ffff2e50f5f656932ef12357cf3c7fdcc615d47565b901c90505b600882161561268357608061267e826fffe5caca7e10e4e61c3624eaa0941cd0615d47565b901c90505b60108216156126ad5760806126a8826fffcb9843d60f6159c9db58835c926644615d47565b901c90505b60208216156126d75760806126d2826fff973b41fa98c081472e6896dfb254c0615d47565b901c90505b60408216156127015760806126fc826fff2ea16466c96a3843ec78b326b52861615d47565b901c90505b608082161561272b576080612726826ffe5dee046a99a2a811c461f1969c3053615d47565b901c90505b610100821615612756576080612751826ffcbe86c7900a88aedcffc83b479aa3a4615d47565b901c90505b61020082161561278157608061277c826ff987a7253ac413176f2b074cf7815e54615d47565b901c90505b6104008216156127ac5760806127a7826ff3392b0822b70005940c7a398e4b70f3615d47565b901c90505b6108008216156127d75760806127d2826fe7159475a2c29b7443b29c7fa6e889d9615d47565b901c90505b6110008216156128025760806127fd826fd097f3bdfd2022b8845ad8f792aa5825615d47565b901c90505b61200082161561282d576080612828826fa9f746462d870fdf8a65dc1f90e061e5615d47565b901c90505b614000821615612858576080612853826f70d869a156d2a1b890bb3df62baf32f7615d47565b901c90505b61800082161561288357608061287e826f31be135f97d08fd981231505542fcfa6615d47565b901c90505b620100008216156128af5760806128aa826f09aa508b5b7a84e1c677de54f3e99bc9615d47565b901c90505b620200008216156128da5760806128d5826e5d6af8dedb81196699c329225ee604615d47565b901c90505b620400008216156129045760806128ff826d2216e584f5fa1ea926041bedfe98615d47565b901c90505b6208000082161561292c576080612927826b048a170391f7dc42444e8fa2615d47565b901c90505b60008460020b13156129475761294481600019615d04565b90505b612955600160201b82615e81565b15612961576001612964565b60005b6129759060ff16602083901c615cc6565b949350505050565b600080836001600160a01b0316856001600160a01b0316111561299e579293925b846001600160a01b0316866001600160a01b031610156129ca576129c3858585614980565b9150612a11565b836001600160a01b0316866001600160a01b03161015612a03576129ef868585614980565b91506129fc8587856149ea565b9050612a11565b612a0e8585856149ea565b90505b94509492505050565b6000806000808715612be757609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b815260040160206040518083038186803b158015612a7457600080fd5b505afa158015612a88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aac9190615893565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba9391612aec91600160a01b90910460020b90600401615a20565b6101006040518083038186803b158015612b0557600080fd5b505afa158015612b19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b3d9190615613565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba939550612b8694600160b81b90910460020b93506004019150615a209050565b6101006040518083038186803b158015612b9f57600080fd5b505afa158015612bb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd79190615613565b50939750612da295505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b815260040160206040518083038186803b158015612c3557600080fd5b505afa158015612c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c6d9190615893565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba9391612cad91600160a01b90910460020b90600401615a20565b6101006040518083038186803b158015612cc657600080fd5b505afa158015612cda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cfe9190615613565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba939550612d469450600160b81b900460020b926004019150615a209050565b6101006040518083038186803b158015612d5f57600080fd5b505afa158015612d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d979190615613565b509297505050505050505b6000609760149054906101000a900460020b60020b8760020b12612dc7575082612dcc565b508281035b6000609760179054906101000a900460020b60020b8860020b1215612df2575082612df7565b508282035b818303819003612e176001600160801b0389168b8303600160801b6146ab565b9b9a5050505050505050505050565b6000806000612710609860049054906101000a900461ffff166064612e4b9190615c7e565b612e599061ffff1687615d47565b612e639190615d04565b60985490915060009061271090612e8690600160201b900461ffff166064615c7e565b612e949061ffff1687615d47565b612e9e9190615d04565b9050612eaa8287615de8565b9350612eb68186615de8565b925050509250929050565b6001600160a01b038316612f255760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610ab4565b6001600160a01b038216612f875760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610ab4565b6001600160a01b03831660009081526033602052604090205481811015612fff5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610ab4565b6130098282615de8565b6001600160a01b03808616600090815260336020526040808220939093559085168152908120805484929061303f908490615cc6565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615fa78339815191528460405161307991815260200190565b60405180910390a350505050565b609e546040516370a0823160e01b8152600091829182916001600160a01b0316906370a08231906130bc90309060040161590c565b60206040518083038186803b1580156130d457600080fd5b505afa1580156130e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061310c9190615893565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061314290309060040161590c565b60206040518083038186803b15801561315a57600080fd5b505afa15801561316e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131929190615893565b609d5460405163a34123a760e01b815291925060009182916001600160a01b03169063a34123a7906131cc908c908c908c90600401615a2e565b6040805180830381600087803b1580156131e557600080fd5b505af11580156131f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061321d91906154e1565b609d546040516309e3d67b60e31b81529294509092506001600160a01b031690634f1eb3d8906132609030908d908d906001600160801b03908190600401615962565b6040805180830381600087803b15801561327957600080fd5b505af115801561328d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132b191906156ad565b5050609e546040516370a0823160e01b8152839186916001600160a01b03909116906370a08231906132e790309060040161590c565b60206040518083038186803b1580156132ff57600080fd5b505afa158015613313573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133379190615893565b6133419190615de8565b61334b9190615de8565b609f546040516370a0823160e01b8152919750829185916001600160a01b0316906370a082319061338090309060040161590c565b60206040518083038186803b15801561339857600080fd5b505afa1580156133ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133d09190615893565b6133da9190615de8565b6133e49190615de8565b945050505050935093915050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b15801561343757600080fd5b505afa15801561344b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061346f9190615751565b5050505050509050600061349c826134898b60020b61256b565b6134958b60020b61256b565b8a8a613938565b90506001600160801b0381161561355957609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d906134e89030908f908f908990600401615920565b6040805180830381600087803b15801561350157600080fd5b505af1158015613515573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061353991906154e1565b9092509050613548828a615de8565b98506135548189615de8565b975050505b6000612710858561356a578861356c565b895b6135769190615d47565b6135809190615d04565b9050600081131561359d5761359a8a8a8a8a858b8a614a34565b50505b50505050505050505050565b336135b2610ea2565b6001600160a01b0316146135d85760405162461bcd60e51b8152600401610ab490615b92565b6097546040516000916001600160a01b031690600080516020615f87833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b03848116911614156136855760975484906127109061364990600160e01b900461ffff1689615d47565b6136539190615d04565b10156136715760405162461bcd60e51b8152600401610ab490615b53565b61367b8487615de8565b9150849050612a11565b609f546001600160a01b03848116911614156136f5576097548490612710906136b990600160e01b900461ffff1688615d47565b6136c39190615d04565b10156136e15760405162461bcd60e51b8152600401610ab490615b53565b6136eb8486615de8565b9050859150612a11565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610ab4565b6040516001600160a01b03831660248201526044810182905261378e90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614c6a565b505050565b804710156137e35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610ab4565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613830576040519150601f19603f3d011682016040523d82523d6000602084013e613835565b606091505b505090508061378e5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610ab4565b60006138b68484846146ab565b9050600082806138d657634e487b7160e01b600052601260045260246000fd5b8486091115610ad75760001981106138ed57600080fd5b806138f781615e66565b95945050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261105c9085906323b872dd60e01b90608401613757565b6000836001600160a01b0316856001600160a01b03161115613958579293925b846001600160a01b0316866001600160a01b031610156139845761397d858585614d3c565b90506138f7565b836001600160a01b0316866001600160a01b031610156139e65760006139ab878686614d3c565b905060006139ba878986614da6565b9050806001600160801b0316826001600160801b0316106139db57806139dd565b815b925050506138f7565b6139f1858584614da6565b9695505050505050565b6001600160a01b038216613a515760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610ab4565b8060356000828254613a639190615cc6565b90915550506001600160a01b03821660009081526033602052604081208054839290613a90908490615cc6565b90915550506040518181526001600160a01b03831690600090600080516020615fa78339815191529060200160405180910390a35050565b6000806000806000613ad86106e4565b91509150816000148015613aec5750600081115b15613b0357613afc8689836146ab565b9250613bb2565b80158015613b115750600082115b15613b2157613afc8789846146ab565b81158015613b2d575080155b15613b545760405162461bcd60e51b81526020600482015260006024820152604401610ab4565b6000613b61888a856146ab565b90506000613b70888b856146ab565b9050600082118015613b825750600081115b613b9e5760405162461bcd60e51b8152600401610ab490615bd4565b808210613bab5780613bad565b815b945050505b613bbd83838a6138a9565b9450613bca83828a6138a9565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff1691839150600090613c2357634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110613c6057634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613ca69085906004016159d6565b60006040518083038186803b158015613cbe57600080fd5b505afa158015613cd2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613cfa919081019061539b565b5090508051600214613d3d5760405162461bcd60e51b815260206004820152600c60248201526b0c2e4e4c2f240d8cadccee8d60a31b6044820152606401610ab4565b6098548151600091829163ffffffff90911660060b9084908390613d7157634e487b7160e01b600052603260045260246000fd5b602002602001015184600181518110613d9a57634e487b7160e01b600052603260045260246000fd5b60200260200101510360060b81613dc157634e487b7160e01b600052601260045260246000fd5b059050613dd08160020b61256b565b6097549092506000915061271090613df390600160f01b900461ffff1684615d18565b613dfd9190615cde565b90508415613e4557613e0f8183615dc8565b6001600160a01b0316866001600160a01b03161015613e405760405162461bcd60e51b8152600401610ab490615ad6565b613e80565b613e4f8183615ca4565b6001600160a01b0316866001600160a01b03161115613e805760405162461bcd60e51b8152600401610ab490615ad6565b505050505050565b609d546000906001600160a01b031663514ea4bf613ea4612505565b6040518263ffffffff1660e01b8152600401613ec291815260200190565b60a06040518083038186803b158015613eda57600080fd5b505afa158015613eee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f1291906156df565b5050609754929350600092839250613f419150600160a01b8104600290810b91600160b81b9004900b85613087565b609e54919350915060009081906001600160a01b03878116911614156141de57609754879061271090613f7f90600160d01b900461ffff1687615d47565b613f899190615d04565b1015613fa75760405162461bcd60e51b8152600401610ab490615b53565b60985461271090600160201b900461ffff16613fc38987615de8565b613fcd9190615d47565b613fd79190615d04565b60996000828254613fe89190615cc6565b90915550506098546127109061400990600160201b900461ffff1685615d47565b6140139190615d04565b609a60008282546140249190615cc6565b90915550612710905060646140398987615de8565b6140439190615d47565b61404d9190615d04565b609b600082825461405e9190615cc6565b909155506127109050614072606485615d47565b61407c9190615d04565b609c600082825461408d9190615cc6565b9091555050609b54609954609e546040516370a0823160e01b81528a9392916001600160a01b0316906370a08231906140ca90309060040161590c565b60206040518083038186803b1580156140e257600080fd5b505afa1580156140f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061411a9190615893565b6141249190615de8565b61412e9190615de8565b6141389190615de8565b609c54609a54609f546040516370a0823160e01b8152939550919290916001600160a01b0316906370a082319061417390309060040161590c565b60206040518083038186803b15801561418b57600080fd5b505afa15801561419f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141c39190615893565b6141cd9190615de8565b6141d79190615de8565b9050614454565b609f546001600160a01b03878116911614156136f55760975487906127109061421290600160d01b900461ffff1686615d47565b61421c9190615d04565b101561423a5760405162461bcd60e51b8152600401610ab490615b53565b6098546127109061425690600160201b900461ffff1686615d47565b6142609190615d04565b609960008282546142719190615cc6565b909155505060985461271090600160201b900461ffff166142928986615de8565b61429c9190615d47565b6142a69190615d04565b609a60008282546142b79190615cc6565b9091555061271090506142cb606486615d47565b6142d59190615d04565b609b60008282546142e69190615cc6565b90915550612710905060646142fb8986615de8565b6143059190615d47565b61430f9190615d04565b609c60008282546143209190615cc6565b9091555050609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a082319061435b90309060040161590c565b60206040518083038186803b15801561437357600080fd5b505afa158015614387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143ab9190615893565b6143b59190615de8565b6143bf9190615de8565b609c54609a54609f546040516370a0823160e01b81529395508a936001600160a01b03909116906370a08231906143fa90309060040161590c565b60206040518083038186803b15801561441257600080fd5b505afa158015614426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061444a9190615893565b6141c39190615de8565b60975461359d90600160a01b8104600290810b91600160b81b9004900b84848e8e8e6133f2565b600054610100900460ff1680614494575060005460ff16155b6144b05760405162461bcd60e51b8152600401610ab490615b05565b600054610100900460ff161580156144d2576000805461ffff19166101011790555b6144da614ddc565b6144e48383614e46565b801561378e576000805461ff0019169055505050565b600054610100900460ff1680614513575060005460ff16155b61452f5760405162461bcd60e51b8152600401610ab490615b05565b600054610100900460ff16158015614551576000805461ffff19166101011790555b614559614edb565b801561456b576000805461ff00191690555b50565b6001600160a01b0382166145ce5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610ab4565b6001600160a01b038216600090815260336020526040902054818110156146425760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610ab4565b61464c8282615de8565b6001600160a01b0384166000908152603360205260408120919091556035805484929061467a908490615de8565b90915550506040518281526000906001600160a01b03851690600080516020615fa7833981519152906020016124f8565b6000808060001985870985870292508281108382030391505080600014156146e557600084116146da57600080fd5b508290049050610ad7565b8084116146f157600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b609d5460405163a34123a760e01b815260009182916001600160a01b039091169063a34123a790614793908a908a908890600401615a2e565b6040805180830381600087803b1580156147ac57600080fd5b505af11580156147c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147e491906154e1565b609d54919350915060009081906001600160a01b031663514ea4bf614807612505565b6040518263ffffffff1660e01b815260040161482591815260200190565b60a06040518083038186803b15801561483d57600080fd5b505afa158015614851573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061487591906156df565b94509450505050600084836001600160801b03166148939190615de8565b905060006148aa856001600160801b038516615de8565b90506148b68282612e26565b90925090506148c689838a6146ab565b6148d09087615cc6565b95506148dd89828a6146ab565b6148e79086615cc6565b609d546040516309e3d67b60e31b81529196506001600160a01b031690634f1eb3d8906149209030908f908f908c908c90600401615962565b6040805180830381600087803b15801561493957600080fd5b505af115801561494d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061497191906156ad565b50505050505050505050505050565b6000826001600160a01b0316846001600160a01b031611156149a0579192915b6001600160a01b0384166149e0600160601b600160e01b03606085901b166149c88787615dc8565b6001600160a01b0316866001600160a01b03166146ab565b6129759190615d04565b6000826001600160a01b0316846001600160a01b03161115614a0a579192915b6129756001600160801b038316614a218686615dc8565b6001600160a01b0316600160601b6146ab565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c4016040805180830381600087803b158015614aa457600080fd5b505af1158015614ab8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614adc91906154e1565b9092509050614aeb828a615d66565b9350614af78189615d66565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015614b4957600080fd5b505afa158015614b5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b819190615751565b50505050505090506000614bae82614b9b8f60020b61256b565b614ba78f60020b61256b565b8989613938565b90506001600160801b03811615614c5a57609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b8152600401614c069493929190615920565b6040805180830381600087803b158015614c1f57600080fd5b505af1158015614c33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614c5791906154e1565b50505b5050505097509795505050505050565b6000614cbf826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614f4b9092919063ffffffff16565b80519091501561378e5780806020019051810190614cdd919061545e565b61378e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610ab4565b6000826001600160a01b0316846001600160a01b03161115614d5c579192915b6000614d7f856001600160a01b0316856001600160a01b0316600160601b6146ab565b90506138f7614da18483614d938989615dc8565b6001600160a01b03166146ab565b614f5a565b6000826001600160a01b0316846001600160a01b03161115614dc6579192915b612975614da183600160601b614d938888615dc8565b600054610100900460ff1680614df5575060005460ff16155b614e115760405162461bcd60e51b8152600401610ab490615b05565b600054610100900460ff16158015614559576000805461ffff1916610101179055801561456b576000805461ff001916905550565b600054610100900460ff1680614e5f575060005460ff16155b614e7b5760405162461bcd60e51b8152600401610ab490615b05565b600054610100900460ff16158015614e9d576000805461ffff19166101011790555b8251614eb09060369060208601906150d6565b508151614ec49060379060208501906150d6565b50801561378e576000805461ff0019169055505050565b600054610100900460ff1680614ef4575060005460ff16155b614f105760405162461bcd60e51b8152600401610ab490615b05565b600054610100900460ff16158015614f32576000805461ffff19166101011790555b6001606555801561456b576000805461ff001916905550565b60606129758484600085614f75565b806001600160801b0381168114614f7057600080fd5b919050565b606082471015614fd65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610ab4565b843b6150245760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610ab4565b600080866001600160a01b0316858760405161504091906158f0565b60006040518083038185875af1925050503d806000811461507d576040519150601f19603f3d011682016040523d82523d6000602084013e615082565b606091505b509150915061509282828661509d565b979650505050505050565b606083156150ac575081610ad7565b8251156150bc5782518084602001fd5b8160405162461bcd60e51b8152600401610ab49190615a54565b8280546150e290615e2b565b90600052602060002090601f016020900481019282615104576000855561514a565b82601f1061511d57805160ff191683800117855561514a565b8280016001018555821561514a579182015b8281111561514a57825182559160200191906001019061512f565b5061515692915061515a565b5090565b5b80821115615156576000815560010161515b565b600082601f83011261517f578081fd5b8151602061519461518f83615c5b565b615c2b565b80838252828201915082860187848660051b89010111156151b3578586fd5b855b858110156151da5781516151c881615f12565b845292840192908401906001016151b5565b5090979650505050505050565b60008083601f8401126151f8578182fd5b5081356001600160401b0381111561520e578182fd5b60208301915083602082850101111561522657600080fd5b9250929050565b8051600681900b8114614f7057600080fd5b600082601f83011261524f578081fd5b81356001600160401b0381111561526857615268615efc565b61527b601f8201601f1916602001615c2b565b81815284602083860101111561528f578283fd5b816020850160208301379081016020019190915292915050565b80516001600160801b0381168114614f7057600080fd5b6000602082840312156152d1578081fd5b8135610ad781615f12565b6000602082840312156152ed578081fd5b8151610ad781615f12565b6000806040838503121561530a578081fd5b823561531581615f12565b9150602083013561532581615f12565b809150509250929050565b600080600060608486031215615344578081fd5b833561534f81615f12565b9250602084013561535f81615f12565b929592945050506040919091013590565b60008060408385031215615382578182fd5b823561538d81615f12565b946020939093013593505050565b600080604083850312156153ad578182fd5b82516001600160401b03808211156153c3578384fd5b818501915085601f8301126153d6578384fd5b815160206153e661518f83615c5b565b8083825282820191508286018a848660051b8901011115615405578889fd5b8896505b8487101561542e5761541a8161522d565b835260019690960195918301918301615409565b5091880151919650909350505080821115615447578283fd5b506154548582860161516f565b9150509250929050565b60006020828403121561546f578081fd5b8151610ad781615f27565b600080600080600060a08688031215615491578283fd5b853561549c81615f35565b945060208601356154ac81615f35565b935060408601356154bc81615f12565b92506060860135915060808601356154d381615f27565b809150509295509295909350565b600080604083850312156154f3578182fd5b505080516020909101519092909150565b60008060008060608587031215615519578182fd5b843593506020850135925060408501356001600160401b0381111561553c578283fd5b615548878288016151e7565b95989497509550505050565b600080600080600080600060e0888a03121561556e578485fd5b87356001600160401b0380821115615584578687fd5b6155908b838c0161523f565b985060208a01359150808211156155a5578687fd5b506155b28a828b0161523f565b96505060408801356155c381615f12565b945060608801356155d381615f44565b935060808801356155e381615f35565b925060a08801356155f381615f35565b915060c088013561560381615f12565b8091505092959891949750929550565b600080600080600080600080610100898b03121561562f578182fd5b615638896152a9565b9750602089015180600f0b811461564d578283fd5b60408a015160608b01519198509650945061566a60808a0161522d565b935060a089015161567a81615f12565b60c08a015190935061568b81615f54565b60e08a015190925061569c81615f27565b809150509295985092959890939650565b600080604083850312156156bf578182fd5b6156c8836152a9565b91506156d6602084016152a9565b90509250929050565b600080600080600060a086880312156156f6578283fd5b6156ff866152a9565b9450602086015193506040860151925061571b606087016152a9565b9150615729608087016152a9565b90509295509295909350565b600060208284031215615746578081fd5b8135610ad781615f44565b600080600080600080600060e0888a03121561576b578081fd5b875161577681615f12565b602089015190975061578781615f35565b604089015190965061579881615f44565b60608901519095506157a981615f44565b60808901519094506157ba81615f44565b60a089015190935060ff811681146157d0578182fd5b60c089015190925061560381615f27565b600080600080600060a086880312156157f8578283fd5b853561580381615f12565b945060208601359350604086013561581a81615f27565b92506060860135915060808601356154d381615f12565b600080600080600060a08688031215615848578283fd5b853561585381615f44565b9450602086013561586381615f44565b9350604086013561587381615f44565b9250606086013561588381615f54565b915060808601356154d381615f12565b6000602082840312156158a4578081fd5b5051919050565b600080604083850312156158bd578182fd5b82359150602083013561532581615f12565b600080604083850312156158e1578182fd5b50508035926020909101359150565b60008251615902818460208701615dff565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b6001600160a01b03959095168552600293840b60208601529190920b60408401526001600160801b03918216606084015216608082015260a00190565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b6020808252825182820181905260009190848201906040850190845b81811015615a1457835163ffffffff16835292840192918401916001016159f2565b50909695505050505050565b60029190910b815260200190565b600293840b81529190920b60208201526001600160801b03909116604082015260600190565b6020815260008251806020840152615a73816040850160208701615dff565b601f01601f19169190910160400192915050565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252600490820152636d42505360e01b604082015260600190565b602080825260159082015274756e61636365707461626c6520736c69707061676560581b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260089082015267686967682066656560c01b604082015260600190565b60208082526003908201526242505360e81b604082015260600190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b604051601f8201601f191681016001600160401b0381118282101715615c5357615c53615efc565b604052919050565b60006001600160401b03821115615c7457615c74615efc565b5060051b60200190565b600061ffff808316818516808303821115615c9b57615c9b615ed0565b01949350505050565b60006001600160a01b03828116848216808303821115615c9b57615c9b615ed0565b60008219821115615cd957615cd9615ed0565b500190565b60006001600160a01b0383811680615cf857615cf8615ee6565b92169190910492915050565b600082615d1357615d13615ee6565b500490565b60006001600160a01b0382811684821681151582840482111615615d3e57615d3e615ed0565b02949350505050565b6000816000190483118215151615615d6157615d61615ed0565b500290565b60008083128015600160ff1b850184121615615d8457615d84615ed0565b6001600160ff1b0384018313811615615d9f57615d9f615ed0565b50500390565b600061ffff83811690831681811015615dc057615dc0615ed0565b039392505050565b60006001600160a01b0383811690831681811015615dc057615dc0615ed0565b600082821015615dfa57615dfa615ed0565b500390565b60005b83811015615e1a578181015183820152602001615e02565b8381111561105c5750506000910152565b600181811c90821680615e3f57607f821691505b60208210811415615e6057634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615e7a57615e7a615ed0565b5060010190565b600082615e9057615e90615ee6565b500690565b60008160020b627fffff19811415615eaf57615eaf615ed0565b9003919050565b6000600160ff1b821415615ecc57615ecc615ed0565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461456b57600080fd5b801515811461456b57600080fd5b8060020b811461456b57600080fd5b61ffff8116811461456b57600080fd5b63ffffffff8116811461456b57600080fdfea40d93a72f8af7b904f2e4a60095955bfcaa3c724969f731bd8bc1fda226a1718be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220b3da908b505a5534b959b8272126080a608704282cb04ad50559eecb89a982ac64736f6c63430008040033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061021a5760003560e01c8063065756db1461021f57806306fdde031461023b578063095ea7b3146102505780630dfe1681146102735780631322d9541461029357806316f0115b146102b057806318160ddd146102c357806323b872dd146102cb57806324b8fd1b146102de57806331366be4146102f3578063313ce5671461030e578063395093511461031d5780633d8b30e11461033057806342fb9d4414610345578063481c6a751461034e57806354fd4d5014610356578063672152bd1461037a57806370a082311461039f578063715018a6146103c8578063727dd228146103d057806378ac6357146103f157806394bf804d1461040457806395d89b411461043b5780639894f21a1461044357806399fd808c146104715780639b1344ac14610484578063a457c2d714610498578063a50b1fe7146104ab578063a9059cbb146104c0578063b135c99f146104d3578063b536bd12146104e6578063be93dd5f146104ef578063c345445914610502578063cc95353e1461050b578063ccdf7a0214610525578063d21220a71461053a578063d34879971461054d578063d6e7ff3914610560578063dd62ed3e14610575578063df28408a146105ae578063e25e15e3146105b6578063e4077894146105c9578063eff557a7146105dc578063f2fde38b14610603578063fa461e3314610616578063fcd3533c14610629575b600080fd5b61022860995481565b6040519081526020015b60405180910390f35b61024361063c565b6040516102329190615a54565b61026361025e366004615370565b6106ce565b6040519015158152602001610232565b609e54610286906001600160a01b031681565b604051610232919061590c565b61029b6106e4565b60408051928352602083019190915201610232565b609d54610286906001600160a01b031681565b603554610228565b6102636102d9366004615330565b610a26565b6102f16102ec36600461547a565b610ade565b005b6102fb606481565b60405161ffff9091168152602001610232565b60405160128152602001610232565b61026361032b366004615370565b610e6b565b6097546102fb90600160e01b900461ffff1681565b610228609a5481565b610286610ea2565b610243604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038a9063ffffffff1681565b60405163ffffffff9091168152602001610232565b6102286103ad3660046152c0565b6001600160a01b031660009081526033602052604090205490565b6102f1610eb1565b6097546103e490600160b81b900460020b81565b6040516102329190615a20565b6102f16103ff3660046158ab565b610f07565b6104176104123660046158ab565b611062565b6040805193845260208401929092526001600160801b031690820152606001610232565b610243611466565b6104566104513660046158cf565b611475565b60408051938452602084019290925290820152606001610232565b6102f161047f366004615831565b6115c7565b6097546103e490600160a01b900460020b81565b6102636104a6366004615370565b611787565b6097546102fb90600160d01b900461ffff1681565b6102636104ce366004615370565b611822565b6102f16104e13660046157e1565b61182f565b610228609b5481565b6102f16104fd3660046158ab565b611972565b610228609c5481565b60985461028690600160301b90046001600160a01b031681565b6098546102fb90600160201b900461ffff1681565b609f54610286906001600160a01b031681565b6102f161055b366004615504565b611a58565b6097546102fb90600160f01b900461ffff1681565b6102286105833660046152f8565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b610228611aa9565b6102f16105c4366004615554565b611ab8565b6102f16105d7366004615735565b611d55565b6102867f000000000000000000000000000000000000000000000000000000000000000081565b6102f16106113660046152c0565b611e2b565b6102f1610624366004615504565b611f0b565b6104176106373660046158ab565b611f62565b60606036805461064b90615e2b565b80601f016020809104026020016040519081016040528092919081815260200182805461067790615e2b565b80156106c45780601f10610699576101008083540402835291602001916106c4565b820191906000526020600020905b8154815290600101906020018083116106a757829003601f168201915b5050505050905090565b60006106db3384846123e0565b50600192915050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf61070c612505565b6040518263ffffffff1660e01b815260040161072a91815260200190565b60a06040518083038186803b15801561074257600080fd5b505afa158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a91906156df565b94509450945094509450600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b1580156107d557600080fd5b505afa1580156107e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080d9190615751565b50505050509150915061085582610835609760149054906101000a900460020b60020b61256b565b60975461084f90600160b81b9004600290810b900b61256b565b8a61297d565b909950975060006001600160801b038516610873600189858c612a1a565b61087d9190615cc6565b90506000846001600160801b0316610898600089868d612a1a565b6108a29190615cc6565b90506108ae8282612e26565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a08231906108ec90309060040161590c565b60206040518083038186803b15801561090457600080fd5b505afa158015610918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c9190615893565b6109469085615cc6565b6109509190615de8565b61095a9190615de8565b610964908c615cc6565b609c54609a54609f546040516370a0823160e01b8152939e50919290916001600160a01b0316906370a082319061099f90309060040161590c565b60206040518083038186803b1580156109b757600080fd5b505afa1580156109cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ef9190615893565b6109f99084615cc6565b610a039190615de8565b610a0d9190615de8565b610a17908b615cc6565b99505050505050505050509091565b6000610a33848484612ec1565b6001600160a01b038416600090815260346020908152604080832033845290915290205482811015610abd5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610ad18533610acc8685615de8565b6123e0565b60019150505b9392505050565b33610ae7610ea2565b6001600160a01b031614610b0d5760405162461bcd60e51b8152600401610ab490615b92565b609d546000906001600160a01b031663514ea4bf610b29612505565b6040518263ffffffff1660e01b8152600401610b4791815260200190565b60a06040518083038186803b158015610b5f57600080fd5b505afa158015610b73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9791906156df565b5050609754929350600092839250610bc69150600160a01b8104600290810b91600160b81b9004900b85613087565b609854919350915061271090610be790600160201b900461ffff1684615d47565b610bf19190615d04565b60996000828254610c029190615cc6565b909155505060985461271090610c2390600160201b900461ffff1683615d47565b610c2d9190615d04565b609a6000828254610c3e9190615cc6565b909155506127109050610c52606484615d47565b610c5c9190615d04565b609b6000828254610c6d9190615cc6565b909155506127109050610c81606483615d47565b610c8b9190615d04565b609c6000828254610c9c9190615cc6565b909155505060978054600289810b62ffffff908116600160b81b0262ffffff60b81b19928d900b909116600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610d1e90309060040161590c565b60206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e9190615893565b610d789190615de8565b610d829190615de8565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610dbe90309060040161590c565b60206040518083038186803b158015610dd657600080fd5b505afa158015610dea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0e9190615893565b610e189190615de8565b610e229190615de8565b9050610e338a8a84848c8c8c6133f2565b6040805160028c810b82528b900b6020820152600080516020615f67833981519152910160405180910390a150505050505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106db918590610acc908690615cc6565b6097546001600160a01b031690565b33610eba610ea2565b6001600160a01b031614610ee05760405162461bcd60e51b8152600401610ab490615b92565b60988054600160201b600160d01b031916905560006099819055609a55610f056135a9565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f515760405162461bcd60e51b8152600401610ab490615a87565b600080610f64609954609a548888613610565b60006099819055609a5590925090508115610f9e57609854609e54610f9e916001600160a01b0391821691600160301b909104168461372b565b8015610fc957609854609f54610fc9916001600160a01b0391821691600160301b909104168361372b565b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611028576110236001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683613793565b61105c565b61105c6001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000008461372b565b50505050565b60008060006002606554141561108a5760405162461bcd60e51b8152600401610ab490615bf4565b6002606555846110ac5760405162461bcd60e51b8152600401610ab490615bd4565b60006110b760355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561110957600080fd5b505afa15801561111d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111419190615751565b505050505050905060008211156111825760008061115d6106e4565b9150915061116c828a866138a9565b9650611179818a866138a9565b955050506111bb565b6001600160801b0387111561119657600080fd5b6111b581610835609760149054906101000a900460020b60020b61256b565b90955093505b84156111d957609e546111d9906001600160a01b0316333088613900565b83156111f757609f546111f7906001600160a01b0316333087613900565b61136981611216609760149054906101000a900460020b60020b61256b565b60975461123090600160b81b9004600290810b900b61256b565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a082319061126690309060040161590c565b60206040518083038186803b15801561127e57600080fd5b505afa158015611292573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b69190615893565b6112c09190615de8565b6112ca9190615de8565b609c54609a54609f546040516370a0823160e01b81526001600160a01b03909116906370a082319061130090309060040161590c565b60206040518083038186803b15801561131857600080fd5b505afa15801561132c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113509190615893565b61135a9190615de8565b6113649190615de8565b613938565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d916113b9913091600160a01b8104600290810b92600160b81b909204900b908990600401615920565b6040805180830381600087803b1580156113d257600080fd5b505af11580156113e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140a91906154e1565b505061141686886139fb565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e7868887878760405161144d95949392919061599f565b60405180910390a1505060016065819055509250925092565b60606037805461064b90615e2b565b60008060008061148460355490565b905080156114a357611497818787613ac8565b919550935091506115bf565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b1580156114e857600080fd5b505afa1580156114fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115209190615751565b5050505050509050600061156a82611549609760149054906101000a900460020b60020b61256b565b60975461156390600160b81b9004600290810b900b61256b565b8b8b613938565b9050806001600160801b031693506115b782611597609760149054906101000a900460020b60020b61256b565b6097546115b190600160b81b9004600290810b900b61256b565b8461297d565b909650945050505b509250925092565b336115d0610ea2565b6001600160a01b0316146115f65760405162461bcd60e51b8152600401610ab490615b92565b6127108461ffff16111561161c5760405162461bcd60e51b8152600401610ab490615b75565b6127108561ffff1611156116425760405162461bcd60e51b8152600401610ab490615b75565b6127108361ffff1611156116685760405162461bcd60e51b8152600401610ab490615b75565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff8516156116df576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff841615611704576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561172a57609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff82161561174c576098805463ffffffff191663ffffffff84161790555b6001600160a01b038116156117805760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156118095760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610ab4565b6118183385610acc8685615de8565b5060019392505050565b60006106db338484612ec1565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118795760405162461bcd60e51b8152600401610ab490615a87565b8515611889576118898786613bd7565b6118968787878787613e88565b60975460408051600160a01b8304600290810b810b8252600160b81b909304830b90920b6020830152600080516020615f67833981519152910160405180910390a16001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611935576119306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683613793565b611969565b6119696001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000008461372b565b50505050505050565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146119bc5760405162461bcd60e51b8152600401610ab490615a87565b6000806119cf609b54609c548888613610565b6000609b819055609c5590925090508115611a1b57609e54611a1b906001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000008461372b565b8015610fc957609f54610fc9906001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000008361372b565b609d546001600160a01b03163314611a6f57600080fd5b8315611a8c57609e54611a8c906001600160a01b0316338661372b565b821561105c57609f5461105c906001600160a01b0316338561372b565b6000611ab3612505565b905090565b600054610100900460ff1680611ad1575060005460ff16155b611aed5760405162461bcd60e51b8152600401610ab490615b05565b600054610100900460ff16158015611b0f576000805461ffff19166101011790555b611b1c6064612710615da5565b61ffff168561ffff161115611b435760405162461bcd60e51b8152600401610ab490615ab8565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe168191600480820192602092909190829003018186803b158015611b9757600080fd5b505afa158015611bab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bcf91906152dc565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611c2857600080fd5b505afa158015611c3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6091906152dc565b609f80546001600160a01b03199081166001600160a01b0393841617909155609880546097805461012c65ffffffffffff19909316600160201b61ffff8d160263ffffffff19161792909217600160301b600160d01b031916600160301b95881695860217909255643e800c801960d31b600165ffffff00000160a01b03909116600160a01b60028a810b62ffffff908116929092029290921792909217600165ffffff00000160a01b031916600160b81b9189900b9290921602909216919091179091179055611d31888861447b565b611d396144fa565b8015611d4b576000805461ff00191690555b5050505050505050565b33611d5e610ea2565b6001600160a01b031614611d845760405162461bcd60e51b8152600401610ab490615b92565b609854600160201b900461ffff1615611dc55760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610ab4565b60008161ffff16118015611ded5750611de16064612710615da5565b61ffff168161ffff1611155b611e095760405162461bcd60e51b8152600401610ab490615ab8565b6098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611e34610ea2565b6001600160a01b031614611e5a5760405162461bcd60e51b8152600401610ab490615b92565b6001600160a01b038116611ec15760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610ab4565b6097546040516001600160a01b03808416921690600080516020615f8783398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611f2257600080fd5b6000841315611f4257609e54611023906001600160a01b0316338661372b565b600083131561105c57609f5461105c906001600160a01b0316338561372b565b600080600060026065541415611f8a5760405162461bcd60e51b8152600401610ab490615bf4565b600260655584611fc55760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610ab4565b6000611fd060355490565b609d549091506000906001600160a01b031663514ea4bf611fef612505565b6040518263ffffffff1660e01b815260040161200d91815260200190565b60a06040518083038186803b15801561202557600080fd5b505afa158015612039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061205d91906156df565b50505050905061206d338861456e565b600061208388836001600160801b0316856146ab565b90506001600160801b03811061209857600080fd5b609e546040516370a0823160e01b815291945084916000916001600160a01b0316906370a08231906120ce90309060040161590c565b60206040518083038186803b1580156120e657600080fd5b505afa1580156120fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061211e9190615893565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061215490309060040161590c565b60206040518083038186803b15801561216c57600080fd5b505afa158015612180573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121a49190615893565b905060006121cd8b609b54609954866121bd9190615de8565b6121c79190615de8565b886146ab565b905060006121f68c609c54609a54866121e69190615de8565b6121f09190615de8565b896146ab565b60975490915061221e90600160a01b8104600290810b91600160b81b9004900b8e8a8c61475a565b609e546040516370a0823160e01b8152839186916001600160a01b03909116906370a082319061225290309060040161590c565b60206040518083038186803b15801561226a57600080fd5b505afa15801561227e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122a29190615893565b6122ac9190615de8565b6122b69190615cc6565b609f546040516370a0823160e01b8152919b50829185916001600160a01b0316906370a08231906122eb90309060040161590c565b60206040518083038186803b15801561230357600080fd5b505afa158015612317573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233b9190615893565b6123459190615de8565b61234f9190615cc6565b9850891561236e57609e5461236e906001600160a01b03168c8c61372b565b881561238b57609f5461238b906001600160a01b03168c8b61372b565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c6040516123c295949392919061599f565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b0383166124425760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610ab4565b6001600160a01b0382166124a35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610ab4565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6097546040516001600160601b03193060601b166020820152600160a01b8204600290810b810b60e890811b6034840152600160b81b909304810b900b90911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b60008060008360020b12612582578260020b61258f565b8260020b61258f90615eb6565b905061259e620d89e719615e95565b60020b8111156125d45760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610ab4565b6000600182166125e857600160801b6125fa565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561262f57608061262a826ffff97272373d413259a46990580e213a615d47565b901c90505b6004821615612659576080612654826ffff2e50f5f656932ef12357cf3c7fdcc615d47565b901c90505b600882161561268357608061267e826fffe5caca7e10e4e61c3624eaa0941cd0615d47565b901c90505b60108216156126ad5760806126a8826fffcb9843d60f6159c9db58835c926644615d47565b901c90505b60208216156126d75760806126d2826fff973b41fa98c081472e6896dfb254c0615d47565b901c90505b60408216156127015760806126fc826fff2ea16466c96a3843ec78b326b52861615d47565b901c90505b608082161561272b576080612726826ffe5dee046a99a2a811c461f1969c3053615d47565b901c90505b610100821615612756576080612751826ffcbe86c7900a88aedcffc83b479aa3a4615d47565b901c90505b61020082161561278157608061277c826ff987a7253ac413176f2b074cf7815e54615d47565b901c90505b6104008216156127ac5760806127a7826ff3392b0822b70005940c7a398e4b70f3615d47565b901c90505b6108008216156127d75760806127d2826fe7159475a2c29b7443b29c7fa6e889d9615d47565b901c90505b6110008216156128025760806127fd826fd097f3bdfd2022b8845ad8f792aa5825615d47565b901c90505b61200082161561282d576080612828826fa9f746462d870fdf8a65dc1f90e061e5615d47565b901c90505b614000821615612858576080612853826f70d869a156d2a1b890bb3df62baf32f7615d47565b901c90505b61800082161561288357608061287e826f31be135f97d08fd981231505542fcfa6615d47565b901c90505b620100008216156128af5760806128aa826f09aa508b5b7a84e1c677de54f3e99bc9615d47565b901c90505b620200008216156128da5760806128d5826e5d6af8dedb81196699c329225ee604615d47565b901c90505b620400008216156129045760806128ff826d2216e584f5fa1ea926041bedfe98615d47565b901c90505b6208000082161561292c576080612927826b048a170391f7dc42444e8fa2615d47565b901c90505b60008460020b13156129475761294481600019615d04565b90505b612955600160201b82615e81565b15612961576001612964565b60005b6129759060ff16602083901c615cc6565b949350505050565b600080836001600160a01b0316856001600160a01b0316111561299e579293925b846001600160a01b0316866001600160a01b031610156129ca576129c3858585614980565b9150612a11565b836001600160a01b0316866001600160a01b03161015612a03576129ef868585614980565b91506129fc8587856149ea565b9050612a11565b612a0e8585856149ea565b90505b94509492505050565b6000806000808715612be757609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b815260040160206040518083038186803b158015612a7457600080fd5b505afa158015612a88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aac9190615893565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba9391612aec91600160a01b90910460020b90600401615a20565b6101006040518083038186803b158015612b0557600080fd5b505afa158015612b19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b3d9190615613565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba939550612b8694600160b81b90910460020b93506004019150615a209050565b6101006040518083038186803b158015612b9f57600080fd5b505afa158015612bb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd79190615613565b50939750612da295505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b815260040160206040518083038186803b158015612c3557600080fd5b505afa158015612c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c6d9190615893565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba9391612cad91600160a01b90910460020b90600401615a20565b6101006040518083038186803b158015612cc657600080fd5b505afa158015612cda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cfe9190615613565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba939550612d469450600160b81b900460020b926004019150615a209050565b6101006040518083038186803b158015612d5f57600080fd5b505afa158015612d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d979190615613565b509297505050505050505b6000609760149054906101000a900460020b60020b8760020b12612dc7575082612dcc565b508281035b6000609760179054906101000a900460020b60020b8860020b1215612df2575082612df7565b508282035b818303819003612e176001600160801b0389168b8303600160801b6146ab565b9b9a5050505050505050505050565b6000806000612710609860049054906101000a900461ffff166064612e4b9190615c7e565b612e599061ffff1687615d47565b612e639190615d04565b60985490915060009061271090612e8690600160201b900461ffff166064615c7e565b612e949061ffff1687615d47565b612e9e9190615d04565b9050612eaa8287615de8565b9350612eb68186615de8565b925050509250929050565b6001600160a01b038316612f255760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610ab4565b6001600160a01b038216612f875760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610ab4565b6001600160a01b03831660009081526033602052604090205481811015612fff5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610ab4565b6130098282615de8565b6001600160a01b03808616600090815260336020526040808220939093559085168152908120805484929061303f908490615cc6565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615fa78339815191528460405161307991815260200190565b60405180910390a350505050565b609e546040516370a0823160e01b8152600091829182916001600160a01b0316906370a08231906130bc90309060040161590c565b60206040518083038186803b1580156130d457600080fd5b505afa1580156130e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061310c9190615893565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061314290309060040161590c565b60206040518083038186803b15801561315a57600080fd5b505afa15801561316e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131929190615893565b609d5460405163a34123a760e01b815291925060009182916001600160a01b03169063a34123a7906131cc908c908c908c90600401615a2e565b6040805180830381600087803b1580156131e557600080fd5b505af11580156131f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061321d91906154e1565b609d546040516309e3d67b60e31b81529294509092506001600160a01b031690634f1eb3d8906132609030908d908d906001600160801b03908190600401615962565b6040805180830381600087803b15801561327957600080fd5b505af115801561328d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132b191906156ad565b5050609e546040516370a0823160e01b8152839186916001600160a01b03909116906370a08231906132e790309060040161590c565b60206040518083038186803b1580156132ff57600080fd5b505afa158015613313573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133379190615893565b6133419190615de8565b61334b9190615de8565b609f546040516370a0823160e01b8152919750829185916001600160a01b0316906370a082319061338090309060040161590c565b60206040518083038186803b15801561339857600080fd5b505afa1580156133ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133d09190615893565b6133da9190615de8565b6133e49190615de8565b945050505050935093915050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b15801561343757600080fd5b505afa15801561344b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061346f9190615751565b5050505050509050600061349c826134898b60020b61256b565b6134958b60020b61256b565b8a8a613938565b90506001600160801b0381161561355957609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d906134e89030908f908f908990600401615920565b6040805180830381600087803b15801561350157600080fd5b505af1158015613515573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061353991906154e1565b9092509050613548828a615de8565b98506135548189615de8565b975050505b6000612710858561356a578861356c565b895b6135769190615d47565b6135809190615d04565b9050600081131561359d5761359a8a8a8a8a858b8a614a34565b50505b50505050505050505050565b336135b2610ea2565b6001600160a01b0316146135d85760405162461bcd60e51b8152600401610ab490615b92565b6097546040516000916001600160a01b031690600080516020615f87833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b03848116911614156136855760975484906127109061364990600160e01b900461ffff1689615d47565b6136539190615d04565b10156136715760405162461bcd60e51b8152600401610ab490615b53565b61367b8487615de8565b9150849050612a11565b609f546001600160a01b03848116911614156136f5576097548490612710906136b990600160e01b900461ffff1688615d47565b6136c39190615d04565b10156136e15760405162461bcd60e51b8152600401610ab490615b53565b6136eb8486615de8565b9050859150612a11565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610ab4565b6040516001600160a01b03831660248201526044810182905261378e90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614c6a565b505050565b804710156137e35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610ab4565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613830576040519150601f19603f3d011682016040523d82523d6000602084013e613835565b606091505b505090508061378e5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610ab4565b60006138b68484846146ab565b9050600082806138d657634e487b7160e01b600052601260045260246000fd5b8486091115610ad75760001981106138ed57600080fd5b806138f781615e66565b95945050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261105c9085906323b872dd60e01b90608401613757565b6000836001600160a01b0316856001600160a01b03161115613958579293925b846001600160a01b0316866001600160a01b031610156139845761397d858585614d3c565b90506138f7565b836001600160a01b0316866001600160a01b031610156139e65760006139ab878686614d3c565b905060006139ba878986614da6565b9050806001600160801b0316826001600160801b0316106139db57806139dd565b815b925050506138f7565b6139f1858584614da6565b9695505050505050565b6001600160a01b038216613a515760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610ab4565b8060356000828254613a639190615cc6565b90915550506001600160a01b03821660009081526033602052604081208054839290613a90908490615cc6565b90915550506040518181526001600160a01b03831690600090600080516020615fa78339815191529060200160405180910390a35050565b6000806000806000613ad86106e4565b91509150816000148015613aec5750600081115b15613b0357613afc8689836146ab565b9250613bb2565b80158015613b115750600082115b15613b2157613afc8789846146ab565b81158015613b2d575080155b15613b545760405162461bcd60e51b81526020600482015260006024820152604401610ab4565b6000613b61888a856146ab565b90506000613b70888b856146ab565b9050600082118015613b825750600081115b613b9e5760405162461bcd60e51b8152600401610ab490615bd4565b808210613bab5780613bad565b815b945050505b613bbd83838a6138a9565b9450613bca83828a6138a9565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff1691839150600090613c2357634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110613c6057634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613ca69085906004016159d6565b60006040518083038186803b158015613cbe57600080fd5b505afa158015613cd2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613cfa919081019061539b565b5090508051600214613d3d5760405162461bcd60e51b815260206004820152600c60248201526b0c2e4e4c2f240d8cadccee8d60a31b6044820152606401610ab4565b6098548151600091829163ffffffff90911660060b9084908390613d7157634e487b7160e01b600052603260045260246000fd5b602002602001015184600181518110613d9a57634e487b7160e01b600052603260045260246000fd5b60200260200101510360060b81613dc157634e487b7160e01b600052601260045260246000fd5b059050613dd08160020b61256b565b6097549092506000915061271090613df390600160f01b900461ffff1684615d18565b613dfd9190615cde565b90508415613e4557613e0f8183615dc8565b6001600160a01b0316866001600160a01b03161015613e405760405162461bcd60e51b8152600401610ab490615ad6565b613e80565b613e4f8183615ca4565b6001600160a01b0316866001600160a01b03161115613e805760405162461bcd60e51b8152600401610ab490615ad6565b505050505050565b609d546000906001600160a01b031663514ea4bf613ea4612505565b6040518263ffffffff1660e01b8152600401613ec291815260200190565b60a06040518083038186803b158015613eda57600080fd5b505afa158015613eee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f1291906156df565b5050609754929350600092839250613f419150600160a01b8104600290810b91600160b81b9004900b85613087565b609e54919350915060009081906001600160a01b03878116911614156141de57609754879061271090613f7f90600160d01b900461ffff1687615d47565b613f899190615d04565b1015613fa75760405162461bcd60e51b8152600401610ab490615b53565b60985461271090600160201b900461ffff16613fc38987615de8565b613fcd9190615d47565b613fd79190615d04565b60996000828254613fe89190615cc6565b90915550506098546127109061400990600160201b900461ffff1685615d47565b6140139190615d04565b609a60008282546140249190615cc6565b90915550612710905060646140398987615de8565b6140439190615d47565b61404d9190615d04565b609b600082825461405e9190615cc6565b909155506127109050614072606485615d47565b61407c9190615d04565b609c600082825461408d9190615cc6565b9091555050609b54609954609e546040516370a0823160e01b81528a9392916001600160a01b0316906370a08231906140ca90309060040161590c565b60206040518083038186803b1580156140e257600080fd5b505afa1580156140f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061411a9190615893565b6141249190615de8565b61412e9190615de8565b6141389190615de8565b609c54609a54609f546040516370a0823160e01b8152939550919290916001600160a01b0316906370a082319061417390309060040161590c565b60206040518083038186803b15801561418b57600080fd5b505afa15801561419f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141c39190615893565b6141cd9190615de8565b6141d79190615de8565b9050614454565b609f546001600160a01b03878116911614156136f55760975487906127109061421290600160d01b900461ffff1686615d47565b61421c9190615d04565b101561423a5760405162461bcd60e51b8152600401610ab490615b53565b6098546127109061425690600160201b900461ffff1686615d47565b6142609190615d04565b609960008282546142719190615cc6565b909155505060985461271090600160201b900461ffff166142928986615de8565b61429c9190615d47565b6142a69190615d04565b609a60008282546142b79190615cc6565b9091555061271090506142cb606486615d47565b6142d59190615d04565b609b60008282546142e69190615cc6565b90915550612710905060646142fb8986615de8565b6143059190615d47565b61430f9190615d04565b609c60008282546143209190615cc6565b9091555050609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a082319061435b90309060040161590c565b60206040518083038186803b15801561437357600080fd5b505afa158015614387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143ab9190615893565b6143b59190615de8565b6143bf9190615de8565b609c54609a54609f546040516370a0823160e01b81529395508a936001600160a01b03909116906370a08231906143fa90309060040161590c565b60206040518083038186803b15801561441257600080fd5b505afa158015614426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061444a9190615893565b6141c39190615de8565b60975461359d90600160a01b8104600290810b91600160b81b9004900b84848e8e8e6133f2565b600054610100900460ff1680614494575060005460ff16155b6144b05760405162461bcd60e51b8152600401610ab490615b05565b600054610100900460ff161580156144d2576000805461ffff19166101011790555b6144da614ddc565b6144e48383614e46565b801561378e576000805461ff0019169055505050565b600054610100900460ff1680614513575060005460ff16155b61452f5760405162461bcd60e51b8152600401610ab490615b05565b600054610100900460ff16158015614551576000805461ffff19166101011790555b614559614edb565b801561456b576000805461ff00191690555b50565b6001600160a01b0382166145ce5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610ab4565b6001600160a01b038216600090815260336020526040902054818110156146425760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610ab4565b61464c8282615de8565b6001600160a01b0384166000908152603360205260408120919091556035805484929061467a908490615de8565b90915550506040518281526000906001600160a01b03851690600080516020615fa7833981519152906020016124f8565b6000808060001985870985870292508281108382030391505080600014156146e557600084116146da57600080fd5b508290049050610ad7565b8084116146f157600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b609d5460405163a34123a760e01b815260009182916001600160a01b039091169063a34123a790614793908a908a908890600401615a2e565b6040805180830381600087803b1580156147ac57600080fd5b505af11580156147c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147e491906154e1565b609d54919350915060009081906001600160a01b031663514ea4bf614807612505565b6040518263ffffffff1660e01b815260040161482591815260200190565b60a06040518083038186803b15801561483d57600080fd5b505afa158015614851573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061487591906156df565b94509450505050600084836001600160801b03166148939190615de8565b905060006148aa856001600160801b038516615de8565b90506148b68282612e26565b90925090506148c689838a6146ab565b6148d09087615cc6565b95506148dd89828a6146ab565b6148e79086615cc6565b609d546040516309e3d67b60e31b81529196506001600160a01b031690634f1eb3d8906149209030908f908f908c908c90600401615962565b6040805180830381600087803b15801561493957600080fd5b505af115801561494d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061497191906156ad565b50505050505050505050505050565b6000826001600160a01b0316846001600160a01b031611156149a0579192915b6001600160a01b0384166149e0600160601b600160e01b03606085901b166149c88787615dc8565b6001600160a01b0316866001600160a01b03166146ab565b6129759190615d04565b6000826001600160a01b0316846001600160a01b03161115614a0a579192915b6129756001600160801b038316614a218686615dc8565b6001600160a01b0316600160601b6146ab565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c4016040805180830381600087803b158015614aa457600080fd5b505af1158015614ab8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614adc91906154e1565b9092509050614aeb828a615d66565b9350614af78189615d66565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015614b4957600080fd5b505afa158015614b5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b819190615751565b50505050505090506000614bae82614b9b8f60020b61256b565b614ba78f60020b61256b565b8989613938565b90506001600160801b03811615614c5a57609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b8152600401614c069493929190615920565b6040805180830381600087803b158015614c1f57600080fd5b505af1158015614c33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614c5791906154e1565b50505b5050505097509795505050505050565b6000614cbf826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614f4b9092919063ffffffff16565b80519091501561378e5780806020019051810190614cdd919061545e565b61378e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610ab4565b6000826001600160a01b0316846001600160a01b03161115614d5c579192915b6000614d7f856001600160a01b0316856001600160a01b0316600160601b6146ab565b90506138f7614da18483614d938989615dc8565b6001600160a01b03166146ab565b614f5a565b6000826001600160a01b0316846001600160a01b03161115614dc6579192915b612975614da183600160601b614d938888615dc8565b600054610100900460ff1680614df5575060005460ff16155b614e115760405162461bcd60e51b8152600401610ab490615b05565b600054610100900460ff16158015614559576000805461ffff1916610101179055801561456b576000805461ff001916905550565b600054610100900460ff1680614e5f575060005460ff16155b614e7b5760405162461bcd60e51b8152600401610ab490615b05565b600054610100900460ff16158015614e9d576000805461ffff19166101011790555b8251614eb09060369060208601906150d6565b508151614ec49060379060208501906150d6565b50801561378e576000805461ff0019169055505050565b600054610100900460ff1680614ef4575060005460ff16155b614f105760405162461bcd60e51b8152600401610ab490615b05565b600054610100900460ff16158015614f32576000805461ffff19166101011790555b6001606555801561456b576000805461ff001916905550565b60606129758484600085614f75565b806001600160801b0381168114614f7057600080fd5b919050565b606082471015614fd65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610ab4565b843b6150245760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610ab4565b600080866001600160a01b0316858760405161504091906158f0565b60006040518083038185875af1925050503d806000811461507d576040519150601f19603f3d011682016040523d82523d6000602084013e615082565b606091505b509150915061509282828661509d565b979650505050505050565b606083156150ac575081610ad7565b8251156150bc5782518084602001fd5b8160405162461bcd60e51b8152600401610ab49190615a54565b8280546150e290615e2b565b90600052602060002090601f016020900481019282615104576000855561514a565b82601f1061511d57805160ff191683800117855561514a565b8280016001018555821561514a579182015b8281111561514a57825182559160200191906001019061512f565b5061515692915061515a565b5090565b5b80821115615156576000815560010161515b565b600082601f83011261517f578081fd5b8151602061519461518f83615c5b565b615c2b565b80838252828201915082860187848660051b89010111156151b3578586fd5b855b858110156151da5781516151c881615f12565b845292840192908401906001016151b5565b5090979650505050505050565b60008083601f8401126151f8578182fd5b5081356001600160401b0381111561520e578182fd5b60208301915083602082850101111561522657600080fd5b9250929050565b8051600681900b8114614f7057600080fd5b600082601f83011261524f578081fd5b81356001600160401b0381111561526857615268615efc565b61527b601f8201601f1916602001615c2b565b81815284602083860101111561528f578283fd5b816020850160208301379081016020019190915292915050565b80516001600160801b0381168114614f7057600080fd5b6000602082840312156152d1578081fd5b8135610ad781615f12565b6000602082840312156152ed578081fd5b8151610ad781615f12565b6000806040838503121561530a578081fd5b823561531581615f12565b9150602083013561532581615f12565b809150509250929050565b600080600060608486031215615344578081fd5b833561534f81615f12565b9250602084013561535f81615f12565b929592945050506040919091013590565b60008060408385031215615382578182fd5b823561538d81615f12565b946020939093013593505050565b600080604083850312156153ad578182fd5b82516001600160401b03808211156153c3578384fd5b818501915085601f8301126153d6578384fd5b815160206153e661518f83615c5b565b8083825282820191508286018a848660051b8901011115615405578889fd5b8896505b8487101561542e5761541a8161522d565b835260019690960195918301918301615409565b5091880151919650909350505080821115615447578283fd5b506154548582860161516f565b9150509250929050565b60006020828403121561546f578081fd5b8151610ad781615f27565b600080600080600060a08688031215615491578283fd5b853561549c81615f35565b945060208601356154ac81615f35565b935060408601356154bc81615f12565b92506060860135915060808601356154d381615f27565b809150509295509295909350565b600080604083850312156154f3578182fd5b505080516020909101519092909150565b60008060008060608587031215615519578182fd5b843593506020850135925060408501356001600160401b0381111561553c578283fd5b615548878288016151e7565b95989497509550505050565b600080600080600080600060e0888a03121561556e578485fd5b87356001600160401b0380821115615584578687fd5b6155908b838c0161523f565b985060208a01359150808211156155a5578687fd5b506155b28a828b0161523f565b96505060408801356155c381615f12565b945060608801356155d381615f44565b935060808801356155e381615f35565b925060a08801356155f381615f35565b915060c088013561560381615f12565b8091505092959891949750929550565b600080600080600080600080610100898b03121561562f578182fd5b615638896152a9565b9750602089015180600f0b811461564d578283fd5b60408a015160608b01519198509650945061566a60808a0161522d565b935060a089015161567a81615f12565b60c08a015190935061568b81615f54565b60e08a015190925061569c81615f27565b809150509295985092959890939650565b600080604083850312156156bf578182fd5b6156c8836152a9565b91506156d6602084016152a9565b90509250929050565b600080600080600060a086880312156156f6578283fd5b6156ff866152a9565b9450602086015193506040860151925061571b606087016152a9565b9150615729608087016152a9565b90509295509295909350565b600060208284031215615746578081fd5b8135610ad781615f44565b600080600080600080600060e0888a03121561576b578081fd5b875161577681615f12565b602089015190975061578781615f35565b604089015190965061579881615f44565b60608901519095506157a981615f44565b60808901519094506157ba81615f44565b60a089015190935060ff811681146157d0578182fd5b60c089015190925061560381615f27565b600080600080600060a086880312156157f8578283fd5b853561580381615f12565b945060208601359350604086013561581a81615f27565b92506060860135915060808601356154d381615f12565b600080600080600060a08688031215615848578283fd5b853561585381615f44565b9450602086013561586381615f44565b9350604086013561587381615f44565b9250606086013561588381615f54565b915060808601356154d381615f12565b6000602082840312156158a4578081fd5b5051919050565b600080604083850312156158bd578182fd5b82359150602083013561532581615f12565b600080604083850312156158e1578182fd5b50508035926020909101359150565b60008251615902818460208701615dff565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b6001600160a01b03959095168552600293840b60208601529190920b60408401526001600160801b03918216606084015216608082015260a00190565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b6020808252825182820181905260009190848201906040850190845b81811015615a1457835163ffffffff16835292840192918401916001016159f2565b50909695505050505050565b60029190910b815260200190565b600293840b81529190920b60208201526001600160801b03909116604082015260600190565b6020815260008251806020840152615a73816040850160208701615dff565b601f01601f19169190910160400192915050565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252600490820152636d42505360e01b604082015260600190565b602080825260159082015274756e61636365707461626c6520736c69707061676560581b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260089082015267686967682066656560c01b604082015260600190565b60208082526003908201526242505360e81b604082015260600190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b604051601f8201601f191681016001600160401b0381118282101715615c5357615c53615efc565b604052919050565b60006001600160401b03821115615c7457615c74615efc565b5060051b60200190565b600061ffff808316818516808303821115615c9b57615c9b615ed0565b01949350505050565b60006001600160a01b03828116848216808303821115615c9b57615c9b615ed0565b60008219821115615cd957615cd9615ed0565b500190565b60006001600160a01b0383811680615cf857615cf8615ee6565b92169190910492915050565b600082615d1357615d13615ee6565b500490565b60006001600160a01b0382811684821681151582840482111615615d3e57615d3e615ed0565b02949350505050565b6000816000190483118215151615615d6157615d61615ed0565b500290565b60008083128015600160ff1b850184121615615d8457615d84615ed0565b6001600160ff1b0384018313811615615d9f57615d9f615ed0565b50500390565b600061ffff83811690831681811015615dc057615dc0615ed0565b039392505050565b60006001600160a01b0383811690831681811015615dc057615dc0615ed0565b600082821015615dfa57615dfa615ed0565b500390565b60005b83811015615e1a578181015183820152602001615e02565b8381111561105c5750506000910152565b600181811c90821680615e3f57607f821691505b60208210811415615e6057634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615e7a57615e7a615ed0565b5060010190565b600082615e9057615e90615ee6565b500690565b60008160020b627fffff19811415615eaf57615eaf615ed0565b9003919050565b6000600160ff1b821415615ecc57615ecc615ed0565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461456b57600080fd5b801515811461456b57600080fd5b8060020b811461456b57600080fd5b61ffff8116811461456b57600080fd5b63ffffffff8116811461456b57600080fdfea40d93a72f8af7b904f2e4a60095955bfcaa3c724969f731bd8bc1fda226a1718be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220b3da908b505a5534b959b8272126080a608704282cb04ad50559eecb89a982ac64736f6c63430008040033", - "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}." - }, - "burn(uint256,address)": { - "params": { - "burnAmount": "The number of G-UNI tokens to burn", - "receiver": "The account to receive the underlying amounts of token0 and token1" - }, - "returns": { - "amount0": "amount of token0 transferred to receiver for burning `burnAmount`", - "amount1": "amount of token1 transferred to receiver for burning `burnAmount`", - "liquidityBurned": "amount of liquidity removed from the underlying Uniswap V3 position" - } - }, - "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 this function is overridden; 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`." - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "details": "When changing the range the inventory of token0 and token1 may be rebalanced with a swap to deposit as much liquidity as possible into the new position. Swap parameters can be computed by simulating the whole operation: remove all liquidity, deposit as much as possible into new position, then observe how much of token0 or token1 is leftover. Swap a proportion of this leftover to deposit more liquidity into the position, since any leftover will be unused and sit idle until the next rebalance.", - "params": { - "newLowerTick": "The new lower bound of the position's range", - "newUpperTick": "The new upper bound of the position's range", - "swapAmountBPS": "amount of token to swap as proportion of total. Pass 0 to ignore swap.", - "swapThresholdPrice": "slippage parameter on the swap as a max or min sqrtPriceX96", - "zeroForOne": "Which token to input into the swap (true = token0, false = token1)" - } - }, - "getMintAmounts(uint256,uint256)": { - "params": { - "amount0Max": "The maximum amount of token1 to forward on mint" - }, - "returns": { - "amount0": "actual amount of token0 to forward when minting `mintAmount`", - "amount1": "actual amount of token1 to forward when minting `mintAmount`", - "mintAmount": "maximum number of G-UNI tokens to mint" - } - }, - "getUnderlyingBalances()": { - "returns": { - "amount0Current": "current total underlying balance of token0", - "amount1Current": "current total underlying balance of token1" - } - }, - "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." - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "params": { - "_lowerTick": "initial upperTick (only changeable with executiveRebalance)", - "_managerFeeBPS": "proportion of fees earned that go to manager treasury note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION", - "_manager_": "address of manager (ownership can be transferred)", - "_name": "name of G-UNI token", - "_pool": "address of Uniswap V3 pool", - "_symbol": "symbol of G-UNI token" - } - }, - "initializeManagerFee(uint16)": { - "params": { - "_managerFeeBPS": "proportion of fees earned that are credited to manager in Basis Points" - } - }, - "manager()": { - "details": "Returns the address of the current manager." - }, - "mint(uint256,address)": { - "details": "to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts", - "params": { - "mintAmount": "The number of G-UNI tokens to mint", - "receiver": "The account to receive the minted tokens" - }, - "returns": { - "amount0": "amount of token0 transferred from msg.sender to mint `mintAmount`", - "amount1": "amount of token1 transferred from msg.sender to mint `mintAmount`", - "liquidityMinted": "amount of liquidity added to the underlying Uniswap V3 position" - } - }, - "name()": { - "details": "Returns the name of the token." - }, - "renounceOwnership()": { - "details": "Leaves the contract without manager. It will not be possible to call `onlyManager` functions anymore. Can only be called by the current manager. NOTE: Renouncing ownership will leave the contract without an manager, thereby removing any functionality that is only available to the manager." - }, - "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 manager." - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "params": { - "newRebalanceBPS": "controls frequency of gelato rebalances: gas fee to execute rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance", - "newSlippageBPS": "maximum slippage on swaps during gelato rebalance", - "newSlippageInterval": "length of time for TWAP used in computing slippage on swaps", - "newTreasury": "address where managerFee withdrawals are sent", - "newWithdrawBPS": "controls frequency of gelato withdrawals: gas fee to execute withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "burn(uint256,address)": { - "notice": "burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens" - }, - "executiveRebalance(int24,int24,uint160,uint256,bool)": { - "notice": "Change the range of underlying UniswapV3 position, only manager can call" - }, - "getMintAmounts(uint256,uint256)": { - "notice": "compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`" - }, - "getUnderlyingBalances()": { - "notice": "compute total underlying holdings of the G-UNI token supply includes current liquidity invested in uniswap position, current fees earned and any uninvested leftover (but does not include manager or gelato fees accrued)" - }, - "initialize(string,string,address,uint16,int24,int24,address)": { - "notice": "initialize storage variables on a new G-UNI pool, only called once" - }, - "initializeManagerFee(uint16)": { - "notice": "initializeManagerFee sets a managerFee, only manager can call. If a manager fee was not set in the initialize function it can be set here but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again." - }, - "mint(uint256,address)": { - "notice": "mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position" - }, - "rebalance(uint160,uint256,bool,uint256,address)": { - "notice": "Reinvest fees earned into underlying position, only gelato executors can call Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance. Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager." - }, - "uniswapV3MintCallback(uint256,uint256,bytes)": { - "notice": "Uniswap V3 callback fn, called back on pool.mint" - }, - "uniswapV3SwapCallback(int256,int256,bytes)": { - "notice": "Uniswap v3 callback fn, called back on pool.swap" - }, - "updateGelatoParams(uint16,uint16,uint16,uint32,address)": { - "notice": "change configurable parameters, only manager can call" - }, - "withdrawGelatoBalance(uint256,address)": { - "notice": "withdraw gelato fees accrued, only gelato executors can call. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - }, - "withdrawManagerBalance(uint256,address)": { - "notice": "withdraw manager fees accrued, only gelato executors can call. Target account to receive fees is managerTreasury, alterable by manager. Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager." - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 5, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 784, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage" - }, - { - "astId": 122, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_balances", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 128, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_allowances", - "offset": 0, - "slot": "52", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 130, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_totalSupply", - "offset": 0, - "slot": "53", - "type": "t_uint256" - }, - { - "astId": 132, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_name", - "offset": 0, - "slot": "54", - "type": "t_string_storage" - }, - { - "astId": 134, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_symbol", - "offset": 0, - "slot": "55", - "type": "t_string_storage" - }, - { - "astId": 636, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "56", - "type": "t_array(t_uint256)45_storage" - }, - { - "astId": 59, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_status", - "offset": 0, - "slot": "101", - "type": "t_uint256" - }, - { - "astId": 102, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "__gap", - "offset": 0, - "slot": "102", - "type": "t_array(t_uint256)49_storage" - }, - { - "astId": 6093, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "_manager", - "offset": 0, - "slot": "151", - "type": "t_address" - }, - { - "astId": 5691, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "lowerTick", - "offset": 20, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 5693, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "upperTick", - "offset": 23, - "slot": "151", - "type": "t_int24" - }, - { - "astId": 5695, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoRebalanceBPS", - "offset": 26, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 5697, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoWithdrawBPS", - "offset": 28, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 5699, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageBPS", - "offset": 30, - "slot": "151", - "type": "t_uint16" - }, - { - "astId": 5701, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoSlippageInterval", - "offset": 0, - "slot": "152", - "type": "t_uint32" - }, - { - "astId": 5703, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerFeeBPS", - "offset": 4, - "slot": "152", - "type": "t_uint16" - }, - { - "astId": 5705, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerTreasury", - "offset": 6, - "slot": "152", - "type": "t_address" - }, - { - "astId": 5707, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance0", - "offset": 0, - "slot": "153", - "type": "t_uint256" - }, - { - "astId": 5709, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "managerBalance1", - "offset": 0, - "slot": "154", - "type": "t_uint256" - }, - { - "astId": 5711, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance0", - "offset": 0, - "slot": "155", - "type": "t_uint256" - }, - { - "astId": 5713, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "gelatoBalance1", - "offset": 0, - "slot": "156", - "type": "t_uint256" - }, - { - "astId": 5716, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "pool", - "offset": 0, - "slot": "157", - "type": "t_contract(IUniswapV3Pool)2072" - }, - { - "astId": 5719, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token0", - "offset": 0, - "slot": "158", - "type": "t_contract(IERC20)909" - }, - { - "astId": 5722, - "contract": "contracts/GUniPool.sol:GUniPool", - "label": "token1", - "offset": 0, - "slot": "159", - "type": "t_contract(IERC20)909" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)45_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)49_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "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)909": { - "encoding": "inplace", - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_contract(IUniswapV3Pool)2072": { - "encoding": "inplace", - "label": "contract IUniswapV3Pool", - "numberOfBytes": "20" - }, - "t_int24": { - "encoding": "inplace", - "label": "int24", - "numberOfBytes": "3" - }, - "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_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} diff --git a/lib/g-uni-v1-core/deployments/ropsten/solcInputs/07200b0d23a751835ce93ba1686cbb62.json b/lib/g-uni-v1-core/deployments/ropsten/solcInputs/07200b0d23a751835ce93ba1686cbb62.json deleted file mode 100644 index 0b5a9bde9..000000000 --- a/lib/g-uni-v1-core/deployments/ropsten/solcInputs/07200b0d23a751835ce93ba1686cbb62.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 100;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.4;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(int24 lowerTick_, int24 upperTick_);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool));\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool));\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n require(mintAmount <= type(uint128).max);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n uint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0,\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1\n );\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 _liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n require(_liquidityBurned_ < type(uint128).max);\n liquidityBurned = uint128(_liquidityBurned_);\n\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n uint256 leftoverShare0 =\n FullMath.mulDiv(\n burnAmount,\n preBalance0 - managerBalance0 - gelatoBalance0,\n totalSupply\n );\n uint256 leftoverShare1 =\n FullMath.mulDiv(\n burnAmount,\n preBalance1 - managerBalance1 - gelatoBalance1,\n totalSupply\n );\n\n _withdrawExact(\n lowerTick,\n upperTick,\n burnAmount,\n totalSupply,\n liquidityBurned\n );\n\n amount0 =\n (token0.balanceOf(address(this)) - preBalance0) +\n leftoverShare0;\n amount1 =\n (token1.balanceOf(address(this)) - preBalance1) +\n leftoverShare1;\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n (uint128 _liquidity, , , , ) = pool.positions(_getPositionID());\n (uint256 feesEarned0, uint256 feesEarned1) =\n _withdrawAll(lowerTick, upperTick, _liquidity);\n\n managerBalance0 += (feesEarned0 * managerFeeBPS) / 10000;\n managerBalance1 += (feesEarned1 * managerFeeBPS) / 10000;\n gelatoBalance0 += (feesEarned0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (feesEarned1 * gelatoFeeBPS) / 10000;\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n emit Rebalance(newLowerTick, newUpperTick);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n _rebalance(\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n emit Rebalance(lowerTick, upperTick);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n // solhint-disable-next-line function-max-lines\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 _liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n _liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, _liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, _liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n (uint128 _liquidity, , , , ) = pool.positions(_getPositionID());\n\n (uint256 feesEarned0, uint256 feesEarned1) =\n _withdrawAll(lowerTick, upperTick, _liquidity);\n\n uint256 reinvest0;\n uint256 reinvest1;\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n managerBalance0 +=\n ((feesEarned0 - feeAmount) * managerFeeBPS) /\n 10000;\n managerBalance1 += (feesEarned1 * managerFeeBPS) / 10000;\n gelatoBalance0 +=\n ((feesEarned0 - feeAmount) * gelatoFeeBPS) /\n 10000;\n gelatoBalance1 += (feesEarned1 * gelatoFeeBPS) / 10000;\n reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n managerBalance0 += (feesEarned0 * managerFeeBPS) / 10000;\n managerBalance1 +=\n ((feesEarned1 - feeAmount) * managerFeeBPS) /\n 10000;\n gelatoBalance0 += (feesEarned0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 +=\n ((feesEarned1 - feeAmount) * gelatoFeeBPS) /\n 10000;\n reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdrawAll(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n ) private returns (uint256 amountEarned0, uint256 amountEarned1) {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (uint256 amount0Burned, uint256 amount1Burned) =\n pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n amountEarned0 =\n token0.balanceOf(address(this)) -\n preBalance0 -\n amount0Burned;\n amountEarned1 =\n token1.balanceOf(address(this)) -\n preBalance1 -\n amount1Burned;\n }\n\n function _withdrawExact(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 burnAmount,\n uint256 supply,\n uint128 liquidityBurned\n ) private {\n (uint256 burn0, uint256 burn1) =\n pool.burn(lowerTick_, upperTick_, liquidityBurned);\n\n (, , , uint128 tokensOwed0, uint128 tokensOwed1) =\n pool.positions(_getPositionID());\n uint256 fee0 = uint256(tokensOwed0) - burn0;\n uint256 fee1 = uint256(tokensOwed1) - burn1;\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n burn0 += FullMath.mulDiv(burnAmount, fee0, supply);\n burn1 += FullMath.mulDiv(burnAmount, fee1, supply);\n\n // Withdraw tokens to user\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n uint128(burn0), // cast can't overflow\n uint128(burn1) // cast can't overflow\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n int256(((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000);\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(int256(amount0) - amount0Delta);\n finalAmount1 = uint256(int256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array length\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"unacceptable slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"unacceptable slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 < sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 < sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3 pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @return pool the address of the newly created G-UNI pool (proxy)\n // solhint-disable-next-line function-max-lines\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external override returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory symbol0 = \"?\";\n string memory symbol1 = \"?\";\n try IERC20Metadata(token0).symbol() returns (string memory sym0) {\n symbol0 = sym0;\n } catch {} // solhint-disable-line no-empty-blocks\n try IERC20Metadata(token1).symbol() returns (string memory sym1) {\n symbol1 = sym1;\n } catch {} // solhint-disable-line no-empty-blocks\n\n string memory name =\n _append(\n \"Gelato Uniswap \",\n symbol0,\n \"/\",\n symbol1,\n \" LP\"\n );\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n\n require(uniPool != address(0), \"uniswap pool does not exist\");\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, msg.sender, pool);\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": ["ast"] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} diff --git a/lib/g-uni-v1-core/deployments/ropsten/solcInputs/0cce3fad8f3de16d15d2c077c292658d.json b/lib/g-uni-v1-core/deployments/ropsten/solcInputs/0cce3fad8f3de16d15d2c077c292658d.json deleted file mode 100644 index 32e8cae83..000000000 --- a/lib/g-uni-v1-core/deployments/ropsten/solcInputs/0cce3fad8f3de16d15d2c077c292658d.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/__mocks__/MockERC20.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\ncontract MockERC20 is ERC20Upgradeable {\n constructor() {\n __ERC20_init(\"\", \"TOKEN\");\n _mint(msg.sender, 100000e18);\n }\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\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\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The defaut value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n __Context_init_unchained();\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override 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 override 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 this function is\n * overridden;\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 override returns (uint8) {\n return 18;\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\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n _approve(sender, _msgSender(), currentAllowance - amount);\n\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] + 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 uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\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 uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\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 += amount;\n _balances[account] += 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 uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\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 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 uint256[45] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\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-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../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 initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\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 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" - }, - "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/abstract/GUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Gelatofied} from \"./Gelatofied.sol\";\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {\n ERC20Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/// @dev Single Global upgradeable state var storage base: APPEND ONLY\n/// @dev Add all inherited contracts with state vars here: APPEND ONLY\n/// @dev ERC20Upgradable Includes Initialize\n// solhint-disable-next-line max-states-count\nabstract contract GUniPoolStorage is\n ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */\n ReentrancyGuardUpgradeable,\n OwnableUninitialized,\n Gelatofied\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n // solhint-disable-next-line const-name-snakecase\n uint16 public constant gelatoFeeBPS = 100;\n\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n int24 public lowerTick;\n int24 public upperTick;\n\n uint16 public gelatoRebalanceBPS;\n uint16 public gelatoWithdrawBPS;\n uint16 public gelatoSlippageBPS;\n uint32 public gelatoSlippageInterval;\n\n uint16 public managerFeeBPS;\n address public managerTreasury;\n\n uint256 public managerBalance0;\n uint256 public managerBalance1;\n uint256 public gelatoBalance0;\n uint256 public gelatoBalance1;\n\n IUniswapV3Pool public pool;\n IERC20 public token0;\n IERC20 public token1;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdateAdminTreasury(\n address oldAdminTreasury,\n address newAdminTreasury\n );\n\n event UpdateGelatoParams(\n uint16 gelatoRebalanceBPS,\n uint16 gelatoWithdrawBPS,\n uint16 gelatoSlippageBPS,\n uint32 gelatoSlippageInterval\n );\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice initialize storage variables on a new G-UNI pool, only called once\n /// @param _name name of G-UNI token\n /// @param _symbol symbol of G-UNI token\n /// @param _pool address of Uniswap V3 pool\n /// @param _managerFeeBPS proportion of fees earned that go to manager treasury\n /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION\n /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)\n /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)\n /// @param _manager_ address of manager (ownership can be transferred)\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external initializer {\n require(_managerFeeBPS <= 10000 - gelatoFeeBPS, \"mBPS\");\n\n // these variables are immutable after initialization\n pool = IUniswapV3Pool(_pool);\n token0 = IERC20(pool.token0());\n token1 = IERC20(pool.token1());\n managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later\n\n // these variables can be udpated by the manager\n gelatoSlippageInterval = 5 minutes; // default: last five minutes;\n gelatoSlippageBPS = 500; // default: 5% slippage\n gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn\n gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested\n managerTreasury = _manager_; // default: treasury is admin\n lowerTick = _lowerTick;\n upperTick = _upperTick;\n _manager = _manager_;\n\n // e.g. \"Gelato Uniswap V3 USDC/DAI LP\" and \"G-UNI\"\n __ERC20_init(_name, _symbol);\n __ReentrancyGuard_init();\n }\n\n /// @notice change configurable parameters, only manager can call\n /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute\n /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance\n /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute\n /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw\n /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance\n /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps\n /// @param newTreasury address where managerFee withdrawals are sent\n // solhint-disable-next-line code-complexity\n function updateGelatoParams(\n uint16 newRebalanceBPS,\n uint16 newWithdrawBPS,\n uint16 newSlippageBPS,\n uint32 newSlippageInterval,\n address newTreasury\n ) external onlyManager {\n require(newWithdrawBPS <= 10000, \"BPS\");\n require(newRebalanceBPS <= 10000, \"BPS\");\n require(newSlippageBPS <= 10000, \"BPS\");\n emit UpdateGelatoParams(\n newRebalanceBPS,\n newWithdrawBPS,\n newSlippageBPS,\n newSlippageInterval\n );\n if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;\n if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;\n if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;\n if (newSlippageInterval != 0)\n gelatoSlippageInterval = newSlippageInterval;\n if (newTreasury != address(0)) managerTreasury = newTreasury;\n }\n\n /// @notice initializeManagerFee sets a managerFee, only manager can call.\n /// If a manager fee was not set in the initialize function it can be set here\n /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.\n /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points\n function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {\n require(managerFeeBPS == 0, \"fee\");\n require(\n _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,\n \"mBPS\"\n );\n managerFeeBPS = _managerFeeBPS;\n }\n\n function renounceOwnership() public virtual override onlyManager {\n managerTreasury = address(0);\n managerFeeBPS = 0;\n managerBalance0 = 0;\n managerBalance1 = 0;\n super.renounceOwnership();\n }\n\n function getPositionID() external view returns (bytes32 positionID) {\n return _getPositionID();\n }\n\n function _getPositionID() internal view returns (bytes32 positionID) {\n return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));\n }\n}\n" - }, - "contracts/abstract/Gelatofied.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract Gelatofied {\n using Address for address payable;\n using SafeERC20 for IERC20;\n\n // solhint-disable-next-line var-name-mixedcase\n address payable public immutable GELATO;\n\n address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n constructor(address payable _gelato) {\n GELATO = _gelato;\n }\n\n modifier gelatofy(uint256 _amount, address _paymentToken) {\n require(msg.sender == GELATO, \"Gelatofied: Only gelato\");\n _;\n if (_paymentToken == _ETH) GELATO.sendValue(_amount);\n else IERC20(_paymentToken).safeTransfer(GELATO, _amount);\n }\n}\n" - }, - "contracts/abstract/OwnableUninitialized.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.4;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an manager) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the manager 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 * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\n/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage\n/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage\nabstract contract OwnableUninitialized {\n address internal _manager;\n\n event OwnershipTransferred(\n address indexed previousManager,\n address indexed newManager\n );\n\n /// @dev Initializes the contract setting the deployer as the initial manager.\n /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD\n // solhint-disable-next-line no-empty-blocks\n constructor() {}\n\n /**\n * @dev Returns the address of the current manager.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Ownable: caller is not the manager\");\n _;\n }\n\n /**\n * @dev Leaves the contract without manager. It will not be possible to call\n * `onlyManager` functions anymore. Can only be called by the current manager.\n *\n * NOTE: Renouncing ownership will leave the contract without an manager,\n * thereby removing any functionality that is only available to the manager.\n */\n function renounceOwnership() public virtual onlyManager {\n emit OwnershipTransferred(_manager, address(0));\n _manager = 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 manager.\n */\n function transferOwnership(address newOwner) public virtual onlyManager {\n require(\n newOwner != address(0),\n \"Ownable: new manager is the zero address\"\n );\n emit OwnershipTransferred(_manager, newOwner);\n _manager = newOwner;\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\nimport './pool/IUniswapV3PoolImmutables.sol';\nimport './pool/IUniswapV3PoolState.sol';\nimport './pool/IUniswapV3PoolDerivedState.sol';\nimport './pool/IUniswapV3PoolActions.sol';\nimport './pool/IUniswapV3PoolOwnerActions.sol';\nimport './pool/IUniswapV3PoolEvents.sol';\n\n/// @title The interface for a Uniswap V3 Pool\n/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform\n/// to the ERC20 specification\n/// @dev The pool interface is broken up into many smaller pieces\ninterface IUniswapV3Pool is\n IUniswapV3PoolImmutables,\n IUniswapV3PoolState,\n IUniswapV3PoolDerivedState,\n IUniswapV3PoolActions,\n IUniswapV3PoolOwnerActions,\n IUniswapV3PoolEvents\n{\n\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.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 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) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\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" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that never changes\n/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values\ninterface IUniswapV3PoolImmutables {\n /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface\n /// @return The contract address\n function factory() external view returns (address);\n\n /// @notice The first of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token0() external view returns (address);\n\n /// @notice The second of the two tokens of the pool, sorted by address\n /// @return The token contract address\n function token1() external view returns (address);\n\n /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6\n /// @return The fee\n function fee() external view returns (uint24);\n\n /// @notice The pool tick spacing\n /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive\n /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...\n /// This value is an int24 to avoid casting even though it is always positive.\n /// @return The tick spacing\n function tickSpacing() external view returns (int24);\n\n /// @notice The maximum amount of position liquidity that can use any tick in the range\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\n /// @return The max amount of liquidity per tick\n function maxLiquidityPerTick() external view returns (uint128);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that can change\n/// @notice These methods compose the pool's state, and can change with any frequency including multiple times\n/// per transaction\ninterface IUniswapV3PoolState {\n /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas\n /// when accessed externally.\n /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value\n /// tick The current tick of the pool, i.e. according to the last tick transition that was run.\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick\n /// boundary.\n /// observationIndex The index of the last oracle observation that was written,\n /// observationCardinality The current maximum number of observations stored in the pool,\n /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.\n /// feeProtocol The protocol fee for both tokens of the pool.\n /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0\n /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.\n /// unlocked Whether the pool is currently locked to reentrancy\n function slot0()\n external\n view\n returns (\n uint160 sqrtPriceX96,\n int24 tick,\n uint16 observationIndex,\n uint16 observationCardinality,\n uint16 observationCardinalityNext,\n uint8 feeProtocol,\n bool unlocked\n );\n\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal0X128() external view returns (uint256);\n\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\n /// @dev This value can overflow the uint256\n function feeGrowthGlobal1X128() external view returns (uint256);\n\n /// @notice The amounts of token0 and token1 that are owed to the protocol\n /// @dev Protocol fees will never exceed uint128 max in either token\n function protocolFees() external view returns (uint128 token0, uint128 token1);\n\n /// @notice The currently in range liquidity available to the pool\n /// @dev This value has no relationship to the total liquidity across all ticks\n function liquidity() external view returns (uint128);\n\n /// @notice Look up information about a specific tick in the pool\n /// @param tick The tick to look up\n /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or\n /// tick upper,\n /// liquidityNet how much liquidity changes when the pool price crosses the tick,\n /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,\n /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,\n /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick\n /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,\n /// secondsOutside the seconds spent on the other side of the tick from the current tick,\n /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.\n /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\n /// a specific position.\n function ticks(int24 tick)\n external\n view\n returns (\n uint128 liquidityGross,\n int128 liquidityNet,\n uint256 feeGrowthOutside0X128,\n uint256 feeGrowthOutside1X128,\n int56 tickCumulativeOutside,\n uint160 secondsPerLiquidityOutsideX128,\n uint32 secondsOutside,\n bool initialized\n );\n\n /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information\n function tickBitmap(int16 wordPosition) external view returns (uint256);\n\n /// @notice Returns the information about a position by the position's key\n /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper\n /// @return _liquidity The amount of liquidity in the position,\n /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,\n /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,\n /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,\n /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke\n function positions(bytes32 key)\n external\n view\n returns (\n uint128 _liquidity,\n uint256 feeGrowthInside0LastX128,\n uint256 feeGrowthInside1LastX128,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n );\n\n /// @notice Returns data about a specific observation index\n /// @param index The element of the observations array to fetch\n /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time\n /// ago, rather than at a specific index in the array.\n /// @return blockTimestamp The timestamp of the observation,\n /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\n /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\n /// Returns initialized whether the observation has been initialized and the values are safe to use\n function observations(uint256 index)\n external\n view\n returns (\n uint32 blockTimestamp,\n int56 tickCumulative,\n uint160 secondsPerLiquidityCumulativeX128,\n bool initialized\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Pool state that is not stored\n/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the\n/// blockchain. The functions here may have variable gas costs.\ninterface IUniswapV3PoolDerivedState {\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\n /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing\n /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,\n /// you must call it with secondsAgos = [3600, 0].\n /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in\n /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.\n /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned\n /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\n /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block\n /// timestamp\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);\n\n /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range\n /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.\n /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first\n /// snapshot is taken and the second snapshot is taken.\n /// @param tickLower The lower tick of the range\n /// @param tickUpper The upper tick of the range\n /// @return tickCumulativeInside The snapshot of the tick accumulator for the range\n /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range\n /// @return secondsInside The snapshot of seconds per liquidity for the range\n function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)\n external\n view\n returns (\n int56 tickCumulativeInside,\n uint160 secondsPerLiquidityInsideX128,\n uint32 secondsInside\n );\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissionless pool actions\n/// @notice Contains pool methods that can be called by anyone\ninterface IUniswapV3PoolActions {\n /// @notice Sets the initial price for the pool\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\n /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96\n function initialize(uint160 sqrtPriceX96) external;\n\n /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position\n /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\n /// on tickLower, tickUpper, the amount of liquidity, and the current price.\n /// @param recipient The address for which the liquidity will be created\n /// @param tickLower The lower tick of the position in which to add liquidity\n /// @param tickUpper The upper tick of the position in which to add liquidity\n /// @param amount The amount of liquidity to mint\n /// @param data Any data that should be passed through to the callback\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\n function mint(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount,\n bytes calldata data\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Collects tokens owed to a position\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\n /// @param recipient The address which should receive the fees collected\n /// @param tickLower The lower tick of the position for which to collect fees\n /// @param tickUpper The upper tick of the position for which to collect fees\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\n /// @return amount0 The amount of fees collected in token0\n /// @return amount1 The amount of fees collected in token1\n function collect(\n address recipient,\n int24 tickLower,\n int24 tickUpper,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\n /// @dev Fees must be collected separately via a call to #collect\n /// @param tickLower The lower tick of the position for which to burn liquidity\n /// @param tickUpper The upper tick of the position for which to burn liquidity\n /// @param amount How much liquidity to burn\n /// @return amount0 The amount of token0 sent to the recipient\n /// @return amount1 The amount of token1 sent to the recipient\n function burn(\n int24 tickLower,\n int24 tickUpper,\n uint128 amount\n ) external returns (uint256 amount0, uint256 amount1);\n\n /// @notice Swap token0 for token1, or token1 for token0\n /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback\n /// @param recipient The address to receive the output of the swap\n /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0\n /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\n /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\n /// @param data Any data to be passed through to the callback\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\n function swap(\n address recipient,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96,\n bytes calldata data\n ) external returns (int256 amount0, int256 amount1);\n\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\n /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback\n /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling\n /// with 0 amount{0,1} and sending the donation amount(s) from the callback\n /// @param recipient The address which will receive the token0 and token1 amounts\n /// @param amount0 The amount of token0 to send\n /// @param amount1 The amount of token1 to send\n /// @param data Any data to be passed through to the callback\n function flash(\n address recipient,\n uint256 amount0,\n uint256 amount1,\n bytes calldata data\n ) external;\n\n /// @notice Increase the maximum number of price and liquidity observations that this pool will store\n /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to\n /// the input observationCardinalityNext.\n /// @param observationCardinalityNext The desired minimum number of observations for the pool to store\n function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Permissioned pool actions\n/// @notice Contains pool methods that may only be called by the factory owner\ninterface IUniswapV3PoolOwnerActions {\n /// @notice Set the denominator of the protocol's % share of the fees\n /// @param feeProtocol0 new protocol fee for token0 of the pool\n /// @param feeProtocol1 new protocol fee for token1 of the pool\n function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;\n\n /// @notice Collect the protocol fee accrued to the pool\n /// @param recipient The address to which collected protocol fees should be sent\n /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1\n /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0\n /// @return amount0 The protocol fee collected in token0\n /// @return amount1 The protocol fee collected in token1\n function collectProtocol(\n address recipient,\n uint128 amount0Requested,\n uint128 amount1Requested\n ) external returns (uint128 amount0, uint128 amount1);\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Events emitted by a pool\n/// @notice Contains all events emitted by the pool\ninterface IUniswapV3PoolEvents {\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\n /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize\n /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\n event Initialize(uint160 sqrtPriceX96, int24 tick);\n\n /// @notice Emitted when liquidity is minted for a given position\n /// @param sender The address that minted the liquidity\n /// @param owner The owner of the position and recipient of any minted liquidity\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity minted to the position range\n /// @param amount0 How much token0 was required for the minted liquidity\n /// @param amount1 How much token1 was required for the minted liquidity\n event Mint(\n address sender,\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted when fees are collected by the owner of a position\n /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees\n /// @param owner The owner of the position for which fees are collected\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount0 The amount of token0 fees collected\n /// @param amount1 The amount of token1 fees collected\n event Collect(\n address indexed owner,\n address recipient,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount0,\n uint128 amount1\n );\n\n /// @notice Emitted when a position's liquidity is removed\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\n /// @param owner The owner of the position for which liquidity is removed\n /// @param tickLower The lower tick of the position\n /// @param tickUpper The upper tick of the position\n /// @param amount The amount of liquidity to remove\n /// @param amount0 The amount of token0 withdrawn\n /// @param amount1 The amount of token1 withdrawn\n event Burn(\n address indexed owner,\n int24 indexed tickLower,\n int24 indexed tickUpper,\n uint128 amount,\n uint256 amount0,\n uint256 amount1\n );\n\n /// @notice Emitted by the pool for any swaps between token0 and token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the output of the swap\n /// @param amount0 The delta of the token0 balance of the pool\n /// @param amount1 The delta of the token1 balance of the pool\n /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\n /// @param liquidity The liquidity of the pool after the swap\n /// @param tick The log base 1.0001 of price of the pool after the swap\n event Swap(\n address indexed sender,\n address indexed recipient,\n int256 amount0,\n int256 amount1,\n uint160 sqrtPriceX96,\n uint128 liquidity,\n int24 tick\n );\n\n /// @notice Emitted by the pool for any flashes of token0/token1\n /// @param sender The address that initiated the swap call, and that received the callback\n /// @param recipient The address that received the tokens from flash\n /// @param amount0 The amount of token0 that was flashed\n /// @param amount1 The amount of token1 that was flashed\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\n event Flash(\n address indexed sender,\n address indexed recipient,\n uint256 amount0,\n uint256 amount1,\n uint256 paid0,\n uint256 paid1\n );\n\n /// @notice Emitted by the pool for increases to the number of observations that can be stored\n /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index\n /// just before a mint/swap/burn.\n /// @param observationCardinalityNextOld The previous value of the next observation cardinality\n /// @param observationCardinalityNextNew The updated value of the next observation cardinality\n event IncreaseObservationCardinalityNext(\n uint16 observationCardinalityNextOld,\n uint16 observationCardinalityNextNew\n );\n\n /// @notice Emitted when the protocol fee is changed by the pool\n /// @param feeProtocol0Old The previous value of the token0 protocol fee\n /// @param feeProtocol1Old The previous value of the token1 protocol fee\n /// @param feeProtocol0New The updated value of the token0 protocol fee\n /// @param feeProtocol1New The updated value of the token1 protocol fee\n event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);\n\n /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner\n /// @param sender The address that collects the protocol fees\n /// @param recipient The address that receives the collected protocol fees\n /// @param amount0 The amount of token0 protocol fees that is withdrawn\n /// @param amount0 The amount of token1 protocol fees that is withdrawn\n event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);\n}\n" - }, - "contracts/GUniPool.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3MintCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {GUniPoolStorage} from \"./abstract/GUniPoolStorage.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\nimport {TickMath} from \"./vendor/uniswap/TickMath.sol\";\nimport {\n IERC20,\n SafeERC20\n} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {\n FullMath,\n LiquidityAmounts\n} from \"./vendor/uniswap/LiquidityAmounts.sol\";\n\ncontract GUniPool is\n IUniswapV3MintCallback,\n IUniswapV3SwapCallback,\n GUniPoolStorage\n{\n using SafeERC20 for IERC20;\n using TickMath for int24;\n\n event Minted(\n address receiver,\n uint256 mintAmount,\n uint256 amount0In,\n uint256 amount1In,\n uint128 liquidityMinted\n );\n\n event Burned(\n address receiver,\n uint256 burnAmount,\n uint256 amount0Out,\n uint256 amount1Out,\n uint128 liquidityBurned\n );\n\n event Rebalance(int24 lowerTick_, int24 upperTick_);\n\n // solhint-disable-next-line max-line-length\n constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks\n\n /// @notice Uniswap V3 callback fn, called back on pool.mint\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata /*_data*/\n ) external override {\n require(msg.sender == address(pool));\n\n if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);\n if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);\n }\n\n /// @notice Uniswap v3 callback fn, called back on pool.swap\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata /*data*/\n ) external override {\n require(msg.sender == address(pool));\n\n if (amount0Delta > 0)\n token0.safeTransfer(msg.sender, uint256(amount0Delta));\n else if (amount1Delta > 0)\n token1.safeTransfer(msg.sender, uint256(amount1Delta));\n }\n\n // User functions => Should be called via a Router\n\n /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position\n /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts\n /// @param mintAmount The number of G-UNI tokens to mint\n /// @param receiver The account to receive the minted tokens\n /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`\n /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`\n /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines, code-complexity\n function mint(uint256 mintAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityMinted\n )\n {\n require(mintAmount > 0, \"mint 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n\n if (totalSupply > 0) {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n amount0 = FullMath.mulDivRoundingUp(\n amount0Current,\n mintAmount,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n amount1Current,\n mintAmount,\n totalSupply\n );\n } else {\n // if supply is 0 mintAmount == liquidity to deposit\n require(mintAmount <= type(uint128).max);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n uint128(mintAmount)\n );\n }\n\n // transfer amounts owed to contract\n if (amount0 > 0) {\n token0.safeTransferFrom(msg.sender, address(this), amount0);\n }\n if (amount1 > 0) {\n token1.safeTransferFrom(msg.sender, address(this), amount1);\n }\n\n // deposit as much new liquidity as possible\n liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0,\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1\n );\n pool.mint(address(this), lowerTick, upperTick, liquidityMinted, \"\");\n\n _mint(receiver, mintAmount);\n emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);\n }\n\n /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens\n /// @param burnAmount The number of G-UNI tokens to burn\n /// @param receiver The account to receive the underlying amounts of token0 and token1\n /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`\n /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`\n /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position\n // solhint-disable-next-line function-max-lines\n function burn(uint256 burnAmount, address receiver)\n external\n nonReentrant\n returns (\n uint256 amount0,\n uint256 amount1,\n uint128 liquidityBurned\n )\n {\n require(burnAmount > 0, \"burn 0\");\n\n uint256 totalSupply = totalSupply();\n\n (uint128 liquidity, , , , ) = pool.positions(_getPositionID());\n\n _burn(msg.sender, burnAmount);\n\n uint256 _liquidityBurned_ =\n FullMath.mulDiv(burnAmount, liquidity, totalSupply);\n require(_liquidityBurned_ < type(uint128).max);\n liquidityBurned = uint128(_liquidityBurned_);\n\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n uint256 leftoverShare0 =\n FullMath.mulDiv(\n burnAmount,\n preBalance0 - managerBalance0 - gelatoBalance0,\n totalSupply\n );\n uint256 leftoverShare1 =\n FullMath.mulDiv(\n burnAmount,\n preBalance1 - managerBalance1 - gelatoBalance1,\n totalSupply\n );\n\n _withdrawExact(\n lowerTick,\n upperTick,\n burnAmount,\n totalSupply,\n liquidityBurned\n );\n\n amount0 =\n (token0.balanceOf(address(this)) - preBalance0) +\n leftoverShare0;\n amount1 =\n (token1.balanceOf(address(this)) - preBalance1) +\n leftoverShare1;\n\n if (amount0 > 0) {\n token0.safeTransfer(receiver, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(receiver, amount1);\n }\n\n emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);\n }\n\n // Manager Functions => Called by Pool Manager\n\n /// @notice Change the range of underlying UniswapV3 position, only manager can call\n /// @dev When changing the range the inventory of token0 and token1 may be rebalanced\n /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters\n /// can be computed by simulating the whole operation: remove all liquidity, deposit as much\n /// as possible into new position, then observe how much of token0 or token1 is leftover.\n /// Swap a proportion of this leftover to deposit more liquidity into the position, since\n /// any leftover will be unused and sit idle until the next rebalance.\n /// @param newLowerTick The new lower bound of the position's range\n /// @param newUpperTick The new upper bound of the position's range\n /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96\n /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.\n /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)\n function executiveRebalance(\n int24 newLowerTick,\n int24 newUpperTick,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) external onlyManager {\n (uint128 _liquidity, , , , ) = pool.positions(_getPositionID());\n (uint256 feesEarned0, uint256 feesEarned1) =\n _withdrawAll(lowerTick, upperTick, _liquidity);\n\n managerBalance0 += (feesEarned0 * managerFeeBPS) / 10000;\n managerBalance1 += (feesEarned1 * managerFeeBPS) / 10000;\n gelatoBalance0 += (feesEarned0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 += (feesEarned1 * gelatoFeeBPS) / 10000;\n\n lowerTick = newLowerTick;\n upperTick = newUpperTick;\n\n uint256 reinvest0 =\n token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;\n uint256 reinvest1 =\n token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;\n\n _deposit(\n newLowerTick,\n newUpperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n\n emit Rebalance(newLowerTick, newUpperTick);\n }\n\n // Gelatofied functions => Automatically called by Gelato\n\n /// @notice Reinvest fees earned into underlying position, only gelato executors can call\n /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.\n /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.\n function rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) external gelatofy(feeAmount, paymentToken) {\n if (swapAmountBPS > 0) {\n _checkSlippage(swapThresholdPrice, zeroForOne);\n }\n _rebalance(\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne,\n feeAmount,\n paymentToken\n );\n\n emit Rebalance(lowerTick, upperTick);\n }\n\n /// @notice withdraw manager fees accrued, only gelato executors can call.\n /// Target account to receive fees is managerTreasury, alterable by manager.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawManagerBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n managerBalance0,\n managerBalance1,\n feeAmount,\n feeToken\n );\n\n managerBalance0 = 0;\n managerBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(managerTreasury, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(managerTreasury, amount1);\n }\n }\n\n /// @notice withdraw gelato fees accrued, only gelato executors can call.\n /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.\n function withdrawGelatoBalance(uint256 feeAmount, address feeToken)\n external\n gelatofy(feeAmount, feeToken)\n {\n (uint256 amount0, uint256 amount1) =\n _balancesToWithdraw(\n gelatoBalance0,\n gelatoBalance1,\n feeAmount,\n feeToken\n );\n\n gelatoBalance0 = 0;\n gelatoBalance1 = 0;\n\n if (amount0 > 0) {\n token0.safeTransfer(GELATO, amount0);\n }\n\n if (amount1 > 0) {\n token1.safeTransfer(GELATO, amount1);\n }\n }\n\n function _balancesToWithdraw(\n uint256 balance0,\n uint256 balance1,\n uint256 feeAmount,\n address feeToken\n ) internal view returns (uint256 amount0, uint256 amount1) {\n if (feeToken == address(token0)) {\n require(\n (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount0 = balance0 - feeAmount;\n amount1 = balance1;\n } else if (feeToken == address(token1)) {\n require(\n (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n amount1 = balance1 - feeAmount;\n amount0 = balance0;\n } else {\n revert(\"wrong token\");\n }\n }\n\n // View functions\n\n /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`\n /// @param amount0Max The maximum amount of token0 to forward on mint\n /// @param amount0Max The maximum amount of token1 to forward on mint\n /// @return amount0 actual amount of token0 to forward when minting `mintAmount`\n /// @return amount1 actual amount of token1 to forward when minting `mintAmount`\n /// @return mintAmount maximum number of G-UNI tokens to mint\n function getMintAmounts(uint256 amount0Max, uint256 amount1Max)\n external\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n uint256 totalSupply = totalSupply();\n if (totalSupply > 0) {\n (amount0, amount1, mintAmount) = _computeMintAmounts(\n totalSupply,\n amount0Max,\n amount1Max\n );\n } else {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 newLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n amount0Max,\n amount1Max\n );\n mintAmount = uint256(newLiquidity);\n (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n newLiquidity\n );\n }\n }\n\n /// @notice compute total underlying holdings of the G-UNI token supply\n /// includes current liquidity invested in uniswap position, current fees earned\n /// and any uninvested leftover (but does not include manager or gelato fees accrued)\n /// @return amount0Current current total underlying balance of token0\n /// @return amount1Current current total underlying balance of token1\n // solhint-disable-next-line function-max-lines\n function getUnderlyingBalances()\n public\n view\n returns (uint256 amount0Current, uint256 amount1Current)\n {\n (\n uint128 _liquidity,\n uint256 feeGrowthInside0Last,\n uint256 feeGrowthInside1Last,\n uint128 tokensOwed0,\n uint128 tokensOwed1\n ) = pool.positions(_getPositionID());\n\n (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();\n\n // compute current holdings from liquidity\n (amount0Current, amount1Current) = LiquidityAmounts\n .getAmountsForLiquidity(\n sqrtRatioX96,\n lowerTick.getSqrtRatioAtTick(),\n upperTick.getSqrtRatioAtTick(),\n _liquidity\n );\n\n // compute current fees earned\n uint256 fee0 =\n _computeFeesEarned(true, feeGrowthInside0Last, tick, _liquidity) +\n uint256(tokensOwed0);\n uint256 fee1 =\n _computeFeesEarned(false, feeGrowthInside1Last, tick, _liquidity) +\n uint256(tokensOwed1);\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n // add any leftover in contract to current holdings\n amount0Current +=\n fee0 +\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n amount1Current +=\n fee1 +\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n }\n\n // Private functions\n\n // solhint-disable-next-line function-max-lines\n function _rebalance(\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne,\n uint256 feeAmount,\n address paymentToken\n ) private {\n (uint128 _liquidity, , , , ) = pool.positions(_getPositionID());\n\n (uint256 feesEarned0, uint256 feesEarned1) =\n _withdrawAll(lowerTick, upperTick, _liquidity);\n\n uint256 reinvest0;\n uint256 reinvest1;\n if (paymentToken == address(token0)) {\n require(\n (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n managerBalance0 +=\n ((feesEarned0 - feeAmount) * managerFeeBPS) /\n 10000;\n managerBalance1 += (feesEarned1 * managerFeeBPS) / 10000;\n gelatoBalance0 +=\n ((feesEarned0 - feeAmount) * gelatoFeeBPS) /\n 10000;\n gelatoBalance1 += (feesEarned1 * gelatoFeeBPS) / 10000;\n reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0 -\n feeAmount;\n reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1;\n } else if (paymentToken == address(token1)) {\n require(\n (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,\n \"high fee\"\n );\n managerBalance0 += (feesEarned0 * managerFeeBPS) / 10000;\n managerBalance1 +=\n ((feesEarned1 - feeAmount) * managerFeeBPS) /\n 10000;\n gelatoBalance0 += (feesEarned0 * gelatoFeeBPS) / 10000;\n gelatoBalance1 +=\n ((feesEarned1 - feeAmount) * gelatoFeeBPS) /\n 10000;\n reinvest0 =\n token0.balanceOf(address(this)) -\n managerBalance0 -\n gelatoBalance0;\n reinvest1 =\n token1.balanceOf(address(this)) -\n managerBalance1 -\n gelatoBalance1 -\n feeAmount;\n } else {\n revert(\"wrong token\");\n }\n\n _deposit(\n lowerTick,\n upperTick,\n reinvest0,\n reinvest1,\n swapThresholdPrice,\n swapAmountBPS,\n zeroForOne\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _withdrawAll(\n int24 lowerTick_,\n int24 upperTick_,\n uint128 liquidity\n ) private returns (uint256 amountEarned0, uint256 amountEarned1) {\n uint256 preBalance0 = token0.balanceOf(address(this));\n uint256 preBalance1 = token1.balanceOf(address(this));\n\n (uint256 amount0Burned, uint256 amount1Burned) =\n pool.burn(lowerTick_, upperTick_, liquidity);\n\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n type(uint128).max,\n type(uint128).max\n );\n\n amountEarned0 =\n token0.balanceOf(address(this)) -\n preBalance0 -\n amount0Burned;\n amountEarned1 =\n token1.balanceOf(address(this)) -\n preBalance1 -\n amount1Burned;\n }\n\n function _withdrawExact(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 burnAmount,\n uint256 supply,\n uint128 liquidityBurned\n ) private {\n (uint256 burn0, uint256 burn1) =\n pool.burn(lowerTick_, upperTick_, liquidityBurned);\n\n (, , , uint128 tokensOwed0, uint128 tokensOwed1) =\n pool.positions(_getPositionID());\n uint256 fee0 = uint256(tokensOwed0) - burn0;\n uint256 fee1 = uint256(tokensOwed1) - burn1;\n\n (fee0, fee1) = _subtractAdminFees(fee0, fee1);\n\n burn0 += FullMath.mulDiv(burnAmount, fee0, supply);\n burn1 += FullMath.mulDiv(burnAmount, fee1, supply);\n\n // Withdraw tokens to user\n pool.collect(\n address(this),\n lowerTick_,\n upperTick_,\n uint128(burn0), // cast can't overflow\n uint128(burn1) // cast can't overflow\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _deposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n uint160 swapThresholdPrice,\n uint256 swapAmountBPS,\n bool zeroForOne\n ) private {\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n // First, deposit as much as we can\n uint128 baseLiquidity =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n amount0,\n amount1\n );\n if (baseLiquidity > 0) {\n (uint256 amountDeposited0, uint256 amountDeposited1) =\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n baseLiquidity,\n \"\"\n );\n\n amount0 -= amountDeposited0;\n amount1 -= amountDeposited1;\n }\n int256 swapAmount =\n int256(((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000);\n if (swapAmount > 0) {\n _swapAndDeposit(\n lowerTick_,\n upperTick_,\n amount0,\n amount1,\n swapAmount,\n swapThresholdPrice,\n zeroForOne\n );\n }\n }\n\n function _swapAndDeposit(\n int24 lowerTick_,\n int24 upperTick_,\n uint256 amount0,\n uint256 amount1,\n int256 swapAmount,\n uint160 swapThresholdPrice,\n bool zeroForOne\n ) private returns (uint256 finalAmount0, uint256 finalAmount1) {\n (int256 amount0Delta, int256 amount1Delta) =\n pool.swap(\n address(this),\n zeroForOne,\n swapAmount,\n swapThresholdPrice,\n \"\"\n );\n finalAmount0 = uint256(int256(amount0) - amount0Delta);\n finalAmount1 = uint256(int256(amount1) - amount1Delta);\n\n // Add liquidity a second time\n (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();\n uint128 liquidityAfterSwap =\n LiquidityAmounts.getLiquidityForAmounts(\n sqrtRatioX96,\n lowerTick_.getSqrtRatioAtTick(),\n upperTick_.getSqrtRatioAtTick(),\n finalAmount0,\n finalAmount1\n );\n if (liquidityAfterSwap > 0) {\n pool.mint(\n address(this),\n lowerTick_,\n upperTick_,\n liquidityAfterSwap,\n \"\"\n );\n }\n }\n\n // solhint-disable-next-line function-max-lines, code-complexity\n function _computeMintAmounts(\n uint256 totalSupply,\n uint256 amount0Max,\n uint256 amount1Max\n )\n private\n view\n returns (\n uint256 amount0,\n uint256 amount1,\n uint256 mintAmount\n )\n {\n (uint256 amount0Current, uint256 amount1Current) =\n getUnderlyingBalances();\n\n // compute proportional amount of tokens to mint\n if (amount0Current == 0 && amount1Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount1Max,\n totalSupply,\n amount1Current\n );\n } else if (amount1Current == 0 && amount0Current > 0) {\n mintAmount = FullMath.mulDiv(\n amount0Max,\n totalSupply,\n amount0Current\n );\n } else if (amount0Current == 0 && amount1Current == 0) {\n revert(\"\");\n } else {\n // only if both are non-zero\n uint256 amount0Mint =\n FullMath.mulDiv(amount0Max, totalSupply, amount0Current);\n uint256 amount1Mint =\n FullMath.mulDiv(amount1Max, totalSupply, amount1Current);\n require(amount0Mint > 0 && amount1Mint > 0, \"mint 0\");\n\n mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;\n }\n\n // compute amounts owed to contract\n amount0 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount0Current,\n totalSupply\n );\n amount1 = FullMath.mulDivRoundingUp(\n mintAmount,\n amount1Current,\n totalSupply\n );\n }\n\n // solhint-disable-next-line function-max-lines\n function _computeFeesEarned(\n bool isZero,\n uint256 feeGrowthInsideLast,\n int24 tick,\n uint128 liquidity\n ) private view returns (uint256 fee) {\n uint256 feeGrowthOutsideLower;\n uint256 feeGrowthOutsideUpper;\n uint256 feeGrowthGlobal;\n if (isZero) {\n feeGrowthGlobal = pool.feeGrowthGlobal0X128();\n (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);\n (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);\n } else {\n feeGrowthGlobal = pool.feeGrowthGlobal1X128();\n (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);\n (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);\n }\n\n unchecked {\n // calculate fee growth below\n uint256 feeGrowthBelow;\n if (tick >= lowerTick) {\n feeGrowthBelow = feeGrowthOutsideLower;\n } else {\n feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;\n }\n\n // calculate fee growth above\n uint256 feeGrowthAbove;\n if (tick < upperTick) {\n feeGrowthAbove = feeGrowthOutsideUpper;\n } else {\n feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;\n }\n\n uint256 feeGrowthInside =\n feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;\n fee = FullMath.mulDiv(\n liquidity,\n feeGrowthInside - feeGrowthInsideLast,\n 0x100000000000000000000000000000000\n );\n }\n }\n\n function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)\n private\n view\n returns (uint256 fee0, uint256 fee1)\n {\n uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;\n fee0 = rawFee0 - deduct0;\n fee1 = rawFee1 - deduct1;\n }\n\n function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)\n private\n view\n {\n uint32[] memory secondsAgo = new uint32[](2);\n secondsAgo[0] = gelatoSlippageInterval;\n secondsAgo[1] = 0;\n\n (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);\n\n require(tickCumulatives.length == 2, \"array length\");\n uint160 avgSqrtRatioX96;\n unchecked {\n int24 avgTick =\n int24(\n (tickCumulatives[1] - tickCumulatives[0]) /\n int56(uint56(gelatoSlippageInterval))\n );\n avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();\n }\n\n uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;\n if (zeroForOne) {\n require(\n swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,\n \"unacceptable slippage\"\n );\n } else {\n require(\n swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,\n \"unacceptable slippage\"\n );\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#mint\n/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface\ninterface IUniswapV3MintCallback {\n /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call\n function uniswapV3MintCallback(\n uint256 amount0Owed,\n uint256 amount1Owed,\n bytes calldata data\n ) external;\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Callback for IUniswapV3PoolActions#swap\n/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface\ninterface IUniswapV3SwapCallback {\n /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.\n /// @dev In the implementation you must pay the pool tokens owed for the swap.\n /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.\n /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.\n /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.\n /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by\n /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.\n /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external;\n}\n" - }, - "contracts/vendor/uniswap/TickMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n/// @title Math library for computing sqrt prices from ticks and vice versa\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\n/// prices between 2**-128 and 2**128\nlibrary TickMath {\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\n int24 internal constant MIN_TICK = -887272;\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\n int24 internal constant MAX_TICK = -MIN_TICK;\n\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\n uint160 internal constant MAX_SQRT_RATIO =\n 1461446703485210103287273052203988822378723970342;\n\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\n /// @dev Throws if |tick| > max tick\n /// @param tick The input tick for the above formula\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\n /// at the given tick\n function getSqrtRatioAtTick(int24 tick)\n internal\n pure\n returns (uint160 sqrtPriceX96)\n {\n uint256 absTick =\n tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\n\n // EDIT: 0.8 compatibility\n require(absTick <= uint256(int256(MAX_TICK)), \"T\");\n\n uint256 ratio =\n absTick & 0x1 != 0\n ? 0xfffcb933bd6fad37aa2d162d1a594001\n : 0x100000000000000000000000000000000;\n if (absTick & 0x2 != 0)\n ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\n if (absTick & 0x4 != 0)\n ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\n if (absTick & 0x8 != 0)\n ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\n if (absTick & 0x10 != 0)\n ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\n if (absTick & 0x20 != 0)\n ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\n if (absTick & 0x40 != 0)\n ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\n if (absTick & 0x80 != 0)\n ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\n if (absTick & 0x100 != 0)\n ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\n if (absTick & 0x200 != 0)\n ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\n if (absTick & 0x400 != 0)\n ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\n if (absTick & 0x800 != 0)\n ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\n if (absTick & 0x1000 != 0)\n ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\n if (absTick & 0x2000 != 0)\n ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\n if (absTick & 0x4000 != 0)\n ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\n if (absTick & 0x8000 != 0)\n ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\n if (absTick & 0x10000 != 0)\n ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\n if (absTick & 0x20000 != 0)\n ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\n if (absTick & 0x40000 != 0)\n ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\n if (absTick & 0x80000 != 0)\n ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\n\n if (tick > 0) ratio = type(uint256).max / ratio;\n\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\n sqrtPriceX96 = uint160(\n (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)\n );\n }\n\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\n /// ever return.\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\n function getTickAtSqrtRatio(uint160 sqrtPriceX96)\n internal\n pure\n returns (int24 tick)\n {\n // second inequality must be < because the price can never reach the price at the max tick\n require(\n sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,\n \"R\"\n );\n uint256 ratio = uint256(sqrtPriceX96) << 32;\n\n uint256 r = ratio;\n uint256 msb = 0;\n\n assembly {\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(5, gt(r, 0xFFFFFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(4, gt(r, 0xFFFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(3, gt(r, 0xFF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(2, gt(r, 0xF))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := shl(1, gt(r, 0x3))\n msb := or(msb, f)\n r := shr(f, r)\n }\n assembly {\n let f := gt(r, 0x1)\n msb := or(msb, f)\n }\n\n if (msb >= 128) r = ratio >> (msb - 127);\n else r = ratio << (127 - msb);\n\n int256 log_2 = (int256(msb) - 128) << 64;\n\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(63, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(62, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(61, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(60, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(59, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(58, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(57, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(56, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(55, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(54, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(53, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(52, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(51, f))\n r := shr(f, r)\n }\n assembly {\n r := shr(127, mul(r, r))\n let f := shr(128, r)\n log_2 := or(log_2, shl(50, f))\n }\n\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\n\n int24 tickLow =\n int24(\n (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128\n );\n int24 tickHi =\n int24(\n (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128\n );\n\n tick = tickLow == tickHi\n ? tickLow\n : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96\n ? tickHi\n : tickLow;\n }\n}\n" - }, - "contracts/vendor/uniswap/LiquidityAmounts.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.5.0;\n\nimport {FullMath} from \"./FullMath.sol\";\nimport \"@uniswap/v3-core/contracts/libraries/FixedPoint96.sol\";\n\n/// @title Liquidity amount functions\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\nlibrary LiquidityAmounts {\n function toUint128(uint256 x) private pure returns (uint128 y) {\n require((y = uint128(x)) == x);\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount0 The amount0 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount0(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n uint256 intermediate =\n FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);\n return\n toUint128(\n FullMath.mulDiv(\n amount0,\n intermediate,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param amount1 The amount1 being sent in\n /// @return liquidity The amount of returned liquidity\n function getLiquidityForAmount1(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n return\n toUint128(\n FullMath.mulDiv(\n amount1,\n FixedPoint96.Q96,\n sqrtRatioBX96 - sqrtRatioAX96\n )\n );\n }\n\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\n /// pool prices and the prices at the tick boundaries\n function getLiquidityForAmounts(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint256 amount0,\n uint256 amount1\n ) internal pure returns (uint128 liquidity) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 < sqrtRatioAX96) {\n liquidity = getLiquidityForAmount0(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n uint128 liquidity0 =\n getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\n uint128 liquidity1 =\n getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\n\n liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;\n } else {\n liquidity = getLiquidityForAmount1(\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount1\n );\n }\n }\n\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount0 The amount0\n function getAmount0ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n uint256(liquidity) << FixedPoint96.RESOLUTION,\n sqrtRatioBX96 - sqrtRatioAX96,\n sqrtRatioBX96\n ) / sqrtRatioAX96;\n }\n\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\n /// @param sqrtRatioAX96 A sqrt price\n /// @param sqrtRatioBX96 Another sqrt price\n /// @param liquidity The liquidity being valued\n /// @return amount1 The amount1\n function getAmount1ForLiquidity(\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n return\n FullMath.mulDiv(\n liquidity,\n sqrtRatioBX96 - sqrtRatioAX96,\n FixedPoint96.Q96\n );\n }\n\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\n /// pool prices and the prices at the tick boundaries\n function getAmountsForLiquidity(\n uint160 sqrtRatioX96,\n uint160 sqrtRatioAX96,\n uint160 sqrtRatioBX96,\n uint128 liquidity\n ) internal pure returns (uint256 amount0, uint256 amount1) {\n if (sqrtRatioAX96 > sqrtRatioBX96)\n (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\n\n if (sqrtRatioX96 < sqrtRatioAX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n } else if (sqrtRatioX96 < sqrtRatioBX96) {\n amount0 = getAmount0ForLiquidity(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidity\n );\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidity\n );\n } else {\n amount1 = getAmount1ForLiquidity(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidity\n );\n }\n }\n}\n" - }, - "contracts/vendor/uniswap/FullMath.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.4;\n\n/// @title Contains 512-bit math functions\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\n/// @dev Handles \"phantom overflow\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\nlibrary FullMath {\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\n function mulDiv(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = a * b\n // Compute the product mod 2**256 and mod 2**256 - 1\n // then use the Chinese Remainder Theorem to reconstruct\n // the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2**256 + prod0\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(a, b, not(0))\n prod0 := mul(a, b)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division\n if (prod1 == 0) {\n require(denominator > 0);\n assembly {\n result := div(prod0, denominator)\n }\n return result;\n }\n\n // Make sure the result is less than 2**256.\n // Also prevents denominator == 0\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0]\n // Compute remainder using mulmod\n uint256 remainder;\n assembly {\n remainder := mulmod(a, b, denominator)\n }\n // Subtract 256 bit number from 512 bit number\n assembly {\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator\n // Compute largest power of two divisor of denominator.\n // Always >= 1.\n // EDIT for 0.8 compatibility:\n // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256\n uint256 twos = denominator & (~denominator + 1);\n\n // Divide denominator by power of two\n assembly {\n denominator := div(denominator, twos)\n }\n\n // Divide [prod1 prod0] by the factors of two\n assembly {\n prod0 := div(prod0, twos)\n }\n // Shift in bits from prod1 into prod0. For this we need\n // to flip `twos` such that it is 2**256 / twos.\n // If twos is zero, then it becomes one\n assembly {\n twos := add(div(sub(0, twos), twos), 1)\n }\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2**256\n // Now that denominator is an odd number, it has an inverse\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\n // Compute the inverse by starting with a seed that is correct\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\n uint256 inv = (3 * denominator) ^ 2;\n // Now use Newton-Raphson iteration to improve the precision.\n // Thanks to Hensel's lifting lemma, this also works in modular\n // arithmetic, doubling the correct bits in each step.\n inv *= 2 - denominator * inv; // inverse mod 2**8\n inv *= 2 - denominator * inv; // inverse mod 2**16\n inv *= 2 - denominator * inv; // inverse mod 2**32\n inv *= 2 - denominator * inv; // inverse mod 2**64\n inv *= 2 - denominator * inv; // inverse mod 2**128\n inv *= 2 - denominator * inv; // inverse mod 2**256\n\n // Because the division is now exact we can divide by multiplying\n // with the modular inverse of denominator. This will give us the\n // correct result modulo 2**256. Since the precoditions guarantee\n // that the outcome is less than 2**256, this is the final result.\n // We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inv;\n return result;\n }\n }\n\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n /// @param a The multiplicand\n /// @param b The multiplier\n /// @param denominator The divisor\n /// @return result The 256-bit result\n function mulDivRoundingUp(\n uint256 a,\n uint256 b,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n result = mulDiv(a, b, denominator);\n if (mulmod(a, b, denominator) > 0) {\n require(result < type(uint256).max);\n result++;\n }\n }\n}\n" - }, - "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.4.0;\n\n/// @title FixedPoint96\n/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)\n/// @dev Used in SqrtPriceMath.sol\nlibrary FixedPoint96 {\n uint8 internal constant RESOLUTION = 96;\n uint256 internal constant Q96 = 0x1000000000000000000000000;\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "contracts/GUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\nimport {IGUniFactory} from \"./interfaces/IGUniFactory.sol\";\nimport {IGUniPoolStorage} from \"./interfaces/IGUniPoolStorage.sol\";\nimport {GUniFactoryStorage} from \"./abstract/GUniFactoryStorage.sol\";\nimport {EIP173Proxy} from \"./vendor/proxy/EIP173Proxy.sol\";\nimport {IEIP173Proxy} from \"./interfaces/IEIP173Proxy.sol\";\nimport {\n IERC20Metadata\n} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\ncontract GUniFactory is GUniFactoryStorage, IGUniFactory {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n constructor(address _uniswapV3Factory)\n GUniFactoryStorage(_uniswapV3Factory)\n {} // solhint-disable-line no-empty-blocks\n\n /// @notice createPool creates a new instance of a G-UNI token on a specified\n /// UniswapV3 pool. The msg.sender is the initial manager of the pool and will\n /// forever be associated with the G-UNI pool as it's `deployer`\n /// @param tokenA one of the tokens in the uniswap pair\n /// @param tokenB the other token in the uniswap pair\n /// @param uniFee fee tier of the uniswap pair\n /// @param managerFee proportion of earned fees that go to pool manager in Basis Points\n /// @param lowerTick initial lower bound of the Uniswap V3 position\n /// @param upperTick initial upper bound of the Uniswap V3 position\n /// @param tokenIdentifier string appended to token name to uniquely identify token instance\n /// tokenIdentifier is just for convenience but not trustworthy (can easily be spoofed)\n /// @return pool the address of the newly created G-UNI pool (proxy)\n // solhint-disable-next-line function-max-lines\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n string memory tokenIdentifier\n ) external override returns (address pool) {\n (address token0, address token1) = _getTokenOrder(tokenA, tokenB);\n\n pool = address(new EIP173Proxy(poolImplementation, address(this), \"\"));\n\n string memory symbol0 = \"?\";\n string memory symbol1 = \"?\";\n try IERC20Metadata(token0).symbol() returns (string memory sym0) {\n symbol0 = sym0;\n } catch {} // solhint-disable-line no-empty-blocks\n try IERC20Metadata(token1).symbol() returns (string memory sym1) {\n symbol1 = sym1;\n } catch {} // solhint-disable-line no-empty-blocks\n\n string memory name =\n _append(\n \"Gelato Uniswap \",\n symbol0,\n \"/\",\n symbol1,\n \" LP \",\n tokenIdentifier\n );\n\n address uniPool =\n IUniswapV3Factory(factory).getPool(token0, token1, uniFee);\n\n require(uniPool != address(0), \"uniswap pool does not exist\");\n\n IGUniPoolStorage(pool).initialize(\n name,\n \"G-UNI\",\n uniPool,\n managerFee,\n lowerTick,\n upperTick,\n msg.sender\n );\n _deployers.add(msg.sender);\n _pools[msg.sender].add(pool);\n emit PoolCreated(uniPool, msg.sender, pool);\n }\n\n function upgradePools(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);\n }\n }\n\n function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)\n external\n onlyManager\n {\n require(pools.length == datas.length, \"mismatching array length\");\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).upgradeToAndCall(\n poolImplementation,\n datas[i]\n );\n }\n }\n\n function makePoolsImmutable(address[] memory pools) external onlyManager {\n for (uint256 i = 0; i < pools.length; i++) {\n IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));\n }\n }\n\n /// @notice isPoolImmutable checks if a certain G-UNI pool is \"immutable\" i.e. that the\n /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded\n /// @param pool address of the G-UNI pool\n /// @return bool signaling if pool is immutable (true) or not (false)\n function isPoolImmutable(address pool) external view returns (bool) {\n return address(0) == getProxyAdmin(pool);\n }\n\n /// @notice getGelatoPools gets all the G-UNI pools deployed by Gelato's\n /// default deployer address (since anyone can deploy and manage G-UNI pools)\n /// @return list of Gelato managed G-UNI pool addresses\n function getGelatoPools() external view returns (address[] memory) {\n return getPools(gelatoDeployer);\n }\n\n /// @notice getDeployers fetches all addresses that have deployed a G-UNI pool\n /// @return deployers the list of deployer addresses\n function getDeployers() public view returns (address[] memory) {\n uint256 length = numDeployers();\n address[] memory deployers = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n deployers[i] = _getDeployer(i);\n }\n\n return deployers;\n }\n\n /// @notice getPools fetches all the G-UNI pool addresses deployed by `deployer`\n /// @param deployer address that has potentially deployed G-UNI pools (can return empty array)\n /// @return pools the list of G-UNI pool addresses deployed by `deployer`\n function getPools(address deployer) public view returns (address[] memory) {\n uint256 length = numPools(deployer);\n address[] memory pools = new address[](length);\n for (uint256 i = 0; i < length; i++) {\n pools[i] = _getPool(deployer, i);\n }\n\n return pools;\n }\n\n /// @notice numPools counts the total number of G-UNI pools in existence\n /// @return result total number of G-UNI pools deployed\n function numPools() public view returns (uint256 result) {\n address[] memory deployers = getDeployers();\n for (uint256 i = 0; i < deployers.length; i++) {\n result += numPools(deployers[i]);\n }\n }\n\n /// @notice numDeployers counts the total number of G-UNI pool deployer addresses\n /// @return total number of G-UNI pool deployer addresses\n function numDeployers() public view returns (uint256) {\n return _deployers.length();\n }\n\n /// @notice numPools counts the total number of G-UNI pools deployed by `deployer`\n /// @param deployer deployer address\n /// @return total number of G-UNI pools deployed by `deployer`\n function numPools(address deployer) public view returns (uint256) {\n return _pools[deployer].length();\n }\n\n /// @notice getProxyAdmin gets the current address who controls the underlying implementation\n /// of a G-UNI pool. For most all pools either this contract address or the zero address will\n /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally\n /// no longer upgradable (no one owns the zero address).\n /// @param pool address of the G-UNI pool\n /// @return address that controls the G-UNI implementation (has power to upgrade it)\n function getProxyAdmin(address pool) public view returns (address) {\n return IEIP173Proxy(pool).proxyAdmin();\n }\n\n function _getDeployer(uint256 index) internal view returns (address) {\n return _deployers.at(index);\n }\n\n function _getPool(address deployer, uint256 index)\n internal\n view\n returns (address)\n {\n return _pools[deployer].at(index);\n }\n\n function _getTokenOrder(address tokenA, address tokenB)\n internal\n pure\n returns (address token0, address token1)\n {\n require(tokenA != tokenB, \"same token\");\n (token0, token1) = tokenA < tokenB\n ? (tokenA, tokenB)\n : (tokenB, tokenA);\n require(token0 != address(0), \"no address zero\");\n }\n\n function _append(\n string memory a,\n string memory b,\n string memory c,\n string memory d,\n string memory e,\n string memory f\n ) internal pure returns (string memory) {\n return string(abi.encodePacked(a, b, c, d, e, f));\n }\n}\n" - }, - "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title The interface for the Uniswap V3 Factory\n/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees\ninterface IUniswapV3Factory {\n /// @notice Emitted when the owner of the factory is changed\n /// @param oldOwner The owner before the owner was changed\n /// @param newOwner The owner after the owner was changed\n event OwnerChanged(address indexed oldOwner, address indexed newOwner);\n\n /// @notice Emitted when a pool is created\n /// @param token0 The first token of the pool by address sort order\n /// @param token1 The second token of the pool by address sort order\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks\n /// @param pool The address of the created pool\n event PoolCreated(\n address indexed token0,\n address indexed token1,\n uint24 indexed fee,\n int24 tickSpacing,\n address pool\n );\n\n /// @notice Emitted when a new fee amount is enabled for pool creation via the factory\n /// @param fee The enabled fee, denominated in hundredths of a bip\n /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee\n event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);\n\n /// @notice Returns the current owner of the factory\n /// @dev Can be changed by the current owner via setOwner\n /// @return The address of the factory owner\n function owner() external view returns (address);\n\n /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled\n /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context\n /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee\n /// @return The tick spacing\n function feeAmountTickSpacing(uint24 fee) external view returns (int24);\n\n /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\n /// @param tokenA The contract address of either token0 or token1\n /// @param tokenB The contract address of the other token\n /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip\n /// @return pool The pool address\n function getPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external view returns (address pool);\n\n /// @notice Creates a pool for the given two tokens and fee\n /// @param tokenA One of the two tokens in the desired pool\n /// @param tokenB The other of the two tokens in the desired pool\n /// @param fee The desired fee for the pool\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved\n /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments\n /// are invalid.\n /// @return pool The address of the newly created pool\n function createPool(\n address tokenA,\n address tokenB,\n uint24 fee\n ) external returns (address pool);\n\n /// @notice Updates the owner of the factory\n /// @dev Must be called by the current owner\n /// @param _owner The new owner of the factory\n function setOwner(address _owner) external;\n\n /// @notice Enables a fee amount with the given tickSpacing\n /// @dev Fee amounts may never be removed once enabled\n /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)\n /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount\n function enableFeeAmount(uint24 fee, int24 tickSpacing) external;\n}\n" - }, - "contracts/interfaces/IGUniFactory.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\ninterface IGUniFactory {\n event PoolCreated(\n address indexed uniPool,\n address indexed manager,\n address indexed pool\n );\n\n function createPool(\n address tokenA,\n address tokenB,\n uint24 uniFee,\n uint16 managerFee,\n int24 lowerTick,\n int24 upperTick,\n string memory tokenIdentifier\n ) external returns (address pool);\n}\n" - }, - "contracts/interfaces/IGUniPoolStorage.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IGUniPoolStorage {\n function initialize(\n string memory _name,\n string memory _symbol,\n address _pool,\n uint16 _managerFeeBPS,\n int24 _lowerTick,\n int24 _upperTick,\n address _manager_\n ) external;\n}\n" - }, - "contracts/abstract/GUniFactoryStorage.sol": { - "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.4;\n\nimport {OwnableUninitialized} from \"./OwnableUninitialized.sol\";\nimport {\n Initializable\n} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\nimport {\n EnumerableSet\n} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract GUniFactoryStorage is\n OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */\n Initializable\n // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:\n // XXXX DONT MODIFY ORDERING XXXX\n{\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n // solhint-disable-next-line const-name-snakecase\n string public constant version = \"1.0.0\";\n address public immutable factory;\n address public poolImplementation;\n address public gelatoDeployer;\n EnumerableSet.AddressSet internal _deployers;\n mapping(address => EnumerableSet.AddressSet) internal _pools;\n // APPPEND ADDITIONAL STATE VARS BELOW:\n // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX\n\n event UpdatePoolImplementation(\n address previousImplementation,\n address newImplementation\n );\n\n event UpdateGelatoDeployer(\n address previosGelatoDeployer,\n address newGelatoDeployer\n );\n\n constructor(address _uniswapV3Factory) {\n factory = _uniswapV3Factory;\n }\n\n function initialize(\n address _implementation,\n address _gelatoDeployer,\n address _manager_\n ) external initializer {\n poolImplementation = _implementation;\n gelatoDeployer = _gelatoDeployer;\n _manager = _manager_;\n }\n\n function setPoolImplementation(address nextImplementation)\n external\n onlyManager\n {\n emit UpdatePoolImplementation(poolImplementation, nextImplementation);\n poolImplementation = nextImplementation;\n }\n\n function setGelatoDeployer(address nextGelatoDeployer)\n external\n onlyManager\n {\n emit UpdateGelatoDeployer(gelatoDeployer, nextGelatoDeployer);\n gelatoDeployer = nextGelatoDeployer;\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./Proxy.sol\";\n\ninterface ERC165 {\n function supportsInterface(bytes4 id) external view returns (bool);\n}\n\n///@notice Proxy implementing EIP173 for ownership management\ncontract EIP173Proxy is Proxy {\n // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////\n\n event ProxyAdminTransferred(\n address indexed previousAdmin,\n address indexed newAdmin\n );\n\n // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////\n\n constructor(\n address implementationAddress,\n address adminAddress,\n bytes memory data\n ) payable {\n _setImplementation(implementationAddress, data);\n _setProxyAdmin(adminAddress);\n }\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n function proxyAdmin() external view returns (address) {\n return _proxyAdmin();\n }\n\n function supportsInterface(bytes4 id) external view returns (bool) {\n if (id == 0x01ffc9a7 || id == 0x7f5828d0) {\n return true;\n }\n if (id == 0xFFFFFFFF) {\n return false;\n }\n\n ERC165 implementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n implementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure\n // because it is itself inside `supportsInterface` that might only get 30,000 gas.\n // In practise this is unlikely to be an issue.\n try implementation.supportsInterface(id) returns (bool support) {\n return support;\n } catch {\n return false;\n }\n }\n\n function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {\n _setProxyAdmin(newAdmin);\n }\n\n function upgradeTo(address newImplementation) external onlyProxyAdmin {\n _setImplementation(newImplementation, \"\");\n }\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n onlyProxyAdmin\n {\n _setImplementation(newImplementation, data);\n }\n\n // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////\n\n modifier onlyProxyAdmin() {\n require(msg.sender == _proxyAdmin(), \"NOT_AUTHORIZED\");\n _;\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _proxyAdmin() internal view returns (address adminAddress) {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n adminAddress := sload(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\n )\n }\n }\n\n function _setProxyAdmin(address newAdmin) internal {\n address previousAdmin = _proxyAdmin();\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,\n newAdmin\n )\n }\n emit ProxyAdminTransferred(previousAdmin, newAdmin);\n }\n}\n" - }, - "contracts/interfaces/IEIP173Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\ninterface IEIP173Proxy {\n function proxyAdmin() external view returns (address);\n\n function transferProxyAdmin(address newAdmin) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable;\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^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] = valueIndex; // Replace lastvalue's index to valueIndex\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" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity ^0.8.0;\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 {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 */\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 || !_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" - }, - "contracts/vendor/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\n// EIP-1967\nabstract contract Proxy {\n // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////\n\n event ProxyImplementationUpdated(\n address indexed previousImplementation,\n address indexed newImplementation\n );\n\n // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////\n\n // prettier-ignore\n receive() external payable virtual {\n revert(\"ETHER_REJECTED\"); // explicit reject by default\n }\n\n fallback() external payable {\n _fallback();\n }\n\n // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////\n\n function _fallback() internal {\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n let implementationAddress := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n calldatacopy(0x0, 0x0, calldatasize())\n let success := delegatecall(\n gas(),\n implementationAddress,\n 0x0,\n calldatasize(),\n 0,\n 0\n )\n let retSz := returndatasize()\n returndatacopy(0, 0, retSz)\n switch success\n case 0 {\n revert(0, retSz)\n }\n default {\n return(0, retSz)\n }\n }\n }\n\n function _setImplementation(address newImplementation, bytes memory data)\n internal\n {\n address previousImplementation;\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n previousImplementation := sload(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n )\n }\n\n // solhint-disable-next-line security/no-inline-assembly\n assembly {\n sstore(\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,\n newImplementation\n )\n }\n\n emit ProxyImplementationUpdated(\n previousImplementation,\n newImplementation\n );\n\n if (data.length > 0) {\n (bool success, ) = newImplementation.delegatecall(data);\n if (!success) {\n assembly {\n // This assembly ensure the revert contains the exact string data\n let returnDataSize := returndatasize()\n returndatacopy(0, 0, returnDataSize)\n revert(0, returnDataSize)\n }\n }\n }\n }\n}\n" - }, - "contracts/vendor/proxy/EIP173ProxyWithReceive.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport \"./EIP173Proxy.sol\";\n\n///@notice Proxy implementing EIP173 for ownership management that accept ETH via receive\ncontract EIP173ProxyWithReceive is EIP173Proxy {\n constructor(\n address implementationAddress,\n address ownerAddress,\n bytes memory data\n ) payable EIP173Proxy(implementationAddress, ownerAddress, data) {}\n\n receive() external payable override {}\n}\n" - }, - "contracts/interfaces/IUniswapV3Factory.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {\n IUniswapV3Factory\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol\";\n" - }, - "contracts/__mocks__/SwapTest.sol": { - "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.4;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {\n IUniswapV3SwapCallback\n} from \"@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol\";\nimport {\n IUniswapV3Pool\n} from \"@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol\";\n\ncontract SwapTest is IUniswapV3SwapCallback {\n function swap(\n address pool,\n bool zeroForOne,\n int256 amountSpecified\n ) external {\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n\n function washTrade(\n address pool,\n int256 amountSpecified,\n uint256 numTrades,\n uint256 ratio\n ) external {\n for (uint256 i = 0; i < numTrades; i++) {\n bool zeroForOne = i % ratio > 0;\n (uint160 sqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n zeroForOne ? sqrtRatio - 1000 : sqrtRatio + 1000,\n abi.encode(msg.sender)\n );\n }\n }\n\n function getSwapResult(\n address pool,\n bool zeroForOne,\n int256 amountSpecified,\n uint160 sqrtPriceLimitX96\n )\n external\n returns (\n int256 amount0Delta,\n int256 amount1Delta,\n uint160 nextSqrtRatio\n )\n {\n (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap(\n address(msg.sender),\n zeroForOne,\n amountSpecified,\n sqrtPriceLimitX96,\n abi.encode(msg.sender)\n );\n\n (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0();\n }\n\n function uniswapV3SwapCallback(\n int256 amount0Delta,\n int256 amount1Delta,\n bytes calldata data\n ) external override {\n address sender = abi.decode(data, (address));\n\n if (amount0Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(\n sender,\n msg.sender,\n uint256(amount0Delta)\n );\n } else if (amount1Delta > 0) {\n IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(\n sender,\n msg.sender,\n uint256(amount1Delta)\n );\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": ["ast"] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} diff --git a/lib/g-uni-v1-core/hardhat.config.ts b/lib/g-uni-v1-core/hardhat.config.ts deleted file mode 100644 index 3e7170fe7..000000000 --- a/lib/g-uni-v1-core/hardhat.config.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { HardhatUserConfig } from "hardhat/config"; - -// PLUGINS -import "@nomiclabs/hardhat-ethers"; -import "@nomiclabs/hardhat-etherscan"; -import "@nomiclabs/hardhat-waffle"; -import "@typechain/hardhat"; -import "hardhat-deploy"; -import "solidity-coverage"; -import "./lib/uniswap"; - -// Process Env Variables -import * as dotenv from "dotenv"; -dotenv.config({ path: __dirname + "/.env" }); - -const config: HardhatUserConfig = { - - // hardhat-deploy - namedAccounts: { - deployer: { - default: 0, - }, - }, - - // etherscan: { - // apiKey: process.env.ETHERSCAN_API_KEY, - // }, - - networks: { - anvil: { - chainId: 31337, - url: "http://localhost:8545", - accounts: [process.env.ANVIL_PRIVATE_KEY ?? ""], - }, - blastSepolia: { - chainId: 168587773, - url: process.env.BLAST_SEPOLIA_RPC || "https://sepolia.blast.io", - accounts: [process.env.DEPLOYER_PRIVATE_KEY ?? ""], - }, - arbitrumSepolia: { - chainId: 421614, - url: process.env.ARBITRUM_SEPOLIA_RPC || "https://sepolia-rollup.arbitrum.io/rpc", - accounts: [process.env.DEPLOYER_PRIVATE_KEY ?? ""], - }, - modeSepolia: { - chainId: 919, - url: process.env.MODE_SEPOLIA_RPC || "https://sepolia.mode.network", - accounts: [process.env.DEPLOYER_PRIVATE_KEY ?? ""], - }, - baseSepolia: { - chainId: 84532, - url: process.env.BASE_SEPOLIA_RPC || "https://sepolia.base.org", - accounts: [process.env.DEPLOYER_PRIVATE_KEY ?? ""], - }, - mantleSepolia: { - chainId: 5003, - url: process.env.MANTLE_SEPOLIA_RPC, - accounts: [process.env.DEPLOYER_PRIVATE_KEY ?? ""] - } - }, - - solidity: { - compilers: [ - { - version: "0.7.3", - settings: { - optimizer: { enabled: true }, - }, - }, - { - version: "0.8.19", - settings: { - optimizer: { enabled: true, runs: 1 }, - }, - }, - ], - }, - - typechain: { - outDir: "typechain", - target: "ethers-v5", - }, - etherscan: { - apiKey: process.env[`${process.env.HARDHAT_NETWORK}_ETHERSCAN_API_KEY`], - } -}; - -export default config; diff --git a/lib/g-uni-v1-core/lib/uniswap.js b/lib/g-uni-v1-core/lib/uniswap.js deleted file mode 100644 index d0b6f4b72..000000000 --- a/lib/g-uni-v1-core/lib/uniswap.js +++ /dev/null @@ -1,31 +0,0 @@ -const fs = require("fs"); -const { - TASK_COMPILE_GET_COMPILATION_TASKS, -} = require("hardhat/builtin-tasks/task-names"); - -const TASK_CREATE_UNISWAPV3_ARTIFACT = "TASK_CREATE_UNISWAPV3_ARTIFACT"; - -/* eslint-disable no-undef */ -subtask(TASK_COMPILE_GET_COMPILATION_TASKS, async (_, __, runSuper) => { - const otherTasks = await runSuper(); - return [...otherTasks, TASK_CREATE_UNISWAPV3_ARTIFACT]; -}); - -subtask(TASK_CREATE_UNISWAPV3_ARTIFACT, async (_, { artifacts }) => { - const artifact = { - _format: "hh-sol-artifact-1", - contractName: "UniswapV3Factory", - abi: [], - bytecode: - "0x60a060405234801561001057600080fd5b503060601b608052600380546001600160a01b031916339081179091556040516000907fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c908290a36101f4600081815260046020527ffb8cf1d12598d1a039dd1d106665851a96aadf67d0d9ed76fceea282119208b7805462ffffff1916600a90811790915560405190929160008051602061614b83398151915291a3610bb8600081815260046020527f72dffa9b822156d9cf4b0090fa0b656bcb9cc2b2c60eb6acfc20a34f54b31743805462ffffff1916603c90811790915560405190929160008051602061614b83398151915291a3612710600081815260046020527f8cc740d51daa94ff54f33bd779c2d20149f524c340519b49181be5a08615f829805462ffffff191660c890811790915560405190929160008051602061614b83398151915291a360805160601c615fd7610174600039806105515250615fd76000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063890357301161005b578063890357301461013b5780638a7c195f146101855780638da5cb5b146101b0578063a1671295146101b85761007d565b806313af4035146100825780631698ee82146100aa57806322afcccb14610102575b600080fd5b6100a86004803603602081101561009857600080fd5b50356001600160a01b03166101f4565b005b6100e6600480360360608110156100c057600080fd5b5080356001600160a01b03908116916020810135909116906040013562ffffff16610267565b604080516001600160a01b039092168252519081900360200190f35b6101246004803603602081101561011857600080fd5b503562ffffff16610293565b6040805160029290920b8252519081900360200190f35b6101436102a8565b604080516001600160a01b0396871681529486166020860152929094168383015262ffffff16606083015260029290920b608082015290519081900360a00190f35b6100a86004803603604081101561019b57600080fd5b5062ffffff813516906020013560020b6102de565b6100e66103a1565b6100e6600480360360608110156101ce57600080fd5b5080356001600160a01b03908116916020810135909116906040013562ffffff166103b0565b6003546001600160a01b0316331461020b57600080fd5b6003546040516001600160a01b038084169216907fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c90600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b60056020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b60046020526000908152604090205460020b81565b600054600154600280546001600160a01b03938416939283169281169162ffffff600160a01b83041691600160b81b9004900b85565b6003546001600160a01b031633146102f557600080fd5b620f42408262ffffff161061030957600080fd5b60008160020b13801561032057506140008160020b125b61032957600080fd5b62ffffff8216600090815260046020526040902054600290810b900b1561034f57600080fd5b62ffffff828116600081815260046020526040808220805462ffffff1916600287900b958616179055517fc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc9190a35050565b6003546001600160a01b031681565b60006103ba610546565b826001600160a01b0316846001600160a01b031614156103d957600080fd5b600080846001600160a01b0316866001600160a01b0316106103fc5784866103ff565b85855b90925090506001600160a01b03821661041757600080fd5b62ffffff8416600090815260046020526040902054600290810b9081900b61043e57600080fd5b6001600160a01b0383811660009081526005602090815260408083208685168452825280832062ffffff8a168452909152902054161561047d57600080fd5b61048a308484888561057d565b6001600160a01b03808516600081815260056020818152604080842089871680865290835281852062ffffff8e168087529084528286208054988a166001600160a01b0319998a1681179091558287529484528286208787528452828620818752845294829020805490971684179096558051600289900b815291820192909252815195995091947f783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b71189281900390910190a45050509392505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461057b57600080fd5b565b6040805160a0810182526001600160a01b03878116808352878216602080850182905292881684860181905262ffffff888116606080880182905260028a810b6080998a01819052600080546001600160a01b03199081169099178155600180548a1689179055825490981686177fffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffff16600160a01b8502177fffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffff16600160b81b91830b9095160293909317909255875180870194909452838801929092528281019190915285518083039091018152930193849052825192909101919091209091610686906106f5565b8190604051809103906000f59050801580156106a6573d6000803e3d6000fd5b50600080546001600160a01b0319908116909155600180549091169055600280547fffffffffffff00000000000000000000000000000000000000000000000000001690559695505050505050565b6158c8806107038339019056fe6101606040523480156200001257600080fd5b503060601b60805260408051630890357360e41b81529051600091339163890357309160048082019260a092909190829003018186803b1580156200005657600080fd5b505afa1580156200006b573d6000803e3d6000fd5b505050506040513d60a08110156200008257600080fd5b508051602080830151604084015160608086015160809096015160e896871b6001600160e81b0319166101005291811b6001600160601b031990811660e05292811b831660c0529390931b1660a052600282810b900b90921b610120529150620000f79082906200010f811b62002b8417901c565b60801b6001600160801b03191661014052506200017d565b60008082600281900b620d89e719816200012557fe5b05029050600083600281900b620d89e8816200013d57fe5b0502905060008460020b83830360020b816200015557fe5b0560010190508062ffffff166001600160801b038016816200017357fe5b0495945050505050565b60805160601c60a05160601c60c05160601c60e05160601c6101005160e81c6101205160e81c6101405160801c61567e6200024a60003980611fee5280614b5f5280614b96525080610c0052806128fd5280614bca5280614bfc525080610cef52806119cb5280611a0252806129455250806111c75280611a855280611ef4528061244452806129215280613e6b5250806108d252806112f55280611a545280611e8e52806123be5280613d2252508061207b528061227d52806128d9525080612bfb525061567e6000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c806370cf754a116100ee578063c45a015511610097578063ddca3f4311610071578063ddca3f4314610800578063f305839914610820578063f30dba9314610828578063f637731d146108aa576101ae565b8063c45a0155146107d1578063d0c93a7c146107d9578063d21220a7146107f8576101ae565b8063883bdbfd116100c8578063883bdbfd14610633578063a34123a71461073c578063a38807f214610776576101ae565b806370cf754a146105c65780638206a4d1146105ce57806385b66729146105f6576101ae565b80633850c7bd1161015b578063490e6cbc11610135578063490e6cbc146104705780634f1eb3d8146104fc578063514ea4bf1461054d5780635339c296146105a6576101ae565b80633850c7bd1461035b5780633c8a7d8d146103b45780634614131914610456576101ae565b80631ad8b03b1161018c5780631ad8b03b146102aa578063252c09d7146102e157806332148f6714610338576101ae565b80630dfe1681146101b3578063128acb08146101d75780631a68650214610286575b600080fd5b6101bb6108d0565b604080516001600160a01b039092168252519081900360200190f35b61026d600480360360a08110156101ed57600080fd5b6001600160a01b0382358116926020810135151592604082013592606083013516919081019060a08101608082013564010000000081111561022e57600080fd5b82018360208201111561024057600080fd5b8035906020019184600183028401116401000000008311171561026257600080fd5b5090925090506108f4565b6040805192835260208301919091528051918290030190f35b61028e6114ad565b604080516001600160801b039092168252519081900360200190f35b6102b26114bc565b60405180836001600160801b03168152602001826001600160801b031681526020019250505060405180910390f35b6102fe600480360360208110156102f757600080fd5b50356114d6565b6040805163ffffffff909516855260069390930b60208501526001600160a01b039091168383015215156060830152519081900360800190f35b6103596004803603602081101561034e57600080fd5b503561ffff1661151c565b005b610363611616565b604080516001600160a01b03909816885260029690960b602088015261ffff9485168787015292841660608701529216608085015260ff90911660a0840152151560c0830152519081900360e00190f35b61026d600480360360a08110156103ca57600080fd5b6001600160a01b03823516916020810135600290810b92604083013590910b916001600160801b036060820135169181019060a08101608082013564010000000081111561041757600080fd5b82018360208201111561042957600080fd5b8035906020019184600183028401116401000000008311171561044b57600080fd5b509092509050611666565b61045e611922565b60408051918252519081900360200190f35b6103596004803603608081101561048657600080fd5b6001600160a01b0382351691602081013591604082013591908101906080810160608201356401000000008111156104bd57600080fd5b8201836020820111156104cf57600080fd5b803590602001918460018302840111640100000000831117156104f157600080fd5b509092509050611928565b6102b2600480360360a081101561051257600080fd5b506001600160a01b03813516906020810135600290810b91604081013590910b906001600160801b0360608201358116916080013516611d83565b61056a6004803603602081101561056357600080fd5b5035611f9d565b604080516001600160801b0396871681526020810195909552848101939093529084166060840152909216608082015290519081900360a00190f35b61045e600480360360208110156105bc57600080fd5b503560010b611fda565b61028e611fec565b610359600480360360408110156105e457600080fd5b5060ff81358116916020013516612010565b6102b26004803603606081101561060c57600080fd5b506001600160a01b03813516906001600160801b036020820135811691604001351661220f565b6106a36004803603602081101561064957600080fd5b81019060208101813564010000000081111561066457600080fd5b82018360208201111561067657600080fd5b8035906020019184602083028401116401000000008311171561069857600080fd5b5090925090506124dc565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156106e75781810151838201526020016106cf565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561072657818101518382015260200161070e565b5050505090500194505050505060405180910390f35b61026d6004803603606081101561075257600080fd5b508035600290810b91602081013590910b90604001356001600160801b0316612569565b6107a06004803603604081101561078c57600080fd5b508035600290810b9160200135900b6126e0565b6040805160069490940b84526001600160a01b03909216602084015263ffffffff1682820152519081900360600190f35b6101bb6128d7565b6107e16128fb565b6040805160029290920b8252519081900360200190f35b6101bb61291f565b610808612943565b6040805162ffffff9092168252519081900360200190f35b61045e612967565b6108486004803603602081101561083e57600080fd5b503560020b61296d565b604080516001600160801b039099168952600f9790970b602089015287870195909552606087019390935260069190910b60808601526001600160a01b031660a085015263ffffffff1660c0840152151560e083015251908190036101000190f35b610359600480360360208110156108c057600080fd5b50356001600160a01b03166129db565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806108ff612bf0565b85610936576040805162461bcd60e51b8152602060048201526002602482015261415360f01b604482015290519081900360640190fd5b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602083015261ffff600160b81b8204811693830193909352600160c81b810483166060830152600160d81b8104909216608082015260ff600160e81b8304811660a0830152600160f01b909204909116151560c082018190526109ef576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b87610a3a5780600001516001600160a01b0316866001600160a01b0316118015610a35575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038716105b610a6c565b80600001516001600160a01b0316866001600160a01b0316108015610a6c57506401000276a36001600160a01b038716115b610aa3576040805162461bcd60e51b815260206004820152600360248201526214d41360ea1b604482015290519081900360640190fd5b6000805460ff60f01b191681556040805160c08101909152808a610ad25760048460a0015160ff16901c610ae5565b60108460a0015160ff1681610ae357fe5b065b60ff1681526004546001600160801b03166020820152604001610b06612c27565b63ffffffff168152602001600060060b815260200160006001600160a01b031681526020016000151581525090506000808913905060006040518060e001604052808b81526020016000815260200185600001516001600160a01b03168152602001856020015160020b81526020018c610b8257600254610b86565b6001545b815260200160006001600160801b0316815260200184602001516001600160801b031681525090505b805115801590610bd55750886001600160a01b031681604001516001600160a01b031614155b15610f9f57610be261560e565b60408201516001600160a01b031681526060820151610c25906006907f00000000000000000000000000000000000000000000000000000000000000008f612c2b565b15156040830152600290810b810b60208301819052620d89e719910b1215610c5657620d89e7196020820152610c75565b6020810151620d89e860029190910b1315610c7557620d89e860208201525b610c828160200151612d6d565b6001600160a01b031660608201526040820151610d13908d610cbc578b6001600160a01b031683606001516001600160a01b031611610cd6565b8b6001600160a01b031683606001516001600160a01b0316105b610ce4578260600151610ce6565b8b5b60c085015185517f000000000000000000000000000000000000000000000000000000000000000061309f565b60c085015260a084015260808301526001600160a01b031660408301528215610d7557610d498160c00151826080015101613291565b825103825260a0810151610d6b90610d6090613291565b6020840151906132a7565b6020830152610db0565b610d828160a00151613291565b825101825260c08101516080820151610daa91610d9f9101613291565b6020840151906132c3565b60208301525b835160ff1615610df6576000846000015160ff168260c0015181610dd057fe5b60c0840180519290910491829003905260a0840180519091016001600160801b03169052505b60c08201516001600160801b031615610e3557610e298160c00151600160801b8460c001516001600160801b03166132d9565b60808301805190910190525b80606001516001600160a01b031682604001516001600160a01b03161415610f5e57806040015115610f35578360a00151610ebf57610e9d846040015160008760200151886040015188602001518a606001516008613389909695949392919063ffffffff16565b6001600160a01b03166080860152600690810b900b6060850152600160a08501525b6000610f0b82602001518e610ed657600154610edc565b84608001515b8f610eeb578560800151610eef565b6002545b608089015160608a015160408b0151600595949392919061351c565b90508c15610f17576000035b610f258360c00151826135ef565b6001600160801b031660c0840152505b8b610f44578060200151610f4d565b60018160200151035b600290810b900b6060830152610f99565b80600001516001600160a01b031682604001516001600160a01b031614610f9957610f8c82604001516136a5565b600290810b900b60608301525b50610baf565b836020015160020b816060015160020b1461107a57600080610fed86604001518660400151886020015188602001518a606001518b6080015160086139d1909695949392919063ffffffff16565b604085015160608601516000805461ffff60c81b1916600160c81b61ffff958616021761ffff60b81b1916600160b81b95909416949094029290921762ffffff60a01b1916600160a01b62ffffff60029490940b93909316929092029190911773ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909116179055506110ac9050565b60408101516000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039092169190911790555b8060c001516001600160801b031683602001516001600160801b0316146110f25760c0810151600480546001600160801b0319166001600160801b039092169190911790555b8a1561114257608081015160015560a08101516001600160801b03161561113d5760a0810151600380546001600160801b031981166001600160801b03918216909301169190911790555b611188565b608081015160025560a08101516001600160801b0316156111885760a0810151600380546001600160801b03808216600160801b92839004821690940116029190911790555b8115158b1515146111a157602081015181518b036111ae565b80600001518a0381602001515b90965094508a156112e75760008512156111f0576111f07f00000000000000000000000000000000000000000000000000000000000000008d87600003613b86565b60006111fa613cd4565b9050336001600160a01b031663fa461e3388888c8c6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561127e57600080fd5b505af1158015611292573d6000803e3d6000fd5b5050505061129e613cd4565b6112a88289613e0d565b11156112e1576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b50611411565b600086121561131e5761131e7f00000000000000000000000000000000000000000000000000000000000000008d88600003613b86565b6000611328613e1d565b9050336001600160a01b031663fa461e3388888c8c6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b1580156113ac57600080fd5b505af11580156113c0573d6000803e3d6000fd5b505050506113cc613e1d565b6113d68288613e0d565b111561140f576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b505b60408082015160c083015160608085015184518b8152602081018b90526001600160a01b03948516818701526001600160801b039093169183019190915260020b60808201529151908e169133917fc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca679181900360a00190a350506000805460ff60f01b1916600160f01b17905550919890975095505050505050565b6004546001600160801b031681565b6003546001600160801b0380821691600160801b90041682565b60088161ffff81106114e757600080fd5b015463ffffffff81169150640100000000810460060b90600160581b81046001600160a01b031690600160f81b900460ff1684565b600054600160f01b900460ff16611560576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19169055611575612bf0565b60008054600160d81b900461ffff169061159160088385613eb5565b6000805461ffff808416600160d81b810261ffff60d81b19909316929092179092559192508316146115fe576040805161ffff80851682528316602082015281517fac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a929181900390910190a15b50506000805460ff60f01b1916600160f01b17905550565b6000546001600160a01b03811690600160a01b810460020b9061ffff600160b81b8204811691600160c81b8104821691600160d81b8204169060ff600160e81b8204811691600160f01b90041687565b600080548190600160f01b900460ff166116ad576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b191690556001600160801b0385166116cd57600080fd5b60008061171b60405180608001604052808c6001600160a01b031681526020018b60020b81526020018a60020b81526020016117118a6001600160801b0316613f58565b600f0b9052613f69565b9250925050819350809250600080600086111561173d5761173a613cd4565b91505b841561174e5761174b613e1d565b90505b336001600160a01b031663d348799787878b8b6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b1580156117d057600080fd5b505af11580156117e4573d6000803e3d6000fd5b50505050600086111561183b576117f9613cd4565b6118038388613e0d565b111561183b576040805162461bcd60e51b815260206004820152600260248201526104d360f41b604482015290519081900360640190fd5b841561188b57611849613e1d565b6118538287613e0d565b111561188b576040805162461bcd60e51b81526020600482015260026024820152614d3160f01b604482015290519081900360640190fd5b8960020b8b60020b8d6001600160a01b03167f7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde338d8b8b60405180856001600160a01b03168152602001846001600160801b0316815260200183815260200182815260200194505050505060405180910390a450506000805460ff60f01b1916600160f01b17905550919890975095505050505050565b60025481565b600054600160f01b900460ff1661196c576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19169055611981612bf0565b6004546001600160801b0316806119c3576040805162461bcd60e51b81526020600482015260016024820152601360fa1b604482015290519081900360640190fd5b60006119f8867f000000000000000000000000000000000000000000000000000000000000000062ffffff16620f42406141a9565b90506000611a2f867f000000000000000000000000000000000000000000000000000000000000000062ffffff16620f42406141a9565b90506000611a3b613cd4565b90506000611a47613e1d565b90508815611a7a57611a7a7f00000000000000000000000000000000000000000000000000000000000000008b8b613b86565b8715611aab57611aab7f00000000000000000000000000000000000000000000000000000000000000008b8a613b86565b336001600160a01b031663e9cbafb085858a8a6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b158015611b2d57600080fd5b505af1158015611b41573d6000803e3d6000fd5b505050506000611b4f613cd4565b90506000611b5b613e1d565b905081611b688588613e0d565b1115611ba0576040805162461bcd60e51b8152602060048201526002602482015261046360f41b604482015290519081900360640190fd5b80611bab8487613e0d565b1115611be3576040805162461bcd60e51b8152602060048201526002602482015261463160f01b604482015290519081900360640190fd5b8382038382038115611c725760008054600160e81b9004600f16908115611c16578160ff168481611c1057fe5b04611c19565b60005b90506001600160801b03811615611c4c57600380546001600160801b038082168401166001600160801b03199091161790555b611c66818503600160801b8d6001600160801b03166132d9565b60018054909101905550505b8015611cfd5760008054600160e81b900460041c600f16908115611ca2578160ff168381611c9c57fe5b04611ca5565b60005b90506001600160801b03811615611cd757600380546001600160801b03600160801b8083048216850182160291161790555b611cf1818403600160801b8d6001600160801b03166132d9565b60028054909101905550505b8d6001600160a01b0316336001600160a01b03167fbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca6338f8f86866040518085815260200184815260200183815260200182815260200194505050505060405180910390a350506000805460ff60f01b1916600160f01b179055505050505050505050505050565b600080548190600160f01b900460ff16611dca576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19168155611de460073389896141e3565b60038101549091506001600160801b0390811690861611611e055784611e14565b60038101546001600160801b03165b60038201549093506001600160801b03600160801b909104811690851611611e3c5783611e52565b6003810154600160801b90046001600160801b03165b91506001600160801b03831615611eb7576003810180546001600160801b031981166001600160801b03918216869003821617909155611eb7907f0000000000000000000000000000000000000000000000000000000000000000908a908616613b86565b6001600160801b03821615611f1d576003810180546001600160801b03600160801b808304821686900382160291811691909117909155611f1d907f0000000000000000000000000000000000000000000000000000000000000000908a908516613b86565b604080516001600160a01b038a1681526001600160801b0380861660208301528416818301529051600288810b92908a900b9133917f70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0919081900360600190a4506000805460ff60f01b1916600160f01b17905590969095509350505050565b60076020526000908152604090208054600182015460028301546003909301546001600160801b0392831693919281811691600160801b90041685565b60066020526000908152604090205481565b7f000000000000000000000000000000000000000000000000000000000000000081565b600054600160f01b900460ff16612054576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916905560408051638da5cb5b60e01b815290516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691638da5cb5b916004808301926020929190829003018186803b1580156120c157600080fd5b505afa1580156120d5573d6000803e3d6000fd5b505050506040513d60208110156120eb57600080fd5b50516001600160a01b0316331461210157600080fd5b60ff82161580612124575060048260ff16101580156121245750600a8260ff1611155b801561214e575060ff8116158061214e575060048160ff161015801561214e5750600a8160ff1611155b61215757600080fd5b60008054610ff0600484901b16840160ff908116600160e81b9081027fffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841617909355919004167f973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b1336010826040805160ff9390920683168252600f600486901c16602083015286831682820152918516606082015290519081900360800190a150506000805460ff60f01b1916600160f01b17905550565b600080548190600160f01b900460ff16612256576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916905560408051638da5cb5b60e01b815290516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691638da5cb5b916004808301926020929190829003018186803b1580156122c357600080fd5b505afa1580156122d7573d6000803e3d6000fd5b505050506040513d60208110156122ed57600080fd5b50516001600160a01b0316331461230357600080fd5b6003546001600160801b039081169085161161231f578361232c565b6003546001600160801b03165b6003549092506001600160801b03600160801b9091048116908416116123525782612366565b600354600160801b90046001600160801b03165b90506001600160801b038216156123e7576003546001600160801b038381169116141561239557600019909101905b600380546001600160801b031981166001600160801b039182168590038216179091556123e7907f00000000000000000000000000000000000000000000000000000000000000009087908516613b86565b6001600160801b0381161561246d576003546001600160801b03828116600160801b90920416141561241857600019015b600380546001600160801b03600160801b80830482168590038216029181169190911790915561246d907f00000000000000000000000000000000000000000000000000000000000000009087908416613b86565b604080516001600160801b0380851682528316602082015281516001600160a01b0388169233927f596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151929081900390910190a36000805460ff60f01b1916600160f01b1790559094909350915050565b6060806124e7612bf0565b61255e6124f2612c27565b858580806020026020016040519081016040528093929190818152602001838360200280828437600092018290525054600454600896959450600160a01b820460020b935061ffff600160b81b8304811693506001600160801b0390911691600160c81b900416614247565b915091509250929050565b600080548190600160f01b900460ff166125b0576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916815560408051608081018252338152600288810b602083015287900b918101919091528190819061260990606081016125fc6001600160801b038a16613f58565b600003600f0b9052613f69565b925092509250816000039450806000039350600085118061262a5750600084115b15612669576003830180546001600160801b038082168089018216600160801b93849004831689019092169092029091176001600160801b0319161790555b604080516001600160801b0388168152602081018790528082018690529051600289810b92908b900b9133917f0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c919081900360600190a450506000805460ff60f01b1916600160f01b179055509094909350915050565b60008060006126ed612bf0565b6126f785856143a1565b600285810b810b60009081526005602052604080822087840b90930b825281206003830154600681900b9367010000000000000082046001600160a01b0316928492600160d81b810463ffffffff169284929091600160f81b900460ff168061275f57600080fd5b6003820154600681900b985067010000000000000081046001600160a01b03169650600160d81b810463ffffffff169450600160f81b900460ff16806127a457600080fd5b50506040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b810b6020840181905261ffff600160b81b8404811695850195909552600160c81b830485166060850152600160d81b8304909416608084015260ff600160e81b8304811660a0850152600160f01b909204909116151560c08301529093508e810b91900b1215905061284d575093909403965090039350900390506128d0565b8a60020b816020015160020b12156128c1576000612869612c27565b602083015160408401516004546060860151939450600093849361289f936008938893879392916001600160801b031690613389565b9a9003989098039b5050949096039290920396509091030392506128d0915050565b50949093039650039350900390505b9250925092565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60015481565b60056020526000908152604090208054600182015460028301546003909301546001600160801b03831693600160801b909304600f0b9290600681900b9067010000000000000081046001600160a01b031690600160d81b810463ffffffff1690600160f81b900460ff1688565b6000546001600160a01b031615612a1e576040805162461bcd60e51b8152602060048201526002602482015261414960f01b604482015290519081900360640190fd5b6000612a29826136a5565b9050600080612a41612a39612c27565b60089061446a565b6040805160e0810182526001600160a01b038816808252600288810b6020808501829052600085870181905261ffff898116606088018190529089166080880181905260a08801839052600160c0909801979097528154600160f01b73ffffffffffffffffffffffffffffffffffffffff19909116871762ffffff60a01b1916600160a01b62ffffff9787900b9790971696909602959095177fffffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffff16600160c81b9091021761ffff60d81b1916600160d81b909602959095177fff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1692909217909355835191825281019190915281519395509193507f98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c9592918290030190a150505050565b60008082600281900b620d89e71981612b9957fe5b05029050600083600281900b620d89e881612bb057fe5b0502905060008460020b83830360020b81612bc757fe5b0560010190508062ffffff166001600160801b03801681612be457fe5b0493505050505b919050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612c2557600080fd5b565b4290565b60008060008460020b8660020b81612c3f57fe5b05905060008660020b128015612c6657508460020b8660020b81612c5f57fe5b0760020b15155b15612c7057600019015b8315612ce557600080612c82836144b6565b600182810b810b600090815260208d9052604090205460ff83169190911b80016000190190811680151597509294509092509085612cc757888360ff16860302612cda565b88612cd1826144c8565b840360ff168603025b965050505050612d63565b600080612cf4836001016144b6565b91509150600060018260ff166001901b031990506000818b60008660010b60010b8152602001908152602001600020541690508060001415955085612d4657888360ff0360ff16866001010102612d5c565b8883612d5183614568565b0360ff168660010101025b9650505050505b5094509492505050565b60008060008360020b12612d84578260020b612d8c565b8260020b6000035b9050620d89e8811115612dca576040805162461bcd60e51b81526020600482015260016024820152601560fa1b604482015290519081900360640190fd5b600060018216612dde57600160801b612df0565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615612e24576ffff97272373d413259a46990580e213a0260801c5b6004821615612e43576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b6008821615612e62576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b6010821615612e81576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615612ea0576fff973b41fa98c081472e6896dfb254c00260801c5b6040821615612ebf576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615612ede576ffe5dee046a99a2a811c461f1969c30530260801c5b610100821615612efe576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615612f1e576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615612f3e576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615612f5e576fe7159475a2c29b7443b29c7fa6e889d90260801c5b611000821615612f7e576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615612f9e576fa9f746462d870fdf8a65dc1f90e061e50260801c5b614000821615612fbe576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615612fde576f31be135f97d08fd981231505542fcfa60260801c5b62010000821615612fff576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b6202000082161561301f576e5d6af8dedb81196699c329225ee6040260801c5b6204000082161561303e576d2216e584f5fa1ea926041bedfe980260801c5b6208000082161561305b576b048a170391f7dc42444e8fa20260801c5b60008460020b131561307657806000198161307257fe5b0490505b64010000000081061561308a57600161308d565b60005b60ff16602082901c0192505050919050565b60008080806001600160a01b03808916908a1610158187128015906131245760006130d88989620f42400362ffffff16620f42406132d9565b9050826130f1576130ec8c8c8c6001614652565b6130fe565b6130fe8b8d8c60016146cd565b955085811061310f578a965061311e565b61311b8c8b838661478a565b96505b5061316e565b8161313b576131368b8b8b60006146cd565b613148565b6131488a8c8b6000614652565b935083886000031061315c5789955061316e565b61316b8b8a8a600003856147d6565b95505b6001600160a01b038a81169087161482156131d15780801561318d5750815b6131a35761319e878d8c60016146cd565b6131a5565b855b95508080156131b2575081155b6131c8576131c3878d8c6000614652565b6131ca565b845b945061321b565b8080156131db5750815b6131f1576131ec8c888c6001614652565b6131f3565b855b9550808015613200575081155b613216576132118c888c60006146cd565b613218565b845b94505b8115801561322b57508860000385115b15613237578860000394505b81801561325657508a6001600160a01b0316876001600160a01b031614155b15613265578589039350613282565b61327f868962ffffff168a620f42400362ffffff166141a9565b93505b50505095509550955095915050565b6000600160ff1b82106132a357600080fd5b5090565b808203828113156000831215146132bd57600080fd5b92915050565b818101828112156000831215146132bd57600080fd5b600080806000198587098686029250828110908390030390508061330f576000841161330457600080fd5b508290049050613382565b80841161331b57600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b60008063ffffffff8716613430576000898661ffff1661ffff81106133aa57fe5b60408051608081018252919092015463ffffffff8082168084526401000000008304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff16151560608301529092508a161461341c57613419818a8988614822565b90505b806020015181604001519250925050613510565b8688036000806134458c8c858c8c8c8c6148d2565b91509150816000015163ffffffff168363ffffffff161415613477578160200151826040015194509450505050613510565b805163ffffffff8481169116141561349f578060200151816040015194509450505050613510565b8151815160208085015190840151918390039286039163ffffffff80841692908516910360060b816134cd57fe5b05028460200151018263ffffffff168263ffffffff1686604001518660400151036001600160a01b031602816134ff57fe5b048560400151019650965050505050505b97509795505050505050565b600295860b860b60009081526020979097526040909620600181018054909503909455938301805490920390915560038201805463ffffffff600160d81b6001600160a01b036701000000000000008085048216909603169094027fffffffffff0000000000000000000000000000000000000000ffffffffffffff90921691909117600681810b90960390950b66ffffffffffffff1666ffffffffffffff199095169490941782810485169095039093160263ffffffff60d81b1990931692909217905554600160801b9004600f0b90565b60008082600f0b121561365457826001600160801b03168260000384039150816001600160801b03161061364f576040805162461bcd60e51b81526020600482015260026024820152614c5360f01b604482015290519081900360640190fd5b6132bd565b826001600160801b03168284019150816001600160801b031610156132bd576040805162461bcd60e51b81526020600482015260026024820152614c4160f01b604482015290519081900360640190fd5b60006401000276a36001600160a01b038316108015906136e1575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038316105b613716576040805162461bcd60e51b81526020600482015260016024820152602960f91b604482015290519081900360640190fd5b77ffffffffffffffffffffffffffffffffffffffff00000000602083901b166001600160801b03811160071b81811c67ffffffffffffffff811160061b90811c63ffffffff811160051b90811c61ffff811160041b90811c60ff8111600390811b91821c600f811160021b90811c918211600190811b92831c979088119617909417909217179091171717608081106137b757607f810383901c91506137c1565b80607f0383901b91505b908002607f81811c60ff83811c9190911c800280831c81831c1c800280841c81841c1c800280851c81851c1c800280861c81861c1c800280871c81871c1c800280881c81881c1c800280891c81891c1c8002808a1c818a1c1c8002808b1c818b1c1c8002808c1c818c1c1c8002808d1c818d1c1c8002808e1c9c81901c9c909c1c80029c8d901c9e9d607f198f0160401b60c09190911c678000000000000000161760c19b909b1c674000000000000000169a909a1760c29990991c672000000000000000169890981760c39790971c671000000000000000169690961760c49590951c670800000000000000169490941760c59390931c670400000000000000169290921760c69190911c670200000000000000161760c79190911c670100000000000000161760c89190911c6680000000000000161760c99190911c6640000000000000161760ca9190911c6620000000000000161760cb9190911c6610000000000000161760cc9190911c6608000000000000161760cd9190911c66040000000000001617693627a301d71055774c8581026f028f6481ab7f045a5af012a19d003aa9198101608090811d906fdb2df09e81959a81455e260799a0632f8301901d600281810b9083900b146139c257886001600160a01b03166139a682612d6d565b6001600160a01b031611156139bb57816139bd565b805b6139c4565b815b9998505050505050505050565b6000806000898961ffff1661ffff81106139e757fe5b60408051608081018252919092015463ffffffff8082168084526401000000008304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff161515606083015290925089161415613a575788859250925050613510565b8461ffff168461ffff16118015613a7857506001850361ffff168961ffff16145b15613a8557839150613a89565b8491505b8161ffff168960010161ffff1681613a9d57fe5b069250613aac81898989614822565b8a8461ffff1661ffff8110613abd57fe5b825191018054602084015160408501516060909501511515600160f81b027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001600160a01b03909616600160581b027fff0000000000000000000000000000000000000000ffffffffffffffffffffff60069390930b66ffffffffffffff16640100000000026affffffffffffff000000001963ffffffff90971663ffffffff199095169490941795909516929092171692909217929092161790555097509795505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083835b60208310613c025780518252601f199092019160209182019101613be3565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613c64576040519150601f19603f3d011682016040523d82523d6000602084013e613c69565b606091505b5091509150818015613c97575080511580613c975750808060200190516020811015613c9457600080fd5b50515b613ccd576040805162461bcd60e51b81526020600482015260026024820152612a2360f11b604482015290519081900360640190fd5b5050505050565b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693919290918291908083835b60208310613d6d5780518252601f199092019160209182019101613d4e565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114613dcd576040519150601f19603f3d011682016040523d82523d6000602084013e613dd2565b606091505b5091509150818015613de657506020815110155b613def57600080fd5b808060200190516020811015613e0457600080fd5b50519250505090565b808201828110156132bd57600080fd5b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016939192909182919080838360208310613d6d5780518252601f199092019160209182019101613d4e565b6000808361ffff1611613ef3576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b8261ffff168261ffff1611613f09575081613382565b825b8261ffff168161ffff161015613f4f576001858261ffff1661ffff8110613f2e57fe5b01805463ffffffff191663ffffffff92909216919091179055600101613f0b565b50909392505050565b80600f81900b8114612beb57600080fd5b6000806000613f76612bf0565b613f88846020015185604001516143a1565b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602080840182905261ffff600160b81b8404811685870152600160c81b84048116606080870191909152600160d81b8504909116608086015260ff600160e81b8504811660a0870152600160f01b909404909316151560c08501528851908901519489015192890151939461402c9491939092909190614acf565b93508460600151600f0b6000146141a157846020015160020b816020015160020b12156140815761407a6140638660200151612d6d565b6140708760400151612d6d565b8760600151614c84565b92506141a1565b846040015160020b816020015160020b12156141775760045460408201516001600160801b03909116906140d3906140b7612c27565b60208501516060860151608087015160089493929187916139d1565b6000805461ffff60c81b1916600160c81b61ffff938416021761ffff60b81b1916600160b81b939092169290920217905581516040870151614123919061411990612d6d565b8860600151614c84565b93506141416141358760200151612d6d565b83516060890151614cc8565b92506141518187606001516135ef565b600480546001600160801b0319166001600160801b0392909216919091179055506141a1565b61419e6141878660200151612d6d565b6141948760400151612d6d565b8760600151614cc8565b91505b509193909250565b60006141b68484846132d9565b9050600082806141c257fe5b84860911156133825760001981106141d957600080fd5b6001019392505050565b6040805160609490941b6bffffffffffffffffffffffff1916602080860191909152600293840b60e890811b60348701529290930b90911b60378401528051808403601a018152603a90930181528251928201929092206000908152929052902090565b60608060008361ffff1611614287576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b865167ffffffffffffffff8111801561429f57600080fd5b506040519080825280602002602001820160405280156142c9578160200160208202803683370190505b509150865167ffffffffffffffff811180156142e457600080fd5b5060405190808252806020026020018201604052801561430e578160200160208202803683370190505b50905060005b87518110156143945761433f8a8a8a848151811061432e57fe5b60200260200101518a8a8a8a613389565b84838151811061434b57fe5b6020026020010184848151811061435e57fe5b60200260200101826001600160a01b03166001600160a01b03168152508260060b60060b81525050508080600101915050614314565b5097509795505050505050565b8060020b8260020b126143e1576040805162461bcd60e51b8152602060048201526003602482015262544c5560e81b604482015290519081900360640190fd5b620d89e719600283900b1215614424576040805162461bcd60e51b8152602060048201526003602482015262544c4d60e81b604482015290519081900360640190fd5b620d89e8600282900b1315614466576040805162461bcd60e51b815260206004820152600360248201526254554d60e81b604482015290519081900360640190fd5b5050565b6040805160808101825263ffffffff9283168082526000602083018190529282019290925260016060909101819052835463ffffffff1916909117909116600160f81b17909155908190565b60020b600881901d9161010090910790565b60008082116144d657600080fd5b600160801b82106144e957608091821c91015b68010000000000000000821061450157604091821c91015b640100000000821061451557602091821c91015b62010000821061452757601091821c91015b610100821061453857600891821c91015b6010821061454857600491821c91015b6004821061455857600291821c91015b60028210612beb57600101919050565b600080821161457657600080fd5b5060ff6001600160801b0382161561459157607f1901614599565b608082901c91505b67ffffffffffffffff8216156145b257603f19016145ba565b604082901c91505b63ffffffff8216156145cf57601f19016145d7565b602082901c91505b61ffff8216156145ea57600f19016145f2565b601082901c91505b60ff821615614604576007190161460c565b600882901c91505b600f82161561461e5760031901614626565b600482901c91505b60038216156146385760011901614640565b600282901c91505b6001821615612beb5760001901919050565b6000836001600160a01b0316856001600160a01b03161115614672579293925b8161469f5761469a836001600160801b03168686036001600160a01b0316600160601b6132d9565b6146c2565b6146c2836001600160801b03168686036001600160a01b0316600160601b6141a9565b90505b949350505050565b6000836001600160a01b0316856001600160a01b031611156146ed579293925b7bffffffffffffffffffffffffffffffff000000000000000000000000606084901b166001600160a01b03868603811690871661472957600080fd5b8361475957866001600160a01b031661474c8383896001600160a01b03166132d9565b8161475357fe5b0461477f565b61477f6147708383896001600160a01b03166141a9565b886001600160a01b0316614cf7565b979650505050505050565b600080856001600160a01b0316116147a157600080fd5b6000846001600160801b0316116147b757600080fd5b816147c95761469a8585856001614d02565b6146c28585856001614de3565b600080856001600160a01b0316116147ed57600080fd5b6000846001600160801b03161161480357600080fd5b816148155761469a8585856000614de3565b6146c28585856000614d02565b61482a61564a565b600085600001518503905060405180608001604052808663ffffffff1681526020018263ffffffff168660020b0288602001510160060b81526020016000856001600160801b03161161487e576001614880565b845b6001600160801b031673ffffffff00000000000000000000000000000000608085901b16816148ab57fe5b048860400151016001600160a01b0316815260200160011515815250915050949350505050565b6148da61564a565b6148e261564a565b888561ffff1661ffff81106148f357fe5b60408051608081018252919092015463ffffffff81168083526401000000008204600690810b810b900b6020840152600160581b82046001600160a01b031693830193909352600160f81b900460ff1615156060820152925061495890899089614ed8565b15614990578663ffffffff16826000015163ffffffff16141561497a57613510565b8161498783898988614822565b91509150613510565b888361ffff168660010161ffff16816149a557fe5b0661ffff1661ffff81106149b557fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b90910416151560608201819052909250614a6c57604080516080810182528a5463ffffffff811682526401000000008104600690810b810b900b6020830152600160581b81046001600160a01b031692820192909252600160f81b90910460ff161515606082015291505b614a7b88836000015189614ed8565b614ab2576040805162461bcd60e51b815260206004820152600360248201526213d31160ea1b604482015290519081900360640190fd5b614abf8989898887614f9b565b9150915097509795505050505050565b6000614ade60078787876141e3565b60015460025491925090600080600f87900b15614c24576000614aff612c27565b6000805460045492935090918291614b499160089186918591600160a01b810460020b9161ffff600160b81b83048116926001600160801b0390921691600160c81b900416613389565b9092509050614b8360058d8b8d8b8b87898b60007f000000000000000000000000000000000000000000000000000000000000000061513b565b9450614bba60058c8b8d8b8b87898b60017f000000000000000000000000000000000000000000000000000000000000000061513b565b93508415614bee57614bee60068d7f0000000000000000000000000000000000000000000000000000000000000000615325565b8315614c2057614c2060068c7f0000000000000000000000000000000000000000000000000000000000000000615325565b5050505b600080614c3660058c8c8b8a8a61538b565b9092509050614c47878a8484615437565b600089600f0b1215614c75578315614c6457614c6460058c6155cc565b8215614c7557614c7560058b6155cc565b50505050505095945050505050565b60008082600f0b12614caa57614ca5614ca085858560016146cd565b613291565b6146c5565b614cbd614ca085858560000360006146cd565b600003949350505050565b60008082600f0b12614ce457614ca5614ca08585856001614652565b614cbd614ca08585856000036000614652565b808204910615150190565b60008115614d755760006001600160a01b03841115614d3857614d3384600160601b876001600160801b03166132d9565b614d50565b6001600160801b038516606085901b81614d4e57fe5b045b9050614d6d614d686001600160a01b03881683613e0d565b6155f8565b9150506146c5565b60006001600160a01b03841115614da357614d9e84600160601b876001600160801b03166141a9565b614dba565b614dba606085901b6001600160801b038716614cf7565b905080866001600160a01b031611614dd157600080fd5b6001600160a01b0386160390506146c5565b600082614df15750836146c5565b7bffffffffffffffffffffffffffffffff000000000000000000000000606085901b168215614e91576001600160a01b03861684810290858281614e3157fe5b041415614e6257818101828110614e6057614e5683896001600160a01b0316836141a9565b93505050506146c5565b505b614e8882614e83878a6001600160a01b03168681614e7c57fe5b0490613e0d565b614cf7565b925050506146c5565b6001600160a01b03861684810290858281614ea857fe5b04148015614eb557508082115b614ebe57600080fd5b808203614e56614d68846001600160a01b038b16846141a9565b60008363ffffffff168363ffffffff1611158015614f0257508363ffffffff168263ffffffff1611155b15614f1e578163ffffffff168363ffffffff1611159050613382565b60008463ffffffff168463ffffffff1611614f46578363ffffffff1664010000000001614f4e565b8363ffffffff165b64ffffffffff16905060008563ffffffff168463ffffffff1611614f7f578363ffffffff1664010000000001614f87565b8363ffffffff165b64ffffffffff169091111595945050505050565b614fa361564a565b614fab61564a565b60008361ffff168560010161ffff1681614fc157fe5b0661ffff169050600060018561ffff16830103905060005b506002818301048961ffff87168281614fee57fe5b0661ffff8110614ffa57fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b9091041615156060820181905290955061506557806001019250614fd9565b898661ffff16826001018161507657fe5b0661ffff811061508257fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b909104161515606082015285519094506000906150ed908b908b614ed8565b905080801561510657506151068a8a8760000151614ed8565b15615111575061512e565b8061512157600182039250615128565b8160010193505b50614fd9565b5050509550959350505050565b60028a810b900b600090815260208c90526040812080546001600160801b031682615166828d6135ef565b9050846001600160801b0316816001600160801b031611156151b4576040805162461bcd60e51b81526020600482015260026024820152614c4f60f01b604482015290519081900360640190fd5b6001600160801b03828116159082161581141594501561528a578c60020b8e60020b1361525a57600183018b9055600283018a90556003830180547fffffffffff0000000000000000000000000000000000000000ffffffffffffff166701000000000000006001600160a01b038c16021766ffffffffffffff191666ffffffffffffff60068b900b161763ffffffff60d81b1916600160d81b63ffffffff8a16021790555b6003830180547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16600160f81b1790555b82546001600160801b0319166001600160801b038216178355856152d35782546152ce906152c990600160801b9004600f90810b810b908f900b6132c3565b613f58565b6152f4565b82546152f4906152c990600160801b9004600f90810b810b908f900b6132a7565b8354600f9190910b6001600160801b03908116600160801b0291161790925550909c9b505050505050505050505050565b8060020b8260020b8161533457fe5b0760020b1561534257600080fd5b60008061535d8360020b8560020b8161535757fe5b056144b6565b600191820b820b60009081526020979097526040909620805460ff9097169190911b90951890945550505050565b600285810b80820b60009081526020899052604080822088850b850b83529082209193849391929184918291908a900b126153d1575050600182015460028301546153e4565b8360010154880391508360020154870390505b6000808b60020b8b60020b121561540657505060018301546002840154615419565b84600101548a0391508460020154890390505b92909803979097039b96909503949094039850939650505050505050565b6040805160a08101825285546001600160801b0390811682526001870154602083015260028701549282019290925260038601548083166060830152600160801b900490911660808201526000600f85900b6154d65781516001600160801b03166154ce576040805162461bcd60e51b815260206004820152600260248201526104e560f41b604482015290519081900360640190fd5b5080516154e5565b81516154e290866135ef565b90505b60006155098360200151860384600001516001600160801b0316600160801b6132d9565b9050600061552f8460400151860385600001516001600160801b0316600160801b6132d9565b905086600f0b6000146155565787546001600160801b0319166001600160801b0384161788555b60018801869055600288018590556001600160801b03821615158061558457506000816001600160801b0316115b156155c2576003880180546001600160801b031981166001600160801b039182168501821617808216600160801b9182900483168501909216021790555b5050505050505050565b600290810b810b6000908152602092909252604082208281556001810183905590810182905560030155565b806001600160a01b0381168114612beb57600080fd5b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b6040805160808101825260008082526020820181905291810182905260608101919091529056fea164736f6c6343000706000aa164736f6c6343000706000ac66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc", - deployedBytecode: - "0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063890357301161005b578063890357301461013b5780638a7c195f146101855780638da5cb5b146101b0578063a1671295146101b85761007d565b806313af4035146100825780631698ee82146100aa57806322afcccb14610102575b600080fd5b6100a86004803603602081101561009857600080fd5b50356001600160a01b03166101f4565b005b6100e6600480360360608110156100c057600080fd5b5080356001600160a01b03908116916020810135909116906040013562ffffff16610267565b604080516001600160a01b039092168252519081900360200190f35b6101246004803603602081101561011857600080fd5b503562ffffff16610293565b6040805160029290920b8252519081900360200190f35b6101436102a8565b604080516001600160a01b0396871681529486166020860152929094168383015262ffffff16606083015260029290920b608082015290519081900360a00190f35b6100a86004803603604081101561019b57600080fd5b5062ffffff813516906020013560020b6102de565b6100e66103a1565b6100e6600480360360608110156101ce57600080fd5b5080356001600160a01b03908116916020810135909116906040013562ffffff166103b0565b6003546001600160a01b0316331461020b57600080fd5b6003546040516001600160a01b038084169216907fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c90600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b60056020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b60046020526000908152604090205460020b81565b600054600154600280546001600160a01b03938416939283169281169162ffffff600160a01b83041691600160b81b9004900b85565b6003546001600160a01b031633146102f557600080fd5b620f42408262ffffff161061030957600080fd5b60008160020b13801561032057506140008160020b125b61032957600080fd5b62ffffff8216600090815260046020526040902054600290810b900b1561034f57600080fd5b62ffffff828116600081815260046020526040808220805462ffffff1916600287900b958616179055517fc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc9190a35050565b6003546001600160a01b031681565b60006103ba610546565b826001600160a01b0316846001600160a01b031614156103d957600080fd5b600080846001600160a01b0316866001600160a01b0316106103fc5784866103ff565b85855b90925090506001600160a01b03821661041757600080fd5b62ffffff8416600090815260046020526040902054600290810b9081900b61043e57600080fd5b6001600160a01b0383811660009081526005602090815260408083208685168452825280832062ffffff8a168452909152902054161561047d57600080fd5b61048a308484888561057d565b6001600160a01b03808516600081815260056020818152604080842089871680865290835281852062ffffff8e168087529084528286208054988a166001600160a01b0319998a1681179091558287529484528286208787528452828620818752845294829020805490971684179096558051600289900b815291820192909252815195995091947f783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b71189281900390910190a45050509392505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461057b57600080fd5b565b6040805160a0810182526001600160a01b03878116808352878216602080850182905292881684860181905262ffffff888116606080880182905260028a810b6080998a01819052600080546001600160a01b03199081169099178155600180548a1689179055825490981686177fffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffff16600160a01b8502177fffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffff16600160b81b91830b9095160293909317909255875180870194909452838801929092528281019190915285518083039091018152930193849052825192909101919091209091610686906106f5565b8190604051809103906000f59050801580156106a6573d6000803e3d6000fd5b50600080546001600160a01b0319908116909155600180549091169055600280547fffffffffffff00000000000000000000000000000000000000000000000000001690559695505050505050565b6158c8806107038339019056fe6101606040523480156200001257600080fd5b503060601b60805260408051630890357360e41b81529051600091339163890357309160048082019260a092909190829003018186803b1580156200005657600080fd5b505afa1580156200006b573d6000803e3d6000fd5b505050506040513d60a08110156200008257600080fd5b508051602080830151604084015160608086015160809096015160e896871b6001600160e81b0319166101005291811b6001600160601b031990811660e05292811b831660c0529390931b1660a052600282810b900b90921b610120529150620000f79082906200010f811b62002b8417901c565b60801b6001600160801b03191661014052506200017d565b60008082600281900b620d89e719816200012557fe5b05029050600083600281900b620d89e8816200013d57fe5b0502905060008460020b83830360020b816200015557fe5b0560010190508062ffffff166001600160801b038016816200017357fe5b0495945050505050565b60805160601c60a05160601c60c05160601c60e05160601c6101005160e81c6101205160e81c6101405160801c61567e6200024a60003980611fee5280614b5f5280614b96525080610c0052806128fd5280614bca5280614bfc525080610cef52806119cb5280611a0252806129455250806111c75280611a855280611ef4528061244452806129215280613e6b5250806108d252806112f55280611a545280611e8e52806123be5280613d2252508061207b528061227d52806128d9525080612bfb525061567e6000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c806370cf754a116100ee578063c45a015511610097578063ddca3f4311610071578063ddca3f4314610800578063f305839914610820578063f30dba9314610828578063f637731d146108aa576101ae565b8063c45a0155146107d1578063d0c93a7c146107d9578063d21220a7146107f8576101ae565b8063883bdbfd116100c8578063883bdbfd14610633578063a34123a71461073c578063a38807f214610776576101ae565b806370cf754a146105c65780638206a4d1146105ce57806385b66729146105f6576101ae565b80633850c7bd1161015b578063490e6cbc11610135578063490e6cbc146104705780634f1eb3d8146104fc578063514ea4bf1461054d5780635339c296146105a6576101ae565b80633850c7bd1461035b5780633c8a7d8d146103b45780634614131914610456576101ae565b80631ad8b03b1161018c5780631ad8b03b146102aa578063252c09d7146102e157806332148f6714610338576101ae565b80630dfe1681146101b3578063128acb08146101d75780631a68650214610286575b600080fd5b6101bb6108d0565b604080516001600160a01b039092168252519081900360200190f35b61026d600480360360a08110156101ed57600080fd5b6001600160a01b0382358116926020810135151592604082013592606083013516919081019060a08101608082013564010000000081111561022e57600080fd5b82018360208201111561024057600080fd5b8035906020019184600183028401116401000000008311171561026257600080fd5b5090925090506108f4565b6040805192835260208301919091528051918290030190f35b61028e6114ad565b604080516001600160801b039092168252519081900360200190f35b6102b26114bc565b60405180836001600160801b03168152602001826001600160801b031681526020019250505060405180910390f35b6102fe600480360360208110156102f757600080fd5b50356114d6565b6040805163ffffffff909516855260069390930b60208501526001600160a01b039091168383015215156060830152519081900360800190f35b6103596004803603602081101561034e57600080fd5b503561ffff1661151c565b005b610363611616565b604080516001600160a01b03909816885260029690960b602088015261ffff9485168787015292841660608701529216608085015260ff90911660a0840152151560c0830152519081900360e00190f35b61026d600480360360a08110156103ca57600080fd5b6001600160a01b03823516916020810135600290810b92604083013590910b916001600160801b036060820135169181019060a08101608082013564010000000081111561041757600080fd5b82018360208201111561042957600080fd5b8035906020019184600183028401116401000000008311171561044b57600080fd5b509092509050611666565b61045e611922565b60408051918252519081900360200190f35b6103596004803603608081101561048657600080fd5b6001600160a01b0382351691602081013591604082013591908101906080810160608201356401000000008111156104bd57600080fd5b8201836020820111156104cf57600080fd5b803590602001918460018302840111640100000000831117156104f157600080fd5b509092509050611928565b6102b2600480360360a081101561051257600080fd5b506001600160a01b03813516906020810135600290810b91604081013590910b906001600160801b0360608201358116916080013516611d83565b61056a6004803603602081101561056357600080fd5b5035611f9d565b604080516001600160801b0396871681526020810195909552848101939093529084166060840152909216608082015290519081900360a00190f35b61045e600480360360208110156105bc57600080fd5b503560010b611fda565b61028e611fec565b610359600480360360408110156105e457600080fd5b5060ff81358116916020013516612010565b6102b26004803603606081101561060c57600080fd5b506001600160a01b03813516906001600160801b036020820135811691604001351661220f565b6106a36004803603602081101561064957600080fd5b81019060208101813564010000000081111561066457600080fd5b82018360208201111561067657600080fd5b8035906020019184602083028401116401000000008311171561069857600080fd5b5090925090506124dc565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156106e75781810151838201526020016106cf565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561072657818101518382015260200161070e565b5050505090500194505050505060405180910390f35b61026d6004803603606081101561075257600080fd5b508035600290810b91602081013590910b90604001356001600160801b0316612569565b6107a06004803603604081101561078c57600080fd5b508035600290810b9160200135900b6126e0565b6040805160069490940b84526001600160a01b03909216602084015263ffffffff1682820152519081900360600190f35b6101bb6128d7565b6107e16128fb565b6040805160029290920b8252519081900360200190f35b6101bb61291f565b610808612943565b6040805162ffffff9092168252519081900360200190f35b61045e612967565b6108486004803603602081101561083e57600080fd5b503560020b61296d565b604080516001600160801b039099168952600f9790970b602089015287870195909552606087019390935260069190910b60808601526001600160a01b031660a085015263ffffffff1660c0840152151560e083015251908190036101000190f35b610359600480360360208110156108c057600080fd5b50356001600160a01b03166129db565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806108ff612bf0565b85610936576040805162461bcd60e51b8152602060048201526002602482015261415360f01b604482015290519081900360640190fd5b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602083015261ffff600160b81b8204811693830193909352600160c81b810483166060830152600160d81b8104909216608082015260ff600160e81b8304811660a0830152600160f01b909204909116151560c082018190526109ef576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b87610a3a5780600001516001600160a01b0316866001600160a01b0316118015610a35575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038716105b610a6c565b80600001516001600160a01b0316866001600160a01b0316108015610a6c57506401000276a36001600160a01b038716115b610aa3576040805162461bcd60e51b815260206004820152600360248201526214d41360ea1b604482015290519081900360640190fd5b6000805460ff60f01b191681556040805160c08101909152808a610ad25760048460a0015160ff16901c610ae5565b60108460a0015160ff1681610ae357fe5b065b60ff1681526004546001600160801b03166020820152604001610b06612c27565b63ffffffff168152602001600060060b815260200160006001600160a01b031681526020016000151581525090506000808913905060006040518060e001604052808b81526020016000815260200185600001516001600160a01b03168152602001856020015160020b81526020018c610b8257600254610b86565b6001545b815260200160006001600160801b0316815260200184602001516001600160801b031681525090505b805115801590610bd55750886001600160a01b031681604001516001600160a01b031614155b15610f9f57610be261560e565b60408201516001600160a01b031681526060820151610c25906006907f00000000000000000000000000000000000000000000000000000000000000008f612c2b565b15156040830152600290810b810b60208301819052620d89e719910b1215610c5657620d89e7196020820152610c75565b6020810151620d89e860029190910b1315610c7557620d89e860208201525b610c828160200151612d6d565b6001600160a01b031660608201526040820151610d13908d610cbc578b6001600160a01b031683606001516001600160a01b031611610cd6565b8b6001600160a01b031683606001516001600160a01b0316105b610ce4578260600151610ce6565b8b5b60c085015185517f000000000000000000000000000000000000000000000000000000000000000061309f565b60c085015260a084015260808301526001600160a01b031660408301528215610d7557610d498160c00151826080015101613291565b825103825260a0810151610d6b90610d6090613291565b6020840151906132a7565b6020830152610db0565b610d828160a00151613291565b825101825260c08101516080820151610daa91610d9f9101613291565b6020840151906132c3565b60208301525b835160ff1615610df6576000846000015160ff168260c0015181610dd057fe5b60c0840180519290910491829003905260a0840180519091016001600160801b03169052505b60c08201516001600160801b031615610e3557610e298160c00151600160801b8460c001516001600160801b03166132d9565b60808301805190910190525b80606001516001600160a01b031682604001516001600160a01b03161415610f5e57806040015115610f35578360a00151610ebf57610e9d846040015160008760200151886040015188602001518a606001516008613389909695949392919063ffffffff16565b6001600160a01b03166080860152600690810b900b6060850152600160a08501525b6000610f0b82602001518e610ed657600154610edc565b84608001515b8f610eeb578560800151610eef565b6002545b608089015160608a015160408b0151600595949392919061351c565b90508c15610f17576000035b610f258360c00151826135ef565b6001600160801b031660c0840152505b8b610f44578060200151610f4d565b60018160200151035b600290810b900b6060830152610f99565b80600001516001600160a01b031682604001516001600160a01b031614610f9957610f8c82604001516136a5565b600290810b900b60608301525b50610baf565b836020015160020b816060015160020b1461107a57600080610fed86604001518660400151886020015188602001518a606001518b6080015160086139d1909695949392919063ffffffff16565b604085015160608601516000805461ffff60c81b1916600160c81b61ffff958616021761ffff60b81b1916600160b81b95909416949094029290921762ffffff60a01b1916600160a01b62ffffff60029490940b93909316929092029190911773ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909116179055506110ac9050565b60408101516000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039092169190911790555b8060c001516001600160801b031683602001516001600160801b0316146110f25760c0810151600480546001600160801b0319166001600160801b039092169190911790555b8a1561114257608081015160015560a08101516001600160801b03161561113d5760a0810151600380546001600160801b031981166001600160801b03918216909301169190911790555b611188565b608081015160025560a08101516001600160801b0316156111885760a0810151600380546001600160801b03808216600160801b92839004821690940116029190911790555b8115158b1515146111a157602081015181518b036111ae565b80600001518a0381602001515b90965094508a156112e75760008512156111f0576111f07f00000000000000000000000000000000000000000000000000000000000000008d87600003613b86565b60006111fa613cd4565b9050336001600160a01b031663fa461e3388888c8c6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561127e57600080fd5b505af1158015611292573d6000803e3d6000fd5b5050505061129e613cd4565b6112a88289613e0d565b11156112e1576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b50611411565b600086121561131e5761131e7f00000000000000000000000000000000000000000000000000000000000000008d88600003613b86565b6000611328613e1d565b9050336001600160a01b031663fa461e3388888c8c6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b1580156113ac57600080fd5b505af11580156113c0573d6000803e3d6000fd5b505050506113cc613e1d565b6113d68288613e0d565b111561140f576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b505b60408082015160c083015160608085015184518b8152602081018b90526001600160a01b03948516818701526001600160801b039093169183019190915260020b60808201529151908e169133917fc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca679181900360a00190a350506000805460ff60f01b1916600160f01b17905550919890975095505050505050565b6004546001600160801b031681565b6003546001600160801b0380821691600160801b90041682565b60088161ffff81106114e757600080fd5b015463ffffffff81169150640100000000810460060b90600160581b81046001600160a01b031690600160f81b900460ff1684565b600054600160f01b900460ff16611560576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19169055611575612bf0565b60008054600160d81b900461ffff169061159160088385613eb5565b6000805461ffff808416600160d81b810261ffff60d81b19909316929092179092559192508316146115fe576040805161ffff80851682528316602082015281517fac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a929181900390910190a15b50506000805460ff60f01b1916600160f01b17905550565b6000546001600160a01b03811690600160a01b810460020b9061ffff600160b81b8204811691600160c81b8104821691600160d81b8204169060ff600160e81b8204811691600160f01b90041687565b600080548190600160f01b900460ff166116ad576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b191690556001600160801b0385166116cd57600080fd5b60008061171b60405180608001604052808c6001600160a01b031681526020018b60020b81526020018a60020b81526020016117118a6001600160801b0316613f58565b600f0b9052613f69565b9250925050819350809250600080600086111561173d5761173a613cd4565b91505b841561174e5761174b613e1d565b90505b336001600160a01b031663d348799787878b8b6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b1580156117d057600080fd5b505af11580156117e4573d6000803e3d6000fd5b50505050600086111561183b576117f9613cd4565b6118038388613e0d565b111561183b576040805162461bcd60e51b815260206004820152600260248201526104d360f41b604482015290519081900360640190fd5b841561188b57611849613e1d565b6118538287613e0d565b111561188b576040805162461bcd60e51b81526020600482015260026024820152614d3160f01b604482015290519081900360640190fd5b8960020b8b60020b8d6001600160a01b03167f7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde338d8b8b60405180856001600160a01b03168152602001846001600160801b0316815260200183815260200182815260200194505050505060405180910390a450506000805460ff60f01b1916600160f01b17905550919890975095505050505050565b60025481565b600054600160f01b900460ff1661196c576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19169055611981612bf0565b6004546001600160801b0316806119c3576040805162461bcd60e51b81526020600482015260016024820152601360fa1b604482015290519081900360640190fd5b60006119f8867f000000000000000000000000000000000000000000000000000000000000000062ffffff16620f42406141a9565b90506000611a2f867f000000000000000000000000000000000000000000000000000000000000000062ffffff16620f42406141a9565b90506000611a3b613cd4565b90506000611a47613e1d565b90508815611a7a57611a7a7f00000000000000000000000000000000000000000000000000000000000000008b8b613b86565b8715611aab57611aab7f00000000000000000000000000000000000000000000000000000000000000008b8a613b86565b336001600160a01b031663e9cbafb085858a8a6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b158015611b2d57600080fd5b505af1158015611b41573d6000803e3d6000fd5b505050506000611b4f613cd4565b90506000611b5b613e1d565b905081611b688588613e0d565b1115611ba0576040805162461bcd60e51b8152602060048201526002602482015261046360f41b604482015290519081900360640190fd5b80611bab8487613e0d565b1115611be3576040805162461bcd60e51b8152602060048201526002602482015261463160f01b604482015290519081900360640190fd5b8382038382038115611c725760008054600160e81b9004600f16908115611c16578160ff168481611c1057fe5b04611c19565b60005b90506001600160801b03811615611c4c57600380546001600160801b038082168401166001600160801b03199091161790555b611c66818503600160801b8d6001600160801b03166132d9565b60018054909101905550505b8015611cfd5760008054600160e81b900460041c600f16908115611ca2578160ff168381611c9c57fe5b04611ca5565b60005b90506001600160801b03811615611cd757600380546001600160801b03600160801b8083048216850182160291161790555b611cf1818403600160801b8d6001600160801b03166132d9565b60028054909101905550505b8d6001600160a01b0316336001600160a01b03167fbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca6338f8f86866040518085815260200184815260200183815260200182815260200194505050505060405180910390a350506000805460ff60f01b1916600160f01b179055505050505050505050505050565b600080548190600160f01b900460ff16611dca576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b19168155611de460073389896141e3565b60038101549091506001600160801b0390811690861611611e055784611e14565b60038101546001600160801b03165b60038201549093506001600160801b03600160801b909104811690851611611e3c5783611e52565b6003810154600160801b90046001600160801b03165b91506001600160801b03831615611eb7576003810180546001600160801b031981166001600160801b03918216869003821617909155611eb7907f0000000000000000000000000000000000000000000000000000000000000000908a908616613b86565b6001600160801b03821615611f1d576003810180546001600160801b03600160801b808304821686900382160291811691909117909155611f1d907f0000000000000000000000000000000000000000000000000000000000000000908a908516613b86565b604080516001600160a01b038a1681526001600160801b0380861660208301528416818301529051600288810b92908a900b9133917f70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0919081900360600190a4506000805460ff60f01b1916600160f01b17905590969095509350505050565b60076020526000908152604090208054600182015460028301546003909301546001600160801b0392831693919281811691600160801b90041685565b60066020526000908152604090205481565b7f000000000000000000000000000000000000000000000000000000000000000081565b600054600160f01b900460ff16612054576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916905560408051638da5cb5b60e01b815290516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691638da5cb5b916004808301926020929190829003018186803b1580156120c157600080fd5b505afa1580156120d5573d6000803e3d6000fd5b505050506040513d60208110156120eb57600080fd5b50516001600160a01b0316331461210157600080fd5b60ff82161580612124575060048260ff16101580156121245750600a8260ff1611155b801561214e575060ff8116158061214e575060048160ff161015801561214e5750600a8160ff1611155b61215757600080fd5b60008054610ff0600484901b16840160ff908116600160e81b9081027fffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841617909355919004167f973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b1336010826040805160ff9390920683168252600f600486901c16602083015286831682820152918516606082015290519081900360800190a150506000805460ff60f01b1916600160f01b17905550565b600080548190600160f01b900460ff16612256576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916905560408051638da5cb5b60e01b815290516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691638da5cb5b916004808301926020929190829003018186803b1580156122c357600080fd5b505afa1580156122d7573d6000803e3d6000fd5b505050506040513d60208110156122ed57600080fd5b50516001600160a01b0316331461230357600080fd5b6003546001600160801b039081169085161161231f578361232c565b6003546001600160801b03165b6003549092506001600160801b03600160801b9091048116908416116123525782612366565b600354600160801b90046001600160801b03165b90506001600160801b038216156123e7576003546001600160801b038381169116141561239557600019909101905b600380546001600160801b031981166001600160801b039182168590038216179091556123e7907f00000000000000000000000000000000000000000000000000000000000000009087908516613b86565b6001600160801b0381161561246d576003546001600160801b03828116600160801b90920416141561241857600019015b600380546001600160801b03600160801b80830482168590038216029181169190911790915561246d907f00000000000000000000000000000000000000000000000000000000000000009087908416613b86565b604080516001600160801b0380851682528316602082015281516001600160a01b0388169233927f596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151929081900390910190a36000805460ff60f01b1916600160f01b1790559094909350915050565b6060806124e7612bf0565b61255e6124f2612c27565b858580806020026020016040519081016040528093929190818152602001838360200280828437600092018290525054600454600896959450600160a01b820460020b935061ffff600160b81b8304811693506001600160801b0390911691600160c81b900416614247565b915091509250929050565b600080548190600160f01b900460ff166125b0576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6000805460ff60f01b1916815560408051608081018252338152600288810b602083015287900b918101919091528190819061260990606081016125fc6001600160801b038a16613f58565b600003600f0b9052613f69565b925092509250816000039450806000039350600085118061262a5750600084115b15612669576003830180546001600160801b038082168089018216600160801b93849004831689019092169092029091176001600160801b0319161790555b604080516001600160801b0388168152602081018790528082018690529051600289810b92908b900b9133917f0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c919081900360600190a450506000805460ff60f01b1916600160f01b179055509094909350915050565b60008060006126ed612bf0565b6126f785856143a1565b600285810b810b60009081526005602052604080822087840b90930b825281206003830154600681900b9367010000000000000082046001600160a01b0316928492600160d81b810463ffffffff169284929091600160f81b900460ff168061275f57600080fd5b6003820154600681900b985067010000000000000081046001600160a01b03169650600160d81b810463ffffffff169450600160f81b900460ff16806127a457600080fd5b50506040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b810b6020840181905261ffff600160b81b8404811695850195909552600160c81b830485166060850152600160d81b8304909416608084015260ff600160e81b8304811660a0850152600160f01b909204909116151560c08301529093508e810b91900b1215905061284d575093909403965090039350900390506128d0565b8a60020b816020015160020b12156128c1576000612869612c27565b602083015160408401516004546060860151939450600093849361289f936008938893879392916001600160801b031690613389565b9a9003989098039b5050949096039290920396509091030392506128d0915050565b50949093039650039350900390505b9250925092565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60015481565b60056020526000908152604090208054600182015460028301546003909301546001600160801b03831693600160801b909304600f0b9290600681900b9067010000000000000081046001600160a01b031690600160d81b810463ffffffff1690600160f81b900460ff1688565b6000546001600160a01b031615612a1e576040805162461bcd60e51b8152602060048201526002602482015261414960f01b604482015290519081900360640190fd5b6000612a29826136a5565b9050600080612a41612a39612c27565b60089061446a565b6040805160e0810182526001600160a01b038816808252600288810b6020808501829052600085870181905261ffff898116606088018190529089166080880181905260a08801839052600160c0909801979097528154600160f01b73ffffffffffffffffffffffffffffffffffffffff19909116871762ffffff60a01b1916600160a01b62ffffff9787900b9790971696909602959095177fffffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffff16600160c81b9091021761ffff60d81b1916600160d81b909602959095177fff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1692909217909355835191825281019190915281519395509193507f98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c9592918290030190a150505050565b60008082600281900b620d89e71981612b9957fe5b05029050600083600281900b620d89e881612bb057fe5b0502905060008460020b83830360020b81612bc757fe5b0560010190508062ffffff166001600160801b03801681612be457fe5b0493505050505b919050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612c2557600080fd5b565b4290565b60008060008460020b8660020b81612c3f57fe5b05905060008660020b128015612c6657508460020b8660020b81612c5f57fe5b0760020b15155b15612c7057600019015b8315612ce557600080612c82836144b6565b600182810b810b600090815260208d9052604090205460ff83169190911b80016000190190811680151597509294509092509085612cc757888360ff16860302612cda565b88612cd1826144c8565b840360ff168603025b965050505050612d63565b600080612cf4836001016144b6565b91509150600060018260ff166001901b031990506000818b60008660010b60010b8152602001908152602001600020541690508060001415955085612d4657888360ff0360ff16866001010102612d5c565b8883612d5183614568565b0360ff168660010101025b9650505050505b5094509492505050565b60008060008360020b12612d84578260020b612d8c565b8260020b6000035b9050620d89e8811115612dca576040805162461bcd60e51b81526020600482015260016024820152601560fa1b604482015290519081900360640190fd5b600060018216612dde57600160801b612df0565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615612e24576ffff97272373d413259a46990580e213a0260801c5b6004821615612e43576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b6008821615612e62576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b6010821615612e81576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615612ea0576fff973b41fa98c081472e6896dfb254c00260801c5b6040821615612ebf576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615612ede576ffe5dee046a99a2a811c461f1969c30530260801c5b610100821615612efe576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615612f1e576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615612f3e576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615612f5e576fe7159475a2c29b7443b29c7fa6e889d90260801c5b611000821615612f7e576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615612f9e576fa9f746462d870fdf8a65dc1f90e061e50260801c5b614000821615612fbe576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615612fde576f31be135f97d08fd981231505542fcfa60260801c5b62010000821615612fff576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b6202000082161561301f576e5d6af8dedb81196699c329225ee6040260801c5b6204000082161561303e576d2216e584f5fa1ea926041bedfe980260801c5b6208000082161561305b576b048a170391f7dc42444e8fa20260801c5b60008460020b131561307657806000198161307257fe5b0490505b64010000000081061561308a57600161308d565b60005b60ff16602082901c0192505050919050565b60008080806001600160a01b03808916908a1610158187128015906131245760006130d88989620f42400362ffffff16620f42406132d9565b9050826130f1576130ec8c8c8c6001614652565b6130fe565b6130fe8b8d8c60016146cd565b955085811061310f578a965061311e565b61311b8c8b838661478a565b96505b5061316e565b8161313b576131368b8b8b60006146cd565b613148565b6131488a8c8b6000614652565b935083886000031061315c5789955061316e565b61316b8b8a8a600003856147d6565b95505b6001600160a01b038a81169087161482156131d15780801561318d5750815b6131a35761319e878d8c60016146cd565b6131a5565b855b95508080156131b2575081155b6131c8576131c3878d8c6000614652565b6131ca565b845b945061321b565b8080156131db5750815b6131f1576131ec8c888c6001614652565b6131f3565b855b9550808015613200575081155b613216576132118c888c60006146cd565b613218565b845b94505b8115801561322b57508860000385115b15613237578860000394505b81801561325657508a6001600160a01b0316876001600160a01b031614155b15613265578589039350613282565b61327f868962ffffff168a620f42400362ffffff166141a9565b93505b50505095509550955095915050565b6000600160ff1b82106132a357600080fd5b5090565b808203828113156000831215146132bd57600080fd5b92915050565b818101828112156000831215146132bd57600080fd5b600080806000198587098686029250828110908390030390508061330f576000841161330457600080fd5b508290049050613382565b80841161331b57600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b60008063ffffffff8716613430576000898661ffff1661ffff81106133aa57fe5b60408051608081018252919092015463ffffffff8082168084526401000000008304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff16151560608301529092508a161461341c57613419818a8988614822565b90505b806020015181604001519250925050613510565b8688036000806134458c8c858c8c8c8c6148d2565b91509150816000015163ffffffff168363ffffffff161415613477578160200151826040015194509450505050613510565b805163ffffffff8481169116141561349f578060200151816040015194509450505050613510565b8151815160208085015190840151918390039286039163ffffffff80841692908516910360060b816134cd57fe5b05028460200151018263ffffffff168263ffffffff1686604001518660400151036001600160a01b031602816134ff57fe5b048560400151019650965050505050505b97509795505050505050565b600295860b860b60009081526020979097526040909620600181018054909503909455938301805490920390915560038201805463ffffffff600160d81b6001600160a01b036701000000000000008085048216909603169094027fffffffffff0000000000000000000000000000000000000000ffffffffffffff90921691909117600681810b90960390950b66ffffffffffffff1666ffffffffffffff199095169490941782810485169095039093160263ffffffff60d81b1990931692909217905554600160801b9004600f0b90565b60008082600f0b121561365457826001600160801b03168260000384039150816001600160801b03161061364f576040805162461bcd60e51b81526020600482015260026024820152614c5360f01b604482015290519081900360640190fd5b6132bd565b826001600160801b03168284019150816001600160801b031610156132bd576040805162461bcd60e51b81526020600482015260026024820152614c4160f01b604482015290519081900360640190fd5b60006401000276a36001600160a01b038316108015906136e1575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038316105b613716576040805162461bcd60e51b81526020600482015260016024820152602960f91b604482015290519081900360640190fd5b77ffffffffffffffffffffffffffffffffffffffff00000000602083901b166001600160801b03811160071b81811c67ffffffffffffffff811160061b90811c63ffffffff811160051b90811c61ffff811160041b90811c60ff8111600390811b91821c600f811160021b90811c918211600190811b92831c979088119617909417909217179091171717608081106137b757607f810383901c91506137c1565b80607f0383901b91505b908002607f81811c60ff83811c9190911c800280831c81831c1c800280841c81841c1c800280851c81851c1c800280861c81861c1c800280871c81871c1c800280881c81881c1c800280891c81891c1c8002808a1c818a1c1c8002808b1c818b1c1c8002808c1c818c1c1c8002808d1c818d1c1c8002808e1c9c81901c9c909c1c80029c8d901c9e9d607f198f0160401b60c09190911c678000000000000000161760c19b909b1c674000000000000000169a909a1760c29990991c672000000000000000169890981760c39790971c671000000000000000169690961760c49590951c670800000000000000169490941760c59390931c670400000000000000169290921760c69190911c670200000000000000161760c79190911c670100000000000000161760c89190911c6680000000000000161760c99190911c6640000000000000161760ca9190911c6620000000000000161760cb9190911c6610000000000000161760cc9190911c6608000000000000161760cd9190911c66040000000000001617693627a301d71055774c8581026f028f6481ab7f045a5af012a19d003aa9198101608090811d906fdb2df09e81959a81455e260799a0632f8301901d600281810b9083900b146139c257886001600160a01b03166139a682612d6d565b6001600160a01b031611156139bb57816139bd565b805b6139c4565b815b9998505050505050505050565b6000806000898961ffff1661ffff81106139e757fe5b60408051608081018252919092015463ffffffff8082168084526401000000008304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff161515606083015290925089161415613a575788859250925050613510565b8461ffff168461ffff16118015613a7857506001850361ffff168961ffff16145b15613a8557839150613a89565b8491505b8161ffff168960010161ffff1681613a9d57fe5b069250613aac81898989614822565b8a8461ffff1661ffff8110613abd57fe5b825191018054602084015160408501516060909501511515600160f81b027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001600160a01b03909616600160581b027fff0000000000000000000000000000000000000000ffffffffffffffffffffff60069390930b66ffffffffffffff16640100000000026affffffffffffff000000001963ffffffff90971663ffffffff199095169490941795909516929092171692909217929092161790555097509795505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083835b60208310613c025780518252601f199092019160209182019101613be3565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613c64576040519150601f19603f3d011682016040523d82523d6000602084013e613c69565b606091505b5091509150818015613c97575080511580613c975750808060200190516020811015613c9457600080fd5b50515b613ccd576040805162461bcd60e51b81526020600482015260026024820152612a2360f11b604482015290519081900360640190fd5b5050505050565b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693919290918291908083835b60208310613d6d5780518252601f199092019160209182019101613d4e565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114613dcd576040519150601f19603f3d011682016040523d82523d6000602084013e613dd2565b606091505b5091509150818015613de657506020815110155b613def57600080fd5b808060200190516020811015613e0457600080fd5b50519250505090565b808201828110156132bd57600080fd5b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016939192909182919080838360208310613d6d5780518252601f199092019160209182019101613d4e565b6000808361ffff1611613ef3576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b8261ffff168261ffff1611613f09575081613382565b825b8261ffff168161ffff161015613f4f576001858261ffff1661ffff8110613f2e57fe5b01805463ffffffff191663ffffffff92909216919091179055600101613f0b565b50909392505050565b80600f81900b8114612beb57600080fd5b6000806000613f76612bf0565b613f88846020015185604001516143a1565b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602080840182905261ffff600160b81b8404811685870152600160c81b84048116606080870191909152600160d81b8504909116608086015260ff600160e81b8504811660a0870152600160f01b909404909316151560c08501528851908901519489015192890151939461402c9491939092909190614acf565b93508460600151600f0b6000146141a157846020015160020b816020015160020b12156140815761407a6140638660200151612d6d565b6140708760400151612d6d565b8760600151614c84565b92506141a1565b846040015160020b816020015160020b12156141775760045460408201516001600160801b03909116906140d3906140b7612c27565b60208501516060860151608087015160089493929187916139d1565b6000805461ffff60c81b1916600160c81b61ffff938416021761ffff60b81b1916600160b81b939092169290920217905581516040870151614123919061411990612d6d565b8860600151614c84565b93506141416141358760200151612d6d565b83516060890151614cc8565b92506141518187606001516135ef565b600480546001600160801b0319166001600160801b0392909216919091179055506141a1565b61419e6141878660200151612d6d565b6141948760400151612d6d565b8760600151614cc8565b91505b509193909250565b60006141b68484846132d9565b9050600082806141c257fe5b84860911156133825760001981106141d957600080fd5b6001019392505050565b6040805160609490941b6bffffffffffffffffffffffff1916602080860191909152600293840b60e890811b60348701529290930b90911b60378401528051808403601a018152603a90930181528251928201929092206000908152929052902090565b60608060008361ffff1611614287576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b865167ffffffffffffffff8111801561429f57600080fd5b506040519080825280602002602001820160405280156142c9578160200160208202803683370190505b509150865167ffffffffffffffff811180156142e457600080fd5b5060405190808252806020026020018201604052801561430e578160200160208202803683370190505b50905060005b87518110156143945761433f8a8a8a848151811061432e57fe5b60200260200101518a8a8a8a613389565b84838151811061434b57fe5b6020026020010184848151811061435e57fe5b60200260200101826001600160a01b03166001600160a01b03168152508260060b60060b81525050508080600101915050614314565b5097509795505050505050565b8060020b8260020b126143e1576040805162461bcd60e51b8152602060048201526003602482015262544c5560e81b604482015290519081900360640190fd5b620d89e719600283900b1215614424576040805162461bcd60e51b8152602060048201526003602482015262544c4d60e81b604482015290519081900360640190fd5b620d89e8600282900b1315614466576040805162461bcd60e51b815260206004820152600360248201526254554d60e81b604482015290519081900360640190fd5b5050565b6040805160808101825263ffffffff9283168082526000602083018190529282019290925260016060909101819052835463ffffffff1916909117909116600160f81b17909155908190565b60020b600881901d9161010090910790565b60008082116144d657600080fd5b600160801b82106144e957608091821c91015b68010000000000000000821061450157604091821c91015b640100000000821061451557602091821c91015b62010000821061452757601091821c91015b610100821061453857600891821c91015b6010821061454857600491821c91015b6004821061455857600291821c91015b60028210612beb57600101919050565b600080821161457657600080fd5b5060ff6001600160801b0382161561459157607f1901614599565b608082901c91505b67ffffffffffffffff8216156145b257603f19016145ba565b604082901c91505b63ffffffff8216156145cf57601f19016145d7565b602082901c91505b61ffff8216156145ea57600f19016145f2565b601082901c91505b60ff821615614604576007190161460c565b600882901c91505b600f82161561461e5760031901614626565b600482901c91505b60038216156146385760011901614640565b600282901c91505b6001821615612beb5760001901919050565b6000836001600160a01b0316856001600160a01b03161115614672579293925b8161469f5761469a836001600160801b03168686036001600160a01b0316600160601b6132d9565b6146c2565b6146c2836001600160801b03168686036001600160a01b0316600160601b6141a9565b90505b949350505050565b6000836001600160a01b0316856001600160a01b031611156146ed579293925b7bffffffffffffffffffffffffffffffff000000000000000000000000606084901b166001600160a01b03868603811690871661472957600080fd5b8361475957866001600160a01b031661474c8383896001600160a01b03166132d9565b8161475357fe5b0461477f565b61477f6147708383896001600160a01b03166141a9565b886001600160a01b0316614cf7565b979650505050505050565b600080856001600160a01b0316116147a157600080fd5b6000846001600160801b0316116147b757600080fd5b816147c95761469a8585856001614d02565b6146c28585856001614de3565b600080856001600160a01b0316116147ed57600080fd5b6000846001600160801b03161161480357600080fd5b816148155761469a8585856000614de3565b6146c28585856000614d02565b61482a61564a565b600085600001518503905060405180608001604052808663ffffffff1681526020018263ffffffff168660020b0288602001510160060b81526020016000856001600160801b03161161487e576001614880565b845b6001600160801b031673ffffffff00000000000000000000000000000000608085901b16816148ab57fe5b048860400151016001600160a01b0316815260200160011515815250915050949350505050565b6148da61564a565b6148e261564a565b888561ffff1661ffff81106148f357fe5b60408051608081018252919092015463ffffffff81168083526401000000008204600690810b810b900b6020840152600160581b82046001600160a01b031693830193909352600160f81b900460ff1615156060820152925061495890899089614ed8565b15614990578663ffffffff16826000015163ffffffff16141561497a57613510565b8161498783898988614822565b91509150613510565b888361ffff168660010161ffff16816149a557fe5b0661ffff1661ffff81106149b557fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b90910416151560608201819052909250614a6c57604080516080810182528a5463ffffffff811682526401000000008104600690810b810b900b6020830152600160581b81046001600160a01b031692820192909252600160f81b90910460ff161515606082015291505b614a7b88836000015189614ed8565b614ab2576040805162461bcd60e51b815260206004820152600360248201526213d31160ea1b604482015290519081900360640190fd5b614abf8989898887614f9b565b9150915097509795505050505050565b6000614ade60078787876141e3565b60015460025491925090600080600f87900b15614c24576000614aff612c27565b6000805460045492935090918291614b499160089186918591600160a01b810460020b9161ffff600160b81b83048116926001600160801b0390921691600160c81b900416613389565b9092509050614b8360058d8b8d8b8b87898b60007f000000000000000000000000000000000000000000000000000000000000000061513b565b9450614bba60058c8b8d8b8b87898b60017f000000000000000000000000000000000000000000000000000000000000000061513b565b93508415614bee57614bee60068d7f0000000000000000000000000000000000000000000000000000000000000000615325565b8315614c2057614c2060068c7f0000000000000000000000000000000000000000000000000000000000000000615325565b5050505b600080614c3660058c8c8b8a8a61538b565b9092509050614c47878a8484615437565b600089600f0b1215614c75578315614c6457614c6460058c6155cc565b8215614c7557614c7560058b6155cc565b50505050505095945050505050565b60008082600f0b12614caa57614ca5614ca085858560016146cd565b613291565b6146c5565b614cbd614ca085858560000360006146cd565b600003949350505050565b60008082600f0b12614ce457614ca5614ca08585856001614652565b614cbd614ca08585856000036000614652565b808204910615150190565b60008115614d755760006001600160a01b03841115614d3857614d3384600160601b876001600160801b03166132d9565b614d50565b6001600160801b038516606085901b81614d4e57fe5b045b9050614d6d614d686001600160a01b03881683613e0d565b6155f8565b9150506146c5565b60006001600160a01b03841115614da357614d9e84600160601b876001600160801b03166141a9565b614dba565b614dba606085901b6001600160801b038716614cf7565b905080866001600160a01b031611614dd157600080fd5b6001600160a01b0386160390506146c5565b600082614df15750836146c5565b7bffffffffffffffffffffffffffffffff000000000000000000000000606085901b168215614e91576001600160a01b03861684810290858281614e3157fe5b041415614e6257818101828110614e6057614e5683896001600160a01b0316836141a9565b93505050506146c5565b505b614e8882614e83878a6001600160a01b03168681614e7c57fe5b0490613e0d565b614cf7565b925050506146c5565b6001600160a01b03861684810290858281614ea857fe5b04148015614eb557508082115b614ebe57600080fd5b808203614e56614d68846001600160a01b038b16846141a9565b60008363ffffffff168363ffffffff1611158015614f0257508363ffffffff168263ffffffff1611155b15614f1e578163ffffffff168363ffffffff1611159050613382565b60008463ffffffff168463ffffffff1611614f46578363ffffffff1664010000000001614f4e565b8363ffffffff165b64ffffffffff16905060008563ffffffff168463ffffffff1611614f7f578363ffffffff1664010000000001614f87565b8363ffffffff165b64ffffffffff169091111595945050505050565b614fa361564a565b614fab61564a565b60008361ffff168560010161ffff1681614fc157fe5b0661ffff169050600060018561ffff16830103905060005b506002818301048961ffff87168281614fee57fe5b0661ffff8110614ffa57fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b9091041615156060820181905290955061506557806001019250614fd9565b898661ffff16826001018161507657fe5b0661ffff811061508257fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b909104161515606082015285519094506000906150ed908b908b614ed8565b905080801561510657506151068a8a8760000151614ed8565b15615111575061512e565b8061512157600182039250615128565b8160010193505b50614fd9565b5050509550959350505050565b60028a810b900b600090815260208c90526040812080546001600160801b031682615166828d6135ef565b9050846001600160801b0316816001600160801b031611156151b4576040805162461bcd60e51b81526020600482015260026024820152614c4f60f01b604482015290519081900360640190fd5b6001600160801b03828116159082161581141594501561528a578c60020b8e60020b1361525a57600183018b9055600283018a90556003830180547fffffffffff0000000000000000000000000000000000000000ffffffffffffff166701000000000000006001600160a01b038c16021766ffffffffffffff191666ffffffffffffff60068b900b161763ffffffff60d81b1916600160d81b63ffffffff8a16021790555b6003830180547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16600160f81b1790555b82546001600160801b0319166001600160801b038216178355856152d35782546152ce906152c990600160801b9004600f90810b810b908f900b6132c3565b613f58565b6152f4565b82546152f4906152c990600160801b9004600f90810b810b908f900b6132a7565b8354600f9190910b6001600160801b03908116600160801b0291161790925550909c9b505050505050505050505050565b8060020b8260020b8161533457fe5b0760020b1561534257600080fd5b60008061535d8360020b8560020b8161535757fe5b056144b6565b600191820b820b60009081526020979097526040909620805460ff9097169190911b90951890945550505050565b600285810b80820b60009081526020899052604080822088850b850b83529082209193849391929184918291908a900b126153d1575050600182015460028301546153e4565b8360010154880391508360020154870390505b6000808b60020b8b60020b121561540657505060018301546002840154615419565b84600101548a0391508460020154890390505b92909803979097039b96909503949094039850939650505050505050565b6040805160a08101825285546001600160801b0390811682526001870154602083015260028701549282019290925260038601548083166060830152600160801b900490911660808201526000600f85900b6154d65781516001600160801b03166154ce576040805162461bcd60e51b815260206004820152600260248201526104e560f41b604482015290519081900360640190fd5b5080516154e5565b81516154e290866135ef565b90505b60006155098360200151860384600001516001600160801b0316600160801b6132d9565b9050600061552f8460400151860385600001516001600160801b0316600160801b6132d9565b905086600f0b6000146155565787546001600160801b0319166001600160801b0384161788555b60018801869055600288018590556001600160801b03821615158061558457506000816001600160801b0316115b156155c2576003880180546001600160801b031981166001600160801b039182168501821617808216600160801b9182900483168501909216021790555b5050505050505050565b600290810b810b6000908152602092909252604082208281556001810183905590810182905560030155565b806001600160a01b0381168114612beb57600080fd5b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b6040805160808101825260008082526020820181905291810182905260608101919091529056fea164736f6c6343000706000aa164736f6c6343000706000a", - linkReferences: {}, - deployedLinkReferences: {}, - }; - - fs.writeFileSync( - `${artifacts._artifactsPath}/UniswapV3Factory.json`, - JSON.stringify(artifact) - ); -}); diff --git a/lib/g-uni-v1-core/package.json b/lib/g-uni-v1-core/package.json deleted file mode 100644 index e76c91924..000000000 --- a/lib/g-uni-v1-core/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "hardhat-project", - "scripts": { - "build": "yarn compile && npx tsc", - "compile": "npx hardhat compile", - "clean": "rm -rf dist && npx hardhat clean", - "deploy:pool": "npx hardhat deploy --tags GUniPool --write true", - "deploy:factory": "npx hardhat deploy --tags GUniFactory --write true", - "format": "prettier --write .", - "format:check": "prettier --check '*/**/*.{js,sol,json,md,ts}'", - "lint": "eslint --cache . && yarn lint:sol", - "lint:ts": "eslint -c .eslintrc.json --ext \"**/*.ts\" \"**/*.test.ts\"", - "lint:sol": "solhint 'contracts/**/*.sol'", - "test": "npx hardhat test", - "verify": "npx hardhat etherscan-verify" - }, - "devDependencies": { - "@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers", - "@nomiclabs/hardhat-etherscan": "2.1.2", - "@nomiclabs/hardhat-waffle": "2.0.1", - "@openzeppelin/contracts": "4.1.0", - "@openzeppelin/contracts-upgradeable": "4.1.0", - "@tsconfig/recommended": "1.0.1", - "@typechain/ethers-v5": "7.0.0", - "@typechain/hardhat": "2.0.1", - "@types/chai": "4.2.18", - "@types/mocha": "8.2.2", - "@types/node": "15.3.0", - "@typescript-eslint/eslint-plugin": "4.24.0", - "@typescript-eslint/parser": "4.24.0", - "@uniswap/v3-core": "1.0.0", - "chai": "4.3.4", - "dotenv": "9.0.2", - "eslint": "7.26.0", - "eslint-config-prettier": "8.3.0", - "eslint-plugin-prettier": "3.4.0", - "ethereum-waffle": "3.3.0", - "ethers": "5.1.4", - "hardhat": "2.3.0", - "hardhat-deploy": "0.10.0", - "husky": "6.0.0", - "lint-staged": "11.0.0", - "node-fetch": "2.6.1", - "prettier": "2.3.0", - "prettier-plugin-solidity": "1.0.0-beta.10", - "solhint": "3.3.4", - "solhint-plugin-prettier": "0.0.5", - "solidity-coverage": "0.7.16", - "ts-generator": "0.1.1", - "ts-node": "9.1.1", - "typechain": "5.0.0", - "typescript": "4.2.4" - }, - "lint-staged": { - "*.{ts,js}": "eslint -c .eslintrc.json" - } -} diff --git a/lib/g-uni-v1-core/src/addresses.ts b/lib/g-uni-v1-core/src/addresses.ts deleted file mode 100644 index 51f7d5864..000000000 --- a/lib/g-uni-v1-core/src/addresses.ts +++ /dev/null @@ -1,139 +0,0 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -interface Addresses { - Gelato: string; - WETH: string; - DAI: string; - USDC: string; - UniswapV3Factory: string; - Swapper: string; - GelatoDevMultiSig: string; - GUniFactory: string; - GUniImplementation: string; -} - -export const getAddresses = (network: string): Addresses => { - switch (network) { - case "mainnet": - return { - Gelato: "0x3CACa7b48D0573D793d3b0279b5F0029180E83b6", - Swapper: "", - GelatoDevMultiSig: "", - WETH: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", - DAI: "0x6B175474E89094C44Da98b954EedeAC495271d0F", - USDC: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - UniswapV3Factory: "0x1F98431c8aD98523631AE4a59f267346ea31F984", - GUniFactory: "0xEA1aFf9dbFfD1580F6b81A3ad3589E66652dB7D9", - GUniImplementation: "", - }; - case "optimism": - return { - Gelato: "0x01051113D81D7d6DA508462F2ad6d7fD96cF42Ef", - Swapper: "", - GelatoDevMultiSig: "", - WETH: "", - DAI: "", - USDC: "", - UniswapV3Factory: "0x1F98431c8aD98523631AE4a59f267346ea31F984", - GUniFactory: "0x2845c6929d621e32B7596520C8a1E5a37e616F09", - GUniImplementation: "0x8582Bf142BE76fEF830D23f590a2587f2aD7C216", - }; - case "polygon": - return { - Gelato: "0x7598e84B2E114AB62CAB288CE5f7d5f6bad35BbA", - Swapper: "0x2E185412E2aF7DC9Ed28359Ea3193EBAd7E929C6", - GelatoDevMultiSig: "0x02864B9A53fd250900Ba74De507a56503C3DC90b", - WETH: "", - DAI: "", - USDC: "", - UniswapV3Factory: "0x1F98431c8aD98523631AE4a59f267346ea31F984", - GUniFactory: "0x37265A834e95D11c36527451c7844eF346dC342a", - GUniImplementation: "0xd2Bb190dD88e7Af5DF176064Ec42f6dfA8672F40", - }; - case "goerli": - return { - Gelato: "0x683913B3A32ada4F8100458A3E1675425BdAa7DF", - Swapper: "", - GelatoDevMultiSig: "0x4B5BaD436CcA8df3bD39A095b84991fAc9A226F1", - WETH: "", - DAI: "", - USDC: "", - UniswapV3Factory: "0x1F98431c8aD98523631AE4a59f267346ea31F984", - GUniFactory: "", - GUniImplementation: "", - }; - case "anvil": - return { - Gelato: "0x0000000000000000000000000000000000000000", - Swapper: "", - GelatoDevMultiSig: "0x0000000000000000000000000000000000000000", - WETH: "0x0000000000000000000000000000000000000000", - DAI: "", - USDC: "", - UniswapV3Factory: "", - GUniFactory: "", - GUniImplementation: "", - }; - case "blastSepolia": - return { - Gelato: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - Swapper: "", - GelatoDevMultiSig: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - WETH: "0x4200000000000000000000000000000000000023", - DAI: "", - USDC: "", - UniswapV3Factory: "0x84fF29e6321c9dd328B8B383b08dd2815b121243", - GUniFactory: "0xED28E5230E934cf9C843C08818D0639176040297", - GUniImplementation: "0xdde18C0c3B637F4BA02f5567a671F5e28b7404e7", - }; - case "arbitrumSepolia": - return { - Gelato: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - Swapper: "", - GelatoDevMultiSig: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - WETH: "", - DAI: "", - USDC: "", - UniswapV3Factory: "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F", - GUniFactory: "0x39AC4439e6CB9427C073259e5742529cE46DD663", - GUniImplementation: "0xF3e2578C66071a637F06cc02b1c11DeC0784C1A6", - }; - case "modeSepolia": - return { - Gelato: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - Swapper: "", - GelatoDevMultiSig: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - WETH: "", - DAI: "", - USDC: "", - UniswapV3Factory: "0x0f88f3f5108eB3BD1A2D411E9a1fD41997811D88", - GUniFactory: "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F", - GUniImplementation: "0xe1B83edA3399A2c9B8265215EA21042C9b918dc5", - }; - case "baseSepolia": - return { - Gelato: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - Swapper: "", - GelatoDevMultiSig: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - WETH: "", - DAI: "", - USDC: "", - UniswapV3Factory: "0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24", - GUniFactory: "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b", - GUniImplementation: "0xF5c31d08a71c854A9f607A5992456dBC31B11e16", - }; - case "mantleSepolia": - return { - Gelato: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - Swapper: "", - GelatoDevMultiSig: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - WETH: "", - DAI: "", - USDC: "", - UniswapV3Factory: "0xE292cF4e316191CbFEbD74909356DF3cd9455e96", - GUniFactory: "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706", - GUniImplementation: "0xE292cF4e316191CbFEbD74909356DF3cd9455e96", - }; - default: - throw new Error(`No addresses for Network: ${network}`); - } -}; diff --git a/lib/g-uni-v1-core/test/GUniPool.test.ts b/lib/g-uni-v1-core/test/GUniPool.test.ts deleted file mode 100644 index e09fd953a..000000000 --- a/lib/g-uni-v1-core/test/GUniPool.test.ts +++ /dev/null @@ -1,1018 +0,0 @@ -import { expect } from "chai"; -import { BigNumber } from "bignumber.js"; -import { ethers, network } from "hardhat"; -import { - IERC20, - IUniswapV3Factory, - IUniswapV3Pool, - SwapTest, - GUniPool, - GUniFactory, - EIP173Proxy, -} from "../typechain"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address"; - -// eslint-disable-next-line -BigNumber.config({ EXPONENTIAL_AT: 999999, DECIMAL_PLACES: 40 }); - -// returns the sqrt price as a 64x96 -function encodePriceSqrt(reserve1: string, reserve0: string) { - return new BigNumber(reserve1) - .div(reserve0) - .sqrt() - .multipliedBy(new BigNumber(2).pow(96)) - .integerValue(3) - .toString(); -} - -function position(address: string, lowerTick: number, upperTick: number) { - return ethers.utils.solidityKeccak256( - ["address", "int24", "int24"], - [address, lowerTick, upperTick] - ); -} - -describe("GUniPool", function () { - this.timeout(0); - - let uniswapFactory: IUniswapV3Factory; - let uniswapPool: IUniswapV3Pool; - - let token0: IERC20; - let token1: IERC20; - let user0: SignerWithAddress; - let user1: SignerWithAddress; - let user2: SignerWithAddress; - let swapTest: SwapTest; - let gUniPool: GUniPool; - let gUniFactory: GUniFactory; - let gelato: SignerWithAddress; - let uniswapPoolAddress: string; - let implementationAddress: string; - - before(async function () { - [user0, user1, user2, gelato] = await ethers.getSigners(); - - const swapTestFactory = await ethers.getContractFactory("SwapTest"); - swapTest = (await swapTestFactory.deploy()) as SwapTest; - }); - - beforeEach(async function () { - const uniswapV3Factory = await ethers.getContractFactory( - "UniswapV3Factory" - ); - const uniswapDeploy = await uniswapV3Factory.deploy(); - uniswapFactory = (await ethers.getContractAt( - "IUniswapV3Factory", - uniswapDeploy.address - )) as IUniswapV3Factory; - - const mockERC20Factory = await ethers.getContractFactory("MockERC20"); - token0 = (await mockERC20Factory.deploy()) as IERC20; - token1 = (await mockERC20Factory.deploy()) as IERC20; - - await token0.approve( - swapTest.address, - ethers.utils.parseEther("10000000000000") - ); - await token1.approve( - swapTest.address, - ethers.utils.parseEther("10000000000000") - ); - - // Sort token0 & token1 so it follows the same order as Uniswap & the GUniPoolFactory - if ( - ethers.BigNumber.from(token0.address).gt( - ethers.BigNumber.from(token1.address) - ) - ) { - const tmp = token0; - token0 = token1; - token1 = tmp; - } - - await uniswapFactory.createPool(token0.address, token1.address, "3000"); - uniswapPoolAddress = await uniswapFactory.getPool( - token0.address, - token1.address, - "3000" - ); - uniswapPool = (await ethers.getContractAt( - "IUniswapV3Pool", - uniswapPoolAddress - )) as IUniswapV3Pool; - await uniswapPool.initialize(encodePriceSqrt("1", "1")); - - await uniswapPool.increaseObservationCardinalityNext("5"); - - const gUniPoolFactory = await ethers.getContractFactory("GUniPool"); - const gUniImplementation = await gUniPoolFactory.deploy( - await gelato.getAddress() - ); - - implementationAddress = gUniImplementation.address; - - const gUniFactoryFactory = await ethers.getContractFactory("GUniFactory"); - - gUniFactory = (await gUniFactoryFactory.deploy( - uniswapFactory.address - )) as GUniFactory; - - await gUniFactory.initialize( - implementationAddress, - await user0.getAddress(), - await user0.getAddress() - ); - - await gUniFactory.createManagedPool( - token0.address, - token1.address, - 3000, - 0, - -887220, - 887220 - ); - - const deployers = await gUniFactory.getDeployers(); - const deployer = deployers[0]; - const gelatoDeployer = await gUniFactory.gelatoDeployer(); - expect(deployer).to.equal(gelatoDeployer); - const pools = await gUniFactory.getPools(deployer); - const gelatoPools = await gUniFactory.getGelatoPools(); - expect(pools[0]).to.equal(gelatoPools[0]); - expect(pools.length).to.equal(gelatoPools.length); - - gUniPool = (await ethers.getContractAt("GUniPool", pools[0])) as GUniPool; - const gelatoFee = await gUniPool.gelatoFeeBPS(); - expect(gelatoFee.toString()).to.equal("250"); - }); - - describe("Before liquidity deposited", function () { - beforeEach(async function () { - await token0.approve( - gUniPool.address, - ethers.utils.parseEther("1000000") - ); - await token1.approve( - gUniPool.address, - ethers.utils.parseEther("1000000") - ); - }); - - describe("deposit", function () { - it("should deposit funds into GUniPool", async function () { - const result = await gUniPool.getMintAmounts( - ethers.utils.parseEther("1"), - ethers.utils.parseEther("1") - ); - await gUniPool.mint(result.mintAmount, await user0.getAddress()); - - expect(await token0.balanceOf(uniswapPool.address)).to.be.gt(0); - expect(await token1.balanceOf(uniswapPool.address)).to.be.gt(0); - const [liquidity] = await uniswapPool.positions( - position(gUniPool.address, -887220, 887220) - ); - expect(liquidity).to.be.gt(0); - const supply = await gUniPool.totalSupply(); - expect(supply).to.be.gt(0); - const result2 = await gUniPool.getMintAmounts( - ethers.utils.parseEther("0.5"), - ethers.utils.parseEther("1") - ); - await gUniPool.mint(result2.mintAmount, await user0.getAddress()); - const [liquidity2] = await uniswapPool.positions( - position(gUniPool.address, -887220, 887220) - ); - expect(liquidity2).to.be.gt(liquidity); - - await gUniPool.transfer( - await user1.getAddress(), - ethers.utils.parseEther("1") - ); - await gUniPool - .connect(user1) - .approve(await user0.getAddress(), ethers.utils.parseEther("1")); - await gUniPool - .connect(user0) - .transferFrom( - await user1.getAddress(), - await user0.getAddress(), - ethers.utils.parseEther("1") - ); - - const decimals = await gUniPool.decimals(); - const symbol = await gUniPool.symbol(); - const name = await gUniPool.name(); - expect(symbol).to.equal("G-UNI"); - expect(decimals).to.equal(18); - expect(name).to.equal("Gelato Uniswap TOKEN/TOKEN LP"); - }); - }); - - describe("onlyGelato", function () { - it("should fail if not called by gelato", async function () { - await expect( - gUniPool - .connect(user1) - .rebalance( - encodePriceSqrt("10", "1"), - 1000, - true, - 10, - token0.address - ) - ).to.be.reverted; - await expect( - gUniPool.connect(user1).withdrawManagerBalance(1, token0.address) - ).to.be.reverted; - await expect( - gUniPool.connect(user1).withdrawGelatoBalance(1, token0.address) - ).to.be.reverted; - }); - it("should fail if no fees earned", async function () { - await expect( - gUniPool - .connect(gelato) - .rebalance( - encodePriceSqrt("10", "1"), - 1000, - true, - 10, - token0.address - ) - ).to.be.reverted; - await expect( - gUniPool.connect(gelato).withdrawManagerBalance(1, token0.address) - ).to.be.reverted; - await expect( - gUniPool.connect(gelato).withdrawGelatoBalance(1, token0.address) - ).to.be.reverted; - }); - }); - - describe("onlyManager", function () { - it("should be possible to executiveRebalance before deposits", async function () { - await gUniPool.executiveRebalance(-887220, 0, 0, 0, false); - await gUniPool.executiveRebalance(-887220, 887220, 0, 0, false); - }); - it("should fail if not called by manager", async function () { - await expect( - gUniPool - .connect(gelato) - .updateGelatoParams(300, 5000, 5000, 5000, await user0.getAddress()) - ).to.be.reverted; - - await expect( - gUniPool.connect(gelato).transferOwnership(await user1.getAddress()) - ).to.be.reverted; - await expect(gUniPool.connect(gelato).renounceOwnership()).to.be - .reverted; - await expect(gUniPool.connect(gelato).initializeManagerFee(100)).to.be - .reverted; - }); - }); - - describe("After liquidity deposited", function () { - beforeEach(async function () { - const result = await gUniPool.getMintAmounts( - ethers.utils.parseEther("1"), - ethers.utils.parseEther("1") - ); - await gUniPool.mint(result.mintAmount, await user0.getAddress()); - }); - - describe("withdrawal", function () { - it("should burn LP tokens and withdraw funds", async function () { - await gUniPool.burn( - (await gUniPool.totalSupply()).div("2"), - await user0.getAddress() - ); - const [liquidity2] = await uniswapPool.positions( - position(gUniPool.address, -887220, 887220) - ); - expect(liquidity2).to.be.gt(0); - expect(await gUniPool.totalSupply()).to.be.gt(0); - expect(await gUniPool.balanceOf(await user0.getAddress())).to.equal( - ethers.utils.parseEther("0.5") - ); - }); - }); - - describe("after fees earned on trades", function () { - beforeEach(async function () { - await swapTest.washTrade( - uniswapPool.address, - "50000000000000", - 100, - 2 - ); - await swapTest.washTrade( - uniswapPool.address, - "50000000000000", - 100, - 3 - ); - await swapTest.washTrade( - uniswapPool.address, - "50000000000000", - 100, - 3 - ); - await swapTest.washTrade( - uniswapPool.address, - "50000000000000", - 100, - 3 - ); - }); - - describe("reinvest fees", function () { - it("should redeposit fees with a rebalance", async function () { - const [liquidityOld] = await uniswapPool.positions( - position(gUniPool.address, -887220, 887220) - ); - const gelatoBalanceBefore = await token1.balanceOf( - await gelato.getAddress() - ); - - await expect( - gUniPool - .connect(gelato) - .rebalance( - encodePriceSqrt("1", "1"), - 5000, - true, - 10, - token0.address - ) - ).to.be.reverted; - - const tx = await gUniPool.updateGelatoParams( - "1000", - "100", - "500", - "300", - await user0.getAddress() - ); - if (network.provider && user0.provider && tx.blockHash) { - const block = await user0.provider.getBlock(tx.blockHash); - const executionTime = block.timestamp + 300; - await network.provider.send("evm_mine", [executionTime]); - } - - const { sqrtPriceX96 } = await uniswapPool.slot0(); - const slippagePrice = sqrtPriceX96.sub( - sqrtPriceX96.div(ethers.BigNumber.from("25")) - ); - - await gUniPool - .connect(gelato) - .rebalance(slippagePrice, 5000, true, 5, token1.address); - - const gelatoBalanceAfter = await token1.balanceOf( - await gelato.getAddress() - ); - expect(gelatoBalanceAfter).to.be.gt(gelatoBalanceBefore); - expect( - Number(gelatoBalanceAfter.sub(gelatoBalanceBefore)) - ).to.be.equal(5); - - const [liquidityNew] = await uniswapPool.positions( - position(gUniPool.address, -887220, 887220) - ); - expect(liquidityNew).to.be.gt(liquidityOld); - }); - }); - - describe("executive rebalance", function () { - it("should change the ticks and redeposit", async function () { - const [liquidityOld] = await uniswapPool.positions( - position(gUniPool.address, -887220, 887220) - ); - - const tx = await gUniPool - .connect(user0) - .updateGelatoParams( - "5000", - "5000", - "5000", - "200", - await user0.getAddress() - ); - await tx.wait(); - await swapTest.washTrade( - uniswapPool.address, - "500000000000000000", - 100, - 2 - ); - await token1.transfer( - gUniPool.address, - ethers.utils.parseEther("1") - ); - if (network.provider && user0.provider && tx.blockHash) { - const block = await user0.provider.getBlock(tx.blockHash); - const executionTime = block.timestamp + 300; - await network.provider.send("evm_mine", [executionTime]); - } - const lowerTickBefore = await gUniPool.lowerTick(); - const upperTickBefore = await gUniPool.upperTick(); - expect(lowerTickBefore).to.equal(-887220); - expect(upperTickBefore).to.equal(887220); - const { sqrtPriceX96 } = await uniswapPool.slot0(); - const slippagePrice = sqrtPriceX96.add( - sqrtPriceX96.div(ethers.BigNumber.from("25")) - ); - - await gUniPool - .connect(user0) - .executiveRebalance(-443580, 443580, slippagePrice, 5000, false); - - const lowerTickAfter = await gUniPool.lowerTick(); - const upperTickAfter = await gUniPool.upperTick(); - expect(lowerTickAfter).to.equal(-443580); - expect(upperTickAfter).to.equal(443580); - - const [liquidityOldAfter] = await uniswapPool.positions( - position(gUniPool.address, -887220, 887220) - ); - expect(liquidityOldAfter).to.equal("0"); - expect(liquidityOldAfter).to.be.lt(liquidityOld); - - const [liquidityNew] = await uniswapPool.positions( - position(gUniPool.address, -443580, 443580) - ); - expect(liquidityNew).to.be.gt(liquidityOld); - - // console.log(gelatoBalance0.toString(), gelatoBalance1.toString()); - - await gUniPool.burn( - await gUniPool.totalSupply(), - await user0.getAddress() - ); - - const contractBalance0 = await token0.balanceOf(gUniPool.address); - const contractBalance1 = await token1.balanceOf(gUniPool.address); - // console.log( - // contractBalance0.toString(), - // contractBalance1.toString() - // ); - - const gelatoBalance0 = await gUniPool.gelatoBalance0(); - const gelatoBalance1 = await gUniPool.gelatoBalance1(); - - expect(contractBalance0).to.equal(gelatoBalance0); - expect(contractBalance1).to.equal(gelatoBalance1); - }); - - it("should receive same amounts on burn as spent on mint (if no trading)", async function () { - const user1Address = await user1.getAddress(); - const user2Address = await user2.getAddress(); - await token0.transfer( - user2Address, - ethers.utils.parseEther("1000") - ); - await token1.transfer( - user2Address, - ethers.utils.parseEther("1000") - ); - await token0.transfer( - user1Address, - ethers.utils.parseEther("1000") - ); - await token1.transfer( - user1Address, - ethers.utils.parseEther("1000") - ); - await token0 - .connect(user1) - .approve(gUniPool.address, ethers.constants.MaxUint256); - await token1 - .connect(user1) - .approve(gUniPool.address, ethers.constants.MaxUint256); - const result = await gUniPool.getMintAmounts( - ethers.utils.parseEther("9"), - ethers.utils.parseEther("9") - ); - await gUniPool.connect(user1).mint(result.mintAmount, user1Address); - await token0 - .connect(user2) - .approve(gUniPool.address, ethers.constants.MaxUint256); - await token1 - .connect(user2) - .approve(gUniPool.address, ethers.constants.MaxUint256); - const result2 = await gUniPool.getMintAmounts( - ethers.utils.parseEther("10"), - ethers.utils.parseEther("10") - ); - await gUniPool - .connect(user2) - .mint(result2.mintAmount, user2Address); - - const balanceAfterMint0 = await token0.balanceOf(user2Address); - const balanceAfterMint1 = await token0.balanceOf(user2Address); - - expect( - ethers.utils.parseEther("1000").sub(balanceAfterMint0.toString()) - ).to.be.gt(ethers.BigNumber.from("1")); - expect( - ethers.utils.parseEther("1000").sub(balanceAfterMint1.toString()) - ).to.be.gt(ethers.BigNumber.from("1")); - - await gUniPool - .connect(user2) - .burn(await gUniPool.balanceOf(user2Address), user2Address); - const balanceAfterBurn0 = await token0.balanceOf(user2Address); - const balanceAfterBurn1 = await token0.balanceOf(user2Address); - expect( - ethers.utils.parseEther("1000").sub(balanceAfterBurn1.toString()) - ).to.be.lte(ethers.BigNumber.from("2")); - expect( - ethers.utils.parseEther("1000").sub(balanceAfterBurn0.toString()) - ).to.be.lte(ethers.BigNumber.from("2")); - expect( - ethers.utils.parseEther("1000").sub(balanceAfterBurn1.toString()) - ).to.be.gte(ethers.constants.Zero); - expect( - ethers.utils.parseEther("1000").sub(balanceAfterBurn0.toString()) - ).to.be.gte(ethers.constants.Zero); - }); - }); - }); - - describe("simulate price moves and deposits, prove all value is returned on burn", function () { - it("does not get tokens stuck in contract", async function () { - await swapTest.washTrade( - uniswapPool.address, - "50000000000000000000000", - 100, - 3 - ); - await swapTest.washTrade( - uniswapPool.address, - "50000000000000000000000", - 100, - 3 - ); - const { sqrtPriceX96 } = await uniswapPool.slot0(); - const slippagePrice = sqrtPriceX96.sub( - sqrtPriceX96.div(ethers.BigNumber.from("25")) - ); - await expect( - gUniPool - .connect(gelato) - .rebalance(slippagePrice, 1000, true, 10, token0.address) - ).to.be.reverted; - - const tx = await gUniPool - .connect(user0) - .updateGelatoParams( - "5000", - "5000", - "5000", - "200", - await user0.getAddress() - ); - if (network.provider && user0.provider && tx.blockHash) { - const block = await user0.provider.getBlock(tx.blockHash); - const executionTime = block.timestamp + 300; - await network.provider.send("evm_mine", [executionTime]); - } - await gUniPool - .connect(gelato) - .rebalance(0, 0, true, 2, token0.address); - - let contractBalance0 = await token0.balanceOf(gUniPool.address); - let contractBalance1 = await token1.balanceOf(gUniPool.address); - // console.log(contractBalance0.toString(), contractBalance1.toString()); - await token0.transfer(await user1.getAddress(), "10000000000"); - await token1.transfer(await user1.getAddress(), "10000000000"); - await token0 - .connect(user1) - .approve(gUniPool.address, "10000000000000"); - await token1 - .connect(user1) - .approve(gUniPool.address, "10000000000000"); - const result = await gUniPool.getMintAmounts(1000000, 1000000); - await gUniPool - .connect(user1) - .mint(result.mintAmount, await user1.getAddress()); - - contractBalance0 = await token0.balanceOf(gUniPool.address); - contractBalance1 = await token1.balanceOf(gUniPool.address); - // console.log(contractBalance0.toString(), contractBalance1.toString()); - - await swapTest.washTrade(uniswapPool.address, "50000", 100, 3); - const tx2 = await swapTest.washTrade( - uniswapPool.address, - "50000", - 100, - 3 - ); - await tx2.wait(); - if (network.provider && tx2.blockHash && user0.provider) { - const block = await user0.provider.getBlock(tx2.blockHash); - const executionTime = block.timestamp + 300; - await network.provider.send("evm_mine", [executionTime]); - } - const { sqrtPriceX96: p2 } = await uniswapPool.slot0(); - const slippagePrice2 = p2.sub(p2.div(ethers.BigNumber.from("50"))); - await gUniPool - .connect(gelato) - .rebalance(slippagePrice2, 5000, true, 1, token0.address); - contractBalance0 = await token0.balanceOf(gUniPool.address); - contractBalance1 = await token1.balanceOf(gUniPool.address); - // console.log(contractBalance0.toString(), contractBalance1.toString()); - - // TEST MINT/BURN should return same amount - await token0.transfer(await user2.getAddress(), "100000000000"); - await token1.transfer(await user2.getAddress(), "100000000000"); - await token0 - .connect(user2) - .approve(gUniPool.address, "1000000000000000"); - await token1 - .connect(user2) - .approve(gUniPool.address, "1000000000000000"); - const preBalance0 = await token0.balanceOf(await user2.getAddress()); - const preBalance1 = await token1.balanceOf(await user2.getAddress()); - const preBalanceG = await gUniPool.balanceOf( - await user2.getAddress() - ); - const mintAmounts = await gUniPool.getMintAmounts( - "90000000002", - "90000000002" - ); - - await gUniPool - .connect(user2) - .mint(mintAmounts.mintAmount, await user2.getAddress()); - const intermediateBalance0 = await token0.balanceOf( - await user2.getAddress() - ); - const intermediateBalance1 = await token1.balanceOf( - await user2.getAddress() - ); - const intermediateBalanceG = await gUniPool.balanceOf( - await user2.getAddress() - ); - - expect(preBalance0.sub(intermediateBalance0)).to.equal( - mintAmounts.amount0 - ); - expect(preBalance1.sub(intermediateBalance1)).to.equal( - mintAmounts.amount1 - ); - expect(intermediateBalanceG.sub(preBalanceG)).to.equal( - mintAmounts.mintAmount - ); - await gUniPool - .connect(user2) - .burn( - await gUniPool.balanceOf(await user2.getAddress()), - await user2.getAddress() - ); - const postBalance0 = await token0.balanceOf(await user2.getAddress()); - const postBalance1 = await token1.balanceOf(await user2.getAddress()); - - expect(preBalance0.sub(postBalance0)).to.be.lte( - ethers.BigNumber.from("2") - ); - expect(preBalance0.sub(postBalance0)).to.be.gte( - ethers.constants.Zero - ); - expect(preBalance1.sub(postBalance1)).to.be.lte( - ethers.BigNumber.from("2") - ); - expect(preBalance1.sub(postBalance1)).to.be.gte( - ethers.constants.Zero - ); - - await gUniPool - .connect(user1) - .burn( - await gUniPool.balanceOf(await user1.getAddress()), - await user1.getAddress() - ); - - contractBalance0 = await token0.balanceOf(gUniPool.address); - contractBalance1 = await token1.balanceOf(gUniPool.address); - // console.log(contractBalance0.toString(), contractBalance1.toString()); - - await gUniPool - .connect(user0) - .burn(await gUniPool.totalSupply(), await user0.getAddress()); - - await gUniPool - .connect(gelato) - .withdrawGelatoBalance(1, token0.address); - - contractBalance0 = await token0.balanceOf(gUniPool.address); - contractBalance1 = await token1.balanceOf(gUniPool.address); - // console.log(contractBalance0.toString(), contractBalance1.toString()); - - expect(contractBalance0).to.equal(0); - expect(contractBalance1).to.equal(0); - }); - }); - describe("manager fees, withdrawals, and ownership", function () { - it("should handle manager fees and ownership", async function () { - for (let i = 0; i < 3; i++) { - await swapTest.washTrade(uniswapPool.address, "50000", 100, 3); - await swapTest.washTrade(uniswapPool.address, "50000", 100, 3); - } - const { sqrtPriceX96 } = await uniswapPool.slot0(); - const slippagePrice = sqrtPriceX96.sub( - sqrtPriceX96.div(ethers.BigNumber.from("25")) - ); - await expect( - gUniPool - .connect(gelato) - .rebalance(slippagePrice, 1000, true, 2, token0.address) - ).to.be.reverted; - const tx = await gUniPool - .connect(user0) - .updateGelatoParams( - "9000", - "9000", - "500", - "300", - await user1.getAddress() - ); - await tx.wait(); - if (network.provider && tx.blockHash && user0.provider) { - const block = await user0.provider.getBlock(tx.blockHash); - const executionTime = block.timestamp + 300; - await network.provider.send("evm_mine", [executionTime]); - } - await gUniPool.connect(user0).initializeManagerFee(5000); - await gUniPool - .connect(gelato) - .rebalance(slippagePrice, 5000, true, 2, token0.address); - - const treasuryBal0 = await token0.balanceOf(await user1.getAddress()); - const treasuryBal1 = await token1.balanceOf(await user1.getAddress()); - - await gUniPool - .connect(gelato) - .withdrawManagerBalance(2, token0.address); - - const treasuryBalEnd0 = await token0.balanceOf( - await user1.getAddress() - ); - const treasuryBalEnd1 = await token1.balanceOf( - await user1.getAddress() - ); - - expect(treasuryBalEnd0).to.be.gt(treasuryBal0); - expect(treasuryBalEnd1).to.be.gt(treasuryBal1); - - const bal0End = await gUniPool.managerBalance0(); - const bal1End = await gUniPool.managerBalance1(); - - expect(bal0End).to.equal(ethers.constants.Zero); - expect(bal1End).to.equal(ethers.constants.Zero); - - const gelatoBal0 = await token0.balanceOf(await gelato.getAddress()); - const gelatoBal1 = await token1.balanceOf(await gelato.getAddress()); - - await gUniPool - .connect(gelato) - .withdrawGelatoBalance(1, token0.address); - - const gelatoBalEnd0 = await token0.balanceOf( - await gelato.getAddress() - ); - const gelatoBalEnd1 = await token1.balanceOf( - await gelato.getAddress() - ); - - expect(gelatoBalEnd0).to.be.gt(gelatoBal0); - expect(gelatoBalEnd1).to.be.gt(gelatoBal1); - - const gelatoLeft0 = await gUniPool.gelatoBalance0(); - const gelatoLeft1 = await gUniPool.gelatoBalance1(); - - expect(gelatoLeft0).to.equal(ethers.constants.Zero); - expect(gelatoLeft1).to.equal(ethers.constants.Zero); - - await expect(gUniPool.connect(user0).initializeManagerFee(2000)).to.be - .reverted; - const treasuryStart = await gUniPool.managerTreasury(); - expect(treasuryStart).to.equal(await user1.getAddress()); - await expect(gUniPool.connect(gelato).renounceOwnership()).to.be - .reverted; - const manager = await gUniPool.manager(); - expect(manager).to.equal(await user0.getAddress()); - await gUniPool - .connect(user0) - .transferOwnership(await user1.getAddress()); - const manager2 = await gUniPool.manager(); - expect(manager2).to.equal(await user1.getAddress()); - await gUniPool.connect(user1).renounceOwnership(); - const treasuryEnd = await gUniPool.managerTreasury(); - expect(treasuryEnd).to.equal(ethers.constants.AddressZero); - const lastManager = await gUniPool.manager(); - expect(lastManager).to.equal(ethers.constants.AddressZero); - }); - }); - describe("factory management", function () { - it("should create pools correctly", async function () { - await gUniFactory.createPool( - token0.address, - token1.address, - 3000, - -887220, - 887220 - ); - const deployers = await gUniFactory.getDeployers(); - const deployer = deployers[0]; - let deployerPools = await gUniFactory.getPools(deployer); - let newPool = (await ethers.getContractAt( - "GUniPool", - deployerPools[deployerPools.length - 1] - )) as GUniPool; - let newPoolManager = await newPool.manager(); - expect(newPoolManager).to.equal(ethers.constants.AddressZero); - await uniswapFactory.createPool( - token0.address, - token1.address, - "500" - ); - await gUniFactory.createPool( - token0.address, - token1.address, - 500, - -10, - 10 - ); - deployerPools = await gUniFactory.getPools(deployer); - newPool = (await ethers.getContractAt( - "GUniPool", - deployerPools[deployerPools.length - 1] - )) as GUniPool; - newPoolManager = await newPool.manager(); - expect(newPoolManager).to.equal(ethers.constants.AddressZero); - let lowerTick = await newPool.lowerTick(); - let upperTick = await newPool.upperTick(); - expect(lowerTick).to.equal(-10); - expect(upperTick).to.equal(10); - - await uniswapFactory.createPool( - token0.address, - token1.address, - "10000" - ); - await gUniFactory.createPool( - token0.address, - token1.address, - 10000, - 200, - 600 - ); - deployerPools = await gUniFactory.getPools(deployer); - newPool = (await ethers.getContractAt( - "GUniPool", - deployerPools[deployerPools.length - 1] - )) as GUniPool; - newPoolManager = await newPool.manager(); - expect(newPoolManager).to.equal(ethers.constants.AddressZero); - lowerTick = await newPool.lowerTick(); - upperTick = await newPool.upperTick(); - expect(lowerTick).to.equal(200); - expect(upperTick).to.equal(600); - - await expect( - gUniFactory.createPool( - token0.address, - token1.address, - 3000, - -10, - 10 - ) - ).to.be.reverted; - await expect( - gUniFactory.createManagedPool( - token0.address, - token1.address, - 3000, - 0, - -10, - 10 - ) - ).to.be.reverted; - await expect( - gUniFactory.createPool( - token0.address, - token1.address, - 10000, - -10, - 10 - ) - ).to.be.reverted; - await expect( - gUniFactory.createManagedPool( - token0.address, - token1.address, - 10000, - 0, - -10, - 10 - ) - ).to.be.reverted; - await expect( - gUniFactory.createPool(token0.address, token1.address, 500, -5, 5) - ).to.be.reverted; - await expect( - gUniFactory.createManagedPool( - token0.address, - token1.address, - 500, - 0, - -5, - 5 - ) - ).to.be.reverted; - await expect( - gUniFactory.createPool(token0.address, token1.address, 500, 100, 0) - ).to.be.reverted; - await expect( - gUniFactory.createManagedPool( - token0.address, - token1.address, - 500, - 0, - 100, - 0 - ) - ).to.be.reverted; - }); - it("should handle implementation upgrades and whitelisting", async function () { - const manager = await gUniFactory.manager(); - expect(manager).to.equal(await user0.getAddress()); - - // only manager should be able to call permissioned functions - await expect( - gUniFactory.connect(gelato).upgradePools([gUniPool.address]) - ).to.be.reverted; - await expect( - gUniFactory - .connect(gelato) - .upgradePoolsAndCall([gUniPool.address], ["0x"]) - ).to.be.reverted; - await expect( - gUniFactory.connect(gelato).makePoolsImmutable([gUniPool.address]) - ).to.be.reverted; - await expect( - gUniFactory - .connect(gelato) - .setPoolImplementation(ethers.constants.AddressZero) - ).to.be.reverted; - await expect( - gUniFactory - .connect(gelato) - .setGelatoDeployer(ethers.constants.AddressZero) - ).to.be.reverted; - - const implementationBefore = await gUniFactory.poolImplementation(); - expect(implementationBefore).to.equal(implementationAddress); - await gUniFactory.setPoolImplementation(ethers.constants.AddressZero); - const implementationAfter = await gUniFactory.poolImplementation(); - expect(implementationAfter).to.equal(ethers.constants.AddressZero); - await gUniFactory.upgradePools([gUniPool.address]); - await expect(gUniPool.totalSupply()).to.be.reverted; - const proxyAdmin = await gUniFactory.getProxyAdmin(gUniPool.address); - expect(proxyAdmin).to.equal(gUniFactory.address); - const isNotImmutable = await gUniFactory.isPoolImmutable( - gUniPool.address - ); - expect(isNotImmutable).to.be.false; - await gUniFactory.makePoolsImmutable([gUniPool.address]); - await expect(gUniFactory.upgradePools([gUniPool.address])).to.be - .reverted; - const poolProxy = (await ethers.getContractAt( - "EIP173Proxy", - gUniPool.address - )) as EIP173Proxy; - await expect( - poolProxy.connect(user0).upgradeTo(implementationAddress) - ).to.be.reverted; - const isImmutable = await gUniFactory.isPoolImmutable( - gUniPool.address - ); - expect(isImmutable).to.be.true; - await gUniFactory.setGelatoDeployer(ethers.constants.AddressZero); - const newDeployer = await gUniFactory.gelatoDeployer(); - expect(newDeployer).to.equal(ethers.constants.AddressZero); - const gelatoPools = await gUniFactory.getGelatoPools(); - expect(gelatoPools.length).to.equal(0); - await gUniFactory.transferOwnership(await user1.getAddress()); - const manager2 = await gUniFactory.manager(); - expect(manager2).to.equal(await user1.getAddress()); - await gUniFactory.connect(user1).renounceOwnership(); - const manager3 = await gUniFactory.manager(); - expect(manager3).to.equal(ethers.constants.AddressZero); - }); - }); - }); - }); -}); diff --git a/lib/g-uni-v1-core/tsconfig.json b/lib/g-uni-v1-core/tsconfig.json deleted file mode 100644 index 798761ccf..000000000 --- a/lib/g-uni-v1-core/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": "@tsconfig/recommended/tsconfig.json", - "compilerOptions": { - "noImplicitAny": true, - "allowSyntheticDefaultImports": true, - "downlevelIteration": true, - "skipLibCheck": true, - "moduleResolution": "node", - "resolveJsonModule": true, - "typeRoots": ["./node_modules/@types"], - "outDir": "dist" - }, - "files": ["hardhat.config.ts"], - "include": ["src", "deploy", "scripts", "test", "typechain"], - "exclude": ["node_modules"] -} diff --git a/lib/g-uni-v1-core/yarn.lock b/lib/g-uni-v1-core/yarn.lock deleted file mode 100644 index c684243a5..000000000 --- a/lib/g-uni-v1-core/yarn.lock +++ /dev/null @@ -1,10468 +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" - -"@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.0", "@ethereumjs/block@^3.2.1": - version "3.2.1" - resolved "https://registry.yarnpkg.com/@ethereumjs/block/-/block-3.2.1.tgz#c24c345e6dd6299efa4bed40979280b7dda96d3a" - integrity sha512-FCxo5KwwULne2A2Yuae4iaGGqSsRjwzXOlDhGalOFiBbLfP3hE04RHaHGw4c8vh1PfOrLauwi0dQNUBkOG3zIA== - dependencies: - "@ethereumjs/common" "^2.2.0" - "@ethereumjs/tx" "^3.1.3" - ethereumjs-util "^7.0.10" - merkle-patricia-tree "^4.1.0" - -"@ethereumjs/blockchain@^5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@ethereumjs/blockchain/-/blockchain-5.2.1.tgz#83ed83647667265f1666f111caf065ef9d1e82b5" - integrity sha512-+hshP2qSOOFsiYvZCbaDQFG7jYTWafE8sfBi+pAsdhAHfP7BN7VLyob7qoQISgwS1s7NTR4c4+2t/woU9ahItw== - dependencies: - "@ethereumjs/block" "^3.2.0" - "@ethereumjs/common" "^2.2.0" - "@ethereumjs/ethash" "^1.0.0" - debug "^2.2.0" - ethereumjs-util "^7.0.9" - 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": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.2.0.tgz#850a3e3e594ee707ad8d44a11e8152fb62450535" - integrity sha512-PyQiTG00MJtBRkJmv46ChZL8u2XWxNBeAthznAUIUiefxPAXjbkuiCZOuncgJS34/XkMbNc9zMt/PlgKRBElig== - dependencies: - crc-32 "^1.2.0" - ethereumjs-util "^7.0.9" - -"@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": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.1.4.tgz#04cf9e9406da5f04a1a26c458744641f4b4b8dd0" - integrity sha512-6cJpmmjCpG5ZVN9NJYtWvmrEQcevw9DIR8hj2ca2PszD2fxbIFXky3Z37gpf8S6u0Npv09kG8It+G4xjydZVLg== - dependencies: - "@ethereumjs/common" "^2.2.0" - ethereumjs-util "^7.0.10" - -"@ethereumjs/vm@^5.3.2": - version "5.3.2" - resolved "https://registry.yarnpkg.com/@ethereumjs/vm/-/vm-5.3.2.tgz#b4d83a3d50a7ad22d6d412cc21bbde221b3e2871" - integrity sha512-QmCUQrW6xbhgEbQh9njue4kAJdM056C+ytBFUTF/kDYa3kNDm4Qxp9HUyTlt1OCSXvDhws0qqlh8+q+pmXpN7g== - dependencies: - "@ethereumjs/block" "^3.2.1" - "@ethereumjs/blockchain" "^5.2.1" - "@ethereumjs/common" "^2.2.0" - "@ethereumjs/tx" "^3.1.3" - 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.1.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.1.2", "@ethersproject/abi@^5.0.1", "@ethersproject/abi@^5.0.2", "@ethersproject/abi@^5.1.0": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.1.2.tgz#a8e75cd0455e6dc9e4861c3d1c22bbe436c1d775" - integrity sha512-uMhoQVPX0UtfzTpekYQSEUcJGDgsJ25ifz+SV6PDETWaUFhcR8RNgb1QPTASP13inW8r6iy0/Xdq9D5hK2pNvA== - dependencies: - "@ethersproject/address" "^5.1.0" - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/constants" "^5.1.0" - "@ethersproject/hash" "^5.1.0" - "@ethersproject/keccak256" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/strings" "^5.1.0" - -"@ethersproject/abi@^5.4.0", "@ethersproject/abi@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.5.0.tgz#fb52820e22e50b854ff15ce1647cc508d6660613" - integrity sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w== - dependencies: - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/hash" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - -"@ethersproject/abstract-provider@5.1.0", "@ethersproject/abstract-provider@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.1.0.tgz#1f24c56cda5524ef4ed3cfc562a01d6b6f8eeb0b" - integrity sha512-8dJUnT8VNvPwWhYIau4dwp7qe1g+KgdRm4XTWvjkI9gAT2zZa90WF5ApdZ3vl1r6NDmnn6vUVvyphClRZRteTQ== - dependencies: - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/networks" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/transactions" "^5.1.0" - "@ethersproject/web" "^5.1.0" - -"@ethersproject/abstract-provider@^5.5.0": - version "5.5.1" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz#2f1f6e8a3ab7d378d8ad0b5718460f85649710c5" - integrity sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/networks" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - "@ethersproject/web" "^5.5.0" - -"@ethersproject/abstract-signer@5.1.0", "@ethersproject/abstract-signer@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.1.0.tgz#744c7a2d0ebe3cc0bc38294d0f53d5ca3f4e49e3" - integrity sha512-qQDMkjGZSSJSKl6AnfTgmz9FSnzq3iEoEbHTYwjDlEAv+LNP7zd4ixCcVWlWyk+2siud856M5CRhAmPdupeN9w== - dependencies: - "@ethersproject/abstract-provider" "^5.1.0" - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - -"@ethersproject/abstract-signer@^5.4.1", "@ethersproject/abstract-signer@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz#590ff6693370c60ae376bf1c7ada59eb2a8dd08d" - integrity sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA== - dependencies: - "@ethersproject/abstract-provider" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - -"@ethersproject/address@5.1.0", "@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.1.0.tgz#3854fd7ebcb6af7597de66f847c3345dae735b58" - integrity sha512-rfWQR12eHn2cpstCFS4RF7oGjfbkZb0oqep+BfrT+gWEGWG2IowJvIsacPOvzyS1jhNF4MQ4BS59B04Mbovteg== - dependencies: - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/keccak256" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/rlp" "^5.1.0" - -"@ethersproject/address@^5.4.0", "@ethersproject/address@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.5.0.tgz#bcc6f576a553f21f3dd7ba17248f81b473c9c78f" - integrity sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/rlp" "^5.5.0" - -"@ethersproject/base64@5.1.0", "@ethersproject/base64@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.1.0.tgz#27240c174d0a4e13f6eae87416fd876caf7f42b6" - integrity sha512-npD1bLvK4Bcxz+m4EMkx+F8Rd7CnqS9DYnhNu0/GlQBXhWjvfoAZzk5HJ0f1qeyp8d+A86PTuzLOGOXf4/CN8g== - dependencies: - "@ethersproject/bytes" "^5.1.0" - -"@ethersproject/base64@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.5.0.tgz#881e8544e47ed976930836986e5eb8fab259c090" - integrity sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA== - dependencies: - "@ethersproject/bytes" "^5.5.0" - -"@ethersproject/basex@5.1.0", "@ethersproject/basex@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.1.0.tgz#80da2e86f9da0cb5ccd446b337364d791f6a131c" - integrity sha512-vBKr39bum7DDbOvkr1Sj19bRMEPA4FnST6Utt6xhDzI7o7L6QNkDn2yrCfP+hnvJGhZFKtLygWwqlTBZoBXYLg== - dependencies: - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - -"@ethersproject/basex@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.5.0.tgz#e40a53ae6d6b09ab4d977bd037010d4bed21b4d3" - integrity sha512-ZIodwhHpVJ0Y3hUCfUucmxKsWQA5TMnavp5j/UOuDdzZWzJlRmuOjcTMIGgHCYuZmHt36BfiSyQPSRskPxbfaQ== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - -"@ethersproject/bignumber@5.1.1", "@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.1.0": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.1.1.tgz#84812695253ccbc639117f7ac49ee1529b68e637" - integrity sha512-AVz5iqz7+70RIqoQTznsdJ6DOVBYciNlvO+AlQmPTB6ofCvoihI9bQdr6wljsX+d5W7Yc4nyvQvP4JMzg0Agig== - dependencies: - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - bn.js "^4.4.0" - -"@ethersproject/bignumber@^5.4.1", "@ethersproject/bignumber@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.5.0.tgz#875b143f04a216f4f8b96245bde942d42d279527" - integrity sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - bn.js "^4.11.9" - -"@ethersproject/bytes@5.1.0", "@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.1.0.tgz#55dfa9c4c21df1b1b538be3accb50fb76d5facfd" - integrity sha512-sGTxb+LVjFxJcJeUswAIK6ncgOrh3D8c192iEJd7mLr95V6du119rRfYT/b87WPkZ5I3gRBUYIYXtdgCWACe8g== - dependencies: - "@ethersproject/logger" "^5.1.0" - -"@ethersproject/bytes@^5.4.0", "@ethersproject/bytes@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" - integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/constants@5.1.0", "@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.1.0.tgz#4e7da6367ea0e9be87585d8b09f3fccf384b1452" - integrity sha512-0/SuHrxc8R8k+JiLmJymxHJbojUDWBQqO+b+XFdwaP0jGzqC09YDy/CAlSZB6qHsBifY8X3I89HcK/oMqxRdBw== - dependencies: - "@ethersproject/bignumber" "^5.1.0" - -"@ethersproject/constants@^5.4.0", "@ethersproject/constants@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.5.0.tgz#d2a2cd7d94bd1d58377d1d66c4f53c9be4d0a45e" - integrity sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - -"@ethersproject/contracts@5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.1.1.tgz#c66cb6d618fcbd73e20a6b808e8f768b2b781d0b" - integrity sha512-6WwktLJ0DFWU8pDkgH4IGttQHhQN4SnwKFu9h+QYVe48VGWtbDu4W8/q/7QA1u/HWlWMrKxqawPiZUJj0UMvOw== - dependencies: - "@ethersproject/abi" "^5.1.0" - "@ethersproject/abstract-provider" "^5.1.0" - "@ethersproject/abstract-signer" "^5.1.0" - "@ethersproject/address" "^5.1.0" - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/constants" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/transactions" "^5.1.0" - -"@ethersproject/contracts@^5.4.1": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.5.0.tgz#b735260d4bd61283a670a82d5275e2a38892c197" - integrity sha512-2viY7NzyvJkh+Ug17v7g3/IJC8HqZBDcOjYARZLdzRxrfGlRgmYgl6xPRKVbEzy1dWKw/iv7chDcS83pg6cLxg== - dependencies: - "@ethersproject/abi" "^5.5.0" - "@ethersproject/abstract-provider" "^5.5.0" - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - -"@ethersproject/hash@5.1.0", "@ethersproject/hash@>=5.0.0-beta.128", "@ethersproject/hash@^5.0.4", "@ethersproject/hash@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.1.0.tgz#40961d64837d57f580b7b055e0d74174876d891e" - integrity sha512-fNwry20yLLPpnRRwm3fBL+2ksgO+KMadxM44WJmRIoTKzy4269+rbq9KFoe2LTqq2CXJM2CE70beGaNrpuqflQ== - dependencies: - "@ethersproject/abstract-signer" "^5.1.0" - "@ethersproject/address" "^5.1.0" - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/keccak256" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/strings" "^5.1.0" - -"@ethersproject/hash@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.5.0.tgz#7cee76d08f88d1873574c849e0207dcb32380cc9" - integrity sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg== - dependencies: - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - -"@ethersproject/hdnode@5.1.0", "@ethersproject/hdnode@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.1.0.tgz#2bf5c4048935136ce83e9242e1bd570afcc0bc83" - integrity sha512-obIWdlujloExPHWJGmhJO/sETOOo7SEb6qemV4f8kyFoXg+cJK+Ta9SvBrj7hsUK85n3LZeZJZRjjM7oez3Clg== - dependencies: - "@ethersproject/abstract-signer" "^5.1.0" - "@ethersproject/basex" "^5.1.0" - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/pbkdf2" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/sha2" "^5.1.0" - "@ethersproject/signing-key" "^5.1.0" - "@ethersproject/strings" "^5.1.0" - "@ethersproject/transactions" "^5.1.0" - "@ethersproject/wordlists" "^5.1.0" - -"@ethersproject/hdnode@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.5.0.tgz#4a04e28f41c546f7c978528ea1575206a200ddf6" - integrity sha512-mcSOo9zeUg1L0CoJH7zmxwUG5ggQHU1UrRf8jyTYy6HxdZV+r0PBoL1bxr+JHIPXRzS6u/UW4mEn43y0tmyF8Q== - dependencies: - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/basex" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/pbkdf2" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/sha2" "^5.5.0" - "@ethersproject/signing-key" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - "@ethersproject/wordlists" "^5.5.0" - -"@ethersproject/json-wallets@5.1.0", "@ethersproject/json-wallets@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.1.0.tgz#bba7af2e520e8aea4d3829d80520db5d2e4fb8d2" - integrity sha512-00n2iBy27w8zrGZSiU762UOVuzCQZxUZxopsZC47++js6xUFuI74DHcJ5K/2pddlF1YBskvmMuboEu1geK8mnA== - dependencies: - "@ethersproject/abstract-signer" "^5.1.0" - "@ethersproject/address" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/hdnode" "^5.1.0" - "@ethersproject/keccak256" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/pbkdf2" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/random" "^5.1.0" - "@ethersproject/strings" "^5.1.0" - "@ethersproject/transactions" "^5.1.0" - aes-js "3.0.0" - scrypt-js "3.0.1" - -"@ethersproject/json-wallets@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.5.0.tgz#dd522d4297e15bccc8e1427d247ec8376b60e325" - integrity sha512-9lA21XQnCdcS72xlBn1jfQdj2A1VUxZzOzi9UkNdnokNKke/9Ya2xA9aIK1SC3PQyBDLt4C+dfps7ULpkvKikQ== - dependencies: - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/address" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/hdnode" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/pbkdf2" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/random" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - aes-js "3.0.0" - scrypt-js "3.0.1" - -"@ethersproject/keccak256@5.1.0", "@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.1.0.tgz#fdcd88fb13bfef4271b225cdd8dec4d315c8e60e" - integrity sha512-vrTB1W6AEYoadww5c9UyVJ2YcSiyIUTNDRccZIgwTmFFoSHwBtcvG1hqy9RzJ1T0bMdATbM9Hfx2mJ6H0i7Hig== - dependencies: - "@ethersproject/bytes" "^5.1.0" - js-sha3 "0.5.7" - -"@ethersproject/keccak256@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.5.0.tgz#e4b1f9d7701da87c564ffe336f86dcee82983492" - integrity sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg== - dependencies: - "@ethersproject/bytes" "^5.5.0" - js-sha3 "0.8.0" - -"@ethersproject/logger@5.1.0", "@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.1.0.tgz#4cdeeefac029373349d5818f39c31b82cc6d9bbf" - integrity sha512-wtUaD1lBX10HBXjjKV9VHCBnTdUaKQnQ2XSET1ezglqLdPdllNOIlLfhyCRqXm5xwcjExVI5ETokOYfjPtaAlw== - -"@ethersproject/logger@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" - integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== - -"@ethersproject/networks@5.1.0", "@ethersproject/networks@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.1.0.tgz#f537290cb05aa6dc5e81e910926c04cfd5814bca" - integrity sha512-A/NIrIED/G/IgU1XUukOA3WcFRxn2I4O5GxsYGA5nFlIi+UZWdGojs85I1VXkR1gX9eFnDXzjE6OtbgZHjFhIA== - dependencies: - "@ethersproject/logger" "^5.1.0" - -"@ethersproject/networks@^5.5.0": - version "5.5.1" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.5.1.tgz#b7f7b9fb88dec1ea48f739b7fb9621311aa8ce6c" - integrity sha512-tYRDM4zZtSUcKnD4UMuAlj7SeXH/k5WC4SP2u1Pn57++JdXHkRu2zwNkgNogZoxHzhm9Q6qqurDBVptHOsW49Q== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/pbkdf2@5.1.0", "@ethersproject/pbkdf2@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.1.0.tgz#6b740a85dc780e879338af74856ca2c0d3b24d19" - integrity sha512-B8cUbHHTgs8OtgJIafrRcz/YPDobVd5Ru8gTnShOiM9EBuFpYHQpq3+8iQJ6pyczDu6HP/oc/njAsIBhwFZYew== - dependencies: - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/sha2" "^5.1.0" - -"@ethersproject/pbkdf2@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.5.0.tgz#e25032cdf02f31505d47afbf9c3e000d95c4a050" - integrity sha512-SaDvQFvXPnz1QGpzr6/HToLifftSXGoXrbpZ6BvoZhmx4bNLHrxDe8MZisuecyOziP1aVEwzC2Hasj+86TgWVg== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/sha2" "^5.5.0" - -"@ethersproject/properties@5.1.0", "@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.1.0.tgz#9484bd6def16595fc6e4bdc26f29dff4d3f6ac42" - integrity sha512-519KKTwgmH42AQL3+GFV3SX6khYEfHsvI6v8HYejlkigSDuqttdgVygFTDsGlofNFchhDwuclrxQnD5B0YLNMg== - dependencies: - "@ethersproject/logger" "^5.1.0" - -"@ethersproject/properties@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.5.0.tgz#61f00f2bb83376d2071baab02245f92070c59995" - integrity sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/providers@5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.1.2.tgz#4e4459698903f911402fe91aa7544eb07f3921ed" - integrity sha512-GqsS8rd+eyd4eNkcNgzZ4l9IRULBPUZa7JPnv22k4MHflMobUseyhfbVnmoN5bVNNkOxjV1IPTw9i0sV1hwdpg== - dependencies: - "@ethersproject/abstract-provider" "^5.1.0" - "@ethersproject/abstract-signer" "^5.1.0" - "@ethersproject/address" "^5.1.0" - "@ethersproject/basex" "^5.1.0" - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/constants" "^5.1.0" - "@ethersproject/hash" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/networks" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/random" "^5.1.0" - "@ethersproject/rlp" "^5.1.0" - "@ethersproject/sha2" "^5.1.0" - "@ethersproject/strings" "^5.1.0" - "@ethersproject/transactions" "^5.1.0" - "@ethersproject/web" "^5.1.0" - bech32 "1.1.4" - ws "7.2.3" - -"@ethersproject/providers@^5.4.4": - version "5.5.1" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.5.1.tgz#ba87e3c93219bbd2e2edf8b369873aee774abf04" - integrity sha512-2zdD5sltACDWhjUE12Kucg2PcgM6V2q9JMyVvObtVGnzJu+QSmibbP+BHQyLWZUBfLApx2942+7DC5D+n4wBQQ== - dependencies: - "@ethersproject/abstract-provider" "^5.5.0" - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/address" "^5.5.0" - "@ethersproject/basex" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/hash" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/networks" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/random" "^5.5.0" - "@ethersproject/rlp" "^5.5.0" - "@ethersproject/sha2" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - "@ethersproject/web" "^5.5.0" - bech32 "1.1.4" - ws "7.4.6" - -"@ethersproject/random@5.1.0", "@ethersproject/random@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.1.0.tgz#0bdff2554df03ebc5f75689614f2d58ea0d9a71f" - integrity sha512-+uuczLQZ4+no9cP6TCoCktXx0u2YbNaRT7lRkSt12d8263e702f0u+4JnnRO8Qmv5nylWJebnqCHzyxP+6mLqw== - dependencies: - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - -"@ethersproject/random@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.5.0.tgz#305ed9e033ca537735365ac12eed88580b0f81f9" - integrity sha512-egGYZwZ/YIFKMHcoBUo8t3a8Hb/TKYX8BCBoLjudVCZh892welR3jOxgOmb48xznc9bTcMm7Tpwc1gHC1PFNFQ== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/rlp@5.1.0", "@ethersproject/rlp@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.1.0.tgz#700f4f071c27fa298d3c1d637485fefe919dd084" - integrity sha512-vDTyHIwNPrecy55gKGZ47eJZhBm8LLBxihzi5ou+zrSvYTpkSTWRcKUlXFDFQVwfWB+P5PGyERAdiDEI76clxw== - dependencies: - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - -"@ethersproject/rlp@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.5.0.tgz#530f4f608f9ca9d4f89c24ab95db58ab56ab99a0" - integrity sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/sha2@5.1.0", "@ethersproject/sha2@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.1.0.tgz#6ca42d1a26884b3e32ffa943fe6494af7211506c" - integrity sha512-+fNSeZRstOpdRJpdGUkRONFCaiAqWkc91zXgg76Nlp5ndBQE25Kk5yK8gCPG1aGnCrbariiPr5j9DmrYH78JCA== - dependencies: - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - hash.js "1.1.3" - -"@ethersproject/sha2@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.5.0.tgz#a40a054c61f98fd9eee99af2c3cc6ff57ec24db7" - integrity sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - hash.js "1.1.7" - -"@ethersproject/signing-key@5.1.0", "@ethersproject/signing-key@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.1.0.tgz#6eddfbddb6826b597b9650e01acf817bf8991b9c" - integrity sha512-tE5LFlbmdObG8bY04NpuwPWSRPgEswfxweAI1sH7TbP0ml1elNfqcq7ii/3AvIN05i5U0Pkm3Tf8bramt8MmLw== - dependencies: - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - bn.js "^4.4.0" - elliptic "6.5.4" - -"@ethersproject/signing-key@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.5.0.tgz#2aa37169ce7e01e3e80f2c14325f624c29cedbe0" - integrity sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - bn.js "^4.11.9" - elliptic "6.5.4" - hash.js "1.1.7" - -"@ethersproject/solidity@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.1.0.tgz#095a9c75244edccb26c452c155736d363399b954" - integrity sha512-kPodsGyo9zg1g9XSXp1lGhFaezBAUUsAUB1Vf6OkppE5Wksg4Et+x3kG4m7J/uShDMP2upkJtHNsIBK2XkVpKQ== - dependencies: - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/keccak256" "^5.1.0" - "@ethersproject/sha2" "^5.1.0" - "@ethersproject/strings" "^5.1.0" - -"@ethersproject/solidity@^5.4.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.5.0.tgz#2662eb3e5da471b85a20531e420054278362f93f" - integrity sha512-9NgZs9LhGMj6aCtHXhtmFQ4AN4sth5HuFXVvAQtzmm0jpSCNOTGtrHZJAeYTh7MBjRR8brylWZxBZR9zDStXbw== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/sha2" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - -"@ethersproject/strings@5.1.0", "@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.1.0.tgz#0f95a56c3c8c9d5510a06c241d818779750e2da5" - integrity sha512-perBZy0RrmmL0ejiFGUOlBVjMsUceqLut3OBP3zP96LhiJWWbS8u1NqQVgN4/Gyrbziuda66DxiQocXhsvx+Sw== - dependencies: - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/constants" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - -"@ethersproject/strings@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.5.0.tgz#e6784d00ec6c57710755699003bc747e98c5d549" - integrity sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/transactions@5.1.1", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.1.0": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.1.1.tgz#5a6bbb25fb062c3cc75eb0db12faefcdd3870813" - integrity sha512-Nwgbp09ttIVN0OoUBatCXaHxR7grWPHbozJN8v7AXDLrl6nnOIBEMDh+yJTnosSQlFhcyjfTGGN+Mx6R8HdvMw== - dependencies: - "@ethersproject/address" "^5.1.0" - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/constants" "^5.1.0" - "@ethersproject/keccak256" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/rlp" "^5.1.0" - "@ethersproject/signing-key" "^5.1.0" - -"@ethersproject/transactions@^5.4.0", "@ethersproject/transactions@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.5.0.tgz#7e9bf72e97bcdf69db34fe0d59e2f4203c7a2908" - integrity sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA== - dependencies: - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/rlp" "^5.5.0" - "@ethersproject/signing-key" "^5.5.0" - -"@ethersproject/units@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.1.0.tgz#b6ab3430ebc22adc3cb4839516496f167bee3ad5" - integrity sha512-isvJrx6qG0nKWfxsGORNjmOq/nh175fStfvRTA2xEKrGqx8JNJY83fswu4GkILowfriEM/eYpretfJnfzi7YhA== - dependencies: - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/constants" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - -"@ethersproject/wallet@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.1.0.tgz#134c5816eaeaa586beae9f9ff67891104a2c9a15" - integrity sha512-ULmUtiYQLTUS+y3DgkLzRhFEK10zMwmjOthnjiZxee3Q/MVwr3rnmuAnXIUZrPjna6hvUPnyRIdW5XuF0Ld0YQ== - dependencies: - "@ethersproject/abstract-provider" "^5.1.0" - "@ethersproject/abstract-signer" "^5.1.0" - "@ethersproject/address" "^5.1.0" - "@ethersproject/bignumber" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/hash" "^5.1.0" - "@ethersproject/hdnode" "^5.1.0" - "@ethersproject/json-wallets" "^5.1.0" - "@ethersproject/keccak256" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/random" "^5.1.0" - "@ethersproject/signing-key" "^5.1.0" - "@ethersproject/transactions" "^5.1.0" - "@ethersproject/wordlists" "^5.1.0" - -"@ethersproject/wallet@^5.4.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.5.0.tgz#322a10527a440ece593980dca6182f17d54eae75" - integrity sha512-Mlu13hIctSYaZmUOo7r2PhNSd8eaMPVXe1wxrz4w4FCE4tDYBywDH+bAR1Xz2ADyXGwqYMwstzTrtUVIsKDO0Q== - dependencies: - "@ethersproject/abstract-provider" "^5.5.0" - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/hash" "^5.5.0" - "@ethersproject/hdnode" "^5.5.0" - "@ethersproject/json-wallets" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/random" "^5.5.0" - "@ethersproject/signing-key" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - "@ethersproject/wordlists" "^5.5.0" - -"@ethersproject/web@5.1.0", "@ethersproject/web@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.1.0.tgz#ed56bbe4e3d9a8ffe3b2ed882da5c62d3551381b" - integrity sha512-LTeluWgTq04+RNqAkVhpydPcRZK/kKxD2Vy7PYGrAD27ABO9kTqTBKwiOuzTyAHKUQHfnvZbXmxBXJAGViSDcA== - dependencies: - "@ethersproject/base64" "^5.1.0" - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/strings" "^5.1.0" - -"@ethersproject/web@^5.5.0": - version "5.5.1" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.5.1.tgz#cfcc4a074a6936c657878ac58917a61341681316" - integrity sha512-olvLvc1CB12sREc1ROPSHTdFCdvMh0J5GSJYiQg2D0hdD4QmJDy8QYDb1CvoqD/bF1c++aeKv2sR5uduuG9dQg== - dependencies: - "@ethersproject/base64" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - -"@ethersproject/wordlists@5.1.0", "@ethersproject/wordlists@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.1.0.tgz#54eb9ef3a00babbff90ffe124e19c89e07e6aace" - integrity sha512-NsUCi/TpBb+oTFvMSccUkJGtp5o/84eOyqp5q5aBeiNBSLkYyw21znRn9mAmxZgySpxgruVgKbaapnYPgvctPQ== - dependencies: - "@ethersproject/bytes" "^5.1.0" - "@ethersproject/hash" "^5.1.0" - "@ethersproject/logger" "^5.1.0" - "@ethersproject/properties" "^5.1.0" - "@ethersproject/strings" "^5.1.0" - -"@ethersproject/wordlists@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.5.0.tgz#aac74963aa43e643638e5172353d931b347d584f" - integrity sha512-bL0UTReWDiaQJJYOC9sh/XcRu/9i2jMrzf8VLRmPKx58ckSlOJiohODkECCO50dtLZHcGU6MLXQ4OOrgBwP77Q== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/hash" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - -"@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@npm:hardhat-deploy-ethers": - version "0.3.0-beta.7" - resolved "https://registry.yarnpkg.com/hardhat-deploy-ethers/-/hardhat-deploy-ethers-0.3.0-beta.7.tgz#860d86b84ed3c4fdef64283ccf1e8d5623454d02" - integrity sha512-JKMNte6vudu9LSNqgmBtNxc1gfxp3NUcPKVAf/FANHfl9pa/mBGg6hpQO7tD8CLkAbe6f4K5BjyYIPWX3p7MKw== - -"@nomiclabs/hardhat-etherscan@2.1.2": - 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-upgradeable@4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.1.0.tgz#36a6113ceeda278ae14f740280e5388161dfd383" - integrity sha512-QZSvbYqNpU/x60vARhq/jghh97VWjml3NAlKfu4u1XehvpEBbHVXJyKTBSZtZY7jviG305jOczEisnN8VeOMcw== - -"@openzeppelin/contracts@4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.1.0.tgz#baec89a7f5f73e3d8ea582a78f1980134b605375" - integrity sha512-TihZitscnaHNcZgXGj9zDLDyCqjziytB4tMCwXq0XimfWkAjBYyk5/pOsDbbwcavhlc79HhpTEpQcrMnPVa1mw== - -"@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": - 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.0.4": - version "7.0.5" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.0.5.tgz#558a7f8145a01366c44b3dcbdd7172c05c461564" - integrity sha512-fUt6b15bjV/VW93UP5opNXJxdwZSbK1EdiwnhN7XrQrcpaOhMJpZ/CjwFpM3THpxwA+YviBUJKSuEqKlCK5alw== - 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", "@solidity-parser/parser@^0.12.1": - 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== - -"@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" - -"@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.23": - version "0.4.23" - resolved "https://registry.yarnpkg.com/@truffle/interface-adapter/-/interface-adapter-0.4.23.tgz#9b474bb0455df1f02d72bf5a08f3d70b6fef875d" - integrity sha512-mfpwY25Apx36WHHNJMNHWyDQVFZoZYNQ43rOwr/n+5gAMxke7+D7+IR9UW4kuO/Jp0+2848UxMdRV+oqm017kQ== - dependencies: - bn.js "^5.1.3" - ethers "^4.0.32" - web3 "1.3.5" - -"@truffle/provider@^0.2.24": - version "0.2.30" - resolved "https://registry.yarnpkg.com/@truffle/provider/-/provider-0.2.30.tgz#c2f7d84e698e1d200f48d1349683ee5dee693808" - integrity sha512-5ScTbWsrm7zmQjw020T41U30/kYA1LppXAtaeucUGN2jvPrSwlh0aTL18makbqftTx1NRuYKw7C8wO4jCKQSUQ== - dependencies: - "@truffle/error" "^0.0.14" - "@truffle/interface-adapter" "^0.4.23" - web3 "1.3.5" - -"@tsconfig/recommended@1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@tsconfig/recommended/-/recommended-1.0.1.tgz#7619bad397e06ead1c5182926c944e0ca6177f52" - integrity sha512-2xN+iGTbPBEzGSnVp/Hd64vKJCJWxsi9gfs88x4PPMyEjHJoA3o5BY9r5OLPHIZU2pAQxkSAsJFqn6itClP8mQ== - -"@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/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/hardhat@2.0.1": - 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/chai@*", "@types/chai@4.2.18": - version "4.2.18" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.18.tgz#0c8e298dbff8205e2266606c1ea5fbdba29b46e4" - integrity sha512-rS27+EkB/RE1Iz3u0XtVL5q36MGDWbgYe7zWiodyKNUnthxY0rukK5V36eiUCtCisB7NN8zKYH6DO2M37qxFEQ== - -"@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/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/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/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.3.0": - version "15.3.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.3.0.tgz#d6fed7d6bc6854306da3dea1af9f874b00783e26" - integrity sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ== - -"@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/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.9.7": - version "6.9.7" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== - -"@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.0" - resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-10.0.0.tgz#eecc3847af03d45ffe53d55aaaaf6ecb28b5e584" - integrity sha512-jDZ55oCKxqlDmoTBBbBBEx+N8ZraUVhggMZ9T5t+6/Dh8/4NiOjSUfpLrPiEwxQDlAe3wpAkoXhWvE6LibtsMQ== - dependencies: - "@sinonjs/fake-timers" "^7.0.4" - -"@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" "*" - -"@typescript-eslint/eslint-plugin@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.24.0.tgz#03801ffc25b2af9d08f3dc9bccfc0b7ce3780d0f" - integrity sha512-qbCgkPM7DWTsYQGjx9RTuQGswi+bEt0isqDBeo+CKV0953zqI0Tp7CZ7Fi9ipgFA6mcQqF4NOVNwS/f2r6xShw== - dependencies: - "@typescript-eslint/experimental-utils" "4.24.0" - "@typescript-eslint/scope-manager" "4.24.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.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.24.0.tgz#c23ead9de44b99c3a5fd925c33a106b00165e172" - integrity sha512-IwTT2VNDKH1h8RZseMH4CcYBz6lTvRoOLDuuqNZZoThvfHEhOiZPQCow+5El3PtyxJ1iDr6UXZwYtE3yZQjhcw== - dependencies: - "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.24.0" - "@typescript-eslint/types" "4.24.0" - "@typescript-eslint/typescript-estree" "4.24.0" - eslint-scope "^5.0.0" - eslint-utils "^2.0.0" - -"@typescript-eslint/parser@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.24.0.tgz#2e5f1cc78ffefe43bfac7e5659309a92b09a51bd" - integrity sha512-dj1ZIh/4QKeECLb2f/QjRwMmDArcwc2WorWPRlB8UNTZlY1KpTVsbX7e3ZZdphfRw29aTFUSNuGB8w9X5sS97w== - dependencies: - "@typescript-eslint/scope-manager" "4.24.0" - "@typescript-eslint/types" "4.24.0" - "@typescript-eslint/typescript-estree" "4.24.0" - debug "^4.1.1" - -"@typescript-eslint/scope-manager@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.24.0.tgz#38088216f0eaf235fa30ed8cabf6948ec734f359" - integrity sha512-9+WYJGDnuC9VtYLqBhcSuM7du75fyCS/ypC8c5g7Sdw7pGL4NDTbeH38eJPfzIydCHZDoOgjloxSAA3+4l/zsA== - dependencies: - "@typescript-eslint/types" "4.24.0" - "@typescript-eslint/visitor-keys" "4.24.0" - -"@typescript-eslint/types@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.24.0.tgz#6d0cca2048cbda4e265e0c4db9c2a62aaad8228c" - integrity sha512-tkZUBgDQKdvfs8L47LaqxojKDE+mIUmOzdz7r+u+U54l3GDkTpEbQ1Jp3cNqqAU9vMUCBA1fitsIhm7yN0vx9Q== - -"@typescript-eslint/typescript-estree@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.24.0.tgz#b49249679a98014d8b03e8d4b70864b950e3c90f" - integrity sha512-kBDitL/by/HK7g8CYLT7aKpAwlR8doshfWz8d71j97n5kUa5caHWvY0RvEUEanL/EqBJoANev8Xc/mQ6LLwXGA== - dependencies: - "@typescript-eslint/types" "4.24.0" - "@typescript-eslint/visitor-keys" "4.24.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.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.24.0.tgz#a8fafdc76cad4e04a681a945fbbac4e35e98e297" - integrity sha512-4ox1sjmGHIxjEDBnMCtWFFhErXtKA1Ec0sBpuz0fqf3P+g3JFGyTxxbF06byw0FRsPnnbq44cKivH7Ks1/0s6g== - dependencies: - "@typescript-eslint/types" "4.24.0" - eslint-visitor-keys "^2.0.0" - -"@uniswap/v3-core@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@uniswap/v3-core/-/v3-core-1.0.0.tgz#6c24adacc4c25dceee0ba3ca142b35adbd7e359d" - integrity sha512-kSC4djMGKMHj7sLMYVnn61k9nu+lHjMIxgg9CDQT+s2QYLoA56GbSK9Oxr+qJXzzygbkrmuY6cwgP6cW2JXPFA== - -"@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== - -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.0.0, 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@^6.0.7: - version "6.4.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" - integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== - -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@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.6.1, ajv@^6.9.1: - 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.4.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.4.0.tgz#48984fdb2ce225cab15795f0772a8d85669075e4" - integrity sha512-7QD2l6+KBSLwf+7MuYocbWvRPdOu63/trReTLu2KFwkgctnub1auoF+Y1WYcm09CTM7quuscrzqmASaLHC/K4Q== - 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@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - -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" - -antlr4@4.7.1: - version "4.7.1" - resolved "https://registry.yarnpkg.com/antlr4/-/antlr4-4.7.1.tgz#69984014f096e9e775f53dd9744bf994d8959773" - integrity sha512-haHyTW7Y9joE5MVs37P2lNYfU2RWBLfcRDD8OWldcdZm5TiCE91B5Xl1oWSwiDUSd4rlExpt2pu1fksYQjRBYQ== - -anymatch@~3.1.1, anymatch@~3.1.2: - 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@^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.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-filter@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" - integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM= - -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-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.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -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= - -ast-parents@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/ast-parents/-/ast-parents-0.0.1.tgz#508fd0f05d0c48775d9eccda2e174423261e8dd3" - integrity sha1-UI/Q8F0MSHddnszaLhdEIyYejdM= - -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - -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-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" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -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== - -available-typed-arrays@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz#6b098ca9d8039079ee3f77f7b783c4480ba513f5" - integrity sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ== - dependencies: - array-filter "^1.0.0" - -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.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" - -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@^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== - -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" - -blakejs@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" - integrity sha1-ad+S75U6qIylGjLfarHFShVfx6U= - -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" - -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@^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-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.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.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-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.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" - -caller-callsite@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" - integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= - dependencies: - callsites "^2.0.0" - -caller-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" - integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= - dependencies: - caller-callsite "^2.0.0" - -callsites@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" - integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= - -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@^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.30001228" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz#bfdc5942cd3326fa51ee0b42fbef4da9d492a7fa" - integrity sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A== - -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" - -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.1.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" - -chalk@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - 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== - -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@^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" - -chokidar@^3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -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" - -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@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= - dependencies: - restore-cursor "^2.0.0" - -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-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@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" - integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== - -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@^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" - -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= - -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: - 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.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== - -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.18.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" - integrity sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ== - -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@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" - integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== - -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: - 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.12.1" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.12.1.tgz#934da8b9b7221e2a2443dc71dfa5bd77a7ea00b8" - integrity sha512-1cch+qads4JnDSWsvc7d6nzlKAippwjUlf6vykkTLW53VSV+NkE6muGBToAjEA8pG90cSfcud3JgVmW2ds5TaQ== - -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.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@^5.0.7: - version "5.2.1" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" - integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== - dependencies: - import-fresh "^2.0.0" - is-directory "^0.3.1" - js-yaml "^3.13.1" - parse-json "^4.0.0" - -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@^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@^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.2, cross-spawn@^7.0.3: - 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" - -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.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.1, 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: - 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" - -debug@^4.3.2: - version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== - dependencies: - ms "2.1.2" - -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= - -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= - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -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.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== - -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@9.0.2: - 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" - -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= - -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.731" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.731.tgz#9f17f7e16f798eaddb21409d80aa755b5b5053dc" - integrity sha512-dn1Nyd0DuFa3xhqZJr6/L9phyk+YXJpvrz6Vcu6mFxFqr5TQ9r/F3yvOYFUrEwY4Tbb1YBjN19TDKnSVCQvalA== - -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== - -encode-utf8@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/encode-utf8/-/encode-utf8-1.0.3.tgz#f30fdd31da07fb596f281beb2f6b027851994cda" - integrity sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw== - -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: - 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== - -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: - version "1.18.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0.tgz#ab80b359eecb7ede4c298000390bc5ac3ec7b5a4" - integrity sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw== - 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.2" - is-string "^1.0.5" - object-inspect "^1.9.0" - 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.0" - -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" - -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-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-scope@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" - integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -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@^1.3.1: - version "1.4.3" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" - integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== - dependencies: - eslint-visitor-keys "^1.1.0" - -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.0.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.26.0: - version "7.26.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.26.0.tgz#d416fdcdcb3236cd8f282065312813f8c13982f6" - integrity sha512-4R1ieRf52/izcZE7AlLy56uIHHDLT74Yzz2Iv2l6kDaYvEu9x+wMB5dZArVL8SYGXSYV2YAg70FcW5Y5nGGNIg== - 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" - 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" - 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 "^4.17.21" - 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.4" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" - -eslint@^5.6.0: - version "5.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" - integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== - dependencies: - "@babel/code-frame" "^7.0.0" - ajv "^6.9.1" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^4.0.1" - doctrine "^3.0.0" - eslint-scope "^4.0.3" - eslint-utils "^1.3.1" - eslint-visitor-keys "^1.0.0" - espree "^5.0.1" - esquery "^1.0.1" - esutils "^2.0.2" - file-entry-cache "^5.0.1" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.7.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - inquirer "^6.2.2" - js-yaml "^3.13.0" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.11" - minimatch "^3.0.4" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - progress "^2.0.0" - regexpp "^2.0.1" - semver "^5.5.1" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" - table "^5.2.3" - text-table "^0.2.0" - -espree@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" - integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== - dependencies: - acorn "^6.0.7" - acorn-jsx "^5.0.0" - eslint-visitor-keys "^1.0.0" - -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.0.1, 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.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-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#1a27c59c15ab1e95ee8e5c4ed6ad814c49cc439e" - 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.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.7, ethereumjs-util@^7.0.8, ethereumjs-util@^7.0.9: - 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@5.1.4, ethers@^5.0.0, ethers@^5.0.1, ethers@^5.0.2: - version "5.1.4" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.1.4.tgz#8ae973705ed962f8f41dc59693704002a38dd18b" - integrity sha512-EAPQ/fgGRu0PoR/VNFnHTMOtG/IZ0AItdW55C9T8ffmVu0rnyllZL404eBF66elJehOLz2kxnUrhXpE7TCpW7g== - dependencies: - "@ethersproject/abi" "5.1.2" - "@ethersproject/abstract-provider" "5.1.0" - "@ethersproject/abstract-signer" "5.1.0" - "@ethersproject/address" "5.1.0" - "@ethersproject/base64" "5.1.0" - "@ethersproject/basex" "5.1.0" - "@ethersproject/bignumber" "5.1.1" - "@ethersproject/bytes" "5.1.0" - "@ethersproject/constants" "5.1.0" - "@ethersproject/contracts" "5.1.1" - "@ethersproject/hash" "5.1.0" - "@ethersproject/hdnode" "5.1.0" - "@ethersproject/json-wallets" "5.1.0" - "@ethersproject/keccak256" "5.1.0" - "@ethersproject/logger" "5.1.0" - "@ethersproject/networks" "5.1.0" - "@ethersproject/pbkdf2" "5.1.0" - "@ethersproject/properties" "5.1.0" - "@ethersproject/providers" "5.1.2" - "@ethersproject/random" "5.1.0" - "@ethersproject/rlp" "5.1.0" - "@ethersproject/sha2" "5.1.0" - "@ethersproject/signing-key" "5.1.0" - "@ethersproject/solidity" "5.1.0" - "@ethersproject/strings" "5.1.0" - "@ethersproject/transactions" "5.1.1" - "@ethersproject/units" "5.1.0" - "@ethersproject/wallet" "5.1.0" - "@ethersproject/web" "5.1.0" - "@ethersproject/wordlists" "5.1.0" - -ethers@^4.0.32: - 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" - -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" - -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== - -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@^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@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.0.0.tgz#4029b0007998a841fbd1032e5f4de86a3c1e3376" - integrity sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - 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@^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" - -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@^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@^3.1.1: - 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-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= - -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" - -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@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= - dependencies: - escape-string-regexp "^1.0.5" - -figures@^3.2.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@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" - integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== - dependencies: - flat-cache "^2.0.1" - -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" - -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.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-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@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" - integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== - dependencies: - flatted "^2.0.0" - rimraf "2.6.3" - write "1.0.3" - -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" - -flatted@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" - integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== - -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= - -fmix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/fmix/-/fmix-0.1.0.tgz#c7bbf124dec42c9d191cfb947d0a9778dd986c0c" - integrity sha1-x7vxJN7ELJ0ZHPuUfQqXeN2YbAw= - dependencies: - imul "^1.0.0" - -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.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -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@^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@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - 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@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" - integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -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-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.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@~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, fsevents@~2.3.2: - 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: - 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-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-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.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-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - -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-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0, glob-parent@~5.1.2: - 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.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@^11.7.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -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.8.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.8.0.tgz#3e20f504810ce87a8d72e55aecf8435b50f4c1b3" - integrity sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q== - 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: - version "4.2.6" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" - integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== - -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-deploy@0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.10.0.tgz#6b98790010dd3f1f362c4ad45207e43c8511eadd" - integrity sha512-C6p0IvdK2CK0fIsdUK0dM+nuhCmDvuL8fi19RUPeSMMfl7BityJArAzVbJt5f68VJ3CZRMa5WV7aSc8M8sNHvg== - dependencies: - "@ethersproject/abi" "^5.4.0" - "@ethersproject/abstract-signer" "^5.4.1" - "@ethersproject/address" "^5.4.0" - "@ethersproject/bignumber" "^5.4.1" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/constants" "^5.4.0" - "@ethersproject/contracts" "^5.4.1" - "@ethersproject/providers" "^5.4.4" - "@ethersproject/solidity" "^5.4.0" - "@ethersproject/transactions" "^5.4.0" - "@ethersproject/wallet" "^5.4.0" - "@types/qs" "^6.9.7" - axios "^0.21.1" - chalk "^4.1.2" - chokidar "^3.5.2" - debug "^4.3.2" - enquirer "^2.3.6" - form-data "^4.0.0" - fs-extra "^10.0.0" - match-all "^1.2.6" - murmur-128 "^0.2.1" - qs "^6.9.4" - -hardhat@2.3.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@^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.1.7, 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.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= - -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-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-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@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - -husky@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-6.0.0.tgz#810f11869adf51604c32ea577edbc377d7f9319e" - integrity sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ== - -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.2" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.2.tgz#ce13d1875b0c3a674bd6a04b7f76b01b1b6ded01" - integrity sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ== - 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@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" - integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= - dependencies: - caller-path "^2.0.0" - resolve-from "^3.0.0" - -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" - -imul@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/imul/-/imul-1.0.1.tgz#9d5867161e8b3de96c2c38d5dc7cb102f35e2ac9" - integrity sha1-nVhnFh6LPelsLDjV3HyxAvNeKsk= - -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== - -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@^6.2.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" - integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== - dependencies: - ansi-escapes "^3.2.0" - chalk "^2.4.2" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^2.0.0" - lodash "^4.17.12" - mute-stream "0.0.7" - run-async "^2.2.0" - rxjs "^6.4.0" - string-width "^2.1.0" - strip-ansi "^5.1.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" - -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== - -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-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@~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-core-module@^2.2.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-directory@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" - integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= - -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-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@^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@^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-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@^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@^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-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-regex@^1.0.4, is-regex@^1.1.2: - 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: - 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= - -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" - -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-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.12.0, js-yaml@^3.13.0, js-yaml@^3.13.1: - 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.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= - -json5@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= - -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" - -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" - -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.3.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" - -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" - -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@11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-11.0.0.tgz#24d0a95aa316ba28e257f5c4613369a75a10c712" - integrity sha512-3rsRIoyaE8IphSUtO1RVTFl1e0SLBtxxUOPBtHxQgBHS5/i6nqvjcUfNioMa4BU9yGnPzbO+xkfLtXtxBpCzjw== - dependencies: - chalk "^4.1.1" - cli-truncate "^2.1.0" - commander "^7.2.0" - cosmiconfig "^7.0.0" - debug "^4.3.1" - dedent "^0.7.0" - enquirer "^2.3.6" - execa "^5.0.0" - listr2 "^3.8.2" - log-symbols "^4.1.0" - micromatch "^4.0.4" - normalize-path "^3.0.0" - please-upgrade-node "^3.2.0" - string-argv "0.3.1" - stringify-object "^3.3.0" - -listr2@^3.8.2: - version "3.8.2" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.8.2.tgz#99b138ad1cfb08f1b0aacd422972e49b2d814b99" - integrity sha512-E28Fw7Zd3HQlCJKzb9a8C8M0HtFWQeucE+S8YrSrqZObuCLPRHMRrR8gNmYt65cU9orXYHwvN5agXC36lYt7VQ== - dependencies: - chalk "^4.1.1" - cli-truncate "^2.1.0" - figures "^3.2.0" - indent-string "^4.0.0" - 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" - -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" - -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.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.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, 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.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" - -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@^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" - -match-all@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/match-all/-/match-all-1.2.6.tgz#66d276ad6b49655551e63d3a6ee53e8be0566f8d" - integrity sha512-0EESkXiTkWzrQQntBu2uzKvLu6vVkUGz40nGPbSZuegcfE5UuSzNjLaIu76zJWuaT/2I3Z/8M06OlUOZLGwLlQ== - -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@^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-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: - version "4.1.0" - resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-4.1.0.tgz#010636c4cfd68682df33a2e3186b7d0be7b98b9d" - integrity sha512-vmP1J7FwIpprFMVjjSMM1JAwFce85Q+tp0TYIedYv8qaMh2oLUZ3ETXn9wbgi9S6elySzKzGa+Ai6VNKGEwSlg== - dependencies: - "@types/levelup" "^4.3.0" - ethereumjs-util "^7.0.8" - level-mem "^5.0.1" - level-ws "^2.0.0" - readable-stream "^3.6.0" - rlp "^2.2.3" - 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@^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, micromatch@^4.0.4: - 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@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@^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.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@^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== - -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== - -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@~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" - -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" - -murmur-128@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/murmur-128/-/murmur-128-0.2.1.tgz#a9f6568781d2350ecb1bf80c14968cadbeaa4b4d" - integrity sha512-WseEgiRkI6aMFBbj8Cg9yBj/y+OdipwVC7zUo3W2W1JAJITwouUOtpqsmGSg67EQmwwSyod7hsVsWY5LsrfQVg== - dependencies: - encode-utf8 "^1.0.2" - fmix "^0.1.0" - imul "^1.0.0" - -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= - -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= - -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" - -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= - -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== - -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@^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.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" - integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== - -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.1: - 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.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.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" - -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" - -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" - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= - dependencies: - mimic-fn "^1.0.0" - -onetime@^5.1.0, onetime@^5.1.2: - 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" - -optionator@^0.8.1, optionator@^0.8.2: - 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" - -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@^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-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-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-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-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-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== - -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-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-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-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - -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.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - -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@^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" - -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= - -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d" - integrity sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg== - -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@^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= - -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= - -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= - -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.10: - version "1.0.0-beta.10" - resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.10.tgz#f2a249002733826b08d981b599335ddb7e93af8d" - integrity sha512-55UsEbeJfqYKB3RFR7Nvpi+ApEoUfgdKHVg2ZybrbOkRW4RTblyONLL3mEr8Vrxpo7wBbObVLbWodGg4YXIQ7g== - dependencies: - "@solidity-parser/parser" "^0.12.1" - 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.3.0, 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== - -prettier@^1.14.3: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== - -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== - -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" - -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: - 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" - -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.7.0, qs@^6.9.4: - 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== - -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@^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" - -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.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.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@^3.0.6, readable-stream@^3.1.0, 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.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@~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" - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.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-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@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== - -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" - -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.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" - -request@^2.79.0, request@^2.85.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== - -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.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@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - -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== - -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.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -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.2.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" - -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.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@^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@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.5.1, 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.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" - -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" - -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, signal-exit@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== - -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" - -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@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== - dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" - -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" - -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" - -solhint-plugin-prettier@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/solhint-plugin-prettier/-/solhint-plugin-prettier-0.0.5.tgz#e3b22800ba435cd640a9eca805a7f8bc3e3e6a6b" - integrity sha512-7jmWcnVshIrO2FFinIvDQmhQpfpS2rRRn3RejiYgnjIE68xO2bvrYvjqVNfrio4xH9ghOqn83tKuTzLjEbmGIA== - dependencies: - prettier-linter-helpers "^1.0.0" - -solhint@3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/solhint/-/solhint-3.3.4.tgz#81770c60eeb027e6e447cb91ed599baf5e888e09" - integrity sha512-AEyjshF/PC6kox1c1l79Pji+DK9WVuk5u2WEh6bBKt188gWa63NBOAgYg0fBRr5CTUmsuGc1sGH7dgUVs83mKw== - dependencies: - "@solidity-parser/parser" "^0.12.0" - ajv "^6.6.1" - antlr4 "4.7.1" - ast-parents "0.0.1" - chalk "^2.4.2" - commander "2.18.0" - cosmiconfig "^5.0.7" - eslint "^5.6.0" - fast-diff "^1.1.2" - glob "^7.1.3" - ignore "^4.0.6" - js-yaml "^3.12.0" - lodash "^4.17.11" - semver "^6.3.0" - optionalDependencies: - prettier "^1.14.3" - -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" - -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.8" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.8.tgz#eb1e97ad99b11bf3f82a3b71a0472dd9a00f2ecf" - integrity sha512-NDgA96EnaLSvtbM7trJj+t1LUR3pirkDCcz9nOUlPb5DMBGsH7oES6C3hs3j7R9oHEa1EMvReS/BUAIT5Tcr0g== - -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" - -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" - -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= - -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.1.0: - 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-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, 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@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" - -table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== - dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" - -table@^6.0.4: - 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" - -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-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= - -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" - -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== - -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= - -"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, 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" - -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@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" - -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" - -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.2.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961" - integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg== - -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.7" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.13.7.tgz#25468a3b39b1c875df03f0937b2b7036a93f3fee" - integrity sha512-1Psi2MmnZJbnEsgJJIlfnd7tFlJfitusmR7zDI8lXlFI0ACD4/Rm/xdrU8bh6zF0i74aiVoBtkRiFulkrmh3AA== - -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.0: - 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== - -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: - 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== - -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" - -varint@^5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" - integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== - -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" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.3.5.tgz#f181a1319d9f867f4183b147e7aebd21aecff4a0" - integrity sha512-XiEUAbB1uKm/agqfwBsCW8fbw+sma85TfwuDpdcy591vinVk0S9TfWgLxro6v1KJ6nSELySIbKGbAJbh2GSyxw== - dependencies: - "@types/node" "^12.12.6" - got "9.6.0" - swarm-js "^0.1.40" - underscore "1.9.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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.3.5.tgz#9f0ff7ed40befb9f691986e66fd94c828c7b1b13" - integrity sha512-HYh3ix5FjysgT0jyzD8s/X5ym0b4BGU7I2QtuBiydMnE0mQEWy7GcT9XKpTySA8FTOHHIAQYvQS07DN/ky3UzA== - dependencies: - underscore "1.9.1" - web3-eth-iban "1.3.5" - web3-utils "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.3.5.tgz#995fe12f3b364469e5208a88d72736327b231faa" - integrity sha512-hCbmgQ+At6OTuaNGAdjXMsCr4eUCmp9yGKSuaB5HdkNVDpqFso4HHjVxcjNrTyJp3OZnyjKBzQzK1ZWLpLl84Q== - dependencies: - "@ethersproject/transactions" "^5.0.0-beta.135" - underscore "1.9.1" - web3-core-helpers "1.3.5" - web3-core-promievent "1.3.5" - web3-core-subscriptions "1.3.5" - web3-utils "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.3.5.tgz#33c34811cc4e2987c56e5192f9a014368c42ca39" - integrity sha512-K0j8x3ZJr0eAyNvyUCxOUsSTd4hco0/9nxxlyOuijcsa6YV8l9NL6eqhniWbSyxCJT8ka5Mb7yAiUZe69EDLBQ== - 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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.3.5.tgz#c452ea85fcffdf5b82b84c250707b638790d0e75" - integrity sha512-9l294U3Ga8qmvv8E37BqjQREfMs+kFnkU3PY28g9DZGYzKvl3V1dgDYqxyrOBdCFhc7rNSpHdgC4PrVHjouspg== - dependencies: - underscore "1.9.1" - util "^0.12.0" - web3-core-helpers "1.3.5" - web3-providers-http "1.3.5" - web3-providers-ipc "1.3.5" - web3-providers-ws "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.3.5.tgz#7c4dc9d559e344d852de2cf01bd0cc13c94023cb" - integrity sha512-6mtXdaEB1V1zKLqYBq7RF2W75AK5ZJNGpW6QYC7Zvbku7zq1ZlgaUkJo88JKMWJ7etfaHaYqQ/7VveHk5sQynA== - dependencies: - eventemitter3 "4.0.4" - underscore "1.9.1" - web3-core-helpers "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.3.5.tgz#1e9335e6c4549dac09aaa07157242ebd6d097226" - integrity sha512-VQjTvnGTqJwDwjKEHSApea3RmgtFGLDSJ6bqrOyHROYNyTyKYjFQ/drG9zs3rjDkND9mgh8foI1ty37Qua3QCQ== - dependencies: - "@types/bn.js" "^4.11.5" - "@types/node" "^12.12.6" - bignumber.js "^9.0.0" - web3-core-helpers "1.3.5" - web3-core-method "1.3.5" - web3-core-requestmanager "1.3.5" - web3-utils "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.3.5.tgz#eeffab0a4b318c47b8777de90983ca45614f8173" - integrity sha512-bkbG2v/mOW5DH6rF/SEgqunusjYoEi2IBw+fkmD3rzWDaEY7+/i1xY94AeO257d06QMgld75GtV/N+aEs7A6vQ== - dependencies: - "@ethersproject/abi" "5.0.7" - underscore "1.9.1" - web3-utils "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.3.5.tgz#c23ee748759a6a06d6485a9322b106baa944dcdd" - integrity sha512-r3WOR21rgm6Cd6OFnifr3Tizdm5K+g2TsSOPySwX4FrgLrYDL6ck4zr5VXUPz+llpSExb/JztpE8pqEHr3U2NA== - 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.3.5" - web3-core-helpers "1.3.5" - web3-core-method "1.3.5" - web3-utils "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.3.5.tgz#b41ecf8612b379c4fb1c614e950135717aa8f919" - integrity sha512-WfGVeQquN3D7Qm+KEIN9EI7yrm/fL2V9Y4+YhDWiKA/ns1pX1LYcEWojTOnBXCnPF3tcvoKKL+KBxXg1iKm38A== - dependencies: - "@types/bn.js" "^4.11.5" - underscore "1.9.1" - web3-core "1.3.5" - web3-core-helpers "1.3.5" - web3-core-method "1.3.5" - web3-core-promievent "1.3.5" - web3-core-subscriptions "1.3.5" - web3-eth-abi "1.3.5" - web3-utils "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.3.5.tgz#5a28d23eb402fb1f6964da60ea60641e4d24d366" - integrity sha512-5bkpFTXV18CvaVP8kCbLZZm2r1TWUv9AsXH+80yz8bTZulUGvXsBMRfK6e5nfEr2Yv59xlIXCFoalmmySI9EJw== - dependencies: - content-hash "^2.5.2" - eth-ens-namehash "2.0.8" - underscore "1.9.1" - web3-core "1.3.5" - web3-core-helpers "1.3.5" - web3-core-promievent "1.3.5" - web3-eth-abi "1.3.5" - web3-eth-contract "1.3.5" - web3-utils "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.3.5.tgz#dff1e37864e23a3387016ec4db96cdc290a6fbd6" - integrity sha512-x+BI/d2Vt0J1cKK8eFd4W0f1TDjgEOYCwiViTb28lLE+tqrgyPqWDA+l6UlKYLF/yMFX3Dym4ofcCOtgcn4q4g== - dependencies: - bn.js "^4.11.9" - web3-utils "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.3.5.tgz#bc5d5b900bc4824139af2ef01eaf8e9855c644ba" - integrity sha512-xELQHNZ8p3VoO1582ghCaq+Bx7pSkOOalc6/ACOCGtHDMelqgVejrmSIZGScYl+k0HzngmQAzURZWQocaoGM1g== - dependencies: - "@types/node" "^12.12.6" - web3-core "1.3.5" - web3-core-helpers "1.3.5" - web3-core-method "1.3.5" - web3-net "1.3.5" - web3-utils "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.3.5.tgz#2a3d0db870ef7921942a5d798ba0569175cc4de1" - integrity sha512-5qqDPMMD+D0xRqOV2ePU2G7/uQmhn0FgCEhFzKDMHrssDQJyQLW/VgfA0NLn64lWnuUrGnQStGvNxrWf7MgsfA== - dependencies: - underscore "1.9.1" - web3-core "1.3.5" - web3-core-helpers "1.3.5" - web3-core-method "1.3.5" - web3-core-subscriptions "1.3.5" - web3-eth-abi "1.3.5" - web3-eth-accounts "1.3.5" - web3-eth-contract "1.3.5" - web3-eth-ens "1.3.5" - web3-eth-iban "1.3.5" - web3-eth-personal "1.3.5" - web3-net "1.3.5" - web3-utils "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.3.5.tgz#06e3465a9fbbeec1240160e2fd66ddb07b6af944" - integrity sha512-usbFbuUpKK8s7jPLGoUzi/WpNnefGFPTj948aJv8BZ04UQA4L/XS5NNkkhk358zNMmhGfEFW8wrWy+0Oy0njtA== - dependencies: - web3-core "1.3.5" - web3-core-method "1.3.5" - web3-utils "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.3.5.tgz#cdada6fb342e08fd75aea249fceb6eee467beffc" - integrity sha512-ZQOmceFjcajEZdiuqciXjijwIYWNmEJ1oxMtbrwB2eGxHRCMXEH2xGRUZuhOFNF88yQC/VXVi14yvYg5ZlFJlA== - dependencies: - web3-core-helpers "1.3.5" - 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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.3.5.tgz#2f5536abfe03f3824e00dedc614d8f46db72b57f" - integrity sha512-cbZOeb/sALiHjzMolJjIyHla/J5wdL2JKUtRO66Nh/uLALBCpU8JUgzNvpAdJ1ae3+A33+EdFStdzuDYHKtQew== - dependencies: - oboe "2.1.5" - underscore "1.9.1" - web3-core-helpers "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.3.5.tgz#7f841ec79358d90c4a803d1291157b5ffb15aeb7" - integrity sha512-zeZ4LMvKhYaJBDCqA//Bzgp4r/T0tNq5U/xvN0axA4YflzF7yqlsbzGwCkcZYDbrUaK3Ltl2uOmvwjbWALOZ1A== - dependencies: - eventemitter3 "4.0.4" - underscore "1.9.1" - web3-core-helpers "1.3.5" - 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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.3.5.tgz#af0b8ebca90a3652dbbb90d351395f36ca91f40b" - integrity sha512-aRwzCduXvuGVslLL/Y15VcOHa70Qr2kxZI7UwOzQVhaaOdxuRRvo3AK/cmyln1Tsd54/n93Yk8I3qg5I2+6alw== - dependencies: - web3-core "1.3.5" - web3-core-method "1.3.5" - web3-core-subscriptions "1.3.5" - web3-net "1.3.5" - -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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.3.5.tgz#14ee2ff1a7a226867698d6eaffd21aa97aed422e" - integrity sha512-5apMRm8ElYjI/92GHqijmaLC+s+d5lgjpjHft+rJSs/dsnX8I8tQreqev0dmU+wzU+2EEe4Sx9a/OwGWHhQv3A== - 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.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.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.3.5.tgz#ef4c3a2241fdd74f2f7794e839f30bc6f9814e46" - integrity sha512-UyQW/MT5EIGBrXPCh/FDIaD7RtJTn5/rJUNw2FOglp0qoXnCQHNKvntiR1ylztk05fYxIF6UgsC76IrazlKJjw== - dependencies: - web3-bzz "1.3.5" - web3-core "1.3.5" - web3-eth "1.3.5" - web3-eth-personal "1.3.5" - web3-net "1.3.5" - web3-shh "1.3.5" - web3-utils "1.3.5" - -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-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= - -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= - -write@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" - integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== - dependencies: - mkdirp "^0.5.1" - -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@7.4.6: - version "7.4.6" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" - integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== - -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.5" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.5.tgz#a484dd851e9beb6fdb420027e3885e8ce48986c1" - integrity sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g== - -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== - -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@^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: - 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-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@^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== diff --git a/lib/openzeppelin-contracts b/lib/openzeppelin-contracts deleted file mode 160000 index d6b63a48b..000000000 --- a/lib/openzeppelin-contracts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d6b63a48ba440ad8d551383697db6e5b0ef84137 diff --git a/lib/openzeppelin-contracts-upgradeable b/lib/openzeppelin-contracts-upgradeable deleted file mode 160000 index dda497279..000000000 --- a/lib/openzeppelin-contracts-upgradeable +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dda4972793c55bfdae604e8ef3388352e3e34bf1 diff --git a/lib/prb-math b/lib/prb-math deleted file mode 160000 index 9dc06519f..000000000 --- a/lib/prb-math +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9dc06519f3b9f1659fec7d396da634fe690f660c diff --git a/lib/solady b/lib/solady deleted file mode 160000 index 2ba1cc1ea..000000000 --- a/lib/solady +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2ba1cc1eaa3bffd5c093d94f76ef1b87b167ff3c diff --git a/lib/solmate b/lib/solmate deleted file mode 160000 index c89230993..000000000 --- a/lib/solmate +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c892309933b25c03d32b1b0d674df7ae292ba925 diff --git a/lib/uniswap-v2-core b/lib/uniswap-v2-core deleted file mode 160000 index 4dd59067c..000000000 --- a/lib/uniswap-v2-core +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4dd59067c76dea4a0e8e4bfdda41877a6b16dedc diff --git a/lib/uniswap-v2-periphery/.gitattributes b/lib/uniswap-v2-periphery/.gitattributes deleted file mode 100644 index 7cc88f065..000000000 --- a/lib/uniswap-v2-periphery/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.sol linguist-language=Solidity \ No newline at end of file diff --git a/lib/uniswap-v2-periphery/.github/stale.yml b/lib/uniswap-v2-periphery/.github/stale.yml deleted file mode 100644 index 91b9bf53e..000000000 --- a/lib/uniswap-v2-periphery/.github/stale.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -issues: - # Number of days of inactivity before an Issue or Pull Request becomes stale - daysUntilStale: 7 - - # Number of days of inactivity before an Issue or Pull Request with the stale label is closed. - # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. - daysUntilClose: 7 - - # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) - onlyLabels: - - question - - autoclose - - # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable - exemptLabels: - - p0 - - bug - - # Comment to post when marking as stale. Set to `false` to disable - markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. diff --git a/lib/uniswap-v2-periphery/.github/workflows/CI.yml b/lib/uniswap-v2-periphery/.github/workflows/CI.yml deleted file mode 100644 index c57b2ec12..000000000 --- a/lib/uniswap-v2-periphery/.github/workflows/CI.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: CI - -on: - push: - branches: - - master - pull_request: - -jobs: - test: - strategy: - matrix: - node: ['10.x', '12.x'] - os: [ubuntu-latest] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - - run: npm install -g yarn - - - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v1 - with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: ${{ matrix.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ matrix.os }}-yarn- - - - run: yarn - - - run: yarn lint - - run: yarn test diff --git a/lib/uniswap-v2-periphery/.gitignore b/lib/uniswap-v2-periphery/.gitignore deleted file mode 100644 index 3e2e84b08..000000000 --- a/lib/uniswap-v2-periphery/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build/ -node_modules/ diff --git a/lib/uniswap-v2-periphery/.mocharc.json b/lib/uniswap-v2-periphery/.mocharc.json deleted file mode 100644 index 1a5fee61b..000000000 --- a/lib/uniswap-v2-periphery/.mocharc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extension": ["ts"], - "spec": "./test/**/*.spec.ts", - "require": "ts-node/register", - "timeout": 12000 -} diff --git a/lib/uniswap-v2-periphery/.prettierrc b/lib/uniswap-v2-periphery/.prettierrc deleted file mode 100644 index 31ba22d84..000000000 --- a/lib/uniswap-v2-periphery/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "semi": false, - "singleQuote": true, - "printWidth": 120 -} diff --git a/lib/uniswap-v2-periphery/.waffle.json b/lib/uniswap-v2-periphery/.waffle.json deleted file mode 100644 index 29868dff2..000000000 --- a/lib/uniswap-v2-periphery/.waffle.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerVersion": "./node_modules/solc", - "outputType": "all", - "compilerOptions": { - "outputSelection": { - "*": { - "*": [ - "evm.bytecode.object", - "evm.deployedBytecode.object", - "abi", - "evm.bytecode.sourceMap", - "evm.deployedBytecode.sourceMap", - "metadata" - ], - "": ["ast"] - } - }, - "evmVersion": "istanbul", - "optimizer": { - "enabled": true, - "runs": 999999 - } - } -} diff --git a/lib/uniswap-v2-periphery/.yarnrc b/lib/uniswap-v2-periphery/.yarnrc deleted file mode 100644 index 5455c6c5d..000000000 --- a/lib/uniswap-v2-periphery/.yarnrc +++ /dev/null @@ -1 +0,0 @@ -ignore-scripts true diff --git a/lib/uniswap-v2-periphery/LICENSE b/lib/uniswap-v2-periphery/LICENSE deleted file mode 100644 index f288702d2..000000000 --- a/lib/uniswap-v2-periphery/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. 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 -them 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 prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. 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. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey 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; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If 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 convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU 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 that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - 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. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -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. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - 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 -state 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 3 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, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program 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, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU 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. But first, please read -. diff --git a/lib/uniswap-v2-periphery/README.md b/lib/uniswap-v2-periphery/README.md deleted file mode 100644 index f60505cee..000000000 --- a/lib/uniswap-v2-periphery/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Uniswap V2 - -[![Actions Status](https://github.com/Uniswap/uniswap-v2-periphery/workflows/CI/badge.svg)](https://github.com/Uniswap/uniswap-v2-periphery/actions) -[![npm](https://img.shields.io/npm/v/@uniswap/v2-periphery?style=flat-square)](https://npmjs.com/package/@uniswap/v2-periphery) - -In-depth documentation on Uniswap V2 is available at [uniswap.org](https://uniswap.org/docs). - -The built contract artifacts can be browsed via [unpkg.com](https://unpkg.com/browse/@uniswap/v2-periphery@latest/). - -# Local Development - -The following assumes the use of `node@>=10`. - -## Install Dependencies - -`yarn` - -## Compile Contracts - -`yarn compile` - -## Run Tests - -`yarn test` diff --git a/lib/uniswap-v2-periphery/buildV1/UniswapV1Exchange.json b/lib/uniswap-v2-periphery/buildV1/UniswapV1Exchange.json deleted file mode 100644 index c2cab7325..000000000 --- a/lib/uniswap-v2-periphery/buildV1/UniswapV1Exchange.json +++ /dev/null @@ -1,485 +0,0 @@ -{ - "abi": [ - { - "name": "TokenPurchase", - "inputs": [ - { "type": "address", "name": "buyer", "indexed": true }, - { "type": "uint256", "name": "eth_sold", "indexed": true }, - { "type": "uint256", "name": "tokens_bought", "indexed": true } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "EthPurchase", - "inputs": [ - { "type": "address", "name": "buyer", "indexed": true }, - { "type": "uint256", "name": "tokens_sold", "indexed": true }, - { "type": "uint256", "name": "eth_bought", "indexed": true } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "AddLiquidity", - "inputs": [ - { "type": "address", "name": "provider", "indexed": true }, - { "type": "uint256", "name": "eth_amount", "indexed": true }, - { "type": "uint256", "name": "token_amount", "indexed": true } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "RemoveLiquidity", - "inputs": [ - { "type": "address", "name": "provider", "indexed": true }, - { "type": "uint256", "name": "eth_amount", "indexed": true }, - { "type": "uint256", "name": "token_amount", "indexed": true } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "Transfer", - "inputs": [ - { "type": "address", "name": "_from", "indexed": true }, - { "type": "address", "name": "_to", "indexed": true }, - { "type": "uint256", "name": "_value", "indexed": false } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "Approval", - "inputs": [ - { "type": "address", "name": "_owner", "indexed": true }, - { "type": "address", "name": "_spender", "indexed": true }, - { "type": "uint256", "name": "_value", "indexed": false } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "setup", - "outputs": [], - "inputs": [{ "type": "address", "name": "token_addr" }], - "constant": false, - "payable": false, - "type": "function", - "gas": 175875 - }, - { - "name": "addLiquidity", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "min_liquidity" }, - { "type": "uint256", "name": "max_tokens" }, - { "type": "uint256", "name": "deadline" } - ], - "constant": false, - "payable": true, - "type": "function", - "gas": 82605 - }, - { - "name": "removeLiquidity", - "outputs": [ - { "type": "uint256", "name": "out" }, - { "type": "uint256", "name": "out" } - ], - "inputs": [ - { "type": "uint256", "name": "amount" }, - { "type": "uint256", "name": "min_eth" }, - { "type": "uint256", "name": "min_tokens" }, - { "type": "uint256", "name": "deadline" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 116814 - }, - { "name": "__default__", "outputs": [], "inputs": [], "constant": false, "payable": true, "type": "function" }, - { - "name": "ethToTokenSwapInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "min_tokens" }, - { "type": "uint256", "name": "deadline" } - ], - "constant": false, - "payable": true, - "type": "function", - "gas": 12757 - }, - { - "name": "ethToTokenTransferInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "min_tokens" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" } - ], - "constant": false, - "payable": true, - "type": "function", - "gas": 12965 - }, - { - "name": "ethToTokenSwapOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_bought" }, - { "type": "uint256", "name": "deadline" } - ], - "constant": false, - "payable": true, - "type": "function", - "gas": 50455 - }, - { - "name": "ethToTokenTransferOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_bought" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" } - ], - "constant": false, - "payable": true, - "type": "function", - "gas": 50663 - }, - { - "name": "tokenToEthSwapInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_sold" }, - { "type": "uint256", "name": "min_eth" }, - { "type": "uint256", "name": "deadline" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 47503 - }, - { - "name": "tokenToEthTransferInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_sold" }, - { "type": "uint256", "name": "min_eth" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 47712 - }, - { - "name": "tokenToEthSwapOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "eth_bought" }, - { "type": "uint256", "name": "max_tokens" }, - { "type": "uint256", "name": "deadline" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 50175 - }, - { - "name": "tokenToEthTransferOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "eth_bought" }, - { "type": "uint256", "name": "max_tokens" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 50384 - }, - { - "name": "tokenToTokenSwapInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_sold" }, - { "type": "uint256", "name": "min_tokens_bought" }, - { "type": "uint256", "name": "min_eth_bought" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "token_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 51007 - }, - { - "name": "tokenToTokenTransferInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_sold" }, - { "type": "uint256", "name": "min_tokens_bought" }, - { "type": "uint256", "name": "min_eth_bought" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" }, - { "type": "address", "name": "token_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 51098 - }, - { - "name": "tokenToTokenSwapOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_bought" }, - { "type": "uint256", "name": "max_tokens_sold" }, - { "type": "uint256", "name": "max_eth_sold" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "token_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 54928 - }, - { - "name": "tokenToTokenTransferOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_bought" }, - { "type": "uint256", "name": "max_tokens_sold" }, - { "type": "uint256", "name": "max_eth_sold" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" }, - { "type": "address", "name": "token_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 55019 - }, - { - "name": "tokenToExchangeSwapInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_sold" }, - { "type": "uint256", "name": "min_tokens_bought" }, - { "type": "uint256", "name": "min_eth_bought" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "exchange_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 49342 - }, - { - "name": "tokenToExchangeTransferInput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_sold" }, - { "type": "uint256", "name": "min_tokens_bought" }, - { "type": "uint256", "name": "min_eth_bought" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" }, - { "type": "address", "name": "exchange_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 49532 - }, - { - "name": "tokenToExchangeSwapOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_bought" }, - { "type": "uint256", "name": "max_tokens_sold" }, - { "type": "uint256", "name": "max_eth_sold" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "exchange_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 53233 - }, - { - "name": "tokenToExchangeTransferOutput", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "uint256", "name": "tokens_bought" }, - { "type": "uint256", "name": "max_tokens_sold" }, - { "type": "uint256", "name": "max_eth_sold" }, - { "type": "uint256", "name": "deadline" }, - { "type": "address", "name": "recipient" }, - { "type": "address", "name": "exchange_addr" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 53423 - }, - { - "name": "getEthToTokenInputPrice", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [{ "type": "uint256", "name": "eth_sold" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 5542 - }, - { - "name": "getEthToTokenOutputPrice", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [{ "type": "uint256", "name": "tokens_bought" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 6872 - }, - { - "name": "getTokenToEthInputPrice", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [{ "type": "uint256", "name": "tokens_sold" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 5637 - }, - { - "name": "getTokenToEthOutputPrice", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [{ "type": "uint256", "name": "eth_bought" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 6897 - }, - { - "name": "tokenAddress", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 1413 - }, - { - "name": "factoryAddress", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 1443 - }, - { - "name": "balanceOf", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [{ "type": "address", "name": "_owner" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 1645 - }, - { - "name": "transfer", - "outputs": [{ "type": "bool", "name": "out" }], - "inputs": [ - { "type": "address", "name": "_to" }, - { "type": "uint256", "name": "_value" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 75034 - }, - { - "name": "transferFrom", - "outputs": [{ "type": "bool", "name": "out" }], - "inputs": [ - { "type": "address", "name": "_from" }, - { "type": "address", "name": "_to" }, - { "type": "uint256", "name": "_value" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 110907 - }, - { - "name": "approve", - "outputs": [{ "type": "bool", "name": "out" }], - "inputs": [ - { "type": "address", "name": "_spender" }, - { "type": "uint256", "name": "_value" } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": 38769 - }, - { - "name": "allowance", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [ - { "type": "address", "name": "_owner" }, - { "type": "address", "name": "_spender" } - ], - "constant": true, - "payable": false, - "type": "function", - "gas": 1925 - }, - { - "name": "name", - "outputs": [{ "type": "bytes32", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 1623 - }, - { - "name": "symbol", - "outputs": [{ "type": "bytes32", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 1653 - }, - { - "name": "decimals", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 1683 - }, - { - "name": "totalSupply", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 1713 - } - ], - "evm": { - "bytecode": { - "object": "61309c56600035601c52740100000000000000000000000000000000000000006020526f7fffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff8000000000000000000000000000000060605274012a05f1fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffed5fa0e000000000000000000000000000000000060a0526366d38203600051141561013b57602060046101403734156100b457600080fd5b60043560205181106100c557600080fd5b506000610140511415600654156007541516166100e157600080fd5b33600755610140516006557f556e6973776170205631000000000000000000000000000000000000000000006000557f554e492d563100000000000000000000000000000000000000000000000000006001556012600255005b63422f104360005114156105ab5760606004610140376000341160006101605111164261018051111661016d57600080fd5b6003546101a05260006101a051111561043e576000610140511161019057600080fd5b343031101561019e57600080fd5b343031036103a0526006543b6101b357600080fd5b6006543014156101c257600080fd5b602061046060246370a082316103e05230610400526103fc6006545afa6101e857600080fd5b600050610460516103c0526103a05161020057600080fd5b6103a05134151561021257600061022f565b6103c051346103c0513402041461022857600080fd5b6103c05134025b0460016103a05161023f57600080fd5b6103a05134151561025157600061026e565b6103c051346103c0513402041461026757600080fd5b6103c05134025b0401101561027b57600080fd5b60016103a05161028a57600080fd5b6103a05134151561029c5760006102b9565b6103c051346103c051340204146102b257600080fd5b6103c05134025b0401610480526103a0516102cc57600080fd5b6103a0513415156102de5760006102fb565b6101a051346101a051340204146102f457600080fd5b6101a05134025b046104a052610140516104a0511015610480516101605110151661031e57600080fd5b60043360e05260c052604060c02080546104a051825401101561034057600080fd5b6104a0518154018155506101a0516104a0516101a05101101561036257600080fd5b6104a0516101a051016003556006543b61037b57600080fd5b60065430141561038a57600080fd5b602061058060646323b872dd6104c052336104e052306105005261048051610520526104dc60006006545af16103bf57600080fd5b600050610580516103cf57600080fd5b6104805134337f06239653922ac7bea6aa2b19dc486b9361821d37712eb796adfd38d81de278ca60006000a46104a0516105a0523360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206105a0a36104a05160005260206000f36105a9565b633b9aca003410156000600654141560006007541415161661045f57600080fd5b306007543b61046d57600080fd5b60075430141561047c57600080fd5b602061024060246306f2bf626101c0526006546101e0526101dc6007545afa6104a457600080fd5b60005061024051146104b557600080fd5b6101605161026052303161028052610280516003556102805160043360e05260c052604060c020556006543b6104ea57600080fd5b6006543014156104f957600080fd5b602061036060646323b872dd6102a052336102c052306102e05261026051610300526102bc60006006545af161052e57600080fd5b6000506103605161053e57600080fd5b6102605134337f06239653922ac7bea6aa2b19dc486b9361821d37712eb796adfd38d81de278ca60006000a461028051610380523360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020610380a36102805160005260206000f35b005b63f88bf15a600051141561084a57608060046101403734156105cc57600080fd5b600061018051116000610160511116426101a051116000610140511116166105f357600080fd5b6003546101c05260006101c0511161060a57600080fd5b6006543b61061757600080fd5b60065430141561062657600080fd5b602061028060246370a0823161020052306102205261021c6006545afa61064c57600080fd5b600050610280516101e0526101c05161066457600080fd5b6101c051610140511515610679576000610699565b30316101405130316101405102041461069157600080fd5b303161014051025b046102a0526101c0516106ab57600080fd5b6101c0516101405115156106c05760006106e6565b6101e051610140516101e051610140510204146106dc57600080fd5b6101e05161014051025b046102c052610180516102c0511015610160516102a05110151661070957600080fd5b60043360e05260c052604060c020610140518154101561072857600080fd5b61014051815403815550610140516101c051101561074557600080fd5b610140516101c0510360035560006000600060006102a051336000f161076a57600080fd5b6006543b61077757600080fd5b60065430141561078657600080fd5b6020610380604463a9059cbb6102e05233610300526102c051610320526102fc60006006545af16107b657600080fd5b600050610380516107c657600080fd5b6102c0516102a051337f0fbf06c058b90cb038a618f8c2acbf6145f8b3570fd1fa56abb8f0f3f05b36e860006000a4610140516103a0526000337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206103a0a360406103c0526103e06102a05181526102c0518160200152506103c0516103e0f3005b6000156109c6575b6101a05261014052610160526101805260006101805111600061016051111661087a57600080fd5b61014051151561088b5760006108ae565b6103e5610140516103e5610140510204146108a557600080fd5b6103e561014051025b6101c0526101c05115156108c35760006108e9565b610180516101c051610180516101c0510204146108df57600080fd5b610180516101c051025b6101e0526101605115156108fe576000610921565b6103e8610160516103e86101605102041461091857600080fd5b6103e861016051025b6101c051610160511515610936576000610959565b6103e8610160516103e86101605102041461095057600080fd5b6103e861016051025b01101561096557600080fd5b6101c05161016051151561097a57600061099d565b6103e8610160516103e86101605102041461099457600080fd5b6103e861016051025b0161020052610200516109af57600080fd5b610200516101e051046000526000516101a0515650005b600015610bf3575b6101a0526101405261016052610180526000610180511160006101605111166109f657600080fd5b610160511515610a07576000610a2d565b61014051610160516101405161016051020414610a2357600080fd5b6101405161016051025b1515610a3a576000610af6565b6103e8610160511515610a4e576000610a74565b61014051610160516101405161016051020414610a6a57600080fd5b6101405161016051025b6103e8610160511515610a88576000610aae565b61014051610160516101405161016051020414610aa457600080fd5b6101405161016051025b020414610aba57600080fd5b6103e8610160511515610ace576000610af4565b61014051610160516101405161016051020414610aea57600080fd5b6101405161016051025b025b6101c05261014051610180511015610b0d57600080fd5b6101405161018051031515610b23576000610b8e565b6103e561014051610180511015610b3957600080fd5b6101405161018051036103e561014051610180511015610b5857600080fd5b610140516101805103020414610b6d57600080fd5b6103e561014051610180511015610b8357600080fd5b610140516101805103025b6101e0526101e051610b9f57600080fd5b6101e0516101c0510460016101e051610bb757600080fd5b6101e0516101c05104011015610bcc57600080fd5b60016101e051610bdb57600080fd5b6101e0516101c05104016000526000516101a0515650005b600015610df4575b6101e0526101405261016052610180526101a0526101c0526000610160511160006101405111164261018051101516610c3357600080fd5b6006543b610c4057600080fd5b600654301415610c4f57600080fd5b60206102a060246370a0823161022052306102405261023c6006545afa610c7557600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516389f2a8716102e05261014051610300526101405130311015610cd657600080fd5b6101405130310361032052610200516103405261034051610320516103005160065801610852565b6103a0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103a0516102c052610160516102c0511015610d5157600080fd5b6006543b610d5e57600080fd5b600654301415610d6d57600080fd5b6020610460604463a9059cbb6103c0526101c0516103e0526102c051610400526103dc60006006545af1610da057600080fd5b60005061046051610db057600080fd5b6102c051610140516101a0517fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f60006000a46102c0516000526000516101e0515650005b63f39b5b9b6000511415610e715760406004610140376101405161016051638c717a3361018052346101a052610140516101c052610160516101e0523361020052336102205261022051610200516101e0516101c0516101a05160065801610bfb565b6102805261016052610140526102805160005260206000f3005b63ad65d76d6000511415610f245760606004610140376044356020518110610e9857600080fd5b5060006101805114153061018051141516610eb257600080fd5b610140516101605161018051638c717a336101a052346101c052610140516101e0526101605161020052336102205261018051610240526102405161022051610200516101e0516101c05160065801610bfb565b6102a0526101805261016052610140526102a05160005260206000f3005b60001561116c575b6101e0526101405261016052610180526101a0526101c0526000610160511160006101405111164261018051101516610f6457600080fd5b6006543b610f7157600080fd5b600654301415610f8057600080fd5b60206102a060246370a0823161022052306102405261023c6006545afa610fa657600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c05163fd11c2236102e0526101405161030052610160513031101561100757600080fd5b61016051303103610320526102005161034052610340516103205161030051600658016109ce565b6103a0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103a0516102c05260016102c051026103e0526103e05161016051101561108d57600080fd5b6103e05161016051036103c05260006103c05111156110c35760006000600060006103c0516101a0516000f16110c257600080fd5b5b6006543b6110d057600080fd5b6006543014156110df57600080fd5b60206104a0604463a9059cbb610400526101c05161042052610140516104405261041c60006006545af161111257600080fd5b6000506104a05161112257600080fd5b6101405160016102c051026101a0517fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f60006000a460016102c051026000526000516101e0515650005b636b1d4db760005114156111e95760406004610140376101405161016051632dff394e61018052610140516101a052346101c052610160516101e0523361020052336102205261022051610200516101e0516101c0516101a05160065801610f2c565b6102805261016052610140526102805160005260206000f3005b630b573638600051141561129c576060600461014037604435602051811061121057600080fd5b506000610180511415306101805114151661122a57600080fd5b610140516101605161018051632dff394e6101a052610140516101c052346101e0526101605161020052336102205261018051610240526102405161022051610200516101e0516101c05160065801610f2c565b6102a0526101805261016052610140526102a05160005260206000f3005b6000156114b3575b6101e0526101405261016052610180526101a0526101c05260006101605111600061014051111642610180511015166112dc57600080fd5b6006543b6112e957600080fd5b6006543014156112f857600080fd5b60206102a060246370a0823161022052306102405261023c6006545afa61131e57600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516389f2a8716102e0526101405161030052610200516103205230316103405261034051610320516103005160065801610852565b6103a0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103a0516102c05260016102c051026103c052610160516103c05110156113ef57600080fd5b60006000600060006103c0516101c0516000f161140b57600080fd5b6006543b61141857600080fd5b60065430141561142757600080fd5b60206104a060646323b872dd6103e0526101a05161040052306104205261014051610440526103fc60006006545af161145f57600080fd5b6000506104a05161146f57600080fd5b6103c051610140516101a0517f7f4091b46c33e918a0f3aa42307641d17bb67029427a5369e54b35398423870560006000a46103c0516000526000516101e0515650005b6395e3c50b600051141561154657606060046101403734156114d457600080fd5b61014051610160516101805163fa1bb7be6101a052610140516101c052610160516101e0526101805161020052336102205233610240526102405161022051610200516101e0516101c051600658016112a4565b6102a0526101805261016052610140526102a05160005260206000f3005b637237e031600051141561160f576080600461014037341561156757600080fd5b606435602051811061157857600080fd5b5060006101a0511415306101a05114151661159257600080fd5b6101405161016051610180516101a05163fa1bb7be6101c052610140516101e0526101605161020052610180516102205233610240526101a05161026052610260516102405161022051610200516101e051600658016112a4565b6102c0526101a0526101805261016052610140526102c05160005260206000f3005b600015611813575b6101e0526101405261016052610180526101a0526101c05260006101405111426101805110151661164757600080fd5b6006543b61165457600080fd5b60065430141561166357600080fd5b60206102a060246370a0823161022052306102405261023c6006545afa61168957600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c05163fd11c2236102e05261014051610300526102005161032052303161034052610340516103205161030051600658016109ce565b6103a0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103a0516102c0526102c05161016051101561174f57600080fd5b6000600060006000610140516101c0516000f161176b57600080fd5b6006543b61177857600080fd5b60065430141561178757600080fd5b602061048060646323b872dd6103c0526101a0516103e05230610400526102c051610420526103dc60006006545af16117bf57600080fd5b600050610480516117cf57600080fd5b610140516102c0516101a0517f7f4091b46c33e918a0f3aa42307641d17bb67029427a5369e54b35398423870560006000a46102c0516000526000516101e0515650005b63013efd8b60005114156118a6576060600461014037341561183457600080fd5b61014051610160516101805163984fe8f66101a052610140516101c052610160516101e0526101805161020052336102205233610240526102405161022051610200516101e0516101c05160065801611617565b6102a0526101805261016052610140526102a05160005260206000f3005b63d4e4841d600051141561196f57608060046101403734156118c757600080fd5b60643560205181106118d857600080fd5b5060006101a0511415306101a0511415166118f257600080fd5b6101405161016051610180516101a05163984fe8f66101c052610140516101e0526101605161020052610180516102205233610240526101a05161026052610260516102405161022051610200516101e05160065801611617565b6102c0526101a0526101805261016052610140526102c05160005260206000f3005b600015611c0a575b610220526101405261016052610180526101a0526101c0526101e0526102005260006101805111600061016051111660006101405111426101a051101516166119bf57600080fd5b600061020051141530610200511415166119d857600080fd5b6006543b6119e557600080fd5b6006543014156119f457600080fd5b60206102e060246370a0823161026052306102805261027c6006545afa611a1a57600080fd5b6000506102e051610240526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516102e051610300516389f2a871610320526101405161034052610240516103605230316103805261038051610360516103405160065801610852565b6103e052610300526102e0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103e05161030052600161030051026104005261018051610400511015611afb57600080fd5b6006543b611b0857600080fd5b600654301415611b1757600080fd5b60206104e060646323b872dd610420526101c051610440523061046052610140516104805261043c60006006545af1611b4f57600080fd5b6000506104e051611b5f57600080fd5b610200513b611b6d57600080fd5b61020051301415611b7d57600080fd5b60206105e0606463ad65d76d6105205261016051610540526101a051610560526101e0516105805261053c61040051610200515af1611bbb57600080fd5b6000506105e0516105005261040051610140516101c0517f7f4091b46c33e918a0f3aa42307641d17bb67029427a5369e54b35398423870560006000a461050051600052600051610220515650005b63ddf7e1a76000511415611d575760a06004610140373415611c2b57600080fd5b6084356020518110611c3c57600080fd5b506007543b611c4a57600080fd5b600754301415611c5957600080fd5b602061028060246306f2bf62610200526101c0516102205261021c6007545afa611c8257600080fd5b600050610280516101e0526101405161016051610180516101a0516101c0516101e051610200516102205161024051610260516102805163204ea33b6102a052610140516102c052610160516102e05261018051610300526101a05161032052336103405233610360526101e0516103805261038051610360516103405161032051610300516102e0516102c05160065801611977565b6103e05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103e05160005260206000f3005b63f552d91b6000511415611ec15760c06004610140373415611d7857600080fd5b6084356020518110611d8957600080fd5b5060a4356020518110611d9b57600080fd5b506007543b611da957600080fd5b600754301415611db857600080fd5b60206102a060246306f2bf62610220526101e0516102405261023c6007545afa611de157600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a05163204ea33b6102c052610140516102e052610160516103005261018051610320526101a0516103405233610360526101c05161038052610200516103a0526103a05161038051610360516103405161032051610300516102e05160065801611977565b610400526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526104005160005260206000f3005b6000156121d7575b610220526101405261016052610180526101a0526101c0526101e05261020052600061018051116000610140511116426101a051101516611f0957600080fd5b60006102005114153061020051141516611f2257600080fd5b610200513b611f3057600080fd5b61020051301415611f4057600080fd5b60206102e060246359e9486261026052610140516102805261027c610200515afa611f6a57600080fd5b6000506102e051610240526006543b611f8257600080fd5b600654301415611f9157600080fd5b60206103a060246370a0823161032052306103405261033c6006545afa611fb757600080fd5b6000506103a051610300526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516102e05161030051610320516103405161036051610380516103a0516103c05163fd11c2236103e05261024051610400526103005161042052303161044052610440516104205161040051600658016109ce565b6104a0526103c0526103a05261038052610360526103405261032052610300526102e0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526104a0516103c052610240516101805110156103c051610160511015166120c857600080fd5b6006543b6120d557600080fd5b6006543014156120e457600080fd5b602061058060646323b872dd6104c0526101c0516104e05230610500526103c051610520526104dc60006006545af161211c57600080fd5b6000506105805161212c57600080fd5b610200513b61213a57600080fd5b6102005130141561214a57600080fd5b60206106806064630b5736386105c052610140516105e0526101a051610600526101e051610620526105dc61024051610200515af161218857600080fd5b600050610680516105a052610240516103c0516101c0517f7f4091b46c33e918a0f3aa42307641d17bb67029427a5369e54b35398423870560006000a46103c051600052600051610220515650005b63b040d54560005114156123245760a060046101403734156121f857600080fd5b608435602051811061220957600080fd5b506007543b61221757600080fd5b60075430141561222657600080fd5b602061028060246306f2bf62610200526101c0516102205261021c6007545afa61224f57600080fd5b600050610280516101e0526101405161016051610180516101a0516101c0516101e0516102005161022051610240516102605161028051631a7b28f26102a052610140516102c052610160516102e05261018051610300526101a05161032052336103405233610360526101e0516103805261038051610360516103405161032051610300516102e0516102c05160065801611ec9565b6103e05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103e05160005260206000f3005b63f3c0efe9600051141561248e5760c0600461014037341561234557600080fd5b608435602051811061235657600080fd5b5060a435602051811061236857600080fd5b506007543b61237657600080fd5b60075430141561238557600080fd5b60206102a060246306f2bf62610220526101e0516102405261023c6007545afa6123ae57600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a051631a7b28f26102c052610140516102e052610160516103005261018051610320526101a0516103405233610360526101c05161038052610200516103a0526103a05161038051610360516103405161032051610300516102e05160065801611ec9565b610400526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526104005160005260206000f3005b63b1cb43bf600051141561255b5760a060046101403734156124af57600080fd5b60843560205181106124c057600080fd5b506101405161016051610180516101a0516101c05163204ea33b6101e0526101405161020052610160516102205261018051610240526101a051610260523361028052336102a0526101c0516102c0526102c0516102a051610280516102605161024051610220516102005160065801611977565b610320526101c0526101a0526101805261016052610140526103205160005260206000f3005b63ec384a3e60005114156126555760c0600461014037341561257c57600080fd5b608435602051811061258d57600080fd5b5060a435602051811061259f57600080fd5b50306101c05114156125b057600080fd5b6101405161016051610180516101a0516101c0516101e05163204ea33b610200526101405161022052610160516102405261018051610260526101a05161028052336102a0526101c0516102c0526101e0516102e0526102e0516102c0516102a0516102805161026051610240516102205160065801611977565b610340526101e0526101c0526101a0526101805261016052610140526103405160005260206000f3005b63ea650c7d60005114156127225760a0600461014037341561267657600080fd5b608435602051811061268757600080fd5b506101405161016051610180516101a0516101c051631a7b28f26101e0526101405161020052610160516102205261018051610240526101a051610260523361028052336102a0526101c0516102c0526102c0516102a051610280516102605161024051610220516102005160065801611ec9565b610320526101c0526101a0526101805261016052610140526103205160005260206000f3005b63981a1327600051141561281c5760c0600461014037341561274357600080fd5b608435602051811061275457600080fd5b5060a435602051811061276657600080fd5b50306101c051141561277757600080fd5b6101405161016051610180516101a0516101c0516101e051631a7b28f2610200526101405161022052610160516102405261018051610260526101a05161028052336102a0526101c0516102c0526101e0516102e0526102e0516102c0516102a0516102805161026051610240516102205160065801611ec9565b610340526101e0526101c0526101a0526101805261016052610140526103405160005260206000f3005b63cd7724c36000511415612918576020600461014037341561283d57600080fd5b6000610140511161284d57600080fd5b6006543b61285a57600080fd5b60065430141561286957600080fd5b602061020060246370a0823161018052306101a05261019c6006545afa61288f57600080fd5b60005061020051610160526101405161016051610180516101a0516101c0516101e051610200516389f2a871610220526101405161024052303161026052610160516102805261028051610260516102405160065801610852565b6102e052610200526101e0526101c0526101a0526101805261016052610140526102e05160005260206000f3005b6359e948626000511415612a27576020600461014037341561293957600080fd5b6000610140511161294957600080fd5b6006543b61295657600080fd5b60065430141561296557600080fd5b602061020060246370a0823161018052306101a05261019c6006545afa61298b57600080fd5b60005061020051610160526101405161016051610180516101a0516101c0516101e051610200516102205163fd11c223610240526101405161026052303161028052610160516102a0526102a0516102805161026051600658016109ce565b6103005261022052610200526101e0526101c0526101a05261018052610160526101405261030051610220526001610220510260005260206000f3005b6395b68fe76000511415612b365760206004610140373415612a4857600080fd5b60006101405111612a5857600080fd5b6006543b612a6557600080fd5b600654301415612a7457600080fd5b602061020060246370a0823161018052306101a05261019c6006545afa612a9a57600080fd5b60005061020051610160526101405161016051610180516101a0516101c0516101e05161020051610220516389f2a871610240526101405161026052610160516102805230316102a0526102a051610280516102605160065801610852565b6103005261022052610200526101e0526101c0526101a05261018052610160526101405261030051610220526001610220510260005260206000f3005b632640f62c6000511415612c325760206004610140373415612b5757600080fd5b60006101405111612b6757600080fd5b6006543b612b7457600080fd5b600654301415612b8357600080fd5b602061020060246370a0823161018052306101a05261019c6006545afa612ba957600080fd5b60005061020051610160526101405161016051610180516101a0516101c0516101e0516102005163fd11c2236102205261014051610240526101605161026052303161028052610280516102605161024051600658016109ce565b6102e052610200526101e0526101c0526101a0526101805261016052610140526102e05160005260206000f3005b639d76ea586000511415612c58573415612c4b57600080fd5b60065460005260206000f3005b63966dae0e6000511415612c7e573415612c7157600080fd5b60075460005260206000f3005b6370a082316000511415612ccd5760206004610140373415612c9f57600080fd5b6004356020518110612cb057600080fd5b5060046101405160e05260c052604060c0205460005260206000f3005b63a9059cbb6000511415612d985760406004610140373415612cee57600080fd5b6004356020518110612cff57600080fd5b5060043360e05260c052604060c0206101605181541015612d1f57600080fd5b6101605181540381555060046101405160e05260c052604060c0208054610160518254011015612d4e57600080fd5b61016051815401815550610160516101805261014051337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020610180a3600160005260206000f3005b6323b872dd6000511415612eb35760606004610140373415612db957600080fd5b6004356020518110612dca57600080fd5b506024356020518110612ddc57600080fd5b5060046101405160e05260c052604060c0206101805181541015612dff57600080fd5b6101805181540381555060046101605160e05260c052604060c0208054610180518254011015612e2e57600080fd5b6101805181540181555060056101405160e05260c052604060c0203360e05260c052604060c0206101805181541015612e6657600080fd5b61018051815403815550610180516101a05261016051610140517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206101a0a3600160005260206000f3005b63095ea7b36000511415612f485760406004610140373415612ed457600080fd5b6004356020518110612ee557600080fd5b506101605160053360e05260c052604060c0206101405160e05260c052604060c02055610160516101805261014051337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256020610180a3600160005260206000f3005b63dd62ed3e6000511415612fb85760406004610140373415612f6957600080fd5b6004356020518110612f7a57600080fd5b506024356020518110612f8c57600080fd5b5060056101405160e05260c052604060c0206101605160e05260c052604060c0205460005260206000f3005b6306fdde036000511415612fde573415612fd157600080fd5b60005460005260206000f3005b6395d89b416000511415613004573415612ff757600080fd5b60015460005260206000f3005b63313ce567600051141561302a57341561301d57600080fd5b60025460005260206000f3005b6318160ddd600051141561305057341561304357600080fd5b60035460005260206000f3005b638c717a33610140523461016052600161018052426101a052336101c052336101e0526101e0516101c0516101a051610180516101605160065801610bfb565b610240526102405b61000461309c0361000460003961000461309c036000f3" - } - } -} diff --git a/lib/uniswap-v2-periphery/buildV1/UniswapV1Factory.json b/lib/uniswap-v2-periphery/buildV1/UniswapV1Factory.json deleted file mode 100644 index 4529b3dbe..000000000 --- a/lib/uniswap-v2-periphery/buildV1/UniswapV1Factory.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "abi": [ - { - "name": "NewExchange", - "inputs": [ - { "type": "address", "name": "token", "indexed": true }, - { "type": "address", "name": "exchange", "indexed": true } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "initializeFactory", - "outputs": [], - "inputs": [{ "type": "address", "name": "template" }], - "constant": false, - "payable": false, - "type": "function", - "gas": 35725 - }, - { - "name": "createExchange", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [{ "type": "address", "name": "token" }], - "constant": false, - "payable": false, - "type": "function", - "gas": 187911 - }, - { - "name": "getExchange", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [{ "type": "address", "name": "token" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 715 - }, - { - "name": "getToken", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [{ "type": "address", "name": "exchange" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 745 - }, - { - "name": "getTokenWithId", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [{ "type": "uint256", "name": "token_id" }], - "constant": true, - "payable": false, - "type": "function", - "gas": 736 - }, - { - "name": "exchangeTemplate", - "outputs": [{ "type": "address", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 633 - }, - { - "name": "tokenCount", - "outputs": [{ "type": "uint256", "name": "out" }], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": 663 - } - ], - "evm": { - "bytecode": { - "object": "6103f056600035601c52740100000000000000000000000000000000000000006020526f7fffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff8000000000000000000000000000000060605274012a05f1fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffed5fa0e000000000000000000000000000000000060a05263538a3f0e60005114156100ed57602060046101403734156100b457600080fd5b60043560205181106100c557600080fd5b50600054156100d357600080fd5b60006101405114156100e457600080fd5b61014051600055005b631648f38e60005114156102bf576020600461014037341561010e57600080fd5b600435602051811061011f57600080fd5b50600061014051141561013157600080fd5b6000600054141561014157600080fd5b60026101405160e05260c052604060c020541561015d57600080fd5b7f602e600c600039602e6000f33660006000376110006000366000730000000000610180526c010000000000000000000000006000540261019b527f5af41558576110006000f30000000000000000000000000000000000000000006101af5260406101806000f0806101cf57600080fd5b61016052610160513b6101e157600080fd5b610160513014156101f157600080fd5b6000600060246366d3820361022052610140516102405261023c6000610160515af161021c57600080fd5b6101605160026101405160e05260c052604060c020556101405160036101605160e05260c052604060c02055600154600160015401101561025c57600080fd5b6001600154016102a0526102a0516001556101405160046102a05160e05260c052604060c0205561016051610140517f9d42cb017eb05bd8944ab536a8b35bc68085931dd5f4356489801453923953f960006000a36101605160005260206000f3005b6306f2bf62600051141561030e57602060046101403734156102e057600080fd5b60043560205181106102f157600080fd5b5060026101405160e05260c052604060c0205460005260206000f3005b6359770438600051141561035d576020600461014037341561032f57600080fd5b600435602051811061034057600080fd5b5060036101405160e05260c052604060c0205460005260206000f3005b63aa65a6c0600051141561039a576020600461014037341561037e57600080fd5b60046101405160e05260c052604060c0205460005260206000f3005b631c2bbd1860005114156103c05734156103b357600080fd5b60005460005260206000f3005b639f181b5e60005114156103e65734156103d957600080fd5b60015460005260206000f3005b60006000fd5b6100046103f0036100046000396100046103f0036000f3" - } - } -} diff --git a/lib/uniswap-v2-periphery/contracts/UniswapV2Migrator.sol b/lib/uniswap-v2-periphery/contracts/UniswapV2Migrator.sol deleted file mode 100644 index fcd635494..000000000 --- a/lib/uniswap-v2-periphery/contracts/UniswapV2Migrator.sol +++ /dev/null @@ -1,49 +0,0 @@ -pragma solidity =0.6.6; - -import '@uniswap/lib/contracts/libraries/TransferHelper.sol'; - -import './interfaces/IUniswapV2Migrator.sol'; -import './interfaces/V1/IUniswapV1Factory.sol'; -import './interfaces/V1/IUniswapV1Exchange.sol'; -import './interfaces/IUniswapV2Router01.sol'; -import './interfaces/IERC20.sol'; - -contract UniswapV2Migrator is IUniswapV2Migrator { - IUniswapV1Factory immutable factoryV1; - IUniswapV2Router01 immutable router; - - constructor(address _factoryV1, address _router) public { - factoryV1 = IUniswapV1Factory(_factoryV1); - router = IUniswapV2Router01(_router); - } - - // needs to accept ETH from any v1 exchange and the router. ideally this could be enforced, as in the router, - // but it's not possible because it requires a call to the v1 factory, which takes too much gas - receive() external payable {} - - function migrate(address token, uint amountTokenMin, uint amountETHMin, address to, uint deadline) - external - override - { - IUniswapV1Exchange exchangeV1 = IUniswapV1Exchange(factoryV1.getExchange(token)); - uint liquidityV1 = exchangeV1.balanceOf(msg.sender); - require(exchangeV1.transferFrom(msg.sender, address(this), liquidityV1), 'TRANSFER_FROM_FAILED'); - (uint amountETHV1, uint amountTokenV1) = exchangeV1.removeLiquidity(liquidityV1, 1, 1, uint(-1)); - TransferHelper.safeApprove(token, address(router), amountTokenV1); - (uint amountTokenV2, uint amountETHV2,) = router.addLiquidityETH{value: amountETHV1}( - token, - amountTokenV1, - amountTokenMin, - amountETHMin, - to, - deadline - ); - if (amountTokenV1 > amountTokenV2) { - TransferHelper.safeApprove(token, address(router), 0); // be a good blockchain citizen, reset allowance to 0 - TransferHelper.safeTransfer(token, msg.sender, amountTokenV1 - amountTokenV2); - } else if (amountETHV1 > amountETHV2) { - // addLiquidityETH guarantees that all of amountETHV1 or amountTokenV1 will be used, hence this else is safe - TransferHelper.safeTransferETH(msg.sender, amountETHV1 - amountETHV2); - } - } -} diff --git a/lib/uniswap-v2-periphery/contracts/UniswapV2Router01.sol b/lib/uniswap-v2-periphery/contracts/UniswapV2Router01.sol deleted file mode 100644 index 74a4035df..000000000 --- a/lib/uniswap-v2-periphery/contracts/UniswapV2Router01.sol +++ /dev/null @@ -1,280 +0,0 @@ -pragma solidity =0.6.6; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol'; -import '@uniswap/lib/contracts/libraries/TransferHelper.sol'; - -import './libraries/UniswapV2Library.sol'; -import './interfaces/IUniswapV2Router01.sol'; -import './interfaces/IERC20.sol'; -import './interfaces/IWETH.sol'; - -contract UniswapV2Router01 is IUniswapV2Router01 { - address public immutable override factory; - address public immutable override WETH; - - modifier ensure(uint deadline) { - require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED'); - _; - } - - constructor(address _factory, address _WETH) public { - factory = _factory; - WETH = _WETH; - } - - receive() external payable { - assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract - } - - // **** ADD LIQUIDITY **** - function _addLiquidity( - address tokenA, - address tokenB, - uint amountADesired, - uint amountBDesired, - uint amountAMin, - uint amountBMin - ) private returns (uint amountA, uint amountB) { - // create the pair if it doesn't exist yet - if (IUniswapV2Factory(factory).getPair(tokenA, tokenB) == address(0)) { - IUniswapV2Factory(factory).createPair(tokenA, tokenB); - } - (uint reserveA, uint reserveB) = UniswapV2Library.getReserves(factory, tokenA, tokenB); - if (reserveA == 0 && reserveB == 0) { - (amountA, amountB) = (amountADesired, amountBDesired); - } else { - uint amountBOptimal = UniswapV2Library.quote(amountADesired, reserveA, reserveB); - if (amountBOptimal <= amountBDesired) { - require(amountBOptimal >= amountBMin, 'UniswapV2Router: INSUFFICIENT_B_AMOUNT'); - (amountA, amountB) = (amountADesired, amountBOptimal); - } else { - uint amountAOptimal = UniswapV2Library.quote(amountBDesired, reserveB, reserveA); - assert(amountAOptimal <= amountADesired); - require(amountAOptimal >= amountAMin, 'UniswapV2Router: INSUFFICIENT_A_AMOUNT'); - (amountA, amountB) = (amountAOptimal, amountBDesired); - } - } - } - function addLiquidity( - address tokenA, - address tokenB, - uint amountADesired, - uint amountBDesired, - uint amountAMin, - uint amountBMin, - address to, - uint deadline - ) external override ensure(deadline) returns (uint amountA, uint amountB, uint liquidity) { - (amountA, amountB) = _addLiquidity(tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin); - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - TransferHelper.safeTransferFrom(tokenA, msg.sender, pair, amountA); - TransferHelper.safeTransferFrom(tokenB, msg.sender, pair, amountB); - liquidity = IUniswapV2Pair(pair).mint(to); - } - function addLiquidityETH( - address token, - uint amountTokenDesired, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) external override payable ensure(deadline) returns (uint amountToken, uint amountETH, uint liquidity) { - (amountToken, amountETH) = _addLiquidity( - token, - WETH, - amountTokenDesired, - msg.value, - amountTokenMin, - amountETHMin - ); - address pair = UniswapV2Library.pairFor(factory, token, WETH); - TransferHelper.safeTransferFrom(token, msg.sender, pair, amountToken); - IWETH(WETH).deposit{value: amountETH}(); - assert(IWETH(WETH).transfer(pair, amountETH)); - liquidity = IUniswapV2Pair(pair).mint(to); - if (msg.value > amountETH) TransferHelper.safeTransferETH(msg.sender, msg.value - amountETH); // refund dust eth, if any - } - - // **** REMOVE LIQUIDITY **** - function removeLiquidity( - address tokenA, - address tokenB, - uint liquidity, - uint amountAMin, - uint amountBMin, - address to, - uint deadline - ) public override ensure(deadline) returns (uint amountA, uint amountB) { - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - IUniswapV2Pair(pair).transferFrom(msg.sender, pair, liquidity); // send liquidity to pair - (uint amount0, uint amount1) = IUniswapV2Pair(pair).burn(to); - (address token0,) = UniswapV2Library.sortTokens(tokenA, tokenB); - (amountA, amountB) = tokenA == token0 ? (amount0, amount1) : (amount1, amount0); - require(amountA >= amountAMin, 'UniswapV2Router: INSUFFICIENT_A_AMOUNT'); - require(amountB >= amountBMin, 'UniswapV2Router: INSUFFICIENT_B_AMOUNT'); - } - function removeLiquidityETH( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) public override ensure(deadline) returns (uint amountToken, uint amountETH) { - (amountToken, amountETH) = removeLiquidity( - token, - WETH, - liquidity, - amountTokenMin, - amountETHMin, - address(this), - deadline - ); - TransferHelper.safeTransfer(token, to, amountToken); - IWETH(WETH).withdraw(amountETH); - TransferHelper.safeTransferETH(to, amountETH); - } - function removeLiquidityWithPermit( - address tokenA, - address tokenB, - uint liquidity, - uint amountAMin, - uint amountBMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external override returns (uint amountA, uint amountB) { - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - uint value = approveMax ? uint(-1) : liquidity; - IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); - (amountA, amountB) = removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline); - } - function removeLiquidityETHWithPermit( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external override returns (uint amountToken, uint amountETH) { - address pair = UniswapV2Library.pairFor(factory, token, WETH); - uint value = approveMax ? uint(-1) : liquidity; - IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); - (amountToken, amountETH) = removeLiquidityETH(token, liquidity, amountTokenMin, amountETHMin, to, deadline); - } - - // **** SWAP **** - // requires the initial amount to have already been sent to the first pair - function _swap(uint[] memory amounts, address[] memory path, address _to) private { - for (uint i; i < path.length - 1; i++) { - (address input, address output) = (path[i], path[i + 1]); - (address token0,) = UniswapV2Library.sortTokens(input, output); - uint amountOut = amounts[i + 1]; - (uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOut) : (amountOut, uint(0)); - address to = i < path.length - 2 ? UniswapV2Library.pairFor(factory, output, path[i + 2]) : _to; - IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output)).swap(amount0Out, amount1Out, to, new bytes(0)); - } - } - function swapExactTokensForTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external override ensure(deadline) returns (uint[] memory amounts) { - amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path); - require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - TransferHelper.safeTransferFrom(path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]); - _swap(amounts, path, to); - } - function swapTokensForExactTokens( - uint amountOut, - uint amountInMax, - address[] calldata path, - address to, - uint deadline - ) external override ensure(deadline) returns (uint[] memory amounts) { - amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); - require(amounts[0] <= amountInMax, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'); - TransferHelper.safeTransferFrom(path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]); - _swap(amounts, path, to); - } - function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) - external - override - payable - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsOut(factory, msg.value, path); - require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - IWETH(WETH).deposit{value: amounts[0]}(); - assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0])); - _swap(amounts, path, to); - } - function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) - external - override - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); - require(amounts[0] <= amountInMax, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'); - TransferHelper.safeTransferFrom(path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]); - _swap(amounts, path, address(this)); - IWETH(WETH).withdraw(amounts[amounts.length - 1]); - TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]); - } - function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) - external - override - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path); - require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - TransferHelper.safeTransferFrom(path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]); - _swap(amounts, path, address(this)); - IWETH(WETH).withdraw(amounts[amounts.length - 1]); - TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]); - } - function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) - external - override - payable - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); - require(amounts[0] <= msg.value, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'); - IWETH(WETH).deposit{value: amounts[0]}(); - assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0])); - _swap(amounts, path, to); - if (msg.value > amounts[0]) TransferHelper.safeTransferETH(msg.sender, msg.value - amounts[0]); // refund dust eth, if any - } - - function quote(uint amountA, uint reserveA, uint reserveB) public pure override returns (uint amountB) { - return UniswapV2Library.quote(amountA, reserveA, reserveB); - } - - function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) public pure override returns (uint amountOut) { - return UniswapV2Library.getAmountOut(amountIn, reserveIn, reserveOut); - } - - function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) public pure override returns (uint amountIn) { - return UniswapV2Library.getAmountOut(amountOut, reserveIn, reserveOut); - } - - function getAmountsOut(uint amountIn, address[] memory path) public view override returns (uint[] memory amounts) { - return UniswapV2Library.getAmountsOut(factory, amountIn, path); - } - - function getAmountsIn(uint amountOut, address[] memory path) public view override returns (uint[] memory amounts) { - return UniswapV2Library.getAmountsIn(factory, amountOut, path); - } -} diff --git a/lib/uniswap-v2-periphery/contracts/UniswapV2Router02.sol b/lib/uniswap-v2-periphery/contracts/UniswapV2Router02.sol deleted file mode 100644 index e6b009e11..000000000 --- a/lib/uniswap-v2-periphery/contracts/UniswapV2Router02.sol +++ /dev/null @@ -1,446 +0,0 @@ -pragma solidity >=0.6.6; - -import "uniswap-v2-core/interfaces/IUniswapV2Factory.sol"; -import './libraries/TransferHelper.sol'; - -import './interfaces/IUniswapV2Router02.sol'; -import './libraries/UniswapV2Library.sol'; -import './libraries/SafeMath.sol'; -import './interfaces/IERC20.sol'; -import './interfaces/IWETH.sol'; - -contract UniswapV2Router02 is IUniswapV2Router02 { - using SafeMath for uint; - - address public immutable override factory; - address public immutable override WETH; - - modifier ensure(uint deadline) { - require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED'); - _; - } - - constructor(address _factory, address _WETH) public { - factory = _factory; - WETH = _WETH; - } - - receive() external payable { - assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract - } - - // **** ADD LIQUIDITY **** - function _addLiquidity( - address tokenA, - address tokenB, - uint amountADesired, - uint amountBDesired, - uint amountAMin, - uint amountBMin - ) internal virtual returns (uint amountA, uint amountB) { - // create the pair if it doesn't exist yet - if (IUniswapV2Factory(factory).getPair(tokenA, tokenB) == address(0)) { - IUniswapV2Factory(factory).createPair(tokenA, tokenB); - } - (uint reserveA, uint reserveB) = UniswapV2Library.getReserves(factory, tokenA, tokenB); - if (reserveA == 0 && reserveB == 0) { - (amountA, amountB) = (amountADesired, amountBDesired); - } else { - uint amountBOptimal = UniswapV2Library.quote(amountADesired, reserveA, reserveB); - if (amountBOptimal <= amountBDesired) { - require(amountBOptimal >= amountBMin, 'UniswapV2Router: INSUFFICIENT_B_AMOUNT'); - (amountA, amountB) = (amountADesired, amountBOptimal); - } else { - uint amountAOptimal = UniswapV2Library.quote(amountBDesired, reserveB, reserveA); - assert(amountAOptimal <= amountADesired); - require(amountAOptimal >= amountAMin, 'UniswapV2Router: INSUFFICIENT_A_AMOUNT'); - (amountA, amountB) = (amountAOptimal, amountBDesired); - } - } - } - function addLiquidity( - address tokenA, - address tokenB, - uint amountADesired, - uint amountBDesired, - uint amountAMin, - uint amountBMin, - address to, - uint deadline - ) external virtual override ensure(deadline) returns (uint amountA, uint amountB, uint liquidity) { - (amountA, amountB) = _addLiquidity(tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin); - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - TransferHelper.safeTransferFrom(tokenA, msg.sender, pair, amountA); - TransferHelper.safeTransferFrom(tokenB, msg.sender, pair, amountB); - liquidity = IUniswapV2Pair(pair).mint(to); - } - function addLiquidityETH( - address token, - uint amountTokenDesired, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) external virtual override payable ensure(deadline) returns (uint amountToken, uint amountETH, uint liquidity) { - (amountToken, amountETH) = _addLiquidity( - token, - WETH, - amountTokenDesired, - msg.value, - amountTokenMin, - amountETHMin - ); - address pair = UniswapV2Library.pairFor(factory, token, WETH); - TransferHelper.safeTransferFrom(token, msg.sender, pair, amountToken); - IWETH(WETH).deposit{value: amountETH}(); - assert(IWETH(WETH).transfer(pair, amountETH)); - liquidity = IUniswapV2Pair(pair).mint(to); - // refund dust eth, if any - if (msg.value > amountETH) TransferHelper.safeTransferETH(msg.sender, msg.value - amountETH); - } - - // **** REMOVE LIQUIDITY **** - function removeLiquidity( - address tokenA, - address tokenB, - uint liquidity, - uint amountAMin, - uint amountBMin, - address to, - uint deadline - ) public virtual override ensure(deadline) returns (uint amountA, uint amountB) { - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - IUniswapV2Pair(pair).transferFrom(msg.sender, pair, liquidity); // send liquidity to pair - (uint amount0, uint amount1) = IUniswapV2Pair(pair).burn(to); - (address token0,) = UniswapV2Library.sortTokens(tokenA, tokenB); - (amountA, amountB) = tokenA == token0 ? (amount0, amount1) : (amount1, amount0); - require(amountA >= amountAMin, 'UniswapV2Router: INSUFFICIENT_A_AMOUNT'); - require(amountB >= amountBMin, 'UniswapV2Router: INSUFFICIENT_B_AMOUNT'); - } - function removeLiquidityETH( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) public virtual override ensure(deadline) returns (uint amountToken, uint amountETH) { - (amountToken, amountETH) = removeLiquidity( - token, - WETH, - liquidity, - amountTokenMin, - amountETHMin, - address(this), - deadline - ); - TransferHelper.safeTransfer(token, to, amountToken); - IWETH(WETH).withdraw(amountETH); - TransferHelper.safeTransferETH(to, amountETH); - } - function removeLiquidityWithPermit( - address tokenA, - address tokenB, - uint liquidity, - uint amountAMin, - uint amountBMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external virtual override returns (uint amountA, uint amountB) { - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - uint value = approveMax ? type(uint).max : liquidity; - IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); - (amountA, amountB) = removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline); - } - function removeLiquidityETHWithPermit( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external virtual override returns (uint amountToken, uint amountETH) { - address pair = UniswapV2Library.pairFor(factory, token, WETH); - uint value = approveMax ? type(uint).max : liquidity; - IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); - (amountToken, amountETH) = removeLiquidityETH(token, liquidity, amountTokenMin, amountETHMin, to, deadline); - } - - // **** REMOVE LIQUIDITY (supporting fee-on-transfer tokens) **** - function removeLiquidityETHSupportingFeeOnTransferTokens( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) public virtual override ensure(deadline) returns (uint amountETH) { - (, amountETH) = removeLiquidity( - token, - WETH, - liquidity, - amountTokenMin, - amountETHMin, - address(this), - deadline - ); - TransferHelper.safeTransfer(token, to, IERC20(token).balanceOf(address(this))); - IWETH(WETH).withdraw(amountETH); - TransferHelper.safeTransferETH(to, amountETH); - } - function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external virtual override returns (uint amountETH) { - address pair = UniswapV2Library.pairFor(factory, token, WETH); - uint value = approveMax ? type(uint).max : liquidity; - IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); - amountETH = removeLiquidityETHSupportingFeeOnTransferTokens( - token, liquidity, amountTokenMin, amountETHMin, to, deadline - ); - } - - // **** SWAP **** - // requires the initial amount to have already been sent to the first pair - function _swap(uint[] memory amounts, address[] memory path, address _to) internal virtual { - for (uint i; i < path.length - 1; i++) { - (address input, address output) = (path[i], path[i + 1]); - (address token0,) = UniswapV2Library.sortTokens(input, output); - uint amountOut = amounts[i + 1]; - (uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOut) : (amountOut, uint(0)); - address to = i < path.length - 2 ? UniswapV2Library.pairFor(factory, output, path[i + 2]) : _to; - IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output)).swap( - amount0Out, amount1Out, to, new bytes(0) - ); - } - } - function swapExactTokensForTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external virtual override ensure(deadline) returns (uint[] memory amounts) { - amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path); - require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - TransferHelper.safeTransferFrom( - path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0] - ); - _swap(amounts, path, to); - } - function swapTokensForExactTokens( - uint amountOut, - uint amountInMax, - address[] calldata path, - address to, - uint deadline - ) external virtual override ensure(deadline) returns (uint[] memory amounts) { - amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); - require(amounts[0] <= amountInMax, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'); - TransferHelper.safeTransferFrom( - path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0] - ); - _swap(amounts, path, to); - } - function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) - external - virtual - override - payable - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsOut(factory, msg.value, path); - require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - IWETH(WETH).deposit{value: amounts[0]}(); - assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0])); - _swap(amounts, path, to); - } - function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) - external - virtual - override - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); - require(amounts[0] <= amountInMax, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'); - TransferHelper.safeTransferFrom( - path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0] - ); - _swap(amounts, path, address(this)); - IWETH(WETH).withdraw(amounts[amounts.length - 1]); - TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]); - } - function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) - external - virtual - override - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path); - require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - TransferHelper.safeTransferFrom( - path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0] - ); - _swap(amounts, path, address(this)); - IWETH(WETH).withdraw(amounts[amounts.length - 1]); - TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]); - } - function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) - external - virtual - override - payable - ensure(deadline) - returns (uint[] memory amounts) - { - require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH'); - amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); - require(amounts[0] <= msg.value, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'); - IWETH(WETH).deposit{value: amounts[0]}(); - assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0])); - _swap(amounts, path, to); - // refund dust eth, if any - if (msg.value > amounts[0]) TransferHelper.safeTransferETH(msg.sender, msg.value - amounts[0]); - } - - // **** SWAP (supporting fee-on-transfer tokens) **** - // requires the initial amount to have already been sent to the first pair - function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual { - for (uint i; i < path.length - 1; i++) { - (address input, address output) = (path[i], path[i + 1]); - (address token0,) = UniswapV2Library.sortTokens(input, output); - IUniswapV2Pair pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output)); - uint amountInput; - uint amountOutput; - { // scope to avoid stack too deep errors - (uint reserve0, uint reserve1,) = pair.getReserves(); - (uint reserveInput, uint reserveOutput) = input == token0 ? (reserve0, reserve1) : (reserve1, reserve0); - amountInput = IERC20(input).balanceOf(address(pair)).sub(reserveInput); - amountOutput = UniswapV2Library.getAmountOut(amountInput, reserveInput, reserveOutput); - } - (uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOutput) : (amountOutput, uint(0)); - address to = i < path.length - 2 ? UniswapV2Library.pairFor(factory, output, path[i + 2]) : _to; - pair.swap(amount0Out, amount1Out, to, new bytes(0)); - } - } - function swapExactTokensForTokensSupportingFeeOnTransferTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external virtual override ensure(deadline) { - TransferHelper.safeTransferFrom( - path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn - ); - uint balanceBefore = IERC20(path[path.length - 1]).balanceOf(to); - _swapSupportingFeeOnTransferTokens(path, to); - require( - IERC20(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin, - 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT' - ); - } - function swapExactETHForTokensSupportingFeeOnTransferTokens( - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) - external - virtual - override - payable - ensure(deadline) - { - require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH'); - uint amountIn = msg.value; - IWETH(WETH).deposit{value: amountIn}(); - assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn)); - uint balanceBefore = IERC20(path[path.length - 1]).balanceOf(to); - _swapSupportingFeeOnTransferTokens(path, to); - require( - IERC20(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin, - 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT' - ); - } - function swapExactTokensForETHSupportingFeeOnTransferTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) - external - virtual - override - ensure(deadline) - { - require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH'); - TransferHelper.safeTransferFrom( - path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn - ); - _swapSupportingFeeOnTransferTokens(path, address(this)); - uint amountOut = IERC20(WETH).balanceOf(address(this)); - require(amountOut >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'); - IWETH(WETH).withdraw(amountOut); - TransferHelper.safeTransferETH(to, amountOut); - } - - // **** LIBRARY FUNCTIONS **** - function quote(uint amountA, uint reserveA, uint reserveB) public pure virtual override returns (uint amountB) { - return UniswapV2Library.quote(amountA, reserveA, reserveB); - } - - function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) - public - pure - virtual - override - returns (uint amountOut) - { - return UniswapV2Library.getAmountOut(amountIn, reserveIn, reserveOut); - } - - function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) - public - pure - virtual - override - returns (uint amountIn) - { - return UniswapV2Library.getAmountIn(amountOut, reserveIn, reserveOut); - } - - function getAmountsOut(uint amountIn, address[] memory path) - public - view - virtual - override - returns (uint[] memory amounts) - { - return UniswapV2Library.getAmountsOut(factory, amountIn, path); - } - - function getAmountsIn(uint amountOut, address[] memory path) - public - view - virtual - override - returns (uint[] memory amounts) - { - return UniswapV2Library.getAmountsIn(factory, amountOut, path); - } -} diff --git a/lib/uniswap-v2-periphery/contracts/examples/ExampleComputeLiquidityValue.sol b/lib/uniswap-v2-periphery/contracts/examples/ExampleComputeLiquidityValue.sol deleted file mode 100644 index bda37f721..000000000 --- a/lib/uniswap-v2-periphery/contracts/examples/ExampleComputeLiquidityValue.sol +++ /dev/null @@ -1,90 +0,0 @@ -pragma solidity =0.6.6; - -import '../libraries/UniswapV2LiquidityMathLibrary.sol'; - -contract ExampleComputeLiquidityValue { - using SafeMath for uint256; - - address public immutable factory; - - constructor(address factory_) public { - factory = factory_; - } - - // see UniswapV2LiquidityMathLibrary#getReservesAfterArbitrage - function getReservesAfterArbitrage( - address tokenA, - address tokenB, - uint256 truePriceTokenA, - uint256 truePriceTokenB - ) external view returns (uint256 reserveA, uint256 reserveB) { - return UniswapV2LiquidityMathLibrary.getReservesAfterArbitrage( - factory, - tokenA, - tokenB, - truePriceTokenA, - truePriceTokenB - ); - } - - // see UniswapV2LiquidityMathLibrary#getLiquidityValue - function getLiquidityValue( - address tokenA, - address tokenB, - uint256 liquidityAmount - ) external view returns ( - uint256 tokenAAmount, - uint256 tokenBAmount - ) { - return UniswapV2LiquidityMathLibrary.getLiquidityValue( - factory, - tokenA, - tokenB, - liquidityAmount - ); - } - - // see UniswapV2LiquidityMathLibrary#getLiquidityValueAfterArbitrageToPrice - function getLiquidityValueAfterArbitrageToPrice( - address tokenA, - address tokenB, - uint256 truePriceTokenA, - uint256 truePriceTokenB, - uint256 liquidityAmount - ) external view returns ( - uint256 tokenAAmount, - uint256 tokenBAmount - ) { - return UniswapV2LiquidityMathLibrary.getLiquidityValueAfterArbitrageToPrice( - factory, - tokenA, - tokenB, - truePriceTokenA, - truePriceTokenB, - liquidityAmount - ); - } - - // test function to measure the gas cost of the above function - function getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - address tokenA, - address tokenB, - uint256 truePriceTokenA, - uint256 truePriceTokenB, - uint256 liquidityAmount - ) external view returns ( - uint256 - ) { - uint gasBefore = gasleft(); - UniswapV2LiquidityMathLibrary.getLiquidityValueAfterArbitrageToPrice( - factory, - tokenA, - tokenB, - truePriceTokenA, - truePriceTokenB, - liquidityAmount - ); - uint gasAfter = gasleft(); - return gasBefore - gasAfter; - } -} diff --git a/lib/uniswap-v2-periphery/contracts/examples/ExampleFlashSwap.sol b/lib/uniswap-v2-periphery/contracts/examples/ExampleFlashSwap.sol deleted file mode 100644 index 17b278162..000000000 --- a/lib/uniswap-v2-periphery/contracts/examples/ExampleFlashSwap.sol +++ /dev/null @@ -1,67 +0,0 @@ -pragma solidity =0.6.6; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Callee.sol'; - -import '../libraries/UniswapV2Library.sol'; -import '../interfaces/V1/IUniswapV1Factory.sol'; -import '../interfaces/V1/IUniswapV1Exchange.sol'; -import '../interfaces/IUniswapV2Router01.sol'; -import '../interfaces/IERC20.sol'; -import '../interfaces/IWETH.sol'; - -contract ExampleFlashSwap is IUniswapV2Callee { - IUniswapV1Factory immutable factoryV1; - address immutable factory; - IWETH immutable WETH; - - constructor(address _factory, address _factoryV1, address router) public { - factoryV1 = IUniswapV1Factory(_factoryV1); - factory = _factory; - WETH = IWETH(IUniswapV2Router01(router).WETH()); - } - - // needs to accept ETH from any V1 exchange and WETH. ideally this could be enforced, as in the router, - // but it's not possible because it requires a call to the v1 factory, which takes too much gas - receive() external payable {} - - // gets tokens/WETH via a V2 flash swap, swaps for the ETH/tokens on V1, repays V2, and keeps the rest! - function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external override { - address[] memory path = new address[](2); - uint amountToken; - uint amountETH; - { // scope for token{0,1}, avoids stack too deep errors - address token0 = IUniswapV2Pair(msg.sender).token0(); - address token1 = IUniswapV2Pair(msg.sender).token1(); - assert(msg.sender == UniswapV2Library.pairFor(factory, token0, token1)); // ensure that msg.sender is actually a V2 pair - assert(amount0 == 0 || amount1 == 0); // this strategy is unidirectional - path[0] = amount0 == 0 ? token0 : token1; - path[1] = amount0 == 0 ? token1 : token0; - amountToken = token0 == address(WETH) ? amount1 : amount0; - amountETH = token0 == address(WETH) ? amount0 : amount1; - } - - assert(path[0] == address(WETH) || path[1] == address(WETH)); // this strategy only works with a V2 WETH pair - IERC20 token = IERC20(path[0] == address(WETH) ? path[1] : path[0]); - IUniswapV1Exchange exchangeV1 = IUniswapV1Exchange(factoryV1.getExchange(address(token))); // get V1 exchange - - if (amountToken > 0) { - (uint minETH) = abi.decode(data, (uint)); // slippage parameter for V1, passed in by caller - token.approve(address(exchangeV1), amountToken); - uint amountReceived = exchangeV1.tokenToEthSwapInput(amountToken, minETH, uint(-1)); - uint amountRequired = UniswapV2Library.getAmountsIn(factory, amountToken, path)[0]; - assert(amountReceived > amountRequired); // fail if we didn't get enough ETH back to repay our flash loan - WETH.deposit{value: amountRequired}(); - assert(WETH.transfer(msg.sender, amountRequired)); // return WETH to V2 pair - (bool success,) = sender.call{value: amountReceived - amountRequired}(new bytes(0)); // keep the rest! (ETH) - assert(success); - } else { - (uint minTokens) = abi.decode(data, (uint)); // slippage parameter for V1, passed in by caller - WETH.withdraw(amountETH); - uint amountReceived = exchangeV1.ethToTokenSwapInput{value: amountETH}(minTokens, uint(-1)); - uint amountRequired = UniswapV2Library.getAmountsIn(factory, amountETH, path)[0]; - assert(amountReceived > amountRequired); // fail if we didn't get enough tokens back to repay our flash loan - assert(token.transfer(msg.sender, amountRequired)); // return tokens to V2 pair - assert(token.transfer(sender, amountReceived - amountRequired)); // keep the rest! (tokens) - } - } -} diff --git a/lib/uniswap-v2-periphery/contracts/examples/ExampleOracleSimple.sol b/lib/uniswap-v2-periphery/contracts/examples/ExampleOracleSimple.sol deleted file mode 100644 index 6ab916fa6..000000000 --- a/lib/uniswap-v2-periphery/contracts/examples/ExampleOracleSimple.sol +++ /dev/null @@ -1,67 +0,0 @@ -pragma solidity =0.6.6; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol'; -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; -import '@uniswap/lib/contracts/libraries/FixedPoint.sol'; - -import '../libraries/UniswapV2OracleLibrary.sol'; -import '../libraries/UniswapV2Library.sol'; - -// fixed window oracle that recomputes the average price for the entire period once every period -// note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period -contract ExampleOracleSimple { - using FixedPoint for *; - - uint public constant PERIOD = 24 hours; - - IUniswapV2Pair immutable pair; - address public immutable token0; - address public immutable token1; - - uint public price0CumulativeLast; - uint public price1CumulativeLast; - uint32 public blockTimestampLast; - FixedPoint.uq112x112 public price0Average; - FixedPoint.uq112x112 public price1Average; - - constructor(address factory, address tokenA, address tokenB) public { - IUniswapV2Pair _pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, tokenA, tokenB)); - pair = _pair; - token0 = _pair.token0(); - token1 = _pair.token1(); - price0CumulativeLast = _pair.price0CumulativeLast(); // fetch the current accumulated price value (1 / 0) - price1CumulativeLast = _pair.price1CumulativeLast(); // fetch the current accumulated price value (0 / 1) - uint112 reserve0; - uint112 reserve1; - (reserve0, reserve1, blockTimestampLast) = _pair.getReserves(); - require(reserve0 != 0 && reserve1 != 0, 'ExampleOracleSimple: NO_RESERVES'); // ensure that there's liquidity in the pair - } - - function update() external { - (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) = - UniswapV2OracleLibrary.currentCumulativePrices(address(pair)); - uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired - - // ensure that at least one full period has passed since the last update - require(timeElapsed >= PERIOD, 'ExampleOracleSimple: PERIOD_NOT_ELAPSED'); - - // overflow is desired, casting never truncates - // cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed - price0Average = FixedPoint.uq112x112(uint224((price0Cumulative - price0CumulativeLast) / timeElapsed)); - price1Average = FixedPoint.uq112x112(uint224((price1Cumulative - price1CumulativeLast) / timeElapsed)); - - price0CumulativeLast = price0Cumulative; - price1CumulativeLast = price1Cumulative; - blockTimestampLast = blockTimestamp; - } - - // note this will always return 0 before update has been called successfully for the first time. - function consult(address token, uint amountIn) external view returns (uint amountOut) { - if (token == token0) { - amountOut = price0Average.mul(amountIn).decode144(); - } else { - require(token == token1, 'ExampleOracleSimple: INVALID_TOKEN'); - amountOut = price1Average.mul(amountIn).decode144(); - } - } -} diff --git a/lib/uniswap-v2-periphery/contracts/examples/ExampleSlidingWindowOracle.sol b/lib/uniswap-v2-periphery/contracts/examples/ExampleSlidingWindowOracle.sol deleted file mode 100644 index 1b8af305b..000000000 --- a/lib/uniswap-v2-periphery/contracts/examples/ExampleSlidingWindowOracle.sol +++ /dev/null @@ -1,125 +0,0 @@ -pragma solidity =0.6.6; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol'; -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; -import '@uniswap/lib/contracts/libraries/FixedPoint.sol'; - -import '../libraries/SafeMath.sol'; -import '../libraries/UniswapV2Library.sol'; -import '../libraries/UniswapV2OracleLibrary.sol'; - -// sliding window oracle that uses observations collected over a window to provide moving price averages in the past -// `windowSize` with a precision of `windowSize / granularity` -// note this is a singleton oracle and only needs to be deployed once per desired parameters, which -// differs from the simple oracle which must be deployed once per pair. -contract ExampleSlidingWindowOracle { - using FixedPoint for *; - using SafeMath for uint; - - struct Observation { - uint timestamp; - uint price0Cumulative; - uint price1Cumulative; - } - - address public immutable factory; - // the desired amount of time over which the moving average should be computed, e.g. 24 hours - uint public immutable windowSize; - // the number of observations stored for each pair, i.e. how many price observations are stored for the window. - // as granularity increases from 1, more frequent updates are needed, but moving averages become more precise. - // averages are computed over intervals with sizes in the range: - // [windowSize - (windowSize / granularity) * 2, windowSize] - // e.g. if the window size is 24 hours, and the granularity is 24, the oracle will return the average price for - // the period: - // [now - [22 hours, 24 hours], now] - uint8 public immutable granularity; - // this is redundant with granularity and windowSize, but stored for gas savings & informational purposes. - uint public immutable periodSize; - - // mapping from pair address to a list of price observations of that pair - mapping(address => Observation[]) public pairObservations; - - constructor(address factory_, uint windowSize_, uint8 granularity_) public { - require(granularity_ > 1, 'SlidingWindowOracle: GRANULARITY'); - require( - (periodSize = windowSize_ / granularity_) * granularity_ == windowSize_, - 'SlidingWindowOracle: WINDOW_NOT_EVENLY_DIVISIBLE' - ); - factory = factory_; - windowSize = windowSize_; - granularity = granularity_; - } - - // returns the index of the observation corresponding to the given timestamp - function observationIndexOf(uint timestamp) public view returns (uint8 index) { - uint epochPeriod = timestamp / periodSize; - return uint8(epochPeriod % granularity); - } - - // returns the observation from the oldest epoch (at the beginning of the window) relative to the current time - function getFirstObservationInWindow(address pair) private view returns (Observation storage firstObservation) { - uint8 observationIndex = observationIndexOf(block.timestamp); - // no overflow issue. if observationIndex + 1 overflows, result is still zero. - uint8 firstObservationIndex = (observationIndex + 1) % granularity; - firstObservation = pairObservations[pair][firstObservationIndex]; - } - - // update the cumulative price for the observation at the current timestamp. each observation is updated at most - // once per epoch period. - function update(address tokenA, address tokenB) external { - address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); - - // populate the array with empty observations (first call only) - for (uint i = pairObservations[pair].length; i < granularity; i++) { - pairObservations[pair].push(); - } - - // get the observation for the current period - uint8 observationIndex = observationIndexOf(block.timestamp); - Observation storage observation = pairObservations[pair][observationIndex]; - - // we only want to commit updates once per period (i.e. windowSize / granularity) - uint timeElapsed = block.timestamp - observation.timestamp; - if (timeElapsed > periodSize) { - (uint price0Cumulative, uint price1Cumulative,) = UniswapV2OracleLibrary.currentCumulativePrices(pair); - observation.timestamp = block.timestamp; - observation.price0Cumulative = price0Cumulative; - observation.price1Cumulative = price1Cumulative; - } - } - - // given the cumulative prices of the start and end of a period, and the length of the period, compute the average - // price in terms of how much amount out is received for the amount in - function computeAmountOut( - uint priceCumulativeStart, uint priceCumulativeEnd, - uint timeElapsed, uint amountIn - ) private pure returns (uint amountOut) { - // overflow is desired. - FixedPoint.uq112x112 memory priceAverage = FixedPoint.uq112x112( - uint224((priceCumulativeEnd - priceCumulativeStart) / timeElapsed) - ); - amountOut = priceAverage.mul(amountIn).decode144(); - } - - // returns the amount out corresponding to the amount in for a given token using the moving average over the time - // range [now - [windowSize, windowSize - periodSize * 2], now] - // update must have been called for the bucket corresponding to timestamp `now - windowSize` - function consult(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut) { - address pair = UniswapV2Library.pairFor(factory, tokenIn, tokenOut); - Observation storage firstObservation = getFirstObservationInWindow(pair); - - uint timeElapsed = block.timestamp - firstObservation.timestamp; - require(timeElapsed <= windowSize, 'SlidingWindowOracle: MISSING_HISTORICAL_OBSERVATION'); - // should never happen. - require(timeElapsed >= windowSize - periodSize * 2, 'SlidingWindowOracle: UNEXPECTED_TIME_ELAPSED'); - - (uint price0Cumulative, uint price1Cumulative,) = UniswapV2OracleLibrary.currentCumulativePrices(pair); - (address token0,) = UniswapV2Library.sortTokens(tokenIn, tokenOut); - - if (token0 == tokenIn) { - return computeAmountOut(firstObservation.price0Cumulative, price0Cumulative, timeElapsed, amountIn); - } else { - return computeAmountOut(firstObservation.price1Cumulative, price1Cumulative, timeElapsed, amountIn); - } - } -} diff --git a/lib/uniswap-v2-periphery/contracts/examples/ExampleSwapToPrice.sol b/lib/uniswap-v2-periphery/contracts/examples/ExampleSwapToPrice.sol deleted file mode 100644 index e0f7eef6a..000000000 --- a/lib/uniswap-v2-periphery/contracts/examples/ExampleSwapToPrice.sol +++ /dev/null @@ -1,77 +0,0 @@ -pragma solidity =0.6.6; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; -import '@uniswap/lib/contracts/libraries/Babylonian.sol'; -import '@uniswap/lib/contracts/libraries/TransferHelper.sol'; - -import '../libraries/UniswapV2LiquidityMathLibrary.sol'; -import '../interfaces/IERC20.sol'; -import '../interfaces/IUniswapV2Router01.sol'; -import '../libraries/SafeMath.sol'; -import '../libraries/UniswapV2Library.sol'; - -contract ExampleSwapToPrice { - using SafeMath for uint256; - - IUniswapV2Router01 public immutable router; - address public immutable factory; - - constructor(address factory_, IUniswapV2Router01 router_) public { - factory = factory_; - router = router_; - } - - // swaps an amount of either token such that the trade is profit-maximizing, given an external true price - // true price is expressed in the ratio of token A to token B - // caller must approve this contract to spend whichever token is intended to be swapped - function swapToPrice( - address tokenA, - address tokenB, - uint256 truePriceTokenA, - uint256 truePriceTokenB, - uint256 maxSpendTokenA, - uint256 maxSpendTokenB, - address to, - uint256 deadline - ) public { - // true price is expressed as a ratio, so both values must be non-zero - require(truePriceTokenA != 0 && truePriceTokenB != 0, "ExampleSwapToPrice: ZERO_PRICE"); - // caller can specify 0 for either if they wish to swap in only one direction, but not both - require(maxSpendTokenA != 0 || maxSpendTokenB != 0, "ExampleSwapToPrice: ZERO_SPEND"); - - bool aToB; - uint256 amountIn; - { - (uint256 reserveA, uint256 reserveB) = UniswapV2Library.getReserves(factory, tokenA, tokenB); - (aToB, amountIn) = UniswapV2LiquidityMathLibrary.computeProfitMaximizingTrade( - truePriceTokenA, truePriceTokenB, - reserveA, reserveB - ); - } - - require(amountIn > 0, 'ExampleSwapToPrice: ZERO_AMOUNT_IN'); - - // spend up to the allowance of the token in - uint256 maxSpend = aToB ? maxSpendTokenA : maxSpendTokenB; - if (amountIn > maxSpend) { - amountIn = maxSpend; - } - - address tokenIn = aToB ? tokenA : tokenB; - address tokenOut = aToB ? tokenB : tokenA; - TransferHelper.safeTransferFrom(tokenIn, msg.sender, address(this), amountIn); - TransferHelper.safeApprove(tokenIn, address(router), amountIn); - - address[] memory path = new address[](2); - path[0] = tokenIn; - path[1] = tokenOut; - - router.swapExactTokensForTokens( - amountIn, - 0, // amountOutMin: we can skip computing this number because the math is tested - path, - to, - deadline - ); - } -} diff --git a/lib/uniswap-v2-periphery/contracts/examples/README.md b/lib/uniswap-v2-periphery/contracts/examples/README.md deleted file mode 100644 index 49fa2af2f..000000000 --- a/lib/uniswap-v2-periphery/contracts/examples/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Examples - -## Disclaimer - -These contracts are for demonstrative purposes only. -While these contracts have unit tests, and we generally expect them to be -correct, there are no guarantees about the correctness or security of -these contracts. We hold these contracts to a different standard of -correctness and security than other contracts in this repository. -E.g., we have explicitly excluded these contracts from the -[bug bounty](https://uniswap.org/bug-bounty/#scope). - -You must do your own due diligence if you wish to use code -from these examples in your project. diff --git a/lib/uniswap-v2-periphery/contracts/interfaces/IERC20.sol b/lib/uniswap-v2-periphery/contracts/interfaces/IERC20.sol deleted file mode 100644 index c1e8c3e65..000000000 --- a/lib/uniswap-v2-periphery/contracts/interfaces/IERC20.sol +++ /dev/null @@ -1,17 +0,0 @@ -pragma solidity >=0.5.0; - -interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint value); - event Transfer(address indexed from, address indexed to, uint value); - - function name() external view returns (string memory); - function symbol() external view returns (string memory); - function decimals() external view returns (uint8); - function totalSupply() external view returns (uint); - function balanceOf(address owner) external view returns (uint); - function allowance(address owner, address spender) external view returns (uint); - - function approve(address spender, uint value) external returns (bool); - function transfer(address to, uint value) external returns (bool); - function transferFrom(address from, address to, uint value) external returns (bool); -} diff --git a/lib/uniswap-v2-periphery/contracts/interfaces/IUniswapV2Migrator.sol b/lib/uniswap-v2-periphery/contracts/interfaces/IUniswapV2Migrator.sol deleted file mode 100644 index 723e3487c..000000000 --- a/lib/uniswap-v2-periphery/contracts/interfaces/IUniswapV2Migrator.sol +++ /dev/null @@ -1,5 +0,0 @@ -pragma solidity >=0.5.0; - -interface IUniswapV2Migrator { - function migrate(address token, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external; -} diff --git a/lib/uniswap-v2-periphery/contracts/interfaces/IUniswapV2Router01.sol b/lib/uniswap-v2-periphery/contracts/interfaces/IUniswapV2Router01.sol deleted file mode 100644 index e584b8c60..000000000 --- a/lib/uniswap-v2-periphery/contracts/interfaces/IUniswapV2Router01.sol +++ /dev/null @@ -1,95 +0,0 @@ -pragma solidity >=0.6.2; - -interface IUniswapV2Router01 { - function factory() external view returns (address); - function WETH() external view returns (address); - - function addLiquidity( - address tokenA, - address tokenB, - uint amountADesired, - uint amountBDesired, - uint amountAMin, - uint amountBMin, - address to, - uint deadline - ) external returns (uint amountA, uint amountB, uint liquidity); - function addLiquidityETH( - address token, - uint amountTokenDesired, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) external payable returns (uint amountToken, uint amountETH, uint liquidity); - function removeLiquidity( - address tokenA, - address tokenB, - uint liquidity, - uint amountAMin, - uint amountBMin, - address to, - uint deadline - ) external returns (uint amountA, uint amountB); - function removeLiquidityETH( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) external returns (uint amountToken, uint amountETH); - function removeLiquidityWithPermit( - address tokenA, - address tokenB, - uint liquidity, - uint amountAMin, - uint amountBMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external returns (uint amountA, uint amountB); - function removeLiquidityETHWithPermit( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external returns (uint amountToken, uint amountETH); - function swapExactTokensForTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external returns (uint[] memory amounts); - function swapTokensForExactTokens( - uint amountOut, - uint amountInMax, - address[] calldata path, - address to, - uint deadline - ) external returns (uint[] memory amounts); - function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) - external - payable - returns (uint[] memory amounts); - function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) - external - returns (uint[] memory amounts); - function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) - external - returns (uint[] memory amounts); - function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) - external - payable - returns (uint[] memory amounts); - - function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); - function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); - function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); - function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); - function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); -} diff --git a/lib/uniswap-v2-periphery/contracts/interfaces/IUniswapV2Router02.sol b/lib/uniswap-v2-periphery/contracts/interfaces/IUniswapV2Router02.sol deleted file mode 100644 index 1fc7b0af0..000000000 --- a/lib/uniswap-v2-periphery/contracts/interfaces/IUniswapV2Router02.sol +++ /dev/null @@ -1,44 +0,0 @@ -pragma solidity >=0.6.2; - -import './IUniswapV2Router01.sol'; - -interface IUniswapV2Router02 is IUniswapV2Router01 { - function removeLiquidityETHSupportingFeeOnTransferTokens( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline - ) external returns (uint amountETH); - function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( - address token, - uint liquidity, - uint amountTokenMin, - uint amountETHMin, - address to, - uint deadline, - bool approveMax, uint8 v, bytes32 r, bytes32 s - ) external returns (uint amountETH); - - function swapExactTokensForTokensSupportingFeeOnTransferTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external; - function swapExactETHForTokensSupportingFeeOnTransferTokens( - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external payable; - function swapExactTokensForETHSupportingFeeOnTransferTokens( - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external; -} diff --git a/lib/uniswap-v2-periphery/contracts/interfaces/IWETH.sol b/lib/uniswap-v2-periphery/contracts/interfaces/IWETH.sol deleted file mode 100644 index e05fb770e..000000000 --- a/lib/uniswap-v2-periphery/contracts/interfaces/IWETH.sol +++ /dev/null @@ -1,7 +0,0 @@ -pragma solidity >=0.5.0; - -interface IWETH { - function deposit() external payable; - function transfer(address to, uint value) external returns (bool); - function withdraw(uint) external; -} diff --git a/lib/uniswap-v2-periphery/contracts/interfaces/V1/IUniswapV1Exchange.sol b/lib/uniswap-v2-periphery/contracts/interfaces/V1/IUniswapV1Exchange.sol deleted file mode 100644 index 039060fbd..000000000 --- a/lib/uniswap-v2-periphery/contracts/interfaces/V1/IUniswapV1Exchange.sol +++ /dev/null @@ -1,9 +0,0 @@ -pragma solidity >=0.5.0; - -interface IUniswapV1Exchange { - function balanceOf(address owner) external view returns (uint); - function transferFrom(address from, address to, uint value) external returns (bool); - function removeLiquidity(uint, uint, uint, uint) external returns (uint, uint); - function tokenToEthSwapInput(uint, uint, uint) external returns (uint); - function ethToTokenSwapInput(uint, uint) external payable returns (uint); -} diff --git a/lib/uniswap-v2-periphery/contracts/interfaces/V1/IUniswapV1Factory.sol b/lib/uniswap-v2-periphery/contracts/interfaces/V1/IUniswapV1Factory.sol deleted file mode 100644 index 1c302fbe3..000000000 --- a/lib/uniswap-v2-periphery/contracts/interfaces/V1/IUniswapV1Factory.sol +++ /dev/null @@ -1,5 +0,0 @@ -pragma solidity >=0.5.0; - -interface IUniswapV1Factory { - function getExchange(address) external view returns (address); -} diff --git a/lib/uniswap-v2-periphery/contracts/libraries/SafeMath.sol b/lib/uniswap-v2-periphery/contracts/libraries/SafeMath.sol deleted file mode 100644 index 837f45022..000000000 --- a/lib/uniswap-v2-periphery/contracts/libraries/SafeMath.sol +++ /dev/null @@ -1,17 +0,0 @@ -pragma solidity >=0.6.6; - -// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) - -library SafeMath { - function add(uint x, uint y) internal pure returns (uint z) { - require((z = x + y) >= x, 'ds-math-add-overflow'); - } - - function sub(uint x, uint y) internal pure returns (uint z) { - require((z = x - y) <= x, 'ds-math-sub-underflow'); - } - - function mul(uint x, uint y) internal pure returns (uint z) { - require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow'); - } -} diff --git a/lib/uniswap-v2-periphery/contracts/libraries/TransferHelper.sol b/lib/uniswap-v2-periphery/contracts/libraries/TransferHelper.sol deleted file mode 100644 index a71d508c1..000000000 --- a/lib/uniswap-v2-periphery/contracts/libraries/TransferHelper.sol +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -pragma solidity >=0.6.0; - -// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false -library TransferHelper { - function safeApprove( - address token, - address to, - uint256 value - ) internal { - // bytes4(keccak256(bytes('approve(address,uint256)'))); - (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); - require( - success && (data.length == 0 || abi.decode(data, (bool))), - 'TransferHelper::safeApprove: approve failed' - ); - } - - function safeTransfer( - address token, - address to, - uint256 value - ) internal { - // bytes4(keccak256(bytes('transfer(address,uint256)'))); - (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); - require( - success && (data.length == 0 || abi.decode(data, (bool))), - 'TransferHelper::safeTransfer: transfer failed' - ); - } - - function safeTransferFrom( - address token, - address from, - address to, - uint256 value - ) internal { - // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); - (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); - require( - success && (data.length == 0 || abi.decode(data, (bool))), - 'TransferHelper::transferFrom: transferFrom failed' - ); - } - - function safeTransferETH(address to, uint256 value) internal { - (bool success, ) = to.call{value: value}(new bytes(0)); - require(success, 'TransferHelper::safeTransferETH: ETH transfer failed'); - } -} \ No newline at end of file diff --git a/lib/uniswap-v2-periphery/contracts/libraries/UniswapV2Library.sol b/lib/uniswap-v2-periphery/contracts/libraries/UniswapV2Library.sol deleted file mode 100644 index d18bfa691..000000000 --- a/lib/uniswap-v2-periphery/contracts/libraries/UniswapV2Library.sol +++ /dev/null @@ -1,81 +0,0 @@ -pragma solidity >=0.5.0; - -import {IUniswapV2Pair} from "uniswap-v2-core/interfaces/IUniswapV2Pair.sol"; -import "./SafeMath.sol"; - -library UniswapV2Library { - using SafeMath for uint; - - // returns sorted token addresses, used to handle return values from pairs sorted in this order - function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { - require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); - (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); - require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); - } - - // calculates the CREATE2 address for a pair without making any external calls - function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { - (address token0, address token1) = sortTokens(tokenA, tokenB); - pair = address(uint160(uint(keccak256(abi.encodePacked( - hex'ff', - factory, - keccak256(abi.encodePacked(token0, token1)), - hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash - ))))); - } - - // fetches and sorts the reserves for a pair - function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { - (address token0,) = sortTokens(tokenA, tokenB); - (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); - (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); - } - - // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset - function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { - require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); - require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); - amountB = amountA.mul(reserveB) / reserveA; - } - - // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset - function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { - require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); - require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); - uint amountInWithFee = amountIn.mul(997); - uint numerator = amountInWithFee.mul(reserveOut); - uint denominator = reserveIn.mul(1000).add(amountInWithFee); - amountOut = numerator / denominator; - } - - // given an output amount of an asset and pair reserves, returns a required input amount of the other asset - function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { - require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); - require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); - uint numerator = reserveIn.mul(amountOut).mul(1000); - uint denominator = reserveOut.sub(amountOut).mul(997); - amountIn = (numerator / denominator).add(1); - } - - // performs chained getAmountOut calculations on any number of pairs - function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { - require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); - amounts = new uint[](path.length); - amounts[0] = amountIn; - for (uint i; i < path.length - 1; i++) { - (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); - amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); - } - } - - // performs chained getAmountIn calculations on any number of pairs - function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { - require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); - amounts = new uint[](path.length); - amounts[amounts.length - 1] = amountOut; - for (uint i = path.length - 1; i > 0; i--) { - (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); - amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); - } - } -} diff --git a/lib/uniswap-v2-periphery/contracts/libraries/UniswapV2LiquidityMathLibrary.sol b/lib/uniswap-v2-periphery/contracts/libraries/UniswapV2LiquidityMathLibrary.sol deleted file mode 100644 index 9b4afcefe..000000000 --- a/lib/uniswap-v2-periphery/contracts/libraries/UniswapV2LiquidityMathLibrary.sol +++ /dev/null @@ -1,139 +0,0 @@ -pragma solidity >=0.5.0; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol'; -import '@uniswap/lib/contracts/libraries/Babylonian.sol'; -import '@uniswap/lib/contracts/libraries/FullMath.sol'; - -import './SafeMath.sol'; -import './UniswapV2Library.sol'; - -// library containing some math for dealing with the liquidity shares of a pair, e.g. computing their exact value -// in terms of the underlying tokens -library UniswapV2LiquidityMathLibrary { - using SafeMath for uint256; - - // computes the direction and magnitude of the profit-maximizing trade - function computeProfitMaximizingTrade( - uint256 truePriceTokenA, - uint256 truePriceTokenB, - uint256 reserveA, - uint256 reserveB - ) pure internal returns (bool aToB, uint256 amountIn) { - aToB = FullMath.mulDiv(reserveA, truePriceTokenB, reserveB) < truePriceTokenA; - - uint256 invariant = reserveA.mul(reserveB); - - uint256 leftSide = Babylonian.sqrt( - FullMath.mulDiv( - invariant.mul(1000), - aToB ? truePriceTokenA : truePriceTokenB, - (aToB ? truePriceTokenB : truePriceTokenA).mul(997) - ) - ); - uint256 rightSide = (aToB ? reserveA.mul(1000) : reserveB.mul(1000)) / 997; - - if (leftSide < rightSide) return (false, 0); - - // compute the amount that must be sent to move the price to the profit-maximizing price - amountIn = leftSide.sub(rightSide); - } - - // gets the reserves after an arbitrage moves the price to the profit-maximizing ratio given an externally observed true price - function getReservesAfterArbitrage( - address factory, - address tokenA, - address tokenB, - uint256 truePriceTokenA, - uint256 truePriceTokenB - ) view internal returns (uint256 reserveA, uint256 reserveB) { - // first get reserves before the swap - (reserveA, reserveB) = UniswapV2Library.getReserves(factory, tokenA, tokenB); - - require(reserveA > 0 && reserveB > 0, 'UniswapV2ArbitrageLibrary: ZERO_PAIR_RESERVES'); - - // then compute how much to swap to arb to the true price - (bool aToB, uint256 amountIn) = computeProfitMaximizingTrade(truePriceTokenA, truePriceTokenB, reserveA, reserveB); - - if (amountIn == 0) { - return (reserveA, reserveB); - } - - // now affect the trade to the reserves - if (aToB) { - uint amountOut = UniswapV2Library.getAmountOut(amountIn, reserveA, reserveB); - reserveA += amountIn; - reserveB -= amountOut; - } else { - uint amountOut = UniswapV2Library.getAmountOut(amountIn, reserveB, reserveA); - reserveB += amountIn; - reserveA -= amountOut; - } - } - - // computes liquidity value given all the parameters of the pair - function computeLiquidityValue( - uint256 reservesA, - uint256 reservesB, - uint256 totalSupply, - uint256 liquidityAmount, - bool feeOn, - uint kLast - ) internal pure returns (uint256 tokenAAmount, uint256 tokenBAmount) { - if (feeOn && kLast > 0) { - uint rootK = Babylonian.sqrt(reservesA.mul(reservesB)); - uint rootKLast = Babylonian.sqrt(kLast); - if (rootK > rootKLast) { - uint numerator1 = totalSupply; - uint numerator2 = rootK.sub(rootKLast); - uint denominator = rootK.mul(5).add(rootKLast); - uint feeLiquidity = FullMath.mulDiv(numerator1, numerator2, denominator); - totalSupply = totalSupply.add(feeLiquidity); - } - } - return (reservesA.mul(liquidityAmount) / totalSupply, reservesB.mul(liquidityAmount) / totalSupply); - } - - // get all current parameters from the pair and compute value of a liquidity amount - // **note this is subject to manipulation, e.g. sandwich attacks**. prefer passing a manipulation resistant price to - // #getLiquidityValueAfterArbitrageToPrice - function getLiquidityValue( - address factory, - address tokenA, - address tokenB, - uint256 liquidityAmount - ) internal view returns (uint256 tokenAAmount, uint256 tokenBAmount) { - (uint256 reservesA, uint256 reservesB) = UniswapV2Library.getReserves(factory, tokenA, tokenB); - IUniswapV2Pair pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, tokenA, tokenB)); - bool feeOn = IUniswapV2Factory(factory).feeTo() != address(0); - uint kLast = feeOn ? pair.kLast() : 0; - uint totalSupply = pair.totalSupply(); - return computeLiquidityValue(reservesA, reservesB, totalSupply, liquidityAmount, feeOn, kLast); - } - - // given two tokens, tokenA and tokenB, and their "true price", i.e. the observed ratio of value of token A to token B, - // and a liquidity amount, returns the value of the liquidity in terms of tokenA and tokenB - function getLiquidityValueAfterArbitrageToPrice( - address factory, - address tokenA, - address tokenB, - uint256 truePriceTokenA, - uint256 truePriceTokenB, - uint256 liquidityAmount - ) internal view returns ( - uint256 tokenAAmount, - uint256 tokenBAmount - ) { - bool feeOn = IUniswapV2Factory(factory).feeTo() != address(0); - IUniswapV2Pair pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, tokenA, tokenB)); - uint kLast = feeOn ? pair.kLast() : 0; - uint totalSupply = pair.totalSupply(); - - // this also checks that totalSupply > 0 - require(totalSupply >= liquidityAmount && liquidityAmount > 0, 'ComputeLiquidityValue: LIQUIDITY_AMOUNT'); - - (uint reservesA, uint reservesB) = getReservesAfterArbitrage(factory, tokenA, tokenB, truePriceTokenA, truePriceTokenB); - - return computeLiquidityValue(reservesA, reservesB, totalSupply, liquidityAmount, feeOn, kLast); - } -} diff --git a/lib/uniswap-v2-periphery/contracts/libraries/UniswapV2OracleLibrary.sol b/lib/uniswap-v2-periphery/contracts/libraries/UniswapV2OracleLibrary.sol deleted file mode 100644 index 4cff017f9..000000000 --- a/lib/uniswap-v2-periphery/contracts/libraries/UniswapV2OracleLibrary.sol +++ /dev/null @@ -1,35 +0,0 @@ -pragma solidity >=0.5.0; - -import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; -import '@uniswap/lib/contracts/libraries/FixedPoint.sol'; - -// library with helper methods for oracles that are concerned with computing average prices -library UniswapV2OracleLibrary { - using FixedPoint for *; - - // helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1] - function currentBlockTimestamp() internal view returns (uint32) { - return uint32(block.timestamp % 2 ** 32); - } - - // produces the cumulative price using counterfactuals to save gas and avoid a call to sync. - function currentCumulativePrices( - address pair - ) internal view returns (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) { - blockTimestamp = currentBlockTimestamp(); - price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast(); - price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast(); - - // if time has elapsed since the last update on the pair, mock the accumulated price values - (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves(); - if (blockTimestampLast != blockTimestamp) { - // subtraction overflow is desired - uint32 timeElapsed = blockTimestamp - blockTimestampLast; - // addition overflow is desired - // counterfactual - price0Cumulative += uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed; - // counterfactual - price1Cumulative += uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed; - } - } -} diff --git a/lib/uniswap-v2-periphery/contracts/test/DeflatingERC20.sol b/lib/uniswap-v2-periphery/contracts/test/DeflatingERC20.sol deleted file mode 100644 index 4bb6ed28a..000000000 --- a/lib/uniswap-v2-periphery/contracts/test/DeflatingERC20.sol +++ /dev/null @@ -1,97 +0,0 @@ -pragma solidity =0.6.6; - -import '../libraries/SafeMath.sol'; - -contract DeflatingERC20 { - using SafeMath for uint; - - string public constant name = 'Deflating Test Token'; - string public constant symbol = 'DTT'; - uint8 public constant decimals = 18; - uint public totalSupply; - mapping(address => uint) public balanceOf; - mapping(address => mapping(address => uint)) public allowance; - - bytes32 public DOMAIN_SEPARATOR; - // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); - bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; - mapping(address => uint) public nonces; - - event Approval(address indexed owner, address indexed spender, uint value); - event Transfer(address indexed from, address indexed to, uint value); - - constructor(uint _totalSupply) public { - uint chainId; - assembly { - chainId := chainid() - } - DOMAIN_SEPARATOR = keccak256( - abi.encode( - keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'), - keccak256(bytes(name)), - keccak256(bytes('1')), - chainId, - address(this) - ) - ); - _mint(msg.sender, _totalSupply); - } - - function _mint(address to, uint value) internal { - totalSupply = totalSupply.add(value); - balanceOf[to] = balanceOf[to].add(value); - emit Transfer(address(0), to, value); - } - - function _burn(address from, uint value) internal { - balanceOf[from] = balanceOf[from].sub(value); - totalSupply = totalSupply.sub(value); - emit Transfer(from, address(0), value); - } - - function _approve(address owner, address spender, uint value) private { - allowance[owner][spender] = value; - emit Approval(owner, spender, value); - } - - function _transfer(address from, address to, uint value) private { - uint burnAmount = value / 100; - _burn(from, burnAmount); - uint transferAmount = value.sub(burnAmount); - balanceOf[from] = balanceOf[from].sub(transferAmount); - balanceOf[to] = balanceOf[to].add(transferAmount); - emit Transfer(from, to, transferAmount); - } - - function approve(address spender, uint value) external returns (bool) { - _approve(msg.sender, spender, value); - return true; - } - - function transfer(address to, uint value) external returns (bool) { - _transfer(msg.sender, to, value); - return true; - } - - function transferFrom(address from, address to, uint value) external returns (bool) { - if (allowance[from][msg.sender] != uint(-1)) { - allowance[from][msg.sender] = allowance[from][msg.sender].sub(value); - } - _transfer(from, to, value); - return true; - } - - function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external { - require(deadline >= block.timestamp, 'EXPIRED'); - bytes32 digest = keccak256( - abi.encodePacked( - '\x19\x01', - DOMAIN_SEPARATOR, - keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)) - ) - ); - address recoveredAddress = ecrecover(digest, v, r, s); - require(recoveredAddress != address(0) && recoveredAddress == owner, 'INVALID_SIGNATURE'); - _approve(owner, spender, value); - } -} diff --git a/lib/uniswap-v2-periphery/contracts/test/ERC20.sol b/lib/uniswap-v2-periphery/contracts/test/ERC20.sol deleted file mode 100644 index b47ee3008..000000000 --- a/lib/uniswap-v2-periphery/contracts/test/ERC20.sol +++ /dev/null @@ -1,94 +0,0 @@ -pragma solidity =0.6.6; - -import '../libraries/SafeMath.sol'; - -contract ERC20 { - using SafeMath for uint; - - string public constant name = 'Test Token'; - string public constant symbol = 'TT'; - uint8 public constant decimals = 18; - uint public totalSupply; - mapping(address => uint) public balanceOf; - mapping(address => mapping(address => uint)) public allowance; - - bytes32 public DOMAIN_SEPARATOR; - // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); - bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; - mapping(address => uint) public nonces; - - event Approval(address indexed owner, address indexed spender, uint value); - event Transfer(address indexed from, address indexed to, uint value); - - constructor(uint _totalSupply) public { - uint chainId; - assembly { - chainId := chainid() - } - DOMAIN_SEPARATOR = keccak256( - abi.encode( - keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'), - keccak256(bytes(name)), - keccak256(bytes('1')), - chainId, - address(this) - ) - ); - _mint(msg.sender, _totalSupply); - } - - function _mint(address to, uint value) internal { - totalSupply = totalSupply.add(value); - balanceOf[to] = balanceOf[to].add(value); - emit Transfer(address(0), to, value); - } - - function _burn(address from, uint value) internal { - balanceOf[from] = balanceOf[from].sub(value); - totalSupply = totalSupply.sub(value); - emit Transfer(from, address(0), value); - } - - function _approve(address owner, address spender, uint value) private { - allowance[owner][spender] = value; - emit Approval(owner, spender, value); - } - - function _transfer(address from, address to, uint value) private { - balanceOf[from] = balanceOf[from].sub(value); - balanceOf[to] = balanceOf[to].add(value); - emit Transfer(from, to, value); - } - - function approve(address spender, uint value) external returns (bool) { - _approve(msg.sender, spender, value); - return true; - } - - function transfer(address to, uint value) external returns (bool) { - _transfer(msg.sender, to, value); - return true; - } - - function transferFrom(address from, address to, uint value) external returns (bool) { - if (allowance[from][msg.sender] != uint(-1)) { - allowance[from][msg.sender] = allowance[from][msg.sender].sub(value); - } - _transfer(from, to, value); - return true; - } - - function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external { - require(deadline >= block.timestamp, 'EXPIRED'); - bytes32 digest = keccak256( - abi.encodePacked( - '\x19\x01', - DOMAIN_SEPARATOR, - keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)) - ) - ); - address recoveredAddress = ecrecover(digest, v, r, s); - require(recoveredAddress != address(0) && recoveredAddress == owner, 'INVALID_SIGNATURE'); - _approve(owner, spender, value); - } -} diff --git a/lib/uniswap-v2-periphery/contracts/test/RouterEventEmitter.sol b/lib/uniswap-v2-periphery/contracts/test/RouterEventEmitter.sol deleted file mode 100644 index 319af1264..000000000 --- a/lib/uniswap-v2-periphery/contracts/test/RouterEventEmitter.sol +++ /dev/null @@ -1,97 +0,0 @@ -pragma solidity =0.6.6; - -import '../interfaces/IUniswapV2Router01.sol'; - -contract RouterEventEmitter { - event Amounts(uint[] amounts); - - receive() external payable {} - - function swapExactTokensForTokens( - address router, - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external { - (bool success, bytes memory returnData) = router.delegatecall(abi.encodeWithSelector( - IUniswapV2Router01(router).swapExactTokensForTokens.selector, amountIn, amountOutMin, path, to, deadline - )); - assert(success); - emit Amounts(abi.decode(returnData, (uint[]))); - } - - function swapTokensForExactTokens( - address router, - uint amountOut, - uint amountInMax, - address[] calldata path, - address to, - uint deadline - ) external { - (bool success, bytes memory returnData) = router.delegatecall(abi.encodeWithSelector( - IUniswapV2Router01(router).swapTokensForExactTokens.selector, amountOut, amountInMax, path, to, deadline - )); - assert(success); - emit Amounts(abi.decode(returnData, (uint[]))); - } - - function swapExactETHForTokens( - address router, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external payable { - (bool success, bytes memory returnData) = router.delegatecall(abi.encodeWithSelector( - IUniswapV2Router01(router).swapExactETHForTokens.selector, amountOutMin, path, to, deadline - )); - assert(success); - emit Amounts(abi.decode(returnData, (uint[]))); - } - - function swapTokensForExactETH( - address router, - uint amountOut, - uint amountInMax, - address[] calldata path, - address to, - uint deadline - ) external { - (bool success, bytes memory returnData) = router.delegatecall(abi.encodeWithSelector( - IUniswapV2Router01(router).swapTokensForExactETH.selector, amountOut, amountInMax, path, to, deadline - )); - assert(success); - emit Amounts(abi.decode(returnData, (uint[]))); - } - - function swapExactTokensForETH( - address router, - uint amountIn, - uint amountOutMin, - address[] calldata path, - address to, - uint deadline - ) external { - (bool success, bytes memory returnData) = router.delegatecall(abi.encodeWithSelector( - IUniswapV2Router01(router).swapExactTokensForETH.selector, amountIn, amountOutMin, path, to, deadline - )); - assert(success); - emit Amounts(abi.decode(returnData, (uint[]))); - } - - function swapETHForExactTokens( - address router, - uint amountOut, - address[] calldata path, - address to, - uint deadline - ) external payable { - (bool success, bytes memory returnData) = router.delegatecall(abi.encodeWithSelector( - IUniswapV2Router01(router).swapETHForExactTokens.selector, amountOut, path, to, deadline - )); - assert(success); - emit Amounts(abi.decode(returnData, (uint[]))); - } -} diff --git a/lib/uniswap-v2-periphery/contracts/test/WETH9.sol b/lib/uniswap-v2-periphery/contracts/test/WETH9.sol deleted file mode 100644 index c5c4c76a8..000000000 --- a/lib/uniswap-v2-periphery/contracts/test/WETH9.sol +++ /dev/null @@ -1,756 +0,0 @@ -// Copyright (C) 2015, 2016, 2017 Dapphub - -// 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 3 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, see . - -pragma solidity =0.6.6; - -contract WETH9 { - string public name = "Wrapped Ether"; - string public symbol = "WETH"; - uint8 public decimals = 18; - - event Approval(address indexed src, address indexed guy, uint wad); - event Transfer(address indexed src, address indexed dst, uint wad); - event Deposit(address indexed dst, uint wad); - event Withdrawal(address indexed src, uint wad); - - mapping (address => uint) public balanceOf; - mapping (address => mapping (address => uint)) public allowance; - - // function() public payable { - // deposit(); - // } - function deposit() public payable { - balanceOf[msg.sender] += msg.value; - emit Deposit(msg.sender, msg.value); - } - function withdraw(uint wad) public { - require(balanceOf[msg.sender] >= wad, ""); - balanceOf[msg.sender] -= wad; - msg.sender.transfer(wad); - emit Withdrawal(msg.sender, wad); - } - - function totalSupply() public view returns (uint) { - return address(this).balance; - } - - function approve(address guy, uint wad) public returns (bool) { - allowance[msg.sender][guy] = wad; - emit Approval(msg.sender, guy, wad); - return true; - } - - function transfer(address dst, uint wad) public returns (bool) { - return transferFrom(msg.sender, dst, wad); - } - - function transferFrom(address src, address dst, uint wad) - public - returns (bool) - { - require(balanceOf[src] >= wad, ""); - - if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) { - require(allowance[src][msg.sender] >= wad, ""); - allowance[src][msg.sender] -= wad; - } - - balanceOf[src] -= wad; - balanceOf[dst] += wad; - - emit Transfer(src, dst, wad); - - return true; - } -} - - -/* - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. 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 -them 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 prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. 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. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey 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; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If 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 convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU 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 that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - 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. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -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. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - 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 -state 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 3 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, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program 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, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU 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. But first, please read -. - -*/ \ No newline at end of file diff --git a/lib/uniswap-v2-periphery/package.json b/lib/uniswap-v2-periphery/package.json deleted file mode 100644 index c5b1bff0a..000000000 --- a/lib/uniswap-v2-periphery/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "@uniswap/v2-periphery", - "version": "1.1.0-beta.0", - "description": "🎚 Peripheral smart contracts for interacting with Uniswap V2", - "engines": { - "node": ">=10" - }, - "homepage": "https://uniswap.org", - "repository": { - "type": "git", - "url": "https://github.com/Uniswap/uniswap-v2-periphery" - }, - "files": [ - "build", - "contracts" - ], - "dependencies": { - "@uniswap/lib": "4.0.1-alpha", - "@uniswap/v2-core": "1.0.0" - }, - "devDependencies": { - "@types/chai": "^4.2.6", - "@types/mocha": "^5.2.7", - "chai": "^4.2.0", - "ethereum-waffle": "^2.4.1", - "ethereumjs-util": "^6.2.0", - "mocha": "^6.2.2", - "ncp": "^2.0.0", - "prettier": "^1.19.1", - "rimraf": "^3.0.0", - "solc": "0.6.6", - "ts-node": "^8.5.4", - "typescript": "^3.7.3" - }, - "scripts": { - "lint": "yarn prettier ./test/*.ts --check", - "lint:fix": "yarn prettier ./test/*.ts --write", - "clean": "rimraf ./build/", - "copy-v1-artifacts": "ncp ./buildV1 ./build", - "precompile": "yarn clean", - "compile": "waffle .waffle.json", - "postcompile": "yarn copy-v1-artifacts", - "pretest": "yarn compile", - "test": "mocha", - "prepublishOnly": "yarn test" - }, - "license": "GPL-3.0-or-later" -} diff --git a/lib/uniswap-v2-periphery/test/ExampleComputeLiquidityValue.spec.ts b/lib/uniswap-v2-periphery/test/ExampleComputeLiquidityValue.spec.ts deleted file mode 100644 index 26ba182dc..000000000 --- a/lib/uniswap-v2-periphery/test/ExampleComputeLiquidityValue.spec.ts +++ /dev/null @@ -1,454 +0,0 @@ -import { AddressZero, MaxUint256 } from 'ethers/constants' -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { solidity, MockProvider, createFixtureLoader, deployContract } from 'ethereum-waffle' - -import { expandTo18Decimals } from './shared/utilities' -import { v2Fixture } from './shared/fixtures' - -import ExampleComputeLiquidityValue from '../build/ExampleComputeLiquidityValue.json' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -describe('ExampleComputeLiquidityValue', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let token0: Contract - let token1: Contract - let factory: Contract - let pair: Contract - let computeLiquidityValue: Contract - let router: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - token0 = fixture.token0 - token1 = fixture.token1 - pair = fixture.pair - factory = fixture.factoryV2 - router = fixture.router - computeLiquidityValue = await deployContract( - wallet, - ExampleComputeLiquidityValue, - [fixture.factoryV2.address], - overrides - ) - }) - - beforeEach('mint some liquidity for the pair at 1:100 (100 shares minted)', async () => { - await token0.transfer(pair.address, expandTo18Decimals(10)) - await token1.transfer(pair.address, expandTo18Decimals(1000)) - await pair.mint(wallet.address, overrides) - expect(await pair.totalSupply()).to.eq(expandTo18Decimals(100)) - }) - - it('correct factory address', async () => { - expect(await computeLiquidityValue.factory()).to.eq(factory.address) - }) - - describe('#getLiquidityValue', () => { - it('correct for 5 shares', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValue( - token0.address, - token1.address, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('500000000000000000') - expect(token1Amount).to.eq('50000000000000000000') - }) - it('correct for 7 shares', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValue( - token0.address, - token1.address, - expandTo18Decimals(7) - ) - expect(token0Amount).to.eq('700000000000000000') - expect(token1Amount).to.eq('70000000000000000000') - }) - - it('correct after swap', async () => { - await token0.approve(router.address, MaxUint256, overrides) - await router.swapExactTokensForTokens( - expandTo18Decimals(10), - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValue( - token0.address, - token1.address, - expandTo18Decimals(7) - ) - expect(token0Amount).to.eq('1400000000000000000') - expect(token1Amount).to.eq('35052578868302453680') - }) - - describe('fee on', () => { - beforeEach('turn on fee', async () => { - await factory.setFeeTo(wallet.address) - }) - - // this is necessary to cause kLast to be set - beforeEach('mint more liquidity to address zero', async () => { - await token0.transfer(pair.address, expandTo18Decimals(10)) - await token1.transfer(pair.address, expandTo18Decimals(1000)) - await pair.mint(AddressZero, overrides) - expect(await pair.totalSupply()).to.eq(expandTo18Decimals(200)) - }) - - it('correct after swap', async () => { - await token0.approve(router.address, MaxUint256, overrides) - await router.swapExactTokensForTokens( - expandTo18Decimals(20), - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValue( - token0.address, - token1.address, - expandTo18Decimals(7) - ) - expect(token0Amount).to.eq('1399824934325735058') - expect(token1Amount).to.eq('35048195651620807684') - }) - }) - }) - - describe('#getReservesAfterArbitrage', () => { - it('1/400', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - 1, - 400 - ) - expect(reserveA).to.eq('5007516917298542016') - expect(reserveB).to.eq('1999997739838173075192') - }) - it('1/200', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - 1, - 200 - ) - expect(reserveA).to.eq('7081698338256310291') - expect(reserveB).to.eq('1413330640570018326894') - }) - it('1/100 (same price)', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - 1, - 100 - ) - expect(reserveA).to.eq('10000000000000000000') - expect(reserveB).to.eq('1000000000000000000000') - }) - it('1/50', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - 1, - 50 - ) - expect(reserveA).to.eq('14133306405700183269') - expect(reserveB).to.eq('708169833825631029041') - }) - it('1/25', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - 1, - 25 - ) - expect(reserveA).to.eq('19999977398381730752') - expect(reserveB).to.eq('500751691729854201595') - }) - it('25/1', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - 25, - 1 - ) - expect(reserveA).to.eq('500721601459041764285') - expect(reserveB).to.eq('20030067669194168064') - }) - it('works with large numbers for the price', async () => { - const [reserveA, reserveB] = await computeLiquidityValue.getReservesAfterArbitrage( - token0.address, - token1.address, - MaxUint256.div(1000), - MaxUint256.div(1000) - ) - // diff of 30 bips - expect(reserveA).to.eq('100120248075158403008') - expect(reserveB).to.eq('100150338345970840319') - }) - }) - - describe('#getLiquidityValue', () => { - describe('fee is off', () => { - it('produces the correct value after arbing to 1:105', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 105, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('488683612488266114') // slightly less than 5% of 10, or 0.5 - expect(token1Amount).to.eq('51161327957205755422') // slightly more than 5% of 100, or 5 - }) - - it('produces the correct value after arbing to 1:95', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 95, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('512255881944227034') // slightly more than 5% of 10, or 0.5 - expect(token1Amount).to.eq('48807237571060645526') // slightly less than 5% of 100, or 5 - }) - - it('produces correct value at the current price', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 100, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('500000000000000000') - expect(token1Amount).to.eq('50000000000000000000') - }) - - it('gas current price', async () => { - expect( - await computeLiquidityValue.getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 100, - expandTo18Decimals(5) - ) - ).to.eq('12705') - }) - - it('gas higher price', async () => { - expect( - await computeLiquidityValue.getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 105, - expandTo18Decimals(5) - ) - ).to.eq('13478') - }) - - it('gas lower price', async () => { - expect( - await computeLiquidityValue.getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 95, - expandTo18Decimals(5) - ) - ).to.eq('13523') - }) - - describe('after a swap', () => { - beforeEach('swap to ~1:25', async () => { - await token0.approve(router.address, MaxUint256, overrides) - await router.swapExactTokensForTokens( - expandTo18Decimals(10), - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - const [reserve0, reserve1] = await pair.getReserves() - expect(reserve0).to.eq('20000000000000000000') - expect(reserve1).to.eq('500751126690035052579') // half plus the fee - }) - - it('is roughly 1/25th liquidity', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 25, - expandTo18Decimals(5) - ) - - expect(token0Amount).to.eq('1000000000000000000') - expect(token1Amount).to.eq('25037556334501752628') - }) - - it('shares after arbing back to 1:100', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 100, - expandTo18Decimals(5) - ) - - expect(token0Amount).to.eq('501127678536722155') - expect(token1Amount).to.eq('50037429168613534246') - }) - }) - }) - - describe('fee is on', () => { - beforeEach('turn on fee', async () => { - await factory.setFeeTo(wallet.address) - }) - - // this is necessary to cause kLast to be set - beforeEach('mint more liquidity to address zero', async () => { - await token0.transfer(pair.address, expandTo18Decimals(10)) - await token1.transfer(pair.address, expandTo18Decimals(1000)) - await pair.mint(AddressZero, overrides) - expect(await pair.totalSupply()).to.eq(expandTo18Decimals(200)) - }) - - describe('no fee to be collected', () => { - it('produces the correct value after arbing to 1:105', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 105, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('488680839243189328') // slightly less than 5% of 10, or 0.5 - expect(token1Amount).to.eq('51161037620273529068') // slightly more than 5% of 100, or 5 - }) - - it('produces the correct value after arbing to 1:95', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 95, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('512252817918759166') // slightly more than 5% of 10, or 0.5 - expect(token1Amount).to.eq('48806945633721895174') // slightly less than 5% of 100, or 5 - }) - - it('produces correct value at the current price', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 100, - expandTo18Decimals(5) - ) - expect(token0Amount).to.eq('500000000000000000') - expect(token1Amount).to.eq('50000000000000000000') - }) - }) - - it('gas current price', async () => { - expect( - await computeLiquidityValue.getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 100, - expandTo18Decimals(5) - ) - ).to.eq('16938') - }) - - it('gas higher price', async () => { - expect( - await computeLiquidityValue.getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 105, - expandTo18Decimals(5) - ) - ).to.eq('18475') - }) - - it('gas lower price', async () => { - expect( - await computeLiquidityValue.getGasCostOfGetLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 95, - expandTo18Decimals(5) - ) - ).to.eq('18406') - }) - - describe('after a swap', () => { - beforeEach('swap to ~1:25', async () => { - await token0.approve(router.address, MaxUint256, overrides) - await router.swapExactTokensForTokens( - expandTo18Decimals(20), - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - const [reserve0, reserve1] = await pair.getReserves() - expect(reserve0).to.eq('40000000000000000000') - expect(reserve1).to.eq('1001502253380070105158') // half plus the fee - }) - - it('is roughly 1:25', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 25, - expandTo18Decimals(5) - ) - - expect(token0Amount).to.eq('999874953089810756') - expect(token1Amount).to.eq('25034425465443434060') - }) - - it('shares after arbing back to 1:100', async () => { - const [token0Amount, token1Amount] = await computeLiquidityValue.getLiquidityValueAfterArbitrageToPrice( - token0.address, - token1.address, - 1, - 100, - expandTo18Decimals(5) - ) - - expect(token0Amount).to.eq('501002443792372662') - expect(token1Amount).to.eq('50024924521757597314') - }) - }) - }) - }) -}) diff --git a/lib/uniswap-v2-periphery/test/ExampleFlashSwap.spec.ts b/lib/uniswap-v2-periphery/test/ExampleFlashSwap.spec.ts deleted file mode 100644 index 8be289877..000000000 --- a/lib/uniswap-v2-periphery/test/ExampleFlashSwap.spec.ts +++ /dev/null @@ -1,153 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { MaxUint256 } from 'ethers/constants' -import { BigNumber, bigNumberify, defaultAbiCoder, formatEther } from 'ethers/utils' -import { solidity, MockProvider, createFixtureLoader, deployContract } from 'ethereum-waffle' - -import { expandTo18Decimals } from './shared/utilities' -import { v2Fixture } from './shared/fixtures' - -import ExampleFlashSwap from '../build/ExampleFlashSwap.json' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999, - gasPrice: 0 -} - -describe('ExampleFlashSwap', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let WETH: Contract - let WETHPartner: Contract - let WETHExchangeV1: Contract - let WETHPair: Contract - let flashSwapExample: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - - WETH = fixture.WETH - WETHPartner = fixture.WETHPartner - WETHExchangeV1 = fixture.WETHExchangeV1 - WETHPair = fixture.WETHPair - flashSwapExample = await deployContract( - wallet, - ExampleFlashSwap, - [fixture.factoryV2.address, fixture.factoryV1.address, fixture.router.address], - overrides - ) - }) - - it('uniswapV2Call:0', async () => { - // add liquidity to V1 at a rate of 1 ETH / 200 X - const WETHPartnerAmountV1 = expandTo18Decimals(2000) - const ETHAmountV1 = expandTo18Decimals(10) - await WETHPartner.approve(WETHExchangeV1.address, WETHPartnerAmountV1) - await WETHExchangeV1.addLiquidity(bigNumberify(1), WETHPartnerAmountV1, MaxUint256, { - ...overrides, - value: ETHAmountV1 - }) - - // add liquidity to V2 at a rate of 1 ETH / 100 X - const WETHPartnerAmountV2 = expandTo18Decimals(1000) - const ETHAmountV2 = expandTo18Decimals(10) - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmountV2) - await WETH.deposit({ value: ETHAmountV2 }) - await WETH.transfer(WETHPair.address, ETHAmountV2) - await WETHPair.mint(wallet.address, overrides) - - const balanceBefore = await WETHPartner.balanceOf(wallet.address) - - // now, execute arbitrage via uniswapV2Call: - // receive 1 ETH from V2, get as much X from V1 as we can, repay V2 with minimum X, keep the rest! - const arbitrageAmount = expandTo18Decimals(1) - // instead of being 'hard-coded', the above value could be calculated optimally off-chain. this would be - // better, but it'd be better yet to calculate the amount at runtime, on-chain. unfortunately, this requires a - // swap-to-price calculation, which is a little tricky, and out of scope for the moment - const WETHPairToken0 = await WETHPair.token0() - const amount0 = WETHPairToken0 === WETHPartner.address ? bigNumberify(0) : arbitrageAmount - const amount1 = WETHPairToken0 === WETHPartner.address ? arbitrageAmount : bigNumberify(0) - await WETHPair.swap( - amount0, - amount1, - flashSwapExample.address, - defaultAbiCoder.encode(['uint'], [bigNumberify(1)]), - overrides - ) - - const balanceAfter = await WETHPartner.balanceOf(wallet.address) - const profit = balanceAfter.sub(balanceBefore).div(expandTo18Decimals(1)) - const reservesV1 = [ - await WETHPartner.balanceOf(WETHExchangeV1.address), - await provider.getBalance(WETHExchangeV1.address) - ] - const priceV1 = reservesV1[0].div(reservesV1[1]) - const reservesV2 = (await WETHPair.getReserves()).slice(0, 2) - const priceV2 = - WETHPairToken0 === WETHPartner.address ? reservesV2[0].div(reservesV2[1]) : reservesV2[1].div(reservesV2[0]) - - expect(profit.toString()).to.eq('69') // our profit is ~69 tokens - expect(priceV1.toString()).to.eq('165') // we pushed the v1 price down to ~165 - expect(priceV2.toString()).to.eq('123') // we pushed the v2 price up to ~123 - }) - - it('uniswapV2Call:1', async () => { - // add liquidity to V1 at a rate of 1 ETH / 100 X - const WETHPartnerAmountV1 = expandTo18Decimals(1000) - const ETHAmountV1 = expandTo18Decimals(10) - await WETHPartner.approve(WETHExchangeV1.address, WETHPartnerAmountV1) - await WETHExchangeV1.addLiquidity(bigNumberify(1), WETHPartnerAmountV1, MaxUint256, { - ...overrides, - value: ETHAmountV1 - }) - - // add liquidity to V2 at a rate of 1 ETH / 200 X - const WETHPartnerAmountV2 = expandTo18Decimals(2000) - const ETHAmountV2 = expandTo18Decimals(10) - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmountV2) - await WETH.deposit({ value: ETHAmountV2 }) - await WETH.transfer(WETHPair.address, ETHAmountV2) - await WETHPair.mint(wallet.address, overrides) - - const balanceBefore = await provider.getBalance(wallet.address) - - // now, execute arbitrage via uniswapV2Call: - // receive 200 X from V2, get as much ETH from V1 as we can, repay V2 with minimum ETH, keep the rest! - const arbitrageAmount = expandTo18Decimals(200) - // instead of being 'hard-coded', the above value could be calculated optimally off-chain. this would be - // better, but it'd be better yet to calculate the amount at runtime, on-chain. unfortunately, this requires a - // swap-to-price calculation, which is a little tricky, and out of scope for the moment - const WETHPairToken0 = await WETHPair.token0() - const amount0 = WETHPairToken0 === WETHPartner.address ? arbitrageAmount : bigNumberify(0) - const amount1 = WETHPairToken0 === WETHPartner.address ? bigNumberify(0) : arbitrageAmount - await WETHPair.swap( - amount0, - amount1, - flashSwapExample.address, - defaultAbiCoder.encode(['uint'], [bigNumberify(1)]), - overrides - ) - - const balanceAfter = await provider.getBalance(wallet.address) - const profit = balanceAfter.sub(balanceBefore) - const reservesV1 = [ - await WETHPartner.balanceOf(WETHExchangeV1.address), - await provider.getBalance(WETHExchangeV1.address) - ] - const priceV1 = reservesV1[0].div(reservesV1[1]) - const reservesV2 = (await WETHPair.getReserves()).slice(0, 2) - const priceV2 = - WETHPairToken0 === WETHPartner.address ? reservesV2[0].div(reservesV2[1]) : reservesV2[1].div(reservesV2[0]) - - expect(formatEther(profit)).to.eq('0.548043441089763649') // our profit is ~.5 ETH - expect(priceV1.toString()).to.eq('143') // we pushed the v1 price up to ~143 - expect(priceV2.toString()).to.eq('161') // we pushed the v2 price down to ~161 - }) -}) diff --git a/lib/uniswap-v2-periphery/test/ExampleOracleSimple.spec.ts b/lib/uniswap-v2-periphery/test/ExampleOracleSimple.spec.ts deleted file mode 100644 index 5c1727d68..000000000 --- a/lib/uniswap-v2-periphery/test/ExampleOracleSimple.spec.ts +++ /dev/null @@ -1,70 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { BigNumber } from 'ethers/utils' -import { solidity, MockProvider, createFixtureLoader, deployContract } from 'ethereum-waffle' - -import { expandTo18Decimals, mineBlock, encodePrice } from './shared/utilities' -import { v2Fixture } from './shared/fixtures' - -import ExampleOracleSimple from '../build/ExampleOracleSimple.json' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -const token0Amount = expandTo18Decimals(5) -const token1Amount = expandTo18Decimals(10) - -describe('ExampleOracleSimple', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let token0: Contract - let token1: Contract - let pair: Contract - let exampleOracleSimple: Contract - - async function addLiquidity() { - await token0.transfer(pair.address, token0Amount) - await token1.transfer(pair.address, token1Amount) - await pair.mint(wallet.address, overrides) - } - - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - - token0 = fixture.token0 - token1 = fixture.token1 - pair = fixture.pair - await addLiquidity() - exampleOracleSimple = await deployContract( - wallet, - ExampleOracleSimple, - [fixture.factoryV2.address, token0.address, token1.address], - overrides - ) - }) - - it('update', async () => { - const blockTimestamp = (await pair.getReserves())[2] - await mineBlock(provider, blockTimestamp + 60 * 60 * 23) - await expect(exampleOracleSimple.update(overrides)).to.be.reverted - await mineBlock(provider, blockTimestamp + 60 * 60 * 24) - await exampleOracleSimple.update(overrides) - - const expectedPrice = encodePrice(token0Amount, token1Amount) - - expect(await exampleOracleSimple.price0Average()).to.eq(expectedPrice[0]) - expect(await exampleOracleSimple.price1Average()).to.eq(expectedPrice[1]) - - expect(await exampleOracleSimple.consult(token0.address, token0Amount)).to.eq(token1Amount) - expect(await exampleOracleSimple.consult(token1.address, token1Amount)).to.eq(token0Amount) - }) -}) diff --git a/lib/uniswap-v2-periphery/test/ExampleSlidingWindowOracle.spec.ts b/lib/uniswap-v2-periphery/test/ExampleSlidingWindowOracle.spec.ts deleted file mode 100644 index a5b5f65fc..000000000 --- a/lib/uniswap-v2-periphery/test/ExampleSlidingWindowOracle.spec.ts +++ /dev/null @@ -1,294 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { BigNumber, bigNumberify } from 'ethers/utils' -import { solidity, MockProvider, createFixtureLoader, deployContract } from 'ethereum-waffle' - -import { expandTo18Decimals, mineBlock, encodePrice } from './shared/utilities' -import { v2Fixture } from './shared/fixtures' - -import ExampleSlidingWindowOracle from '../build/ExampleSlidingWindowOracle.json' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -const defaultToken0Amount = expandTo18Decimals(5) -const defaultToken1Amount = expandTo18Decimals(10) - -describe('ExampleSlidingWindowOracle', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let token0: Contract - let token1: Contract - let pair: Contract - let weth: Contract - let factory: Contract - - async function addLiquidity(amount0: BigNumber = defaultToken0Amount, amount1: BigNumber = defaultToken1Amount) { - if (!amount0.isZero()) await token0.transfer(pair.address, amount0) - if (!amount1.isZero()) await token1.transfer(pair.address, amount1) - await pair.sync() - } - - const defaultWindowSize = 86400 // 24 hours - const defaultGranularity = 24 // 1 hour each - - function observationIndexOf( - timestamp: number, - windowSize: number = defaultWindowSize, - granularity: number = defaultGranularity - ): number { - const periodSize = Math.floor(windowSize / granularity) - const epochPeriod = Math.floor(timestamp / periodSize) - return epochPeriod % granularity - } - - function deployOracle(windowSize: number, granularity: number) { - return deployContract(wallet, ExampleSlidingWindowOracle, [factory.address, windowSize, granularity], overrides) - } - - beforeEach('deploy fixture', async function() { - const fixture = await loadFixture(v2Fixture) - - token0 = fixture.token0 - token1 = fixture.token1 - pair = fixture.pair - weth = fixture.WETH - factory = fixture.factoryV2 - }) - - // 1/1/2020 @ 12:00 am UTC - // cannot be 0 because that instructs ganache to set it to current timestamp - // cannot be 86400 because then timestamp 0 is a valid historical observation - const startTime = 1577836800 - - // must come before adding liquidity to pairs for correct cumulative price computations - // cannot use 0 because that resets to current timestamp - beforeEach(`set start time to ${startTime}`, () => mineBlock(provider, startTime)) - - it('requires granularity to be greater than 0', async () => { - await expect(deployOracle(defaultWindowSize, 0)).to.be.revertedWith('SlidingWindowOracle: GRANULARITY') - }) - - it('requires windowSize to be evenly divisible by granularity', async () => { - await expect(deployOracle(defaultWindowSize - 1, defaultGranularity)).to.be.revertedWith( - 'SlidingWindowOracle: WINDOW_NOT_EVENLY_DIVISIBLE' - ) - }) - - it('computes the periodSize correctly', async () => { - const oracle = await deployOracle(defaultWindowSize, defaultGranularity) - expect(await oracle.periodSize()).to.eq(3600) - const oracleOther = await deployOracle(defaultWindowSize * 2, defaultGranularity / 2) - expect(await oracleOther.periodSize()).to.eq(3600 * 4) - }) - - describe('#observationIndexOf', () => { - it('works for examples', async () => { - const oracle = await deployOracle(defaultWindowSize, defaultGranularity) - expect(await oracle.observationIndexOf(0)).to.eq(0) - expect(await oracle.observationIndexOf(3599)).to.eq(0) - expect(await oracle.observationIndexOf(3600)).to.eq(1) - expect(await oracle.observationIndexOf(4800)).to.eq(1) - expect(await oracle.observationIndexOf(7199)).to.eq(1) - expect(await oracle.observationIndexOf(7200)).to.eq(2) - expect(await oracle.observationIndexOf(86399)).to.eq(23) - expect(await oracle.observationIndexOf(86400)).to.eq(0) - expect(await oracle.observationIndexOf(90000)).to.eq(1) - }) - it('overflow safe', async () => { - const oracle = await deployOracle(25500, 255) // 100 period size - expect(await oracle.observationIndexOf(0)).to.eq(0) - expect(await oracle.observationIndexOf(99)).to.eq(0) - expect(await oracle.observationIndexOf(100)).to.eq(1) - expect(await oracle.observationIndexOf(199)).to.eq(1) - expect(await oracle.observationIndexOf(25499)).to.eq(254) // 255th element - expect(await oracle.observationIndexOf(25500)).to.eq(0) - }) - it('matches offline computation', async () => { - const oracle = await deployOracle(defaultWindowSize, defaultGranularity) - for (let timestamp of [0, 5000, 1000, 25000, 86399, 86400, 86401]) { - expect(await oracle.observationIndexOf(timestamp)).to.eq(observationIndexOf(timestamp)) - } - }) - }) - - describe('#update', () => { - let slidingWindowOracle: Contract - - beforeEach( - 'deploy oracle', - async () => (slidingWindowOracle = await deployOracle(defaultWindowSize, defaultGranularity)) - ) - - beforeEach('add default liquidity', () => addLiquidity()) - - it('succeeds', async () => { - await slidingWindowOracle.update(token0.address, token1.address, overrides) - }) - - it('sets the appropriate epoch slot', async () => { - const blockTimestamp = (await pair.getReserves())[2] - expect(blockTimestamp).to.eq(startTime) - await slidingWindowOracle.update(token0.address, token1.address, overrides) - expect(await slidingWindowOracle.pairObservations(pair.address, observationIndexOf(blockTimestamp))).to.deep.eq([ - bigNumberify(blockTimestamp), - await pair.price0CumulativeLast(), - await pair.price1CumulativeLast() - ]) - }).retries(2) // we may have slight differences between pair blockTimestamp and the expected timestamp - // because the previous block timestamp may differ from the current block timestamp by 1 second - - it('gas for first update (allocates empty array)', async () => { - const tx = await slidingWindowOracle.update(token0.address, token1.address, overrides) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq('116816') - }).retries(2) // gas test inconsistent - - it('gas for second update in the same period (skips)', async () => { - await slidingWindowOracle.update(token0.address, token1.address, overrides) - const tx = await slidingWindowOracle.update(token0.address, token1.address, overrides) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq('25574') - }).retries(2) // gas test inconsistent - - it('gas for second update different period (no allocate, no skip)', async () => { - await slidingWindowOracle.update(token0.address, token1.address, overrides) - await mineBlock(provider, startTime + 3600) - const tx = await slidingWindowOracle.update(token0.address, token1.address, overrides) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq('94703') - }).retries(2) // gas test inconsistent - - it('second update in one timeslot does not overwrite', async () => { - await slidingWindowOracle.update(token0.address, token1.address, overrides) - const before = await slidingWindowOracle.pairObservations(pair.address, observationIndexOf(0)) - // first hour still - await mineBlock(provider, startTime + 1800) - await slidingWindowOracle.update(token0.address, token1.address, overrides) - const after = await slidingWindowOracle.pairObservations(pair.address, observationIndexOf(1800)) - expect(observationIndexOf(1800)).to.eq(observationIndexOf(0)) - expect(before).to.deep.eq(after) - }) - - it('fails for invalid pair', async () => { - await expect(slidingWindowOracle.update(weth.address, token1.address)).to.be.reverted - }) - }) - - describe('#consult', () => { - let slidingWindowOracle: Contract - - beforeEach( - 'deploy oracle', - async () => (slidingWindowOracle = await deployOracle(defaultWindowSize, defaultGranularity)) - ) - - // must come after setting time to 0 for correct cumulative price computations in the pair - beforeEach('add default liquidity', () => addLiquidity()) - - it('fails if previous bucket not set', async () => { - await slidingWindowOracle.update(token0.address, token1.address, overrides) - await expect(slidingWindowOracle.consult(token0.address, 0, token1.address)).to.be.revertedWith( - 'SlidingWindowOracle: MISSING_HISTORICAL_OBSERVATION' - ) - }) - - it('fails for invalid pair', async () => { - await expect(slidingWindowOracle.consult(weth.address, 0, token1.address)).to.be.reverted - }) - - describe('happy path', () => { - let blockTimestamp: number - let previousBlockTimestamp: number - let previousCumulativePrices: any - beforeEach('add some prices', async () => { - previousBlockTimestamp = (await pair.getReserves())[2] - previousCumulativePrices = [await pair.price0CumulativeLast(), await pair.price1CumulativeLast()] - await slidingWindowOracle.update(token0.address, token1.address, overrides) - blockTimestamp = previousBlockTimestamp + 23 * 3600 - await mineBlock(provider, blockTimestamp) - await slidingWindowOracle.update(token0.address, token1.address, overrides) - }) - - it('has cumulative price in previous bucket', async () => { - expect( - await slidingWindowOracle.pairObservations(pair.address, observationIndexOf(previousBlockTimestamp)) - ).to.deep.eq([bigNumberify(previousBlockTimestamp), previousCumulativePrices[0], previousCumulativePrices[1]]) - }).retries(5) // test flaky because timestamps aren't mocked - - it('has cumulative price in current bucket', async () => { - const timeElapsed = blockTimestamp - previousBlockTimestamp - const prices = encodePrice(defaultToken0Amount, defaultToken1Amount) - expect( - await slidingWindowOracle.pairObservations(pair.address, observationIndexOf(blockTimestamp)) - ).to.deep.eq([bigNumberify(blockTimestamp), prices[0].mul(timeElapsed), prices[1].mul(timeElapsed)]) - }).retries(5) // test flaky because timestamps aren't mocked - - it('provides the current ratio in consult token0', async () => { - expect(await slidingWindowOracle.consult(token0.address, 100, token1.address)).to.eq(200) - }) - - it('provides the current ratio in consult token1', async () => { - expect(await slidingWindowOracle.consult(token1.address, 100, token0.address)).to.eq(50) - }) - }) - - describe('price changes over period', () => { - const hour = 3600 - beforeEach('add some prices', async () => { - // starting price of 1:2, or token0 = 2token1, token1 = 0.5token0 - await slidingWindowOracle.update(token0.address, token1.address, overrides) // hour 0, 1:2 - // change the price at hour 3 to 1:1 and immediately update - await mineBlock(provider, startTime + 3 * hour) - await addLiquidity(defaultToken0Amount, bigNumberify(0)) - await slidingWindowOracle.update(token0.address, token1.address, overrides) - - // change the ratios at hour 6:00 to 2:1, don't update right away - await mineBlock(provider, startTime + 6 * hour) - await token0.transfer(pair.address, defaultToken0Amount.mul(2)) - await pair.sync() - - // update at hour 9:00 (price has been 2:1 for 3 hours, invokes counterfactual) - await mineBlock(provider, startTime + 9 * hour) - await slidingWindowOracle.update(token0.address, token1.address, overrides) - // move to hour 23:00 so we can check prices - await mineBlock(provider, startTime + 23 * hour) - }) - - it('provides the correct ratio in consult token0', async () => { - // at hour 23, price of token 0 spent 3 hours at 2, 3 hours at 1, 17 hours at 0.5 so price should - // be less than 1 - expect(await slidingWindowOracle.consult(token0.address, 100, token1.address)).to.eq(76) - }) - - it('provides the correct ratio in consult token1', async () => { - // price should be greater than 1 - expect(await slidingWindowOracle.consult(token1.address, 100, token0.address)).to.eq(167) - }) - - // price has been 2:1 all of 23 hours - describe('hour 32', () => { - beforeEach('set hour 32', () => mineBlock(provider, startTime + 32 * hour)) - it('provides the correct ratio in consult token0', async () => { - // at hour 23, price of token 0 spent 3 hours at 2, 3 hours at 1, 17 hours at 0.5 so price should - // be less than 1 - expect(await slidingWindowOracle.consult(token0.address, 100, token1.address)).to.eq(50) - }) - - it('provides the correct ratio in consult token1', async () => { - // price should be greater than 1 - expect(await slidingWindowOracle.consult(token1.address, 100, token0.address)).to.eq(200) - }) - }) - }) - }) -}) diff --git a/lib/uniswap-v2-periphery/test/ExampleSwapToPrice.spec.ts b/lib/uniswap-v2-periphery/test/ExampleSwapToPrice.spec.ts deleted file mode 100644 index 51d861a23..000000000 --- a/lib/uniswap-v2-periphery/test/ExampleSwapToPrice.spec.ts +++ /dev/null @@ -1,198 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { MaxUint256 } from 'ethers/constants' -import { BigNumber, bigNumberify, defaultAbiCoder, formatEther } from 'ethers/utils' -import { solidity, MockProvider, createFixtureLoader, deployContract } from 'ethereum-waffle' - -import { expandTo18Decimals } from './shared/utilities' -import { v2Fixture } from './shared/fixtures' - -import ExampleSwapToPrice from '../build/ExampleSwapToPrice.json' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -describe('ExampleSwapToPrice', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let token0: Contract - let token1: Contract - let pair: Contract - let swapToPriceExample: Contract - let router: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - token0 = fixture.token0 - token1 = fixture.token1 - pair = fixture.pair - router = fixture.router - swapToPriceExample = await deployContract( - wallet, - ExampleSwapToPrice, - [fixture.factoryV2.address, fixture.router.address], - overrides - ) - }) - - beforeEach('set up price differential of 1:100', async () => { - await token0.transfer(pair.address, expandTo18Decimals(10)) - await token1.transfer(pair.address, expandTo18Decimals(1000)) - await pair.sync(overrides) - }) - - beforeEach('approve the swap contract to spend any amount of both tokens', async () => { - await token0.approve(swapToPriceExample.address, MaxUint256) - await token1.approve(swapToPriceExample.address, MaxUint256) - }) - - it('correct router address', async () => { - expect(await swapToPriceExample.router()).to.eq(router.address) - }) - - describe('#swapToPrice', () => { - it('requires non-zero true price inputs', async () => { - await expect( - swapToPriceExample.swapToPrice( - token0.address, - token1.address, - 0, - 0, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256 - ) - ).to.be.revertedWith('ExampleSwapToPrice: ZERO_PRICE') - await expect( - swapToPriceExample.swapToPrice( - token0.address, - token1.address, - 10, - 0, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256 - ) - ).to.be.revertedWith('ExampleSwapToPrice: ZERO_PRICE') - await expect( - swapToPriceExample.swapToPrice( - token0.address, - token1.address, - 0, - 10, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256 - ) - ).to.be.revertedWith('ExampleSwapToPrice: ZERO_PRICE') - }) - - it('requires non-zero max spend', async () => { - await expect( - swapToPriceExample.swapToPrice(token0.address, token1.address, 1, 100, 0, 0, wallet.address, MaxUint256) - ).to.be.revertedWith('ExampleSwapToPrice: ZERO_SPEND') - }) - - it('moves the price to 1:90', async () => { - await expect( - swapToPriceExample.swapToPrice( - token0.address, - token1.address, - 1, - 90, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256, - overrides - ) - ) - // (1e19 + 526682316179835569) : (1e21 - 49890467170695440744) ~= 1:90 - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, swapToPriceExample.address, '526682316179835569') - .to.emit(token0, 'Approval') - .withArgs(swapToPriceExample.address, router.address, '526682316179835569') - .to.emit(token0, 'Transfer') - .withArgs(swapToPriceExample.address, pair.address, '526682316179835569') - .to.emit(token1, 'Transfer') - .withArgs(pair.address, wallet.address, '49890467170695440744') - }) - - it('moves the price to 1:110', async () => { - await expect( - swapToPriceExample.swapToPrice( - token0.address, - token1.address, - 1, - 110, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256, - overrides - ) - ) - // (1e21 + 47376582963642643588) : (1e19 - 451039908682851138) ~= 1:110 - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, swapToPriceExample.address, '47376582963642643588') - .to.emit(token1, 'Approval') - .withArgs(swapToPriceExample.address, router.address, '47376582963642643588') - .to.emit(token1, 'Transfer') - .withArgs(swapToPriceExample.address, pair.address, '47376582963642643588') - .to.emit(token0, 'Transfer') - .withArgs(pair.address, wallet.address, '451039908682851138') - }) - - it('reverse token order', async () => { - await expect( - swapToPriceExample.swapToPrice( - token1.address, - token0.address, - 110, - 1, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256, - overrides - ) - ) - // (1e21 + 47376582963642643588) : (1e19 - 451039908682851138) ~= 1:110 - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, swapToPriceExample.address, '47376582963642643588') - .to.emit(token1, 'Approval') - .withArgs(swapToPriceExample.address, router.address, '47376582963642643588') - .to.emit(token1, 'Transfer') - .withArgs(swapToPriceExample.address, pair.address, '47376582963642643588') - .to.emit(token0, 'Transfer') - .withArgs(pair.address, wallet.address, '451039908682851138') - }) - - it('swap gas cost', async () => { - const tx = await swapToPriceExample.swapToPrice( - token0.address, - token1.address, - 1, - 110, - MaxUint256, - MaxUint256, - wallet.address, - MaxUint256, - overrides - ) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq('115129') - }).retries(2) // gas test is inconsistent - }) -}) diff --git a/lib/uniswap-v2-periphery/test/UniswapV2Migrator.spec.ts b/lib/uniswap-v2-periphery/test/UniswapV2Migrator.spec.ts deleted file mode 100644 index ba4938da7..000000000 --- a/lib/uniswap-v2-periphery/test/UniswapV2Migrator.spec.ts +++ /dev/null @@ -1,70 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { AddressZero, MaxUint256 } from 'ethers/constants' -import { bigNumberify } from 'ethers/utils' -import { solidity, MockProvider, createFixtureLoader } from 'ethereum-waffle' - -import { v2Fixture } from './shared/fixtures' -import { expandTo18Decimals, MINIMUM_LIQUIDITY } from './shared/utilities' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -describe('UniswapV2Migrator', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let WETHPartner: Contract - let WETHPair: Contract - let router: Contract - let migrator: Contract - let WETHExchangeV1: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - WETHPartner = fixture.WETHPartner - WETHPair = fixture.WETHPair - router = fixture.router01 // we used router01 for this contract - migrator = fixture.migrator - WETHExchangeV1 = fixture.WETHExchangeV1 - }) - - it('migrate', async () => { - const WETHPartnerAmount = expandTo18Decimals(1) - const ETHAmount = expandTo18Decimals(4) - await WETHPartner.approve(WETHExchangeV1.address, MaxUint256) - await WETHExchangeV1.addLiquidity(bigNumberify(1), WETHPartnerAmount, MaxUint256, { - ...overrides, - value: ETHAmount - }) - await WETHExchangeV1.approve(migrator.address, MaxUint256) - const expectedLiquidity = expandTo18Decimals(2) - const WETHPairToken0 = await WETHPair.token0() - await expect( - migrator.migrate(WETHPartner.address, WETHPartnerAmount, ETHAmount, wallet.address, MaxUint256, overrides) - ) - .to.emit(WETHPair, 'Transfer') - .withArgs(AddressZero, AddressZero, MINIMUM_LIQUIDITY) - .to.emit(WETHPair, 'Transfer') - .withArgs(AddressZero, wallet.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address ? WETHPartnerAmount : ETHAmount, - WETHPairToken0 === WETHPartner.address ? ETHAmount : WETHPartnerAmount - ) - .to.emit(WETHPair, 'Mint') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? WETHPartnerAmount : ETHAmount, - WETHPairToken0 === WETHPartner.address ? ETHAmount : WETHPartnerAmount - ) - expect(await WETHPair.balanceOf(wallet.address)).to.eq(expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - }) -}) diff --git a/lib/uniswap-v2-periphery/test/UniswapV2Router01.spec.ts b/lib/uniswap-v2-periphery/test/UniswapV2Router01.spec.ts deleted file mode 100644 index 651c5620e..000000000 --- a/lib/uniswap-v2-periphery/test/UniswapV2Router01.spec.ts +++ /dev/null @@ -1,734 +0,0 @@ -import chai, { expect } from 'chai' -import { Contract } from 'ethers' -import { AddressZero, Zero, MaxUint256 } from 'ethers/constants' -import { BigNumber, bigNumberify } from 'ethers/utils' -import { solidity, MockProvider, createFixtureLoader } from 'ethereum-waffle' -import { ecsign } from 'ethereumjs-util' - -import { expandTo18Decimals, getApprovalDigest, mineBlock, MINIMUM_LIQUIDITY } from './shared/utilities' -import { v2Fixture } from './shared/fixtures' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -enum RouterVersion { - UniswapV2Router01 = 'UniswapV2Router01', - UniswapV2Router02 = 'UniswapV2Router02' -} - -describe('UniswapV2Router{01,02}', () => { - for (const routerVersion of Object.keys(RouterVersion)) { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let token0: Contract - let token1: Contract - let WETH: Contract - let WETHPartner: Contract - let factory: Contract - let router: Contract - let pair: Contract - let WETHPair: Contract - let routerEventEmitter: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - token0 = fixture.token0 - token1 = fixture.token1 - WETH = fixture.WETH - WETHPartner = fixture.WETHPartner - factory = fixture.factoryV2 - router = { - [RouterVersion.UniswapV2Router01]: fixture.router01, - [RouterVersion.UniswapV2Router02]: fixture.router02 - }[routerVersion as RouterVersion] - pair = fixture.pair - WETHPair = fixture.WETHPair - routerEventEmitter = fixture.routerEventEmitter - }) - - afterEach(async function() { - expect(await provider.getBalance(router.address)).to.eq(Zero) - }) - - describe(routerVersion, () => { - it('factory, WETH', async () => { - expect(await router.factory()).to.eq(factory.address) - expect(await router.WETH()).to.eq(WETH.address) - }) - - it('addLiquidity', async () => { - const token0Amount = expandTo18Decimals(1) - const token1Amount = expandTo18Decimals(4) - - const expectedLiquidity = expandTo18Decimals(2) - await token0.approve(router.address, MaxUint256) - await token1.approve(router.address, MaxUint256) - await expect( - router.addLiquidity( - token0.address, - token1.address, - token0Amount, - token1Amount, - 0, - 0, - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pair.address, token0Amount) - .to.emit(token1, 'Transfer') - .withArgs(wallet.address, pair.address, token1Amount) - .to.emit(pair, 'Transfer') - .withArgs(AddressZero, AddressZero, MINIMUM_LIQUIDITY) - .to.emit(pair, 'Transfer') - .withArgs(AddressZero, wallet.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(pair, 'Sync') - .withArgs(token0Amount, token1Amount) - .to.emit(pair, 'Mint') - .withArgs(router.address, token0Amount, token1Amount) - - expect(await pair.balanceOf(wallet.address)).to.eq(expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - }) - - it('addLiquidityETH', async () => { - const WETHPartnerAmount = expandTo18Decimals(1) - const ETHAmount = expandTo18Decimals(4) - - const expectedLiquidity = expandTo18Decimals(2) - const WETHPairToken0 = await WETHPair.token0() - await WETHPartner.approve(router.address, MaxUint256) - await expect( - router.addLiquidityETH( - WETHPartner.address, - WETHPartnerAmount, - WETHPartnerAmount, - ETHAmount, - wallet.address, - MaxUint256, - { ...overrides, value: ETHAmount } - ) - ) - .to.emit(WETHPair, 'Transfer') - .withArgs(AddressZero, AddressZero, MINIMUM_LIQUIDITY) - .to.emit(WETHPair, 'Transfer') - .withArgs(AddressZero, wallet.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address ? WETHPartnerAmount : ETHAmount, - WETHPairToken0 === WETHPartner.address ? ETHAmount : WETHPartnerAmount - ) - .to.emit(WETHPair, 'Mint') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? WETHPartnerAmount : ETHAmount, - WETHPairToken0 === WETHPartner.address ? ETHAmount : WETHPartnerAmount - ) - - expect(await WETHPair.balanceOf(wallet.address)).to.eq(expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - }) - - async function addLiquidity(token0Amount: BigNumber, token1Amount: BigNumber) { - await token0.transfer(pair.address, token0Amount) - await token1.transfer(pair.address, token1Amount) - await pair.mint(wallet.address, overrides) - } - it('removeLiquidity', async () => { - const token0Amount = expandTo18Decimals(1) - const token1Amount = expandTo18Decimals(4) - await addLiquidity(token0Amount, token1Amount) - - const expectedLiquidity = expandTo18Decimals(2) - await pair.approve(router.address, MaxUint256) - await expect( - router.removeLiquidity( - token0.address, - token1.address, - expectedLiquidity.sub(MINIMUM_LIQUIDITY), - 0, - 0, - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(pair, 'Transfer') - .withArgs(wallet.address, pair.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(pair, 'Transfer') - .withArgs(pair.address, AddressZero, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(token0, 'Transfer') - .withArgs(pair.address, wallet.address, token0Amount.sub(500)) - .to.emit(token1, 'Transfer') - .withArgs(pair.address, wallet.address, token1Amount.sub(2000)) - .to.emit(pair, 'Sync') - .withArgs(500, 2000) - .to.emit(pair, 'Burn') - .withArgs(router.address, token0Amount.sub(500), token1Amount.sub(2000), wallet.address) - - expect(await pair.balanceOf(wallet.address)).to.eq(0) - const totalSupplyToken0 = await token0.totalSupply() - const totalSupplyToken1 = await token1.totalSupply() - expect(await token0.balanceOf(wallet.address)).to.eq(totalSupplyToken0.sub(500)) - expect(await token1.balanceOf(wallet.address)).to.eq(totalSupplyToken1.sub(2000)) - }) - - it('removeLiquidityETH', async () => { - const WETHPartnerAmount = expandTo18Decimals(1) - const ETHAmount = expandTo18Decimals(4) - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - - const expectedLiquidity = expandTo18Decimals(2) - const WETHPairToken0 = await WETHPair.token0() - await WETHPair.approve(router.address, MaxUint256) - await expect( - router.removeLiquidityETH( - WETHPartner.address, - expectedLiquidity.sub(MINIMUM_LIQUIDITY), - 0, - 0, - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(WETHPair, 'Transfer') - .withArgs(wallet.address, WETHPair.address, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(WETHPair, 'Transfer') - .withArgs(WETHPair.address, AddressZero, expectedLiquidity.sub(MINIMUM_LIQUIDITY)) - .to.emit(WETH, 'Transfer') - .withArgs(WETHPair.address, router.address, ETHAmount.sub(2000)) - .to.emit(WETHPartner, 'Transfer') - .withArgs(WETHPair.address, router.address, WETHPartnerAmount.sub(500)) - .to.emit(WETHPartner, 'Transfer') - .withArgs(router.address, wallet.address, WETHPartnerAmount.sub(500)) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address ? 500 : 2000, - WETHPairToken0 === WETHPartner.address ? 2000 : 500 - ) - .to.emit(WETHPair, 'Burn') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? WETHPartnerAmount.sub(500) : ETHAmount.sub(2000), - WETHPairToken0 === WETHPartner.address ? ETHAmount.sub(2000) : WETHPartnerAmount.sub(500), - router.address - ) - - expect(await WETHPair.balanceOf(wallet.address)).to.eq(0) - const totalSupplyWETHPartner = await WETHPartner.totalSupply() - const totalSupplyWETH = await WETH.totalSupply() - expect(await WETHPartner.balanceOf(wallet.address)).to.eq(totalSupplyWETHPartner.sub(500)) - expect(await WETH.balanceOf(wallet.address)).to.eq(totalSupplyWETH.sub(2000)) - }) - - it('removeLiquidityWithPermit', async () => { - const token0Amount = expandTo18Decimals(1) - const token1Amount = expandTo18Decimals(4) - await addLiquidity(token0Amount, token1Amount) - - const expectedLiquidity = expandTo18Decimals(2) - - const nonce = await pair.nonces(wallet.address) - const digest = await getApprovalDigest( - pair, - { owner: wallet.address, spender: router.address, value: expectedLiquidity.sub(MINIMUM_LIQUIDITY) }, - nonce, - MaxUint256 - ) - - const { v, r, s } = ecsign(Buffer.from(digest.slice(2), 'hex'), Buffer.from(wallet.privateKey.slice(2), 'hex')) - - await router.removeLiquidityWithPermit( - token0.address, - token1.address, - expectedLiquidity.sub(MINIMUM_LIQUIDITY), - 0, - 0, - wallet.address, - MaxUint256, - false, - v, - r, - s, - overrides - ) - }) - - it('removeLiquidityETHWithPermit', async () => { - const WETHPartnerAmount = expandTo18Decimals(1) - const ETHAmount = expandTo18Decimals(4) - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - - const expectedLiquidity = expandTo18Decimals(2) - - const nonce = await WETHPair.nonces(wallet.address) - const digest = await getApprovalDigest( - WETHPair, - { owner: wallet.address, spender: router.address, value: expectedLiquidity.sub(MINIMUM_LIQUIDITY) }, - nonce, - MaxUint256 - ) - - const { v, r, s } = ecsign(Buffer.from(digest.slice(2), 'hex'), Buffer.from(wallet.privateKey.slice(2), 'hex')) - - await router.removeLiquidityETHWithPermit( - WETHPartner.address, - expectedLiquidity.sub(MINIMUM_LIQUIDITY), - 0, - 0, - wallet.address, - MaxUint256, - false, - v, - r, - s, - overrides - ) - }) - - describe('swapExactTokensForTokens', () => { - const token0Amount = expandTo18Decimals(5) - const token1Amount = expandTo18Decimals(10) - const swapAmount = expandTo18Decimals(1) - const expectedOutputAmount = bigNumberify('1662497915624478906') - - beforeEach(async () => { - await addLiquidity(token0Amount, token1Amount) - await token0.approve(router.address, MaxUint256) - }) - - it('happy path', async () => { - await expect( - router.swapExactTokensForTokens( - swapAmount, - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pair.address, swapAmount) - .to.emit(token1, 'Transfer') - .withArgs(pair.address, wallet.address, expectedOutputAmount) - .to.emit(pair, 'Sync') - .withArgs(token0Amount.add(swapAmount), token1Amount.sub(expectedOutputAmount)) - .to.emit(pair, 'Swap') - .withArgs(router.address, swapAmount, 0, 0, expectedOutputAmount, wallet.address) - }) - - it('amounts', async () => { - await token0.approve(routerEventEmitter.address, MaxUint256) - await expect( - routerEventEmitter.swapExactTokensForTokens( - router.address, - swapAmount, - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(routerEventEmitter, 'Amounts') - .withArgs([swapAmount, expectedOutputAmount]) - }) - - it('gas', async () => { - // ensure that setting price{0,1}CumulativeLast for the first time doesn't affect our gas math - await mineBlock(provider, (await provider.getBlock('latest')).timestamp + 1) - await pair.sync(overrides) - - await token0.approve(router.address, MaxUint256) - await mineBlock(provider, (await provider.getBlock('latest')).timestamp + 1) - const tx = await router.swapExactTokensForTokens( - swapAmount, - 0, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq( - { - [RouterVersion.UniswapV2Router01]: 101876, - [RouterVersion.UniswapV2Router02]: 101898 - }[routerVersion as RouterVersion] - ) - }).retries(3) - }) - - describe('swapTokensForExactTokens', () => { - const token0Amount = expandTo18Decimals(5) - const token1Amount = expandTo18Decimals(10) - const expectedSwapAmount = bigNumberify('557227237267357629') - const outputAmount = expandTo18Decimals(1) - - beforeEach(async () => { - await addLiquidity(token0Amount, token1Amount) - }) - - it('happy path', async () => { - await token0.approve(router.address, MaxUint256) - await expect( - router.swapTokensForExactTokens( - outputAmount, - MaxUint256, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(token0, 'Transfer') - .withArgs(wallet.address, pair.address, expectedSwapAmount) - .to.emit(token1, 'Transfer') - .withArgs(pair.address, wallet.address, outputAmount) - .to.emit(pair, 'Sync') - .withArgs(token0Amount.add(expectedSwapAmount), token1Amount.sub(outputAmount)) - .to.emit(pair, 'Swap') - .withArgs(router.address, expectedSwapAmount, 0, 0, outputAmount, wallet.address) - }) - - it('amounts', async () => { - await token0.approve(routerEventEmitter.address, MaxUint256) - await expect( - routerEventEmitter.swapTokensForExactTokens( - router.address, - outputAmount, - MaxUint256, - [token0.address, token1.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(routerEventEmitter, 'Amounts') - .withArgs([expectedSwapAmount, outputAmount]) - }) - }) - - describe('swapExactETHForTokens', () => { - const WETHPartnerAmount = expandTo18Decimals(10) - const ETHAmount = expandTo18Decimals(5) - const swapAmount = expandTo18Decimals(1) - const expectedOutputAmount = bigNumberify('1662497915624478906') - - beforeEach(async () => { - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - - await token0.approve(router.address, MaxUint256) - }) - - it('happy path', async () => { - const WETHPairToken0 = await WETHPair.token0() - await expect( - router.swapExactETHForTokens(0, [WETH.address, WETHPartner.address], wallet.address, MaxUint256, { - ...overrides, - value: swapAmount - }) - ) - .to.emit(WETH, 'Transfer') - .withArgs(router.address, WETHPair.address, swapAmount) - .to.emit(WETHPartner, 'Transfer') - .withArgs(WETHPair.address, wallet.address, expectedOutputAmount) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address - ? WETHPartnerAmount.sub(expectedOutputAmount) - : ETHAmount.add(swapAmount), - WETHPairToken0 === WETHPartner.address - ? ETHAmount.add(swapAmount) - : WETHPartnerAmount.sub(expectedOutputAmount) - ) - .to.emit(WETHPair, 'Swap') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? 0 : swapAmount, - WETHPairToken0 === WETHPartner.address ? swapAmount : 0, - WETHPairToken0 === WETHPartner.address ? expectedOutputAmount : 0, - WETHPairToken0 === WETHPartner.address ? 0 : expectedOutputAmount, - wallet.address - ) - }) - - it('amounts', async () => { - await expect( - routerEventEmitter.swapExactETHForTokens( - router.address, - 0, - [WETH.address, WETHPartner.address], - wallet.address, - MaxUint256, - { - ...overrides, - value: swapAmount - } - ) - ) - .to.emit(routerEventEmitter, 'Amounts') - .withArgs([swapAmount, expectedOutputAmount]) - }) - - it('gas', async () => { - const WETHPartnerAmount = expandTo18Decimals(10) - const ETHAmount = expandTo18Decimals(5) - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - - // ensure that setting price{0,1}CumulativeLast for the first time doesn't affect our gas math - await mineBlock(provider, (await provider.getBlock('latest')).timestamp + 1) - await pair.sync(overrides) - - const swapAmount = expandTo18Decimals(1) - await mineBlock(provider, (await provider.getBlock('latest')).timestamp + 1) - const tx = await router.swapExactETHForTokens( - 0, - [WETH.address, WETHPartner.address], - wallet.address, - MaxUint256, - { - ...overrides, - value: swapAmount - } - ) - const receipt = await tx.wait() - expect(receipt.gasUsed).to.eq( - { - [RouterVersion.UniswapV2Router01]: 138770, - [RouterVersion.UniswapV2Router02]: 138770 - }[routerVersion as RouterVersion] - ) - }).retries(3) - }) - - describe('swapTokensForExactETH', () => { - const WETHPartnerAmount = expandTo18Decimals(5) - const ETHAmount = expandTo18Decimals(10) - const expectedSwapAmount = bigNumberify('557227237267357629') - const outputAmount = expandTo18Decimals(1) - - beforeEach(async () => { - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - }) - - it('happy path', async () => { - await WETHPartner.approve(router.address, MaxUint256) - const WETHPairToken0 = await WETHPair.token0() - await expect( - router.swapTokensForExactETH( - outputAmount, - MaxUint256, - [WETHPartner.address, WETH.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(WETHPartner, 'Transfer') - .withArgs(wallet.address, WETHPair.address, expectedSwapAmount) - .to.emit(WETH, 'Transfer') - .withArgs(WETHPair.address, router.address, outputAmount) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address - ? WETHPartnerAmount.add(expectedSwapAmount) - : ETHAmount.sub(outputAmount), - WETHPairToken0 === WETHPartner.address - ? ETHAmount.sub(outputAmount) - : WETHPartnerAmount.add(expectedSwapAmount) - ) - .to.emit(WETHPair, 'Swap') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? expectedSwapAmount : 0, - WETHPairToken0 === WETHPartner.address ? 0 : expectedSwapAmount, - WETHPairToken0 === WETHPartner.address ? 0 : outputAmount, - WETHPairToken0 === WETHPartner.address ? outputAmount : 0, - router.address - ) - }) - - it('amounts', async () => { - await WETHPartner.approve(routerEventEmitter.address, MaxUint256) - await expect( - routerEventEmitter.swapTokensForExactETH( - router.address, - outputAmount, - MaxUint256, - [WETHPartner.address, WETH.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(routerEventEmitter, 'Amounts') - .withArgs([expectedSwapAmount, outputAmount]) - }) - }) - - describe('swapExactTokensForETH', () => { - const WETHPartnerAmount = expandTo18Decimals(5) - const ETHAmount = expandTo18Decimals(10) - const swapAmount = expandTo18Decimals(1) - const expectedOutputAmount = bigNumberify('1662497915624478906') - - beforeEach(async () => { - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - }) - - it('happy path', async () => { - await WETHPartner.approve(router.address, MaxUint256) - const WETHPairToken0 = await WETHPair.token0() - await expect( - router.swapExactTokensForETH( - swapAmount, - 0, - [WETHPartner.address, WETH.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(WETHPartner, 'Transfer') - .withArgs(wallet.address, WETHPair.address, swapAmount) - .to.emit(WETH, 'Transfer') - .withArgs(WETHPair.address, router.address, expectedOutputAmount) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address - ? WETHPartnerAmount.add(swapAmount) - : ETHAmount.sub(expectedOutputAmount), - WETHPairToken0 === WETHPartner.address - ? ETHAmount.sub(expectedOutputAmount) - : WETHPartnerAmount.add(swapAmount) - ) - .to.emit(WETHPair, 'Swap') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? swapAmount : 0, - WETHPairToken0 === WETHPartner.address ? 0 : swapAmount, - WETHPairToken0 === WETHPartner.address ? 0 : expectedOutputAmount, - WETHPairToken0 === WETHPartner.address ? expectedOutputAmount : 0, - router.address - ) - }) - - it('amounts', async () => { - await WETHPartner.approve(routerEventEmitter.address, MaxUint256) - await expect( - routerEventEmitter.swapExactTokensForETH( - router.address, - swapAmount, - 0, - [WETHPartner.address, WETH.address], - wallet.address, - MaxUint256, - overrides - ) - ) - .to.emit(routerEventEmitter, 'Amounts') - .withArgs([swapAmount, expectedOutputAmount]) - }) - }) - - describe('swapETHForExactTokens', () => { - const WETHPartnerAmount = expandTo18Decimals(10) - const ETHAmount = expandTo18Decimals(5) - const expectedSwapAmount = bigNumberify('557227237267357629') - const outputAmount = expandTo18Decimals(1) - - beforeEach(async () => { - await WETHPartner.transfer(WETHPair.address, WETHPartnerAmount) - await WETH.deposit({ value: ETHAmount }) - await WETH.transfer(WETHPair.address, ETHAmount) - await WETHPair.mint(wallet.address, overrides) - }) - - it('happy path', async () => { - const WETHPairToken0 = await WETHPair.token0() - await expect( - router.swapETHForExactTokens( - outputAmount, - [WETH.address, WETHPartner.address], - wallet.address, - MaxUint256, - { - ...overrides, - value: expectedSwapAmount - } - ) - ) - .to.emit(WETH, 'Transfer') - .withArgs(router.address, WETHPair.address, expectedSwapAmount) - .to.emit(WETHPartner, 'Transfer') - .withArgs(WETHPair.address, wallet.address, outputAmount) - .to.emit(WETHPair, 'Sync') - .withArgs( - WETHPairToken0 === WETHPartner.address - ? WETHPartnerAmount.sub(outputAmount) - : ETHAmount.add(expectedSwapAmount), - WETHPairToken0 === WETHPartner.address - ? ETHAmount.add(expectedSwapAmount) - : WETHPartnerAmount.sub(outputAmount) - ) - .to.emit(WETHPair, 'Swap') - .withArgs( - router.address, - WETHPairToken0 === WETHPartner.address ? 0 : expectedSwapAmount, - WETHPairToken0 === WETHPartner.address ? expectedSwapAmount : 0, - WETHPairToken0 === WETHPartner.address ? outputAmount : 0, - WETHPairToken0 === WETHPartner.address ? 0 : outputAmount, - wallet.address - ) - }) - - it('amounts', async () => { - await expect( - routerEventEmitter.swapETHForExactTokens( - router.address, - outputAmount, - [WETH.address, WETHPartner.address], - wallet.address, - MaxUint256, - { - ...overrides, - value: expectedSwapAmount - } - ) - ) - .to.emit(routerEventEmitter, 'Amounts') - .withArgs([expectedSwapAmount, outputAmount]) - }) - }) - }) - } -}) diff --git a/lib/uniswap-v2-periphery/test/UniswapV2Router02.spec.ts b/lib/uniswap-v2-periphery/test/UniswapV2Router02.spec.ts deleted file mode 100644 index ddd0f3cae..000000000 --- a/lib/uniswap-v2-periphery/test/UniswapV2Router02.spec.ts +++ /dev/null @@ -1,380 +0,0 @@ -import chai, { expect } from 'chai' -import { solidity, MockProvider, createFixtureLoader, deployContract } from 'ethereum-waffle' -import { Contract } from 'ethers' -import { BigNumber, bigNumberify } from 'ethers/utils' -import { MaxUint256 } from 'ethers/constants' -import IUniswapV2Pair from '@uniswap/v2-core/build/IUniswapV2Pair.json' - -import { v2Fixture } from './shared/fixtures' -import { expandTo18Decimals, getApprovalDigest, MINIMUM_LIQUIDITY } from './shared/utilities' - -import DeflatingERC20 from '../build/DeflatingERC20.json' -import { ecsign } from 'ethereumjs-util' - -chai.use(solidity) - -const overrides = { - gasLimit: 9999999 -} - -describe('UniswapV2Router02', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let token0: Contract - let token1: Contract - let router: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - token0 = fixture.token0 - token1 = fixture.token1 - router = fixture.router02 - }) - - it('quote', async () => { - expect(await router.quote(bigNumberify(1), bigNumberify(100), bigNumberify(200))).to.eq(bigNumberify(2)) - expect(await router.quote(bigNumberify(2), bigNumberify(200), bigNumberify(100))).to.eq(bigNumberify(1)) - await expect(router.quote(bigNumberify(0), bigNumberify(100), bigNumberify(200))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_AMOUNT' - ) - await expect(router.quote(bigNumberify(1), bigNumberify(0), bigNumberify(200))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_LIQUIDITY' - ) - await expect(router.quote(bigNumberify(1), bigNumberify(100), bigNumberify(0))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_LIQUIDITY' - ) - }) - - it('getAmountOut', async () => { - expect(await router.getAmountOut(bigNumberify(2), bigNumberify(100), bigNumberify(100))).to.eq(bigNumberify(1)) - await expect(router.getAmountOut(bigNumberify(0), bigNumberify(100), bigNumberify(100))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT' - ) - await expect(router.getAmountOut(bigNumberify(2), bigNumberify(0), bigNumberify(100))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_LIQUIDITY' - ) - await expect(router.getAmountOut(bigNumberify(2), bigNumberify(100), bigNumberify(0))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_LIQUIDITY' - ) - }) - - it('getAmountIn', async () => { - expect(await router.getAmountIn(bigNumberify(1), bigNumberify(100), bigNumberify(100))).to.eq(bigNumberify(2)) - await expect(router.getAmountIn(bigNumberify(0), bigNumberify(100), bigNumberify(100))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT' - ) - await expect(router.getAmountIn(bigNumberify(1), bigNumberify(0), bigNumberify(100))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_LIQUIDITY' - ) - await expect(router.getAmountIn(bigNumberify(1), bigNumberify(100), bigNumberify(0))).to.be.revertedWith( - 'UniswapV2Library: INSUFFICIENT_LIQUIDITY' - ) - }) - - it('getAmountsOut', async () => { - await token0.approve(router.address, MaxUint256) - await token1.approve(router.address, MaxUint256) - await router.addLiquidity( - token0.address, - token1.address, - bigNumberify(10000), - bigNumberify(10000), - 0, - 0, - wallet.address, - MaxUint256, - overrides - ) - - await expect(router.getAmountsOut(bigNumberify(2), [token0.address])).to.be.revertedWith( - 'UniswapV2Library: INVALID_PATH' - ) - const path = [token0.address, token1.address] - expect(await router.getAmountsOut(bigNumberify(2), path)).to.deep.eq([bigNumberify(2), bigNumberify(1)]) - }) - - it('getAmountsIn', async () => { - await token0.approve(router.address, MaxUint256) - await token1.approve(router.address, MaxUint256) - await router.addLiquidity( - token0.address, - token1.address, - bigNumberify(10000), - bigNumberify(10000), - 0, - 0, - wallet.address, - MaxUint256, - overrides - ) - - await expect(router.getAmountsIn(bigNumberify(1), [token0.address])).to.be.revertedWith( - 'UniswapV2Library: INVALID_PATH' - ) - const path = [token0.address, token1.address] - expect(await router.getAmountsIn(bigNumberify(1), path)).to.deep.eq([bigNumberify(2), bigNumberify(1)]) - }) -}) - -describe('fee-on-transfer tokens', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let DTT: Contract - let WETH: Contract - let router: Contract - let pair: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - - WETH = fixture.WETH - router = fixture.router02 - - DTT = await deployContract(wallet, DeflatingERC20, [expandTo18Decimals(10000)]) - - // make a DTT<>WETH pair - await fixture.factoryV2.createPair(DTT.address, WETH.address) - const pairAddress = await fixture.factoryV2.getPair(DTT.address, WETH.address) - pair = new Contract(pairAddress, JSON.stringify(IUniswapV2Pair.abi), provider).connect(wallet) - }) - - afterEach(async function() { - expect(await provider.getBalance(router.address)).to.eq(0) - }) - - async function addLiquidity(DTTAmount: BigNumber, WETHAmount: BigNumber) { - await DTT.approve(router.address, MaxUint256) - await router.addLiquidityETH(DTT.address, DTTAmount, DTTAmount, WETHAmount, wallet.address, MaxUint256, { - ...overrides, - value: WETHAmount - }) - } - - it('removeLiquidityETHSupportingFeeOnTransferTokens', async () => { - const DTTAmount = expandTo18Decimals(1) - const ETHAmount = expandTo18Decimals(4) - await addLiquidity(DTTAmount, ETHAmount) - - const DTTInPair = await DTT.balanceOf(pair.address) - const WETHInPair = await WETH.balanceOf(pair.address) - const liquidity = await pair.balanceOf(wallet.address) - const totalSupply = await pair.totalSupply() - const NaiveDTTExpected = DTTInPair.mul(liquidity).div(totalSupply) - const WETHExpected = WETHInPair.mul(liquidity).div(totalSupply) - - await pair.approve(router.address, MaxUint256) - await router.removeLiquidityETHSupportingFeeOnTransferTokens( - DTT.address, - liquidity, - NaiveDTTExpected, - WETHExpected, - wallet.address, - MaxUint256, - overrides - ) - }) - - it('removeLiquidityETHWithPermitSupportingFeeOnTransferTokens', async () => { - const DTTAmount = expandTo18Decimals(1) - .mul(100) - .div(99) - const ETHAmount = expandTo18Decimals(4) - await addLiquidity(DTTAmount, ETHAmount) - - const expectedLiquidity = expandTo18Decimals(2) - - const nonce = await pair.nonces(wallet.address) - const digest = await getApprovalDigest( - pair, - { owner: wallet.address, spender: router.address, value: expectedLiquidity.sub(MINIMUM_LIQUIDITY) }, - nonce, - MaxUint256 - ) - const { v, r, s } = ecsign(Buffer.from(digest.slice(2), 'hex'), Buffer.from(wallet.privateKey.slice(2), 'hex')) - - const DTTInPair = await DTT.balanceOf(pair.address) - const WETHInPair = await WETH.balanceOf(pair.address) - const liquidity = await pair.balanceOf(wallet.address) - const totalSupply = await pair.totalSupply() - const NaiveDTTExpected = DTTInPair.mul(liquidity).div(totalSupply) - const WETHExpected = WETHInPair.mul(liquidity).div(totalSupply) - - await pair.approve(router.address, MaxUint256) - await router.removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( - DTT.address, - liquidity, - NaiveDTTExpected, - WETHExpected, - wallet.address, - MaxUint256, - false, - v, - r, - s, - overrides - ) - }) - - describe('swapExactTokensForTokensSupportingFeeOnTransferTokens', () => { - const DTTAmount = expandTo18Decimals(5) - .mul(100) - .div(99) - const ETHAmount = expandTo18Decimals(10) - const amountIn = expandTo18Decimals(1) - - beforeEach(async () => { - await addLiquidity(DTTAmount, ETHAmount) - }) - - it('DTT -> WETH', async () => { - await DTT.approve(router.address, MaxUint256) - - await router.swapExactTokensForTokensSupportingFeeOnTransferTokens( - amountIn, - 0, - [DTT.address, WETH.address], - wallet.address, - MaxUint256, - overrides - ) - }) - - // WETH -> DTT - it('WETH -> DTT', async () => { - await WETH.deposit({ value: amountIn }) // mint WETH - await WETH.approve(router.address, MaxUint256) - - await router.swapExactTokensForTokensSupportingFeeOnTransferTokens( - amountIn, - 0, - [WETH.address, DTT.address], - wallet.address, - MaxUint256, - overrides - ) - }) - }) - - // ETH -> DTT - it('swapExactETHForTokensSupportingFeeOnTransferTokens', async () => { - const DTTAmount = expandTo18Decimals(10) - .mul(100) - .div(99) - const ETHAmount = expandTo18Decimals(5) - const swapAmount = expandTo18Decimals(1) - await addLiquidity(DTTAmount, ETHAmount) - - await router.swapExactETHForTokensSupportingFeeOnTransferTokens( - 0, - [WETH.address, DTT.address], - wallet.address, - MaxUint256, - { - ...overrides, - value: swapAmount - } - ) - }) - - // DTT -> ETH - it('swapExactTokensForETHSupportingFeeOnTransferTokens', async () => { - const DTTAmount = expandTo18Decimals(5) - .mul(100) - .div(99) - const ETHAmount = expandTo18Decimals(10) - const swapAmount = expandTo18Decimals(1) - - await addLiquidity(DTTAmount, ETHAmount) - await DTT.approve(router.address, MaxUint256) - - await router.swapExactTokensForETHSupportingFeeOnTransferTokens( - swapAmount, - 0, - [DTT.address, WETH.address], - wallet.address, - MaxUint256, - overrides - ) - }) -}) - -describe('fee-on-transfer tokens: reloaded', () => { - const provider = new MockProvider({ - hardfork: 'istanbul', - mnemonic: 'horn horn horn horn horn horn horn horn horn horn horn horn', - gasLimit: 9999999 - }) - const [wallet] = provider.getWallets() - const loadFixture = createFixtureLoader(provider, [wallet]) - - let DTT: Contract - let DTT2: Contract - let router: Contract - beforeEach(async function() { - const fixture = await loadFixture(v2Fixture) - - router = fixture.router02 - - DTT = await deployContract(wallet, DeflatingERC20, [expandTo18Decimals(10000)]) - DTT2 = await deployContract(wallet, DeflatingERC20, [expandTo18Decimals(10000)]) - - // make a DTT<>WETH pair - await fixture.factoryV2.createPair(DTT.address, DTT2.address) - const pairAddress = await fixture.factoryV2.getPair(DTT.address, DTT2.address) - }) - - afterEach(async function() { - expect(await provider.getBalance(router.address)).to.eq(0) - }) - - async function addLiquidity(DTTAmount: BigNumber, DTT2Amount: BigNumber) { - await DTT.approve(router.address, MaxUint256) - await DTT2.approve(router.address, MaxUint256) - await router.addLiquidity( - DTT.address, - DTT2.address, - DTTAmount, - DTT2Amount, - DTTAmount, - DTT2Amount, - wallet.address, - MaxUint256, - overrides - ) - } - - describe('swapExactTokensForTokensSupportingFeeOnTransferTokens', () => { - const DTTAmount = expandTo18Decimals(5) - .mul(100) - .div(99) - const DTT2Amount = expandTo18Decimals(5) - const amountIn = expandTo18Decimals(1) - - beforeEach(async () => { - await addLiquidity(DTTAmount, DTT2Amount) - }) - - it('DTT -> DTT2', async () => { - await DTT.approve(router.address, MaxUint256) - - await router.swapExactTokensForTokensSupportingFeeOnTransferTokens( - amountIn, - 0, - [DTT.address, DTT2.address], - wallet.address, - MaxUint256, - overrides - ) - }) - }) -}) diff --git a/lib/uniswap-v2-periphery/test/shared/fixtures.ts b/lib/uniswap-v2-periphery/test/shared/fixtures.ts deleted file mode 100644 index 0e9da378c..000000000 --- a/lib/uniswap-v2-periphery/test/shared/fixtures.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { Wallet, Contract } from 'ethers' -import { Web3Provider } from 'ethers/providers' -import { deployContract } from 'ethereum-waffle' - -import { expandTo18Decimals } from './utilities' - -import UniswapV2Factory from '@uniswap/v2-core/build/UniswapV2Factory.json' -import IUniswapV2Pair from '@uniswap/v2-core/build/IUniswapV2Pair.json' - -import ERC20 from '../../build/ERC20.json' -import WETH9 from '../../build/WETH9.json' -import UniswapV1Exchange from '../../build/UniswapV1Exchange.json' -import UniswapV1Factory from '../../build/UniswapV1Factory.json' -import UniswapV2Router01 from '../../build/UniswapV2Router01.json' -import UniswapV2Migrator from '../../build/UniswapV2Migrator.json' -import UniswapV2Router02 from '../../build/UniswapV2Router02.json' -import RouterEventEmitter from '../../build/RouterEventEmitter.json' - -const overrides = { - gasLimit: 9999999 -} - -interface V2Fixture { - token0: Contract - token1: Contract - WETH: Contract - WETHPartner: Contract - factoryV1: Contract - factoryV2: Contract - router01: Contract - router02: Contract - routerEventEmitter: Contract - router: Contract - migrator: Contract - WETHExchangeV1: Contract - pair: Contract - WETHPair: Contract -} - -export async function v2Fixture(provider: Web3Provider, [wallet]: Wallet[]): Promise { - // deploy tokens - const tokenA = await deployContract(wallet, ERC20, [expandTo18Decimals(10000)]) - const tokenB = await deployContract(wallet, ERC20, [expandTo18Decimals(10000)]) - const WETH = await deployContract(wallet, WETH9) - const WETHPartner = await deployContract(wallet, ERC20, [expandTo18Decimals(10000)]) - - // deploy V1 - const factoryV1 = await deployContract(wallet, UniswapV1Factory, []) - await factoryV1.initializeFactory((await deployContract(wallet, UniswapV1Exchange, [])).address) - - // deploy V2 - const factoryV2 = await deployContract(wallet, UniswapV2Factory, [wallet.address]) - - // deploy routers - const router01 = await deployContract(wallet, UniswapV2Router01, [factoryV2.address, WETH.address], overrides) - const router02 = await deployContract(wallet, UniswapV2Router02, [factoryV2.address, WETH.address], overrides) - - // event emitter for testing - const routerEventEmitter = await deployContract(wallet, RouterEventEmitter, []) - - // deploy migrator - const migrator = await deployContract(wallet, UniswapV2Migrator, [factoryV1.address, router01.address], overrides) - - // initialize V1 - await factoryV1.createExchange(WETHPartner.address, overrides) - const WETHExchangeV1Address = await factoryV1.getExchange(WETHPartner.address) - const WETHExchangeV1 = new Contract(WETHExchangeV1Address, JSON.stringify(UniswapV1Exchange.abi), provider).connect( - wallet - ) - - // initialize V2 - await factoryV2.createPair(tokenA.address, tokenB.address) - const pairAddress = await factoryV2.getPair(tokenA.address, tokenB.address) - const pair = new Contract(pairAddress, JSON.stringify(IUniswapV2Pair.abi), provider).connect(wallet) - - const token0Address = await pair.token0() - const token0 = tokenA.address === token0Address ? tokenA : tokenB - const token1 = tokenA.address === token0Address ? tokenB : tokenA - - await factoryV2.createPair(WETH.address, WETHPartner.address) - const WETHPairAddress = await factoryV2.getPair(WETH.address, WETHPartner.address) - const WETHPair = new Contract(WETHPairAddress, JSON.stringify(IUniswapV2Pair.abi), provider).connect(wallet) - - return { - token0, - token1, - WETH, - WETHPartner, - factoryV1, - factoryV2, - router01, - router02, - router: router02, // the default router, 01 had a minor bug - routerEventEmitter, - migrator, - WETHExchangeV1, - pair, - WETHPair - } -} diff --git a/lib/uniswap-v2-periphery/test/shared/utilities.ts b/lib/uniswap-v2-periphery/test/shared/utilities.ts deleted file mode 100644 index 52de7fa19..000000000 --- a/lib/uniswap-v2-periphery/test/shared/utilities.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { Contract } from 'ethers' -import { Web3Provider } from 'ethers/providers' -import { BigNumber, bigNumberify, keccak256, defaultAbiCoder, toUtf8Bytes, solidityPack } from 'ethers/utils' - -export const MINIMUM_LIQUIDITY = bigNumberify(10).pow(3) - -const PERMIT_TYPEHASH = keccak256( - toUtf8Bytes('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)') -) - -export function expandTo18Decimals(n: number): BigNumber { - return bigNumberify(n).mul(bigNumberify(10).pow(18)) -} - -function getDomainSeparator(name: string, tokenAddress: string) { - return keccak256( - defaultAbiCoder.encode( - ['bytes32', 'bytes32', 'bytes32', 'uint256', 'address'], - [ - keccak256(toUtf8Bytes('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)')), - keccak256(toUtf8Bytes(name)), - keccak256(toUtf8Bytes('1')), - 1, - tokenAddress - ] - ) - ) -} - -export async function getApprovalDigest( - token: Contract, - approve: { - owner: string - spender: string - value: BigNumber - }, - nonce: BigNumber, - deadline: BigNumber -): Promise { - const name = await token.name() - const DOMAIN_SEPARATOR = getDomainSeparator(name, token.address) - return keccak256( - solidityPack( - ['bytes1', 'bytes1', 'bytes32', 'bytes32'], - [ - '0x19', - '0x01', - DOMAIN_SEPARATOR, - keccak256( - defaultAbiCoder.encode( - ['bytes32', 'address', 'address', 'uint256', 'uint256', 'uint256'], - [PERMIT_TYPEHASH, approve.owner, approve.spender, approve.value, nonce, deadline] - ) - ) - ] - ) - ) -} - -export async function mineBlock(provider: Web3Provider, timestamp: number): Promise { - await new Promise(async (resolve, reject) => { - ;(provider._web3Provider.sendAsync as any)( - { jsonrpc: '2.0', method: 'evm_mine', params: [timestamp] }, - (error: any, result: any): void => { - if (error) { - reject(error) - } else { - resolve(result) - } - } - ) - }) -} - -export function encodePrice(reserve0: BigNumber, reserve1: BigNumber) { - return [reserve1.mul(bigNumberify(2).pow(112)).div(reserve0), reserve0.mul(bigNumberify(2).pow(112)).div(reserve1)] -} diff --git a/lib/uniswap-v2-periphery/tsconfig.json b/lib/uniswap-v2-periphery/tsconfig.json deleted file mode 100644 index 13ad6feb2..000000000 --- a/lib/uniswap-v2-periphery/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "module": "commonjs", - "strict": true, - "esModuleInterop": true, - "resolveJsonModule": true - } -} diff --git a/lib/uniswap-v2-periphery/yarn.lock b/lib/uniswap-v2-periphery/yarn.lock deleted file mode 100644 index 2655a445c..000000000 --- a/lib/uniswap-v2-periphery/yarn.lock +++ /dev/null @@ -1,6347 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@ethereum-waffle/chai@^2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/chai/-/chai-2.5.1.tgz#8bdc055952fc80ff78132571396a2771a36d97ae" - integrity sha512-g/PTnycTM5bODJCumO0XnccKeLITKELwuWOll3EAK+lE5u/OYvfVH5tAsDMJkB8m7J6wVKJ8iT+UiLEKb1qO1g== - dependencies: - "@ethereum-waffle/provider" "^2.5.1" - ethers "^4.0.45" - -"@ethereum-waffle/compiler@^2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/compiler/-/compiler-2.5.1.tgz#955a1fd6558f66b388707c4cec05459e6253535f" - integrity sha512-H08PgcJ+M4URDP2JBjDeYJRMtsh7PusEdRTaEQ7bHeVyjqqv18UEtFPBD7bR169sK9RGlkzjYmCeIRWomCQLlw== - dependencies: - "@resolver-engine/imports" "^0.3.3" - "@resolver-engine/imports-fs" "^0.3.3" - "@types/mkdirp" "^0.5.2" - "@types/node-fetch" "^2.5.5" - ethers "^4.0.45" - mkdirp "^0.5.1" - node-fetch "^2.6.0" - solc "^0.6.3" - -"@ethereum-waffle/mock-contract@^2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/mock-contract/-/mock-contract-2.5.1.tgz#83dbd85bbcab0c0747eadca1bb802f228d7b0874" - integrity sha512-KuUCaCaMRKOI9sJ/MqiJU9ne8wpMWN4NB3beGZpPEo66jK2Ythvz5mgYLNAwAZdzM531NPKc/cWmLUdEF7jnlw== - dependencies: - ethers "^4.0.45" - -"@ethereum-waffle/provider@^2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@ethereum-waffle/provider/-/provider-2.5.1.tgz#fba3c120239c4928caae82db6b1bc4a4e294017a" - integrity sha512-J2yAB7F8eLIPHghcEKjPHBD4Zuix5mM8V4c5JHO20FTrqElWJbZ8pkg/aoztPms2JEt9gEvadAFTcxhd9eYDnA== - dependencies: - ethers "^4.0.45" - ganache-core "^2.10.2" - -"@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/abstract-provider@^5.5.0": - version "5.5.1" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz#2f1f6e8a3ab7d378d8ad0b5718460f85649710c5" - integrity sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/networks" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - "@ethersproject/web" "^5.5.0" - -"@ethersproject/abstract-signer@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz#590ff6693370c60ae376bf1c7ada59eb2a8dd08d" - integrity sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA== - dependencies: - "@ethersproject/abstract-provider" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - -"@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.5.0.tgz#bcc6f576a553f21f3dd7ba17248f81b473c9c78f" - integrity sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/rlp" "^5.5.0" - -"@ethersproject/base64@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.5.0.tgz#881e8544e47ed976930836986e5eb8fab259c090" - integrity sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA== - dependencies: - "@ethersproject/bytes" "^5.5.0" - -"@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.5.0.tgz#875b143f04a216f4f8b96245bde942d42d279527" - integrity sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - bn.js "^4.11.9" - -"@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" - integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.5.0.tgz#d2a2cd7d94bd1d58377d1d66c4f53c9be4d0a45e" - integrity sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - -"@ethersproject/hash@>=5.0.0-beta.128": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.5.0.tgz#7cee76d08f88d1873574c849e0207dcb32380cc9" - integrity sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg== - dependencies: - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - -"@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.5.0.tgz#e4b1f9d7701da87c564ffe336f86dcee82983492" - integrity sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg== - dependencies: - "@ethersproject/bytes" "^5.5.0" - js-sha3 "0.8.0" - -"@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" - integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== - -"@ethersproject/networks@^5.5.0": - version "5.5.1" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.5.1.tgz#b7f7b9fb88dec1ea48f739b7fb9621311aa8ce6c" - integrity sha512-tYRDM4zZtSUcKnD4UMuAlj7SeXH/k5WC4SP2u1Pn57++JdXHkRu2zwNkgNogZoxHzhm9Q6qqurDBVptHOsW49Q== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.5.0.tgz#61f00f2bb83376d2071baab02245f92070c59995" - integrity sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/rlp@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.5.0.tgz#530f4f608f9ca9d4f89c24ab95db58ab56ab99a0" - integrity sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/signing-key@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.5.0.tgz#2aa37169ce7e01e3e80f2c14325f624c29cedbe0" - integrity sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - bn.js "^4.11.9" - elliptic "6.5.4" - hash.js "1.1.7" - -"@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.5.0.tgz#e6784d00ec6c57710755699003bc747e98c5d549" - integrity sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.5.0.tgz#7e9bf72e97bcdf69db34fe0d59e2f4203c7a2908" - integrity sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA== - dependencies: - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/rlp" "^5.5.0" - "@ethersproject/signing-key" "^5.5.0" - -"@ethersproject/web@^5.5.0": - version "5.5.1" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.5.1.tgz#cfcc4a074a6936c657878ac58917a61341681316" - integrity sha512-olvLvc1CB12sREc1ROPSHTdFCdvMh0J5GSJYiQg2D0hdD4QmJDy8QYDb1CvoqD/bF1c++aeKv2sR5uduuG9dQg== - dependencies: - "@ethersproject/base64" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - -"@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" - -"@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== - -"@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" - -"@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/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/chai@^4.2.6": - version "4.2.22" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.22.tgz#47020d7e4cf19194d43b5202f35f75bd2ad35ce7" - integrity sha512-tFfcE+DSTzWAgifkjik9AySNqIyNoYwmR+uecPwwD/XRNfvOjmC/FjCxpiUGDkDVDphPfCUecSQVFw+lN3M3kQ== - -"@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@^5.2.7": - version "5.2.7" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea" - integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ== - -"@types/node-fetch@^2.5.5": - version "2.5.12" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.12.tgz#8a6f779b1d4e60b7a57fb6fd48d84fb545b9cc66" - integrity sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - -"@types/node@*": - version "16.11.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.11.tgz#6ea7342dfb379ea1210835bada87b3c512120234" - integrity sha512-KB0sixD67CeecHC33MYn+eYARkqTheIRNuu97y2XMjR7Wu3XibO1vaY6VBV6O/a89SPI81cEUIYT87UqUWlZNw== - -"@types/node@^12.12.6": - version "12.20.37" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.37.tgz#abb38afa9d6e8a2f627a8cb52290b3c80fbe61ed" - integrity sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA== - -"@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/secp256k1@^4.0.1": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" - integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== - dependencies: - "@types/node" "*" - -"@uniswap/lib@4.0.1-alpha": - version "4.0.1-alpha" - resolved "https://registry.yarnpkg.com/@uniswap/lib/-/lib-4.0.1-alpha.tgz#2881008e55f075344675b3bca93f020b028fbd02" - integrity sha512-f6UIliwBbRsgVLxIaBANF6w09tYqc6Y/qXdsrbEmXHyFA7ILiKrIwRFXe1yOg8M3cksgVsO9N7yuL2DdCGQKBA== - -"@uniswap/v2-core@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@uniswap/v2-core/-/v2-core-1.0.0.tgz#e0fab91a7d53e8cafb5326ae4ca18351116b0844" - integrity sha512-BJiXrBGnN8mti7saW49MXwxDBRFiWemGetE58q8zgfnPPzQKq55ADltEILqOt6VFZ22kVeVKbF8gVd8aY3l7pA== - -"@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== - -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@~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" - -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" - -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== - -ajv@^6.12.3: - 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" - -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-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-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" - -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@^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.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-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-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= - -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.6" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" - integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== - 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= - -async-eventemitter@^0.2.2: - 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@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@^1.4.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= - -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" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -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== - -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== - -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.8: - version "3.0.9" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" - integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== - 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" - -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" - -bignumber.js@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.1.tgz#8d7ba124c882bfd8e43260c67475518d0689e4e5" - integrity sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA== - -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" - -blakejs@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.1.tgz#bf313053978b2cd4c444a48795710be05c785702" - integrity sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg== - -bluebird@^3.5.0: - 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.6, bn.js@^4.11.8, bn.js@^4.11.9, 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.2.0: - 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" - -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@^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" - -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-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.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.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.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -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-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.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.5" - resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.5.tgz#da9ea8166911cc276bf677b8aed2d02d31f59028" - integrity sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A== - dependencies: - node-gyp-build "^4.3.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, 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" - -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.30001284" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001284.tgz#d3653929ded898cd0c1f09a56fd8ca6952df4fca" - integrity sha512-t28SKa7g6kiIQi6NHeOcKrOrGMzCRrXvlasPwWC26TH2QNdglgzQIRUuJ0cR3NeQPH+5jpuveeeSFDLm2zbkEw== - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - -chai@^4.2.0: - 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.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" - -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" - -chownr@^1.1.4: - 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" - -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" - -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" - -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= - -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: - 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-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= - -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== - -commander@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" - integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== - -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: - 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.8.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - 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== - -cookiejar@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.3.tgz#fc7a6216e408e74414b90230050842dacda75acc" - integrity sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ== - -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.19.2" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.19.2.tgz#26b5bfb503178cff6e3e115bc2ba6c6419383680" - integrity sha512-5LkcgQEy8pFeVnd/zomkUBSwnmIxuF1C8E9KrMAbOc8f34IBT9RGvTYeNDdp1PnvMJrrVhvk1hg/yVV5h/znlg== - -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: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -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" - -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" - -cross-fetch@^2.1.0, cross-fetch@^2.1.1: - version "2.2.5" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.5.tgz#afaf5729f3b6c78d89c9296115c9f142541a5705" - integrity sha512-xqYAhQb4NhCJSRym03dwxpP1bYXpK3y7UN83Bo2WFi3x1Zmzn0SL/6xGoPr+gpt4WmNrgCCX3HPysvOwFOW36w== - dependencies: - node-fetch "2.6.1" - whatwg-fetch "2.0.4" - -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" - -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" - -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, 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.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@^3.1.0: - 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.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" - -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" - -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" - -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= - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -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" - -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" - -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== - -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" - -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= - -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.4.10" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.10.tgz#5f44ae6f6725b1949d6e8d34352f80d4c1880734" - integrity sha512-tFgA40Iq2oy4k2PnZrLJowbgpij+lD6ZLxkw8Ht1NKTYyN8dvSvC5xlo8X0WW2jqhKSzITrbr5mpB4/AZ/8OUA== - -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== - -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@^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: - 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" - -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" - -es-abstract@^1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" - integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== - dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - get-intrinsic "^1.1.1" - get-symbol-description "^1.0.0" - has "^1.0.3" - has-symbols "^1.0.2" - internal-slot "^1.0.3" - is-callable "^1.2.4" - is-negative-zero "^2.0.1" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.1" - is-string "^1.0.7" - is-weakref "^1.0.1" - object-inspect "^1.11.0" - 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" - -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= - -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== - -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: - 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-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-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.10" - resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.10.tgz#3ca07f4aed698e75bd134584850260246a5fed8a" - integrity sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA== - 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.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@^2.4.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-2.5.1.tgz#537325bb5112fae35ee00a0e783343f8a6f6b917" - integrity sha512-GPumiHpJHN9ONO7owo4mEZJDZzyDRawV3ukBdd+mPCxJkJbe69LTvza1nxcgwMjruXOd9GHaOnE/C2Sb+uGuMA== - dependencies: - "@ethereum-waffle/chai" "^2.5.1" - "@ethereum-waffle/compiler" "^2.5.1" - "@ethereum-waffle/mock-contract" "^2.5.1" - "@ethereum-waffle/provider" "^2.5.1" - ethers "^4.0.45" - -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: - 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.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.2: - version "7.1.3" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.3.tgz#b55d7b64dde3e3e45749e4c41288238edec32d23" - integrity sha512-y+82tEbyASO0K0X1/SRhbJJoAlfcvq8JbrG4a5cjrOks7HS/36efU/0j2flxCPOUM++HFahk33kr/ZxyC4vNuw== - dependencies: - "@types/bn.js" "^5.1.0" - bn.js "^5.1.2" - create-hash "^1.1.2" - ethereum-cryptography "^0.1.3" - 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.45: - version "4.0.49" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894" - integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg== - dependencies: - aes-js "3.0.0" - bn.js "^4.11.9" - 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" - -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" - -eventemitter3@4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384" - integrity sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ== - -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" - -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" - -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.6.0" - resolved "https://registry.yarnpkg.com/ext/-/ext-1.6.0.tgz#3871d50641e874cc172e2b53f919842d19db4c52" - integrity sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg== - dependencies: - type "^2.5.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== - -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.1" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" - integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== - -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@^3.1.1: - 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-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== - -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" - -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" - -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-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-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" - -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" - -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= - -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.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -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@^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.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" - integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== - -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.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-minipass@^1.2.7: - 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.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= - -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-core@^2.10.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@^2.0.1: - 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.0, 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-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.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.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-symbol-description@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" - integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.1" - -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" - -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@^7.1.3: - version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - 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.7: - 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@~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@^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== - -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: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== - -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== - -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" - -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@^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-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-tostringtag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" - integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== - dependencies: - has-symbols "^1.0.2" - -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.1.7, 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.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= - -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.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-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.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-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" - -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== - -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= - -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= - -internal-slot@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" - integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== - dependencies: - get-intrinsic "^1.1.0" - has "^1.0.3" - side-channel "^1.0.4" - -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" - -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== - -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.1" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" - integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-bigint@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" - integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== - dependencies: - has-bigints "^1.0.1" - -is-boolean-object@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" - integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -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.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" - integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== - -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-core-module@^2.2.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" - integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== - 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.5" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" - integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== - dependencies: - has-tostringtag "^1.0.0" - -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-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-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@^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-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-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-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.6" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" - integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== - dependencies: - has-tostringtag "^1.0.0" - -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-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-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-regex@^1.0.4, is-regex@^1.1.4, is-regex@~1.1.3: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" - integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -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-shared-array-buffer@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" - integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== - -is-stream@^1.0.0, is-stream@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - -is-string@^1.0.5, is-string@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" - integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== - dependencies: - has-tostringtag "^1.0.0" - -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-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-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-weakref@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2" - integrity sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ== - dependencies: - call-bind "^1.0.0" - -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== - -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= - -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" - -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-tokens@^3.0.0 || ^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" - -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-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.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@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" - integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== - -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= - -json5@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= - -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" - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= - -jsprim@^1.2.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" - integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" - -keccak@3.0.1: - 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@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.2.tgz#4c2c6e8c54e04f2670ee49fa734eb9da152206e0" - integrity sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ== - dependencies: - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - readable-stream "^3.6.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" - -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-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-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-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-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" - -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" - -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" - -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.17.11, lodash@^4.17.14, lodash@^4.17.15, 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@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== - dependencies: - chalk "^2.0.1" - -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" - -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-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" - -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= - -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@~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= - -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" - -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@^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" - -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.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== - -mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== - dependencies: - mime-db "1.51.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-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.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@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@^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.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.3.3: - 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.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.4.tgz#fd01504a6797ec5c9be81ff43d204961ed64a512" - integrity sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw== - dependencies: - minimist "^1.2.5" - -mkdirp@^0.5.1, mkdirp@^0.5.5: - 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" - -mocha@^6.2.2: - version "6.2.3" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.2.3.tgz#e648432181d8b99393410212664450a4c1e31912" - integrity sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg== - dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - 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 "2.2.0" - minimatch "3.0.4" - mkdirp "0.5.4" - ms "2.1.1" - node-environment-flags "1.0.5" - 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== - -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.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -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@~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" - -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" - -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= - -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" - -ncp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" - integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M= - -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== - -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= - -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-environment-flags@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.5.tgz#fa930275f5bf5dae188d6192b24b4c8bbac3d76a" - integrity sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" - -node-fetch@2.6.1: - 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@^2.6.0: - version "2.6.6" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89" - integrity sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA== - dependencies: - whatwg-url "^5.0.0" - -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, node-gyp-build@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" - integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== - -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== - -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.11.0, object-inspect@^1.9.0, object-inspect@~1.11.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" - integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== - -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.3" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz#b223cf38e17fefb97a63c10c91df72ccb386df9e" - integrity sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.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" - -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" - -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" - -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" - -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-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-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-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-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-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-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== - -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-headers@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.4.tgz#9eaf2d02bed2d1eff494331ce3df36d7924760bf" - integrity sha512-psZ9iZoCNFLrgRjZ1d8mn0h9WRqJwFxM9q3x7iUjN/YT2OksthDJ5TiPCu2F38kS4zutqfW+YdVVkBZZx3/1aw== - -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" - -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@^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-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.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - -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= - -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" - -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= - -pify@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= - -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= - -precond@0.2: - version "0.2.3" - resolved "https://registry.yarnpkg.com/precond/-/precond-0.2.3.tgz#aa9591bcaa24923f1e0f4849d240f47efc1075ac" - integrity sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw= - -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= - -prettier@^1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== - -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= - -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" - -proxy-addr@~2.0.5: - version "2.0.7" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" - integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== - dependencies: - forwarded "0.2.0" - 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: - 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" - -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.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= - -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" - -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.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.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@^3.0.6, 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.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" - -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-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" - -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" - -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.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" - -request@^2.79.0, request@^2.85.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@^2.0.0: - 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@^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== - -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.20.0: - 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" - -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== - -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.0: - 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.7" - resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" - integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== - dependencies: - bn.js "^5.2.0" - -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== - -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.1, 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== - -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.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@^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@>=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@^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@~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" - -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" - -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-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= - -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" - -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" - -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== - -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" - -solc@0.6.6: - version "0.6.6" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.6.6.tgz#0d4b9c2e7105dd6015583f5e1c5ba6a35861ea71" - integrity sha512-p0IO/1fRaHWKN+qR+mUivpwnBpFYD8EoFAzT8VL4lmllNwsyEO7TJJAc2QK0XUeWOYOT92NWKhDNNNLTVbHShA== - 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" - -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" - -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.17: - version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - 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: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -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" - -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" - -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= - -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-width@^1.0.2 || 2": - 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.prototype.trim@~1.2.4: - version "1.2.5" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.5.tgz#a587bcc8bfad8cb9829a577f5de30dd170c1682c" - integrity sha512-Lnh17webJVsD6ECeovpVN17RlAKjmz4rF9S+8Y45CkMc/ufVpTkU3vZIyIC7sllQ1FCvObZnnCdNs/HXTUOTlg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - -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" - -strip-ansi@^3.0.0: - 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-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= - -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@^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" - -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" - -tape@^4.6.3: - version "4.14.0" - resolved "https://registry.yarnpkg.com/tape/-/tape-4.14.0.tgz#e4d46097e129817175b90925f2385f6b1bcfa826" - integrity sha512-z0+WrUUJuG6wIdWrl4W3rTte2CR26G6qcPOj3w1hfRdcmhF3kHBhOBW9VHsPVAkz08ZmGzp7phVpDupbLzrYKQ== - dependencies: - call-bind "~1.0.2" - deep-equal "~1.1.1" - defined "~1.0.0" - dotignore "~0.1.2" - for-each "~0.3.3" - glob "~7.1.7" - has "~1.0.3" - inherits "~2.0.4" - is-regex "~1.1.3" - minimist "~1.2.5" - object-inspect "~1.11.0" - resolve "~1.20.0" - resumer "~0.0.0" - string.prototype.trim "~1.2.4" - through "~2.3.8" - -tar@^4.0.2: - version "4.4.19" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" - integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA== - dependencies: - chownr "^1.1.4" - fs-minipass "^1.2.7" - minipass "^2.9.0" - minizlib "^1.3.3" - mkdirp "^0.5.5" - safe-buffer "^5.2.1" - yallist "^3.1.1" - -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" - -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@^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== - -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" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= - -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= - -ts-node@^8.5.4: - version "8.10.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.10.2.tgz#eee03764633b1234ddd37f8db9ec10b75ec7fb8d" - integrity sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA== - dependencies: - arg "^4.1.0" - diff "^4.0.1" - make-error "^1.1.1" - source-map-support "^0.5.17" - yn "3.1.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: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - -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-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.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/type/-/type-2.5.0.tgz#0a2e78c2e77907b252abe5f298c1b01c63f0db3d" - integrity sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw== - -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@^3.7.3: - version "3.9.10" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" - integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== - -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= - -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.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== - -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== - -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.7" - resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.7.tgz#c15a19a6af1f7ad9ec7ddc425747ca28c3644922" - integrity sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q== - dependencies: - node-gyp-build "^4.3.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: - 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" - -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== - -varint@^5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" - integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== - -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" - -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-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-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-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-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-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@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-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-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-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-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-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-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@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-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-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-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-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-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-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@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" - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - -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: - 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== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -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@^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@1.3.1, which@^1.2.9: - 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" - -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" - -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" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -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.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.3.tgz#05541053414921bc29c63bee14b8b0dd50b07b3d" - integrity sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA== - dependencies: - async-limiter "~1.0.0" - -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.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@^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== - -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@^3.0.0, yallist@^3.0.2, yallist@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - -yargs-parser@13.1.2, 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-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.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" - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== diff --git a/lib/uniswap-v3-core b/lib/uniswap-v3-core deleted file mode 160000 index 6562c52e8..000000000 --- a/lib/uniswap-v3-core +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6562c52e8f75f0c10f9deaf44861847585fc8129 diff --git a/lib/uniswap-v3-periphery b/lib/uniswap-v3-periphery deleted file mode 160000 index b325bb090..000000000 --- a/lib/uniswap-v3-periphery +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b325bb0905d922ae61fcc7df85ee802e8df5e96c diff --git a/package.json b/package.json index 90ed32b1d..edd5b49ff 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,11 @@ "deploy": "./script/deploy/deploy.sh", "fmt:check": "forge fmt --check", "fmt": "forge fmt", - "full-install": "./install.sh", "lint:all": "pnpm run fmt && pnpm run solhint:all", "lint:check": "pnpm run fmt:check && pnpm run solhint:check", "lint": "pnpm run fmt && pnpm run solhint", + "postinstall": "./script/install.sh", + "publish": "./script/publish.sh", "salts": "./script/salts/write_salt.sh", "size": "forge clean && forge build --sizes --skip test --skip '*/Mock*.sol'", "solhint:all": "solhint --fix --config ./.solhint.json 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'", @@ -26,7 +27,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "BSL-1.1", "dependencies": { "solhint-community": "^3.7.0" } diff --git a/remappings.txt b/remappings.txt index 4b3bfbe3d..03efc5cba 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,11 +1,5 @@ -ds-test/=lib/forge-std/lib/ds-test/src/ -forge-std/=lib/forge-std/src/ -solady/=lib/solady/src/ -solmate/=lib/solmate/src/ -uniswap-v2-core/=lib/uniswap-v2-core/contracts/ -uniswap-v3-core/=lib/uniswap-v3-core/contracts/ -uniswap-v3-periphery/=lib/uniswap-v3-periphery/contracts/ -@uniswap/v3-core/=lib/uniswap-v3-core/ -@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ -@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/ -g-uni-v1-core/=lib/g-uni-v1-core/contracts/ +@forge-std-1.9.1=dependencies/forge-std-1.9.1/src +@solmate-6.7.0=dependencies/solmate-6.7.0/src +@solady-0.0.124=dependencies/solady-0.0.124/src +@openzeppelin-contracts-4.9.2=dependencies/@openzeppelin-contracts-4.9.2 +@clones-with-immutable-args-1.1.1=dependencies/clones-with-immutable-args-1.1.1/src \ No newline at end of file diff --git a/script/deploy/Deploy.s.sol b/script/deploy/Deploy.s.sol index e9ecc83c3..ee0f49c5d 100644 --- a/script/deploy/Deploy.s.sol +++ b/script/deploy/Deploy.s.sol @@ -2,35 +2,26 @@ pragma solidity 0.8.19; // Scripting libraries -import {Script, console2} from "forge-std/Script.sol"; -import {stdJson} from "forge-std/StdJson.sol"; -import {WithEnvironment} from "script/deploy/WithEnvironment.s.sol"; -import {WithSalts} from "script/salts/WithSalts.s.sol"; +import {Script, console2} from "@forge-std-1.9.1/Script.sol"; +import {stdJson} from "@forge-std-1.9.1/StdJson.sol"; +import {WithEnvironment} from "./WithEnvironment.s.sol"; +import {WithSalts} from "../salts/WithSalts.s.sol"; // System contracts -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; -import {AtomicCatalogue} from "src/AtomicCatalogue.sol"; -import {BatchCatalogue} from "src/BatchCatalogue.sol"; -import {Module, Keycode, keycodeFromVeecode} from "src/modules/Modules.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; -import {IFeeManager} from "src/interfaces/IFeeManager.sol"; +import {AtomicAuctionHouse} from "../../src/AtomicAuctionHouse.sol"; +import {BatchAuctionHouse} from "../../src/BatchAuctionHouse.sol"; +import {AtomicCatalogue} from "../../src/AtomicCatalogue.sol"; +import {BatchCatalogue} from "../../src/BatchCatalogue.sol"; +import {Module, Keycode, keycodeFromVeecode} from "../../src/modules/Modules.sol"; +import {IFeeManager} from "../../src/interfaces/IFeeManager.sol"; // Auction modules -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {FixedPriceSale} from "src/modules/auctions/atomic/FPS.sol"; -import {FixedPriceBatch} from "src/modules/auctions/batch/FPB.sol"; +import {EncryptedMarginalPrice} from "../../src/modules/auctions/batch/EMP.sol"; +import {FixedPriceSale} from "../../src/modules/auctions/atomic/FPS.sol"; +import {FixedPriceBatch} from "../../src/modules/auctions/batch/FPB.sol"; // Derivative modules -import {LinearVesting} from "src/modules/derivatives/LinearVesting.sol"; - -// Callbacks -import {UniswapV2DirectToLiquidity} from "src/callbacks/liquidity/UniswapV2DTL.sol"; -import {UniswapV3DirectToLiquidity} from "src/callbacks/liquidity/UniswapV3DTL.sol"; -import {CappedMerkleAllowlist} from "src/callbacks/allowlists/CappedMerkleAllowlist.sol"; -import {MerkleAllowlist} from "src/callbacks/allowlists/MerkleAllowlist.sol"; -import {TokenAllowlist} from "src/callbacks/allowlists/TokenAllowlist.sol"; -import {AllocatedMerkleAllowlist} from "src/callbacks/allowlists/AllocatedMerkleAllowlist.sol"; +import {LinearVesting} from "../../src/modules/derivatives/LinearVesting.sol"; /// @notice Declarative deployment script that reads a deployment sequence (with constructor args) /// and a configured environment file to deploy and install contracts in the Axis protocol. @@ -38,7 +29,6 @@ contract Deploy is Script, WithEnvironment, WithSalts { using stdJson for string; string internal constant _PREFIX_DEPLOYMENT_ROOT = "deployments"; - string internal constant _PREFIX_CALLBACKS = "deployments.callbacks"; string internal constant _PREFIX_AUCTION_MODULES = "deployments.auctionModules"; string internal constant _PREFIX_DERIVATIVE_MODULES = "deployments.derivativeModules"; @@ -580,491 +570,6 @@ contract Deploy is Script, WithEnvironment, WithSalts { return (address(dmBatchLinearVesting), _PREFIX_DERIVATIVE_MODULES); } - // ========== MODULE DEPLOYMENTS ========== // - - function deployAtomicUniswapV2DirectToLiquidity(bytes memory) - public - returns (address, string memory) - { - // No args used - console2.log(""); - console2.log("Deploying UniswapV2DirectToLiquidity (Atomic)"); - - address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); - address uniswapV2Factory = _getAddressNotZero("constants.uniswapV2.factory"); - address uniswapV2Router = _getAddressNotZero("constants.uniswapV2.router"); - - // Get the salt - bytes32 salt_ = _getSalt( - "UniswapV2DirectToLiquidity", - type(UniswapV2DirectToLiquidity).creationCode, - abi.encode(atomicAuctionHouse, uniswapV2Factory, uniswapV2Router) - ); - - // Revert if the salt is not set - require(salt_ != bytes32(0), "Salt not set"); - - // Deploy the module - console2.log(" salt:", vm.toString(salt_)); - - vm.broadcast(); - UniswapV2DirectToLiquidity cbAtomicUniswapV2Dtl = new UniswapV2DirectToLiquidity{ - salt: salt_ - }(atomicAuctionHouse, uniswapV2Factory, uniswapV2Router); - console2.log(""); - console2.log( - " UniswapV2DirectToLiquidity (Atomic) deployed at:", address(cbAtomicUniswapV2Dtl) - ); - - return (address(cbAtomicUniswapV2Dtl), _PREFIX_CALLBACKS); - } - - function deployBatchUniswapV2DirectToLiquidity(bytes memory) - public - returns (address, string memory) - { - // No args used - console2.log(""); - console2.log("Deploying UniswapV2DirectToLiquidity (Batch)"); - - address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); - address uniswapV2Factory = _getAddressNotZero("constants.uniswapV2.factory"); - address uniswapV2Router = _getAddressNotZero("constants.uniswapV2.router"); - - // Get the salt - bytes32 salt_ = _getSalt( - "UniswapV2DirectToLiquidity", - type(UniswapV2DirectToLiquidity).creationCode, - abi.encode(batchAuctionHouse, uniswapV2Factory, uniswapV2Router) - ); - - // Revert if the salt is not set - require(salt_ != bytes32(0), "Salt not set"); - - // Deploy the module - console2.log(" salt:", vm.toString(salt_)); - - vm.broadcast(); - UniswapV2DirectToLiquidity cbBatchUniswapV2Dtl = new UniswapV2DirectToLiquidity{salt: salt_}( - batchAuctionHouse, uniswapV2Factory, uniswapV2Router - ); - console2.log(""); - console2.log( - " UniswapV2DirectToLiquidity (Batch) deployed at:", address(cbBatchUniswapV2Dtl) - ); - - return (address(cbBatchUniswapV2Dtl), _PREFIX_CALLBACKS); - } - - function deployAtomicUniswapV3DirectToLiquidity(bytes memory) - public - returns (address, string memory) - { - // No args used - console2.log(""); - console2.log("Deploying UniswapV3DirectToLiquidity (Atomic)"); - - address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); - address uniswapV3Factory = _getAddressNotZero("constants.uniswapV3.factory"); - address gUniFactory = _getAddressNotZero("constants.gUni.factory"); - - // Get the salt - bytes32 salt_ = _getSalt( - "UniswapV3DirectToLiquidity", - type(UniswapV3DirectToLiquidity).creationCode, - abi.encode(atomicAuctionHouse, uniswapV3Factory, gUniFactory) - ); - - // Revert if the salt is not set - require(salt_ != bytes32(0), "Salt not set"); - - // Deploy the module - console2.log(" salt:", vm.toString(salt_)); - - vm.broadcast(); - UniswapV3DirectToLiquidity cbAtomicUniswapV3Dtl = new UniswapV3DirectToLiquidity{ - salt: salt_ - }(atomicAuctionHouse, uniswapV3Factory, gUniFactory); - console2.log(""); - console2.log( - " UniswapV3DirectToLiquidity (Atomic) deployed at:", address(cbAtomicUniswapV3Dtl) - ); - - return (address(cbAtomicUniswapV3Dtl), _PREFIX_CALLBACKS); - } - - function deployBatchUniswapV3DirectToLiquidity(bytes memory) - public - returns (address, string memory) - { - // No args used - console2.log(""); - console2.log("Deploying UniswapV3DirectToLiquidity (Batch)"); - - address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); - address uniswapV3Factory = _getAddressNotZero("constants.uniswapV3.factory"); - address gUniFactory = _getAddressNotZero("constants.gUni.factory"); - - // Get the salt - bytes32 salt_ = _getSalt( - "UniswapV3DirectToLiquidity", - type(UniswapV3DirectToLiquidity).creationCode, - abi.encode(batchAuctionHouse, uniswapV3Factory, gUniFactory) - ); - - // Revert if the salt is not set - require(salt_ != bytes32(0), "Salt not set"); - - // Deploy the module - console2.log(" salt:", vm.toString(salt_)); - - vm.broadcast(); - UniswapV3DirectToLiquidity cbBatchUniswapV3Dtl = new UniswapV3DirectToLiquidity{salt: salt_}( - batchAuctionHouse, uniswapV3Factory, gUniFactory - ); - console2.log(""); - console2.log( - " UniswapV3DirectToLiquidity (Batch) deployed at:", address(cbBatchUniswapV3Dtl) - ); - - return (address(cbBatchUniswapV3Dtl), _PREFIX_CALLBACKS); - } - - function deployAtomicCappedMerkleAllowlist(bytes memory) - public - returns (address, string memory) - { - // No args used - console2.log(""); - console2.log("Deploying CappedMerkleAllowlist (Atomic)"); - - address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - - // Get the salt - bytes32 salt_ = _getSalt( - "CappedMerkleAllowlist", - type(CappedMerkleAllowlist).creationCode, - abi.encode(atomicAuctionHouse, permissions) - ); - - // Revert if the salt is not set - require(salt_ != bytes32(0), "Salt not set"); - - // Deploy the module - console2.log(" salt:", vm.toString(salt_)); - - vm.broadcast(); - CappedMerkleAllowlist cbAtomicCappedMerkleAllowlist = - new CappedMerkleAllowlist{salt: salt_}(atomicAuctionHouse, permissions); - console2.log(""); - console2.log( - " CappedMerkleAllowlist (Atomic) deployed at:", - address(cbAtomicCappedMerkleAllowlist) - ); - - return (address(cbAtomicCappedMerkleAllowlist), _PREFIX_CALLBACKS); - } - - function deployBatchCappedMerkleAllowlist(bytes memory) - public - returns (address, string memory) - { - // No args used - console2.log(""); - console2.log("Deploying CappedMerkleAllowlist (Batch)"); - - address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - - // Get the salt - bytes32 salt_ = _getSalt( - "CappedMerkleAllowlist", - type(CappedMerkleAllowlist).creationCode, - abi.encode(batchAuctionHouse, permissions) - ); - - // Revert if the salt is not set - require(salt_ != bytes32(0), "Salt not set"); - - // Deploy the module - console2.log(" salt:", vm.toString(salt_)); - - vm.broadcast(); - CappedMerkleAllowlist cbBatchCappedMerkleAllowlist = - new CappedMerkleAllowlist{salt: salt_}(batchAuctionHouse, permissions); - console2.log(""); - console2.log( - " CappedMerkleAllowlist (Batch) deployed at:", address(cbBatchCappedMerkleAllowlist) - ); - - return (address(cbBatchCappedMerkleAllowlist), _PREFIX_CALLBACKS); - } - - function deployAtomicMerkleAllowlist(bytes memory) public returns (address, string memory) { - // No args used - console2.log(""); - console2.log("Deploying MerkleAllowlist (Atomic)"); - - address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - - // Get the salt - bytes32 salt_ = _getSalt( - "MerkleAllowlist", - type(MerkleAllowlist).creationCode, - abi.encode(atomicAuctionHouse, permissions) - ); - - // Revert if the salt is not set - require(salt_ != bytes32(0), "Salt not set"); - - // Deploy the module - console2.log(" salt:", vm.toString(salt_)); - - vm.broadcast(); - MerkleAllowlist cbAtomicMerkleAllowlist = - new MerkleAllowlist{salt: salt_}(atomicAuctionHouse, permissions); - console2.log(""); - console2.log(" MerkleAllowlist (Atomic) deployed at:", address(cbAtomicMerkleAllowlist)); - - return (address(cbAtomicMerkleAllowlist), _PREFIX_CALLBACKS); - } - - function deployBatchMerkleAllowlist(bytes memory) public returns (address, string memory) { - // No args used - console2.log(""); - console2.log("Deploying MerkleAllowlist (Batch)"); - - address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - - // Get the salt - bytes32 salt_ = _getSalt( - "MerkleAllowlist", - type(MerkleAllowlist).creationCode, - abi.encode(batchAuctionHouse, permissions) - ); - - // Revert if the salt is not set - require(salt_ != bytes32(0), "Salt not set"); - - // Deploy the module - console2.log(" salt:", vm.toString(salt_)); - - vm.broadcast(); - MerkleAllowlist cbBatchMerkleAllowlist = - new MerkleAllowlist{salt: salt_}(batchAuctionHouse, permissions); - console2.log(""); - console2.log(" MerkleAllowlist (Batch) deployed at:", address(cbBatchMerkleAllowlist)); - - return (address(cbBatchMerkleAllowlist), _PREFIX_CALLBACKS); - } - - function deployAtomicTokenAllowlist(bytes memory) public returns (address, string memory) { - // No args used - console2.log(""); - console2.log("Deploying TokenAllowlist (Atomic)"); - - address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - - // Get the salt - bytes32 salt_ = _getSalt( - "TokenAllowlist", - type(TokenAllowlist).creationCode, - abi.encode(atomicAuctionHouse, permissions) - ); - - // Revert if the salt is not set - require(salt_ != bytes32(0), "Salt not set"); - - // Deploy the module - console2.log(" salt:", vm.toString(salt_)); - - vm.broadcast(); - TokenAllowlist cbAtomicTokenAllowlist = - new TokenAllowlist{salt: salt_}(atomicAuctionHouse, permissions); - console2.log(""); - console2.log(" TokenAllowlist (Atomic) deployed at:", address(cbAtomicTokenAllowlist)); - - return (address(cbAtomicTokenAllowlist), _PREFIX_CALLBACKS); - } - - function deployBatchTokenAllowlist(bytes memory) public returns (address, string memory) { - // No args used - console2.log(""); - console2.log("Deploying TokenAllowlist (Batch)"); - - address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - - // Get the salt - bytes32 salt_ = _getSalt( - "TokenAllowlist", - type(TokenAllowlist).creationCode, - abi.encode(batchAuctionHouse, permissions) - ); - - // Revert if the salt is not set - require(salt_ != bytes32(0), "Salt not set"); - - // Deploy the module - console2.log(" salt:", vm.toString(salt_)); - - vm.broadcast(); - TokenAllowlist cbBatchTokenAllowlist = - new TokenAllowlist{salt: salt_}(batchAuctionHouse, permissions); - console2.log(""); - console2.log(" TokenAllowlist (Batch) deployed at:", address(cbBatchTokenAllowlist)); - - return (address(cbBatchTokenAllowlist), _PREFIX_CALLBACKS); - } - - function deployAtomicAllocatedMerkleAllowlist(bytes memory) - public - returns (address, string memory) - { - // No args used - console2.log(""); - console2.log("Deploying AllocatedMerkleAllowlist (Atomic)"); - - address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - - // Get the salt - bytes32 salt_ = _getSalt( - "AllocatedMerkleAllowlist", - type(AllocatedMerkleAllowlist).creationCode, - abi.encode(atomicAuctionHouse, permissions) - ); - - // Revert if the salt is not set - require(salt_ != bytes32(0), "Salt not set"); - - // Deploy the module - console2.log(" salt:", vm.toString(salt_)); - - vm.broadcast(); - AllocatedMerkleAllowlist cbAtomicAllocatedMerkleAllowlist = - new AllocatedMerkleAllowlist{salt: salt_}(atomicAuctionHouse, permissions); - console2.log(""); - console2.log( - " AllocatedMerkleAllowlist (Atomic) deployed at:", - address(cbAtomicAllocatedMerkleAllowlist) - ); - - return (address(cbAtomicAllocatedMerkleAllowlist), _PREFIX_CALLBACKS); - } - - function deployBatchAllocatedMerkleAllowlist(bytes memory) - public - returns (address, string memory) - { - // No args used - console2.log(""); - console2.log("Deploying AllocatedMerkleAllowlist (Batch)"); - - address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - - // Get the salt - bytes32 salt_ = _getSalt( - "AllocatedMerkleAllowlist", - type(AllocatedMerkleAllowlist).creationCode, - abi.encode(batchAuctionHouse, permissions) - ); - - // Revert if the salt is not set - require(salt_ != bytes32(0), "Salt not set"); - - // Deploy the module - console2.log(" salt:", vm.toString(salt_)); - - vm.broadcast(); - AllocatedMerkleAllowlist cbBatchAllocatedMerkleAllowlist = - new AllocatedMerkleAllowlist{salt: salt_}(batchAuctionHouse, permissions); - console2.log(""); - console2.log( - " AllocatedMerkleAllowlist (Batch) deployed at:", - address(cbBatchAllocatedMerkleAllowlist) - ); - - return (address(cbBatchAllocatedMerkleAllowlist), _PREFIX_CALLBACKS); - } - // ========== HELPER FUNCTIONS ========== // function _isAtomicAuctionHouse(string memory deploymentName) internal pure returns (bool) { diff --git a/script/deploy/DeployBlast.s.sol b/script/deploy/DeployBlast.s.sol index 6d01d428c..b16253551 100644 --- a/script/deploy/DeployBlast.s.sol +++ b/script/deploy/DeployBlast.s.sol @@ -1,17 +1,17 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {console2} from "forge-std/Script.sol"; +import {console2} from "@forge-std-1.9.1/Script.sol"; // System contracts -import {BlastAtomicAuctionHouse} from "src/blast/BlastAtomicAuctionHouse.sol"; -import {BlastBatchAuctionHouse} from "src/blast/BlastBatchAuctionHouse.sol"; -import {BlastEMP} from "src/blast/modules/auctions/batch/BlastEMP.sol"; -import {BlastFPS} from "src/blast/modules/auctions/atomic/BlastFPS.sol"; -import {BlastFPB} from "src/blast/modules/auctions/batch/BlastFPB.sol"; -import {BlastLinearVesting} from "src/blast/modules/derivatives/BlastLinearVesting.sol"; - -import {Deploy} from "script/deploy/Deploy.s.sol"; +import {BlastAtomicAuctionHouse} from "../../src/blast/BlastAtomicAuctionHouse.sol"; +import {BlastBatchAuctionHouse} from "../../src/blast/BlastBatchAuctionHouse.sol"; +import {BlastEMP} from "../../src/blast/modules/auctions/batch/BlastEMP.sol"; +import {BlastFPS} from "../../src/blast/modules/auctions/atomic/BlastFPS.sol"; +import {BlastFPB} from "../../src/blast/modules/auctions/batch/BlastFPB.sol"; +import {BlastLinearVesting} from "../../src/blast/modules/derivatives/BlastLinearVesting.sol"; + +import {Deploy} from "./Deploy.s.sol"; /// @notice Declarative deploy script that uses contracts specific to the Blast L2 chain. /// See Deploy.s.sol for more information on the Deploy contract. diff --git a/script/deploy/README.md b/script/deploy/README.md index 4b7f06336..10e35d628 100644 --- a/script/deploy/README.md +++ b/script/deploy/README.md @@ -98,18 +98,3 @@ CHAIN="blast-sepolia" ./script/deploy/deploy.sh --deployFile ./script/deploy/seq If the `verify` flag on `deploy.sh` is set, the contract should be verified automatically. If `VERIFIER` is blank or `etherscan`, then `ETHERSCAN_API_KEY` must be set as an environment variable. Additionally, `VERIFIER_URL` can be used to set a custom verifier URL (by default it uses the one configurd in ethers-rs). If deploying against a Tenderly fork and verifying, [follow the instructions](https://docs.tenderly.co/contract-verification). - -## External Dependencies - -Note that for each chain Axis is to be deployed on, if the Uniswap V3 DTL callback is to be used, a deployment of G-UNI will be required. - -Apart from first-party deployments, the `script/env.json` file contains the addresses of third-party dependencies. These have been sourced from the following locations: - -- [Uniswap V2](https://github.com/Uniswap/docs/blob/65d3f21e6cb2879b0672ad791563de0e54fcc089/docs/contracts/v2/reference/smart-contracts/08-deployment-addresses.md) - - Exceptions - - Arbitrum Sepolia, Base Sepolia, Blast Sepolia and Mode Sepolia are custom deployments, due to the unavailability of the Uniswap V2 contracts. -- [Uniswap V3](https://github.com/Uniswap/docs/tree/65d3f21e6cb2879b0672ad791563de0e54fcc089/docs/contracts/v3/reference/deployments) - - Exceptions - - Arbitrum Sepolia and Blast Sepolia are custom deployments by Axis Finance alongside the G-UNI deployment. -- G-UNI - - All of the addresses mentioned are custom deployments by Axis Finance. This is because the addresses from the deployments recorded in the [g-uni-v1-core repository](https://github.com/gelatodigital/g-uni-v1-core/tree/bea63422e2155242b051896b635508b7a99d2a1a/deployments) point to proxies, which have since been upgraded to point to Arrakis contracts that have different interfaces. diff --git a/script/deploy/WithEnvironment.s.sol b/script/deploy/WithEnvironment.s.sol index 1ed6b2463..98a572b77 100644 --- a/script/deploy/WithEnvironment.s.sol +++ b/script/deploy/WithEnvironment.s.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; // Scripting libraries -import {Script, console2} from "forge-std/Script.sol"; -import {stdJson} from "forge-std/StdJson.sol"; +import {Script, console2} from "@forge-std-1.9.1/Script.sol"; +import {stdJson} from "@forge-std-1.9.1/StdJson.sol"; abstract contract WithEnvironment is Script { using stdJson for string; @@ -19,18 +19,40 @@ abstract contract WithEnvironment is Script { env = vm.readFile("./script/env.json"); } + /// @notice Get address from environment file + /// @dev First checks in the current chain's environment file, then in axis-core's environment file + /// + /// @param key_ The key to look up in the environment file + /// @return address The address from the environment file, or the zero address function _envAddress(string memory key_) internal view returns (address) { - // TODO consider returning address(0) if not found - return env.readAddress(string.concat(".current.", chain, ".", key_)); + console2.log(" Checking in env.json"); + string memory fullKey = string.concat(".current.", chain, ".", key_); + address addr; + bool keyExists = vm.keyExists(env, fullKey); + + if (keyExists) { + addr = env.readAddress(fullKey); + console2.log(" %s: %s (from env.json)", key_, addr); + } else { + console2.log(" %s: *** NOT FOUND ***", key_); + } + + return addr; } + /// @notice Get a non-zero address from environment file + /// @dev First checks in the current chain's environment file, then in axis-core's environment file + /// + /// Reverts if the key is not found + /// + /// @param key_ The key to look up in the environment file + /// @return address The address from the environment file function _envAddressNotZero(string memory key_) internal view returns (address) { address addr = _envAddress(key_); require( addr != address(0), string.concat("WithEnvironment: key '", key_, "' has zero address") ); - console2.log(" %s: %s (from env.json)", key_, addr); return addr; } } diff --git a/script/deploy/sequences/allowlists.json b/script/deploy/sequences/allowlists.json deleted file mode 100644 index ffde53993..000000000 --- a/script/deploy/sequences/allowlists.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "sequence": [ - { - "name": "AtomicCappedMerkleAllowlist" - }, - { - "name": "BatchCappedMerkleAllowlist" - }, - { - "name": "AtomicMerkleAllowlist" - }, - { - "name": "BatchMerkleAllowlist" - }, - { - "name": "AtomicTokenAllowlist" - }, - { - "name": "BatchTokenAllowlist" - }, - { - "name": "AtomicAllocatedMerkleAllowlist" - }, - { - "name": "BatchAllocatedMerkleAllowlist" - } - ] -} \ No newline at end of file diff --git a/script/deploy/sequences/batch-allowlists.json b/script/deploy/sequences/batch-allowlists.json deleted file mode 100644 index 8ca7db8e3..000000000 --- a/script/deploy/sequences/batch-allowlists.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "sequence": [ - { - "name": "BatchCappedMerkleAllowlist" - }, - { - "name": "BatchMerkleAllowlist" - }, - { - "name": "BatchTokenAllowlist" - }, - { - "name": "BatchAllocatedMerkleAllowlist" - } - ] -} \ No newline at end of file diff --git a/script/deploy/sequences/batch-callbacks.json b/script/deploy/sequences/batch-callbacks.json deleted file mode 100644 index 6d24632d7..000000000 --- a/script/deploy/sequences/batch-callbacks.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "sequence": [ - { - "name": "BatchCappedMerkleAllowlist" - }, - { - "name": "BatchMerkleAllowlist" - }, - { - "name": "BatchTokenAllowlist" - }, - { - "name": "BatchAllocatedMerkleAllowlist" - }, - { - "name": "BatchUniswapV2DirectToLiquidity" - }, - { - "name": "BatchUniswapV3DirectToLiquidity" - } - ] -} \ No newline at end of file diff --git a/script/deploy/sequences/uniswap-dtl.json b/script/deploy/sequences/uniswap-dtl.json deleted file mode 100644 index b0465b981..000000000 --- a/script/deploy/sequences/uniswap-dtl.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "sequence": [ - { - "name": "BatchUniswapV2DirectToLiquidity" - }, - { - "name": "BatchUniswapV3DirectToLiquidity" - } - ] -} \ No newline at end of file diff --git a/script/env.json b/script/env.json index b10ad4b85..8943c85c0 100644 --- a/script/env.json +++ b/script/env.json @@ -6,16 +6,6 @@ "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x0000000000000000000000000000000000000000" - }, - "uniswapV2": { - "factory": "0xf1D7CC64Fb4452F05c498126312eBE29f30Fbcf9", - "router": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" - }, - "uniswapV3": { - "factory": "0x1F98431c8aD98523631AE4a59f267346ea31F984" } } }, @@ -25,16 +15,6 @@ "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x39AC4439e6CB9427C073259e5742529cE46DD663" - }, - "uniswapV2": { - "factory": "0xeA68f4B82D43979c42E1Fc8E80BDA27BF54C9651", - "router": "0x706f328cdE340522149821FC249c2ad321070212" - }, - "uniswapV3": { - "factory": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" } }, "deployments": { @@ -44,14 +24,6 @@ "EncryptedMarginalPrice": "0x81661B3CC47218327cE17bAd69d9246FCC321667", "FixedPriceBatch": "0x0107DeD7dCD989470268eaeae2Aa2711Efa2597c" }, - "callbacks": { - "BatchAllocatedMerkleAllowlist": "0x98765dB6F0c4334075FB06d8D2998749b8CF604e", - "BatchCappedMerkleAllowlist": "0x9868c93CDec64f471b1DFf60f5e8249249dBa126", - "BatchMerkleAllowlist": "0x989F7525b5e0c804e5A2707F14d34C523D56B43b", - "BatchTokenAllowlist": "0x982598d92BBB2a2E54EdCd262EeF114a517fEeCE", - "BatchUniswapV2DirectToLiquidity": "0xE6c6B510E4b0e442BF01fabDc93d4bf032683C3C", - "BatchUniswapV3DirectToLiquidity": "0xE6f7888cfc8219C93E70Ca528195b4afD80D7894" - }, "derivativeModules": { "BatchLinearVesting": "0x056ed71c999bDdF489d34eD767a50c608Ae16Bf9" } @@ -63,16 +35,6 @@ "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x0000000000000000000000000000000000000000" - }, - "uniswapV2": { - "factory": "0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6", - "router": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" - }, - "uniswapV3": { - "factory": "0x33128a8fC17869897dcE68Ed026d694621f6FDfD" } } }, @@ -82,16 +44,6 @@ "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b" - }, - "uniswapV2": { - "factory": "0xFFa262a1FaDaEd0CE863792CE7A57cC329d7492e", - "router": "0xFA41988c6D1B095826Bea02dbcD124661305dAE7" - }, - "uniswapV3": { - "factory": "0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24" } }, "deployments": { @@ -101,14 +53,6 @@ "EncryptedMarginalPrice": "0xA7413717C633175Bc5B669E94625a4d3FE009870", "FixedPriceBatch": "0xC818f1f000f9C24D014BCe2c5334e14B1360d9CD" }, - "callbacks": { - "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", - "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", - "BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", - "BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", - "BatchUniswapV2DirectToLiquidity": "0xE6F478d800e9807efAb601a1CD60BBd7CBA1c0b8", - "BatchUniswapV3DirectToLiquidity": "0xE6BC347aA7Ce46bDb45F938605C5d4b88881bB1c" - }, "derivativeModules": { "BatchLinearVesting": "0x4042D4F2236D055212d485E028E8FE4939252F88" } @@ -125,16 +69,6 @@ "blast": "0x4300000000000000000000000000000000000002", "usdb": "0x4300000000000000000000000000000000000003", "weth": "0x4300000000000000000000000000000000000004" - }, - "gUni": { - "factory": "0x0000000000000000000000000000000000000000" - }, - "uniswapV2": { - "factory": "0x5C346464d33F90bABaf70dB6388507CC889C1070", - "router": "0xBB66Eb1c5e875933D44DAe661dbD80e5D9B03035" - }, - "uniswapV3": { - "factory": "0x792edAdE80af5fC680d96a2eD80A44247D2Cf6Fd" } } }, @@ -149,16 +83,6 @@ "blast": "0x4300000000000000000000000000000000000002", "usdb": "0x4200000000000000000000000000000000000022", "weth": "0x4200000000000000000000000000000000000023" - }, - "gUni": { - "factory": "0xED28E5230E934cf9C843C08818D0639176040297" - }, - "uniswapV2": { - "factory": "0x8823062F9406f31cc52cc24A70a8415d982E245b", - "router": "0xF3711CaF818d6932da1e31aACF27167c989cD886" - }, - "uniswapV3": { - "factory": "0x84fF29e6321c9dd328B8B383b08dd2815b121243" } }, "deployments": { @@ -168,14 +92,6 @@ "EncryptedMarginalPrice": "0x3ae8dD1ee2752883459C4c33c2f7Aeb8a56669f0", "FixedPriceBatch": "0x9C5dF80078066a49E77537c4cc728a5e788e671F" }, - "callbacks": { - "BatchAllocatedMerkleAllowlist": "0x9895D556E8d1be6C909EC88D43Dd0F6Ae6f7f4D7", - "BatchCappedMerkleAllowlist": "0x98e72F243db7CDfDB015865415A0AE1bFb071507", - "BatchMerkleAllowlist": "0x9824De4B9A917D30a5427813E43e5DF968e19066", - "BatchTokenAllowlist": "0x986e7E24A33Ef6fbDc6C3a94657fBb59d85AbE1C", - "BatchUniswapV2DirectToLiquidity": "0xE6F7049c79AA674D1E7b709C3Dc42C614359956A", - "BatchUniswapV3DirectToLiquidity": "0xE6EDA80884CF4D44841fF33a3162A68EebBa2b7b" - }, "derivativeModules": { "BatchLinearVesting": "0xAd21cD6Cea90e46436002e79B12247eCe16110B3" } @@ -187,16 +103,6 @@ "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x0000000000000000000000000000000000000000" - }, - "uniswapV2": { - "factory": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", - "router": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" - }, - "uniswapV3": { - "factory": "0x1F98431c8aD98523631AE4a59f267346ea31F984" } } }, @@ -206,16 +112,6 @@ "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706" - }, - "uniswapV2": { - "factory": "0x63Fb97Dd80060cFd70c87Aa54F594F3988B6Fc66", - "router": "0x884E32d3c9D60962EF1A005f3d5365a41CDE38b8" - }, - "uniswapV3": { - "factory": "0xE292cF4e316191CbFEbD74909356DF3cd9455e96" } }, "deployments": { @@ -225,14 +121,6 @@ "EncryptedMarginalPrice": "0xaC9957282BeA578f371078ddc4cD12A135B105d6", "FixedPriceBatch": "0x8b7e483d96004ca7893EfB14E049f7648b62322b" }, - "callbacks": { - "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", - "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", - "BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", - "BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", - "BatchUniswapV2DirectToLiquidity": "0xE6feE7a689Ff7493032Ba48B15fE841c6cC30DB9", - "BatchUniswapV3DirectToLiquidity": "0xE6c1ab82a2b4a194C87e643668bb715619766F0B" - }, "derivativeModules": { "BatchLinearVesting": "0x16D5Aab9d35f8B3ac7BD086eEDcCe5343682D5F0" } @@ -244,16 +132,6 @@ "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" - }, - "uniswapV2": { - "factory": "0xFFa262a1FaDaEd0CE863792CE7A57cC329d7492e", - "router": "0xFA41988c6D1B095826Bea02dbcD124661305dAE7" - }, - "uniswapV3": { - "factory": "0x0f88f3f5108eB3BD1A2D411E9a1fD41997811D88" } }, "deployments": { @@ -263,14 +141,6 @@ "EncryptedMarginalPrice": "0x8b47F82a58d8AFBE5167feBf0D3F3Bb509aaf2bd", "FixedPriceBatch": "0xFB1113E170CA6d95f3a91121BDD2370a822598E9" }, - "callbacks": { - "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", - "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", - "BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", - "BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", - "BatchUniswapV2DirectToLiquidity": "0xE6F478d800e9807efAb601a1CD60BBd7CBA1c0b8", - "BatchUniswapV3DirectToLiquidity": "0xE6BB80a6B8628F150E340BdE2e0C49fA17E1e566" - }, "derivativeModules": { "BatchLinearVesting": "0xF170C78a493d9245d125e05bBEc35c98735f5277" } @@ -282,16 +152,6 @@ "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x0000000000000000000000000000000000000000" - }, - "uniswapV2": { - "factory": "0xB7f907f7A9eBC822a80BD25E224be42Ce0A698A0", - "router": "0x425141165d3DE9FEC831896C016617a52363b687" - }, - "uniswapV3": { - "factory": "0x0227628f3F023bb0B980b67D528571c95c6DaC1c" } } } diff --git a/script/install.sh b/script/install.sh new file mode 100755 index 000000000..b9c9cae23 --- /dev/null +++ b/script/install.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# echo "" +# echo "*** Setting up submodules" +# git submodule init +# git submodule update +# echo " Done" + +echo "" +echo "*** Installing forge dependencies" +forge install +echo " Done" + +echo "" +echo "*** Installing soldeer dependencies" +rm -rf dependencies/* && forge soldeer update +echo " Done" + +# echo "" +# echo "*** Restoring submodule commits" +# echo " Done" diff --git a/script/ops/Batch.s.sol b/script/ops/Batch.s.sol index 2eea83917..2b8f0a7d8 100644 --- a/script/ops/Batch.s.sol +++ b/script/ops/Batch.s.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.8.19; -import {BatchScript} from "script/ops/lib/BatchScript.sol"; -import {stdJson} from "forge-std/StdJson.sol"; +import {BatchScript} from "./lib/BatchScript.sol"; +import {stdJson} from "@forge-std-1.9.1/StdJson.sol"; abstract contract Batch is BatchScript { using stdJson for string; diff --git a/script/ops/lib/BatchScript.sol b/script/ops/lib/BatchScript.sol index 32fbb2806..f91215683 100644 --- a/script/ops/lib/BatchScript.sol +++ b/script/ops/lib/BatchScript.sol @@ -1,12 +1,14 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; +pragma solidity >=0.7.0 <0.9.0; // 💬 ABOUT // Gnosis Safe transaction batching script // 🧩 MODULES -//import {Script, console2, StdChains, stdJson, stdMath, StdStorage, stdStorageSafe, VmSafe} from "forge-std/Script.sol"; -import "forge-std/Script.sol"; +//import {Script, console2, StdChains, stdJson, stdMath, StdStorage, stdStorageSafe, VmSafe} from "@forge-std-1.9.1/Script.sol"; +import {Script} from "@forge-std-1.9.1/Script.sol"; +import {stdJson} from "@forge-std-1.9.1/StdJson.sol"; +import {console2} from "@forge-std-1.9.1/console2.sol"; import {Surl} from "./Surl.sol"; import {DelegatePrank} from "./DelegatePrank.sol"; @@ -358,6 +360,7 @@ abstract contract BatchScript is Script, DelegatePrank { } function _stripSlashQuotes(string memory str_) internal returns (string memory) { + // solhint-disable quotes // Remove slash quotes from string string memory command = string.concat( "sed 's/", @@ -378,6 +381,7 @@ abstract contract BatchScript is Script, DelegatePrank { inputs[1] = "-c"; inputs[2] = string.concat(command, "'", str_, "'"); bytes memory res = vm.ffi(inputs); + // solhint-enable quotes return string(res); } diff --git a/script/ops/lib/DelegatePrank.sol b/script/ops/lib/DelegatePrank.sol index a8aadcc4f..fab8a1dc9 100644 --- a/script/ops/lib/DelegatePrank.sol +++ b/script/ops/lib/DelegatePrank.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.6.2 <0.9.0; +pragma solidity >=0.7.0 <0.9.0; -import {CommonBase} from "forge-std/Base.sol"; -import "forge-std/console.sol"; +import {CommonBase} from "@forge-std-1.9.1/Base.sol"; +import "@forge-std-1.9.1/console.sol"; -/* +/* Make arbitrary delegatecalls to an implementation contract. Supplements vm.prank. diff --git a/script/ops/lib/Surl.sol b/script/ops/lib/Surl.sol index bdc25b1b8..4459e8e44 100644 --- a/script/ops/lib/Surl.sol +++ b/script/ops/lib/Surl.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.13; -import {Vm} from "forge-std/Vm.sol"; +import {Vm} from "@forge-std-1.9.1/Vm.sol"; library Surl { Vm constant vm = Vm(address(bytes20(uint160(uint256(keccak256("hevm cheat code")))))); @@ -108,6 +108,7 @@ library Surl { string memory body, string memory method ) internal returns (uint256 status, bytes memory data) { + // solhint-disable quotes string memory scriptStart = 'response=$(curl -s -w "\\n%{http_code}" '; string memory scriptEnd = '); status=$(tail -n1 <<< "$response"); data=$(sed "$ d" <<< "$response");data=$(echo "$data" | tr -d "\\n"); cast abi-encode "response(uint256,string)" "$status" "$data";'; @@ -133,5 +134,6 @@ library Surl { bytes memory res = vm.ffi(inputs); (status, data) = abi.decode(res, (uint256, bytes)); + // solhint-enable quotes } } diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol index 2424fbedd..d756a33be 100644 --- a/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol +++ b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol @@ -2,25 +2,25 @@ pragma solidity 0.8.19; // Scripting libraries -import {Script, console2} from "forge-std/Script.sol"; -import {WithEnvironment} from "script/deploy/WithEnvironment.s.sol"; +import {Script, console2} from "@forge-std-1.9.1/Script.sol"; +import {WithEnvironment} from "../../../deploy/WithEnvironment.s.sol"; // System contracts -import {IBatchAuctionHouse} from "src/interfaces/IBatchAuctionHouse.sol"; -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {toKeycode} from "src/modules/Modules.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; -import {IFixedPriceBatch} from "src/interfaces/modules/auctions/IFixedPriceBatch.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; +import {IBatchAuctionHouse} from "../../../../src/interfaces/IBatchAuctionHouse.sol"; +import {BatchAuctionHouse} from "../../../../src/BatchAuctionHouse.sol"; +import {IAuctionHouse} from "../../../../src/interfaces/IAuctionHouse.sol"; +import {toKeycode} from "../../../../src/modules/Modules.sol"; +import {ICallback} from "../../../../src/interfaces/ICallback.sol"; +import {IFixedPriceBatch} from "../../../../src/interfaces/modules/auctions/IFixedPriceBatch.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; // Callbacks -import {BaseDirectToLiquidity} from "src/callbacks/liquidity/BaseDTL.sol"; -import {UniswapV2DirectToLiquidity} from "src/callbacks/liquidity/UniswapV2DTL.sol"; +// import {BaseDirectToLiquidity} from "../../../../src/callbacks/liquidity/BaseDTL.sol"; +// import {UniswapV2DirectToLiquidity} from "../../../../src/callbacks/liquidity/UniswapV2DTL.sol"; // Generic contracts -import {ERC20} from "lib/solmate/src/tokens/ERC20.sol"; -import {MockERC20} from "lib/solmate/src/test/utils/mocks/MockERC20.sol"; +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; +import {MockERC20} from "@solmate-6.7.0/test/utils/mocks/MockERC20.sol"; contract TestData is Script, WithEnvironment { BatchAuctionHouse public auctionHouse; @@ -59,15 +59,14 @@ contract TestData is Script, WithEnvironment { callbackImplParams = abi.encode(uniswapV3PoolFee_); } - routingParams.callbackData = abi.encode( - BaseDirectToLiquidity.OnCreateParams({ - proceedsUtilisationPercent: 5000, // 50% - vestingStart: 0, - vestingExpiry: 0, - recipient: msg.sender, - implParams: callbackImplParams - }) - ); + routingParams.callbackData = abi.encode(""); + // BaseDirectToLiquidity.OnCreateParams({ + // proceedsUtilisationPercent: 5000, // 50% + // vestingStart: 0, + // vestingExpiry: 0, + // recipient: msg.sender, + // implParams: callbackImplParams + // }) // Approve spending of the base token by the callback (for deposit into the liquidity pool) ERC20(baseToken_).approve(callback_, 10e18); @@ -151,8 +150,9 @@ contract TestData is Script, WithEnvironment { console2.log("Timestamp is", block.timestamp); - bytes memory callbackData = - abi.encode(UniswapV2DirectToLiquidity.OnSettleParams({maxSlippage: 50})); // 0.5% + // bytes memory callbackData = + // abi.encode(UniswapV2DirectToLiquidity.OnSettleParams({maxSlippage: 50})); // 0.5% + bytes memory callbackData = abi.encode(""); vm.broadcast(); auctionHouse.settle(lotId_, 100, callbackData); diff --git a/script/ops/test/FixedPriceBatch/TestData.s.sol b/script/ops/test/FixedPriceBatch/TestData.s.sol index 5fdfea107..4c9af82b9 100644 --- a/script/ops/test/FixedPriceBatch/TestData.s.sol +++ b/script/ops/test/FixedPriceBatch/TestData.s.sol @@ -2,24 +2,24 @@ pragma solidity 0.8.19; // Scripting libraries -import {Script, console2} from "forge-std/Script.sol"; -import {WithEnvironment} from "script/deploy/WithEnvironment.s.sol"; +import {Script, console2} from "@forge-std-1.9.1/Script.sol"; +import {WithEnvironment} from "../../../deploy/WithEnvironment.s.sol"; // System contracts -import {IBatchAuctionHouse} from "src/interfaces/IBatchAuctionHouse.sol"; -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {toKeycode} from "src/modules/Modules.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; -import {IFixedPriceBatch} from "src/interfaces/modules/auctions/IFixedPriceBatch.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -// import {BaselineAxisLaunch} from "src/callbacks/liquidity/BaselineV2/BaselineAxisLaunch.sol"; +import {IBatchAuctionHouse} from "../../../../src/interfaces/IBatchAuctionHouse.sol"; +import {BatchAuctionHouse} from "../../../../src/BatchAuctionHouse.sol"; +import {IAuctionHouse} from "../../../../src/interfaces/IAuctionHouse.sol"; +import {toKeycode} from "../../../../src/modules/Modules.sol"; +import {ICallback} from "../../../../src/interfaces/ICallback.sol"; +import {IFixedPriceBatch} from "../../../../src/interfaces/modules/auctions/IFixedPriceBatch.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +// import {BaselineAxisLaunch} from "../../../../src/callbacks/liquidity/BaselineV2/BaselineAxisLaunch.sol"; // import {BALwithAllocatedAllowlist} from -// "src/callbacks/liquidity/BaselineV2/BALwithAllocatedAllowlist.sol"; +// "../../../../src/callbacks/liquidity/BaselineV2/BALwithAllocatedAllowlist.sol"; // Generic contracts -import {ERC20} from "lib/solmate/src/tokens/ERC20.sol"; -import {MockERC20} from "lib/solmate/src/test/utils/mocks/MockERC20.sol"; +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; +import {MockERC20} from "@solmate-6.7.0/test/utils/mocks/MockERC20.sol"; contract TestData is Script, WithEnvironment { BatchAuctionHouse public auctionHouse; diff --git a/script/ops/test/TestData.s.sol b/script/ops/test/TestData.s.sol index c2a80bfc2..0879f9a11 100644 --- a/script/ops/test/TestData.s.sol +++ b/script/ops/test/TestData.s.sol @@ -2,17 +2,17 @@ pragma solidity 0.8.19; // Scripting libraries -import {Script, console2} from "forge-std/Script.sol"; +import {Script, console2} from "@forge-std-1.9.1/Script.sol"; // System contracts -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {toKeycode} from "src/modules/Modules.sol"; -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {Point} from "src/lib/ECIES.sol"; +import {BatchAuctionHouse} from "../../../src/BatchAuctionHouse.sol"; +import {IAuctionHouse} from "../../../src/interfaces/IAuctionHouse.sol"; +import {toKeycode} from "../../../src/modules/Modules.sol"; +import {EncryptedMarginalPrice} from "../../../src/modules/auctions/batch/EMP.sol"; +import {Point} from "../../../src/lib/ECIES.sol"; // Generic contracts -import {MockERC20} from "lib/solmate/src/test/utils/mocks/MockERC20.sol"; +import {MockERC20} from "@solmate-6.7.0/test/utils/mocks/MockERC20.sol"; contract TestData is Script { BatchAuctionHouse public auctionHouse; diff --git a/script/publish.sh b/script/publish.sh new file mode 100755 index 000000000..8914d4cdd --- /dev/null +++ b/script/publish.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# This script is used to release a new version of the package. It will: +# - Validate that the working directory is clean +# - Validate the version number argument +# - Update the version number in the package.json file (which also commits and tags in git) +# - Push a new version to soldeer + +# Check if the working directory is clean +if [ -n "$(git status --porcelain)" ]; then + echo "Working directory not clean. Please commit all changes before releasing." + exit 1 +fi + +# Check if the version number argument is provided +if [ -z "$1" ]; then + echo "Please provide the version number as an argument." + exit 1 +fi + +# Update the version number in the package.json file +npm version $1 + +# Push the new version to soldeer +forge soldeer push axis-core~v$1 diff --git a/script/salts/README.md b/script/salts/README.md index f08b51bc5..34531d5e1 100644 --- a/script/salts/README.md +++ b/script/salts/README.md @@ -38,35 +38,6 @@ Assuming that the developer wants to deploy an AtomicAuctionHouse at an address The generated salt would be stored in `./script/salts/salts.json` under the key `AtomicAuctionHouse` and a hash of the bytecode. Provided the bytecode is the same, the same salt can be used to deploy the contract at the same address on different chains. -### Generating Salts for Baseline Allocated Allowlist - -The Baseline Allocated Allowlist is a single-use Callbacks contract that enables the owner of a fixed-price batch auction to: - -- deploy the proceeds using Baseline -- specify a bid limit for each address - -To generate a salt for a specific callback deployment, the following addresses are needed: - -- Baseline kernel -- Owner of the Baseline deployment (which will have the ability to withdraw reserves) -- Reserve (quote) token - -These addresses should match the arguments in the deployment sequence file. - -The following script can then be run: - -```bash -./script/salts/dtl-baseline/baseline_allocated_allowlist_salts.sh --kernel --owner --reserveToken -``` - -### Generating Salts for Uniswap Direct to Liquidity - -Assuming that the developer wants to deploy a Uniswap V3 direct to liquidity callback for atomic auctions, the following command would be run: - -```bash -./script/salts/dtl-uniswap/uniswap_dtl_salts.sh --type atomic --version 3 -``` - ### Generating Salts for Any Contract For aesthetic, gas or other reasons, certain contracts will need to be deployed at deterministic addresses. diff --git a/script/salts/WithSalts.s.sol b/script/salts/WithSalts.s.sol index eca86edbb..f03c0b2af 100644 --- a/script/salts/WithSalts.s.sol +++ b/script/salts/WithSalts.s.sol @@ -1,9 +1,9 @@ /// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Script} from "forge-std/Script.sol"; -import {console2} from "forge-std/console2.sol"; -import {stdJson} from "forge-std/StdJson.sol"; +import {Script} from "@forge-std-1.9.1/Script.sol"; +import {console2} from "@forge-std-1.9.1/console2.sol"; +import {stdJson} from "@forge-std-1.9.1/StdJson.sol"; contract WithSalts is Script { using stdJson for string; diff --git a/script/salts/allowlist/AllowlistSalts.s.sol b/script/salts/allowlist/AllowlistSalts.s.sol deleted file mode 100644 index c7a72848d..000000000 --- a/script/salts/allowlist/AllowlistSalts.s.sol +++ /dev/null @@ -1,79 +0,0 @@ -/// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -// Scripting libraries -import {Script, console2} from "lib/forge-std/src/Script.sol"; -import {WithEnvironment} from "script/deploy/WithEnvironment.s.sol"; -import {WithSalts} from "script/salts/WithSalts.s.sol"; - -import {MerkleAllowlist} from "src/callbacks/allowlists/MerkleAllowlist.sol"; -import {CappedMerkleAllowlist} from "src/callbacks/allowlists/CappedMerkleAllowlist.sol"; -import {TokenAllowlist} from "src/callbacks/allowlists/TokenAllowlist.sol"; -import {AllocatedMerkleAllowlist} from "src/callbacks/allowlists/AllocatedMerkleAllowlist.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; - -contract AllowlistSalts is Script, WithEnvironment, WithSalts { - string internal constant _ADDRESS_PREFIX = "98"; - - function _setUp(string calldata chain_) internal { - _loadEnv(chain_); - _createBytecodeDirectory(); - } - - function generate(string calldata chain_, bool atomic_) public { - _setUp(chain_); - - address auctionHouse; - if (atomic_) { - auctionHouse = _envAddress("deployments.AtomicAuctionHouse"); - console2.log("AtomicAuctionHouse:", auctionHouse); - } else { - auctionHouse = _envAddress("deployments.BatchAuctionHouse"); - console2.log("BatchAuctionHouse:", auctionHouse); - } - - // All of these allowlists have the same permissions and constructor args - string memory prefix = "98"; - bytes memory args = abi.encode( - auctionHouse, - Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }) - ); - - // Merkle Allowlist - // 10011000 = 0x98 - bytes memory contractCode = type(MerkleAllowlist).creationCode; - string memory saltKey = "MerkleAllowlist"; - (string memory bytecodePath, bytes32 bytecodeHash) = - _writeBytecode(saltKey, contractCode, args); - _setSalt(bytecodePath, prefix, saltKey, bytecodeHash); - - // Capped Merkle Allowlist - // 10011000 = 0x98 - contractCode = type(CappedMerkleAllowlist).creationCode; - saltKey = "CappedMerkleAllowlist"; - (bytecodePath, bytecodeHash) = _writeBytecode(saltKey, contractCode, args); - _setSalt(bytecodePath, prefix, saltKey, bytecodeHash); - - // Token Allowlist - // 10011000 = 0x98 - contractCode = type(TokenAllowlist).creationCode; - saltKey = "TokenAllowlist"; - (bytecodePath, bytecodeHash) = _writeBytecode(saltKey, contractCode, args); - _setSalt(bytecodePath, prefix, saltKey, bytecodeHash); - - // Allocated Allowlist - contractCode = type(AllocatedMerkleAllowlist).creationCode; - saltKey = "AllocatedMerkleAllowlist"; - (bytecodePath, bytecodeHash) = _writeBytecode(saltKey, contractCode, args); - _setSalt(bytecodePath, prefix, saltKey, bytecodeHash); - } -} diff --git a/script/salts/allowlist/allowlist_salts.sh b/script/salts/allowlist/allowlist_salts.sh deleted file mode 100755 index d2dfbe0ce..000000000 --- a/script/salts/allowlist/allowlist_salts.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -# Usage: -# ./allowlist_salts.sh --type --envFile <.env> -# -# Expects the following environment variables: -# CHAIN: The chain to deploy to, based on values from the ./script/env.json file. - -# Iterate through named arguments -# Source: https://unix.stackexchange.com/a/388038 -while [ $# -gt 0 ]; do - if [[ $1 == *"--"* ]]; then - v="${1/--/}" - declare $v="$2" - fi - - shift -done - -# Get the name of the .env file or use the default -ENV_FILE=${envFile:-".env"} -echo "Sourcing environment variables from $ENV_FILE" - -# Load environment file -set -a # Automatically export all variables -source $ENV_FILE -set +a # Disable automatic export - -# Check that the CHAIN environment variable is set -if [ -z "$CHAIN" ] -then - echo "CHAIN environment variable is not set. Please set it in the .env file or provide it as an environment variable." - exit 1 -fi - -# Check that the mode is "atomic" or "batch" -if [ "$type" != "atomic" ] && [ "$type" != "batch" ] -then - echo "Invalid type specified. Provide 'atomic' or 'batch' after the --type flag." - exit 1 -fi - -# Set flag for atomic or batch auction -ATOMIC=$( if [ "$type" == "atomic" ]; then echo "true"; else echo "false"; fi ) - -echo "Using RPC at URL: $RPC_URL" -echo "Using chain: $CHAIN" -echo "Using type: $type" - -forge script ./script/salts/allowlist/AllowListSalts.s.sol:AllowlistSalts --sig "generate(string,bool)()" $CHAIN $ATOMIC diff --git a/script/salts/auctionHouse/AuctionHouseSalts.s.sol b/script/salts/auctionHouse/AuctionHouseSalts.s.sol index 814e258f5..03fe81eb7 100644 --- a/script/salts/auctionHouse/AuctionHouseSalts.s.sol +++ b/script/salts/auctionHouse/AuctionHouseSalts.s.sol @@ -2,12 +2,12 @@ pragma solidity 0.8.19; // Scripting libraries -import {Script, console2} from "lib/forge-std/src/Script.sol"; -import {WithEnvironment} from "script/deploy/WithEnvironment.s.sol"; -import {WithSalts} from "script/salts/WithSalts.s.sol"; +import {Script, console2} from "@forge-std-1.9.1/Script.sol"; +import {WithEnvironment} from "../../deploy/WithEnvironment.s.sol"; +import {WithSalts} from "../WithSalts.s.sol"; -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; +import {AtomicAuctionHouse} from "../../../src/AtomicAuctionHouse.sol"; +import {BatchAuctionHouse} from "../../../src/BatchAuctionHouse.sol"; contract AuctionHouseSalts is Script, WithEnvironment, WithSalts { address internal _envOwner; diff --git a/script/salts/auctionHouse/AuctionHouseSaltsBlast.s.sol b/script/salts/auctionHouse/AuctionHouseSaltsBlast.s.sol index db5aabd7b..6c4135b43 100644 --- a/script/salts/auctionHouse/AuctionHouseSaltsBlast.s.sol +++ b/script/salts/auctionHouse/AuctionHouseSaltsBlast.s.sol @@ -2,12 +2,12 @@ pragma solidity 0.8.19; // Scripting libraries -import {Script, console2} from "lib/forge-std/src/Script.sol"; -import {WithEnvironment} from "script/deploy/WithEnvironment.s.sol"; -import {WithSalts} from "script/salts/WithSalts.s.sol"; +import {Script, console2} from "@forge-std-1.9.1/Script.sol"; +import {WithEnvironment} from "../../deploy/WithEnvironment.s.sol"; +import {WithSalts} from "../WithSalts.s.sol"; -import {BlastAtomicAuctionHouse} from "src/blast/BlastAtomicAuctionHouse.sol"; -import {BlastBatchAuctionHouse} from "src/blast/BlastBatchAuctionHouse.sol"; +import {BlastAtomicAuctionHouse} from "../../../src/blast/BlastAtomicAuctionHouse.sol"; +import {BlastBatchAuctionHouse} from "../../../src/blast/BlastBatchAuctionHouse.sol"; contract AuctionHouseSaltsBlast is Script, WithEnvironment, WithSalts { address internal _envOwner; diff --git a/script/salts/dtl-uniswap/UniswapDTLSalts.s.sol b/script/salts/dtl-uniswap/UniswapDTLSalts.s.sol deleted file mode 100644 index 1eec7b8de..000000000 --- a/script/salts/dtl-uniswap/UniswapDTLSalts.s.sol +++ /dev/null @@ -1,107 +0,0 @@ -/// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -// Scripting libraries -import {Script, console2} from "lib/forge-std/src/Script.sol"; -import {WithEnvironment} from "script/deploy/WithEnvironment.s.sol"; -import {WithSalts} from "script/salts/WithSalts.s.sol"; - -import {UniswapV2DirectToLiquidity} from "src/callbacks/liquidity/UniswapV2DTL.sol"; -import {UniswapV3DirectToLiquidity} from "src/callbacks/liquidity/UniswapV3DTL.sol"; - -contract UniswapDTLSalts is Script, WithEnvironment, WithSalts { - string internal constant _ADDRESS_PREFIX = "E6"; - - address internal _envUniswapV2Factory; - address internal _envUniswapV2Router; - address internal _envUniswapV3Factory; - address internal _envGUniFactory; - - function _setUp(string calldata chain_) internal { - _loadEnv(chain_); - _createBytecodeDirectory(); - - // Cache Uniswap factories - _envUniswapV2Factory = _envAddressNotZero("constants.uniswapV2.factory"); - console2.log("UniswapV2Factory:", _envUniswapV2Factory); - _envUniswapV2Router = _envAddressNotZero("constants.uniswapV2.router"); - console2.log("UniswapV2Router:", _envUniswapV2Router); - _envUniswapV3Factory = _envAddressNotZero("constants.uniswapV3.factory"); - console2.log("UniswapV3Factory:", _envUniswapV3Factory); - _envGUniFactory = _envAddressNotZero("constants.gUni.factory"); - console2.log("GUniFactory:", _envGUniFactory); - } - - function generate( - string calldata chain_, - string calldata uniswapVersion_, - bool atomic_ - ) public { - _setUp(chain_); - - if (keccak256(abi.encodePacked(uniswapVersion_)) == keccak256(abi.encodePacked("2"))) { - _generateV2(atomic_); - } else if (keccak256(abi.encodePacked(uniswapVersion_)) == keccak256(abi.encodePacked("3"))) - { - _generateV3(atomic_); - } else { - revert("Invalid Uniswap version: 2 or 3"); - } - } - - function _generateV2(bool atomic_) internal { - if (atomic_) { - address _envAtomicAuctionHouse = _envAddressNotZero("deployments.AtomicAuctionHouse"); - console2.log("AtomicAuctionHouse:", _envAtomicAuctionHouse); - - // Calculate salt for the UniswapV2DirectToLiquidity - bytes memory contractCode = type(UniswapV2DirectToLiquidity).creationCode; - (string memory bytecodePath, bytes32 bytecodeHash) = _writeBytecode( - "UniswapV2DirectToLiquidity", - contractCode, - abi.encode(_envAtomicAuctionHouse, _envUniswapV2Factory, _envUniswapV2Router) - ); - _setSalt(bytecodePath, _ADDRESS_PREFIX, "UniswapV2DirectToLiquidity", bytecodeHash); - } else { - address _envBatchAuctionHouse = _envAddressNotZero("deployments.BatchAuctionHouse"); - console2.log("BatchAuctionHouse:", _envBatchAuctionHouse); - - // Calculate salt for the UniswapV2DirectToLiquidity - bytes memory contractCode = type(UniswapV2DirectToLiquidity).creationCode; - (string memory bytecodePath, bytes32 bytecodeHash) = _writeBytecode( - "UniswapV2DirectToLiquidity", - contractCode, - abi.encode(_envBatchAuctionHouse, _envUniswapV2Factory, _envUniswapV2Router) - ); - _setSalt(bytecodePath, _ADDRESS_PREFIX, "UniswapV2DirectToLiquidity", bytecodeHash); - } - } - - function _generateV3(bool atomic_) internal { - if (atomic_) { - address _envAtomicAuctionHouse = _envAddressNotZero("deployments.AtomicAuctionHouse"); - console2.log("AtomicAuctionHouse:", _envAtomicAuctionHouse); - - // Calculate salt for the UniswapV3DirectToLiquidity - bytes memory contractCode = type(UniswapV3DirectToLiquidity).creationCode; - (string memory bytecodePath, bytes32 bytecodeHash) = _writeBytecode( - "UniswapV3DirectToLiquidity", - contractCode, - abi.encode(_envAtomicAuctionHouse, _envUniswapV3Factory, _envGUniFactory) - ); - _setSalt(bytecodePath, _ADDRESS_PREFIX, "UniswapV3DirectToLiquidity", bytecodeHash); - } else { - address _envBatchAuctionHouse = _envAddressNotZero("deployments.BatchAuctionHouse"); - console2.log("BatchAuctionHouse:", _envBatchAuctionHouse); - - // Calculate salt for the UniswapV3DirectToLiquidity - bytes memory contractCode = type(UniswapV3DirectToLiquidity).creationCode; - (string memory bytecodePath, bytes32 bytecodeHash) = _writeBytecode( - "UniswapV3DirectToLiquidity", - contractCode, - abi.encode(_envBatchAuctionHouse, _envUniswapV3Factory, _envGUniFactory) - ); - _setSalt(bytecodePath, _ADDRESS_PREFIX, "UniswapV3DirectToLiquidity", bytecodeHash); - } - } -} diff --git a/script/salts/dtl-uniswap/uniswap_dtl_salts.sh b/script/salts/dtl-uniswap/uniswap_dtl_salts.sh deleted file mode 100755 index 68640f24f..000000000 --- a/script/salts/dtl-uniswap/uniswap_dtl_salts.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -# Usage: -# ./uniswap_dtl_salts.sh --version <2 | 3> --type --envFile <.env> -# -# Expects the following environment variables: -# CHAIN: The chain to deploy to, based on values from the ./script/env.json file. - -# Iterate through named arguments -# Source: https://unix.stackexchange.com/a/388038 -while [ $# -gt 0 ]; do - if [[ $1 == *"--"* ]]; then - v="${1/--/}" - declare $v="$2" - fi - - shift -done - -# Get the name of the .env file or use the default -ENV_FILE=${envFile:-".env"} -echo "Sourcing environment variables from $ENV_FILE" - -# Load environment file -set -a # Automatically export all variables -source $ENV_FILE -set +a # Disable automatic export - -# Check that the CHAIN environment variable is set -if [ -z "$CHAIN" ] -then - echo "CHAIN environment variable is not set. Please set it in the .env file or provide it as an environment variable." - exit 1 -fi - -# Check that the version is 2 or 3 -if [ "$version" != "2" ] && [ "$version" != "3" ] -then - echo "Invalid version specified. Provide '2' or '3' after the --version flag." - exit 1 -fi - -# Check that the mode is "atomic" or "batch" -if [ "$type" != "atomic" ] && [ "$type" != "batch" ] -then - echo "Invalid mode specified. Provide 'atomic' or 'batch' after the --type flag." - exit 1 -fi - -# Set flag for atomic or batch auction -ATOMIC=$( if [ "$type" == "atomic" ]; then echo "true"; else echo "false"; fi ) - -echo "Using chain: $CHAIN" -echo "Using RPC at URL: $RPC_URL" -echo "Using Uniswap version: $version" -echo "Using auction type: $type" - -forge script ./script/salts/dtl-uniswap/UniswapDTLSalts.s.sol:UniswapDTLSalts --sig "generate(string,string,bool)()" $CHAIN $version $ATOMIC diff --git a/script/salts/salts.json b/script/salts/salts.json index 26f18f48e..7cfb4254f 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -1,16 +1,4 @@ { - "AllocatedMerkleAllowlist": { - "0x109440c1c675388d17f52673a20abbe28dd179642c176d6142dd7f44821be594": "0x5d9938f8fccff4783842cc1c5968240c6d173a447ccf3e11c096c5bb0e7423ec", - "0x1330bbebf9210aa32cfa7221ca21157fee8f977c21e2e9bb9d396e02000726b2": "0x8cdbe3133136ece80f286b64a3dabf2a9d1bd5868e8a851a7747048f17e44717", - "0x23a85d2e69471278dd573d17331b360da25418c731483eca071acc91667846fa": "0x775d17e9071a23da2e1bcf5addb052676b2e180f3e69fb810613fa19f203a48f", - "0x30b51492b0fefba6189938e77c04874f66af1ae415576b9a0870e3d831af3aeb": "0xb21446946154104802ca94a722f3d9c017dedcf52633e778343e049f558fc5e5", - "0x4db54f4a6df5f03f26f181efffd95909d94800d3b955d3606e12682b9bcbd89a": "0x5438ed572ff2d286c6686cc1ff5ab265f61aa3dc48953f7aa2b2483b84d4cd4e", - "0x6257c89e534c1414806da36437177a5ad7e372d98a2c231396c638f0e3e01986": "0x4d82fff8053192aea9b71c7cbc74250b30c2b870b08016dac5cd40eaf6f0ea68", - "0x829a6a78304229812355cc3fd4ffbb383e35120e39942f1547bce97c9156f204": "0x12550234064c7913456e44b288c40022cf5b78c608f5e7f5ef0489157f49478f", - "0x940f58c92177218354ef28efcd7056b131053fc33f27336c68af3eda9b7a537f": "0x9471763f5a9abcd58fee06a10aede685e570750ddc1de9f9e742130bb8f6369c", - "0xaa5c1bd02f7b04980f0e4ef0778e9165f8404f41c1c2bc372f2902f80dc646b0": "0x3c781e03bd8272c21052708923b6b00b60d976b84bc792a25a8eeb527d166944", - "0xc329d36cea27b1f8e044c99a5eda27503fd6087f50b6d27b7bb12ac4493507e1": "0xb724ad108002e85a8144c2b305013b4d302fb1ef4a39d477f6d18e96bc219a3d" - }, "AtomicAuctionHouse": { "0xc34e46cfceb1e62d804e8197ba829a150e216e433ee21a68b96f1edd3abd4dd9": "0x87bc14fda5bd97c7e883ae1227f30462125ebcf6800a34d10f39af4ac46e84b9" }, @@ -29,131 +17,24 @@ "0xcad29ef747f1a7ad12c1e5e715ac675f8534c0d3682dfddfa39287ae7b7d7f01": "0x761de87b1ea43dc2f84665b59b2ce8498c1a09458e3a89751578be7c72811114", "0xf7e1693ed561ec566275117c8ea944263f9f801df4d4c61e4a934b7152f36dcc": "0x0b3e7731b05ed1f6d2cbbc4e64b503b8582801ae807ee756b3472916ec29c6fb" }, - "CappedMerkleAllowlist": { - "0x0249dded8310d17581f166a526ea9ded65b81112ccac0ee8a144e9770d2b8432": "0xf5746fa34aeff9866dc5ec58712f7f47045aea15db39a0aabf4dadc9d35c8854", - "0x0ae7777d88dd21a8b9ca3dd9212307295a83aed438fef9dad0b62d57fbaf1025": "0x1de5ae5b126bd2cee8eb4f083080f5c30baa692580cf823fa5f382a7bfc70ac5", - "0x1294c31af16cc9492e4dd3b6b8fac32773804d78c01419e9b217ae0607dc54ad": "0xb726562fcfe3b1946fc21f4fc2ee7065faebff62793e4ae4d770ac734ae6795f", - "0x1862ac863dc5f418c2e4637cbb69eeb9167c098cd66fc4c383431729bcc056eb": "0x848d8f46acb79432a25b5b3070de9ef468df82ff8080f509eace1a7cbef19308", - "0x37dd279dfdb57fe95beada85483507cc5a2a17f19f45ddae873c83c638d6194a": "0xfc978ee8a1088ba257d060a261139da833380b31d8dd2cbf6b50a61afe69bf2b", - "0x3b13d752dd521a5917210eff552f4d0ec3ff4ddb2d194f5d02b7e2247489ebdc": "0xf1ff9fa131a9733c7bdb0d3a3bd2f0ff01a4460e6886df4c7099947ebcfb1ee9", - "0x3fc1cd506bf64c403917a5799b49e036dd3aae5428060a18d3c19d6e6065498e": "0xd24c83ddb154d7c984384db1f8da3ab3307028e5f1cc43031c4243a81e25edb6", - "0x41e4959210f69f1bc43a7e525cd5c4d9552ded294727f411ff30fe70c69a4b76": "0x20e7f379ad74ce616829a0e336c3b9c48e0d2a74f219219e32e02fe2a982da7d", - "0x7629e3374867d748eaab783ad2eedb4e39634e55428c39713fd82415d41043a3": "0x31246341c7c82c31414f184b807da273fdd6cdf591cb6f997fec41babc279fd9", - "0x78ee3a1a70f7e9a784590ca00ef3290f3478105f6338266b9e5f0d10951b4aa9": "0xdb5af3b6d32454d69075509db94196460a19acb9849c5dc0d5ccef5a1b4ab032", - "0xa59fba1bee7eda5c33e9d52daa5505c2cf60b89d41566b07c2e601a34990a631": "0x5613adffef93f5433b34f4c2f38569b6694af67aa4cbacf7faab427824aa8b94", - "0xba7c6b1a20d51f9d58af92b2ad7ef3e41e1468b723bedeaa967ad18324a01396": "0x008360de5819a25fa0b4f08212b0b7745df530809622970e4dfefc77cb8c5066", - "0xbece95cede2c4b6f2712067328ed372606a7ec24649023996465365239ed5c23": "0x43af01d498eaa96528f948867f7b771b700b090e1b1077c95ecc1394265f1af9", - "0xec2a597ad93b51f9a58ce3a90dc777d51183931ff91f23ba7d685f36d08a5fb5": "0x09ef29485dadd335f15b530a213bf16fe826b712a6d9704d86d2980a775c6309" - }, - "MerkleAllowlist": { - "0x00e31f39c32ce8511a5db04dec4a0a92b29eb2cb02a965f107dbeb9549517e6a": "0xcfcc4407dd569ab1e457b9d475420c8d10e7db6751646b5aa84cfacf500947ba", - "0x13f8dde16815b53fad1d222ffd783f6ed99b01992a48aac29791352ac7578576": "0x605db39e79afd6a7e67bd3055afc358a69143d97544404d75b8091c2d2c82fa1", - "0x2cc37ca69a4e1ef00579453aad3e7dd939350a9b53f3dfa1f20896f0cd1dbddb": "0x87a479d8c7b3a31f53b0ae53979510bcb06d09a2e202432ac40581c6bc37ff08", - "0x48ea0384a799d4ff2b7287d3cf0736171352670aeb2b33bc18c70cbc5abd0fce": "0x179e7c820be6b4a6cfb0ce475443dd900c553322dbd3d38eda34dcfab7b20b81", - "0x772e272fd6e30185ccd0d9d485a87d71b47d93ad31dcdb274bbde5002f12b12d": "0x5b5c6bacfcaa186167a4345af4ba4facedb0bb7693daa623b9db75f06b89c13f", - "0x8dabf7c769c996b5b33b4da1013d93b9daeeb7cf468d179804c9130fd7eaa891": "0x71072df633972dfa166196430a104dbc30b8dc5997a8b965253ca299fd96feaf", - "0xb4128aa3cf1f256d76081a556cbe66c83429e49ce28bca3b2e3b07b926f0bda8": "0xcbac00a3b5465e91d8c65d179de9fa8f52be1c99b8ecfd9ce35b51faa0046232", - "0xc56445d8a92973e5e7a453750ca38da11f04e2c965b3ae42a0f77ccdf2cd5b33": "0xc38225a585e134360208d9f73f4bdfaca9b43cd130f1a6cf0fd631e9877e32a6", - "0xc8e647c61be9e05b08050eb7d8cfc1102b5328d9540b81891da5783ba25d2978": "0x368c44b5208a15f6292a0ac1246d7d6973d5c919d32cebd2f30da0844356e63a", - "0xcd18d417a886a13a14969e2690fc3af13f228e73a02e48d9d4e8a6b3fa61504a": "0x7aa449a66650f30013cfd8021a16640d3489de2246ec5ad62f3ccbe5e84f819a", - "0xd3da57bd92a493efbf623f32c63315442acb0a1519cdeb57c846803150efd238": "0x1ce173dc622d4d68f9b5fbe79de27e376bf66f560df27fb52c56d89fc0c4d66f", - "0xed4ba02077e70f78db70ce191509333d2dcccfff136d30dcb011f567305e88ad": "0x2b8bc588174d409692f1bd993942e3806c9a11344dbe674f46aed32a030aacf1", - "0xf758779927a94ce49a1ea7e126142cca8472adf8cc3133234411737bb193ce41": "0xe826d67a09b7f9d1da2beacf436b833ae46aae40524c788fd02a10b5c3258c9a" - }, - "Test_AllocatedMerkleAllowlist": { - "0xde90b3fc26aad97623cc3f0e749f074571be9d3c8688157fbd960725e16919a1": "0x9596400a18c78815f94c837c0c4c9adedcf148bef921b03f2f5485e989e4d894", - "0xe2c6fd7c60245abd79e4d6662cc0bf46a157fcc89d7164c26f1cb3127bd81693": "0xab62ce2ec3c59955ae05207dea7f11b37f7dd59fe263d17fd3a9567d5969de03" - }, - "Test_CappedMerkleAllowlist": { - "0xb611d6b0a4ba211d9187da8183c1a5973ac76646eaf34a40dcc33799f7eccbc8": "0x8e563156842f36f3a5394c529dd654f27bd13a15719fef94201dcecdaee5c8f2", - "0xe63a572771160980afbe50bd2e8e17ff72aa986ff96e827c2473f9aad4450152": "0x905181541a5a5ccf43806626923610e22059ed62f7920214d34968ca02546276" - }, - "Test_GUniFactory": { - "0x99fbce18602720731ae027d057bc0e206a620bbb54da7363d32dc149e7aeaa64": "0xf3e2bc8f6351215210664136231cceca0f7c958d3b200eaed4043a316eca22be" - }, "Test_MockCallback": { - "0x052a304d0a4a19a819c4e1501b45b4f1b49f73d1a7cac910386fe5fc509633a4": "0x23bf8e610bda6f67da3aacddcdc06d5115c1a2f9ca1ad5b05e22270957691f9c", - "0x211f0c56d141fbeca1844d250c6a356beb00eaecc7afef8cd01797aa6b730ba6": "0xa6c46f4d51a8f24eb4784910b5c7e56a0f934dd5c7d3ee1acd792e6d9420a60f", - "0x409bf08f08583ee56edee5cf91c507ce0ee7cd3a33d6b176505cde7e6fab5212": "0x3af6a46a05923aa7ee6595d2e0e2faf686df66d285eafd78a1f5362c5798673c", - "0x42425e602c9c169d71be77da2f8ca1fc0718c859fc8a1a8940e010485b9b2db4": "0x969a131cd92afa82fc9b8107c8ad2528e4e58a906aac95ab5daf67f3d66b0108", - "0x4eb19888c437940923b0c1e78a04f1afe2a75dae78812574ba219f022fc5395a": "0xa0366c4c40ecc27c7524cf434991c72e52cb5c788dcd8e41d57b1b60816ed0c8", - "0x65861ca173680f85c64b5ecb1041d69eba8addf2e4f3acde8ae4b0ec5f2625f5": "0x24e139159750ccac7ce9171d1d0614c0dd259860d3fd32414c3035a067a15a37", - "0x732ffa915e7dee8ddde1f40a62d2a275e439a4fc180fa652b48e733b460fdd52": "0x960ac514bca5346af94c02ffd0e41efc9621655176e00bea3ce189c90c6ae32c", - "0x819496f5a9c8dd326fdaaafa185159c136315d5abee91896f192dbdf2212768d": "0xa1fd5154cfc6047e818dbebfec02844f9e4212b13623859cd22a61f3ce402fd1", - "0x9df1908fad57611d75eb1b9d9a581ddc43baeaa767a14f5ddd26fe371bbcf06b": "0x163971f6fbc7e3f04d19a9c30b7242a052dc8f62112bd599d19c159912551d82", - "0xb10e85dc047de055ec7bcc8d8933f859c8c220aa1540e8d61f36e6391d5975fd": "0xbcd13ec915bd280815fa3972d770be741a950cb4894c3e12c96b6922c8a126f6", - "0xb262c3f41c3ffc3d264c72a40f60b02c497017ed75f73524e008f3ead803a998": "0x409a276310191a7f79a4606d6a0d55a3b7466bb3e11ad8dbfbd86fbda8e28278", - "0xb582fee2a3f0fd5f455d98b1278099ceadb1a7c9d46e93e5100c8cc86aa4a388": "0xec3828c499ca1343fd984a138b8309244ecaf60787aed571366807ad7838abb2", - "0xbcd87b9a1206b37ef12053cbcac10515fbf400962837441462e04daa9e2ddc98": "0x2e1978d15be94d24f05692c57ec78f5aa0042e7cfb1dbfec3810ef54ba3e8045", - "0xc9ae4a5f6e1baf9009493d9068d9f61f8461a99a23532a7f8ed98393106ef560": "0xe96624612c4472683efb4b14e79d214833fe9864ded742ecf6c76301252659d1", - "0xd3e19abee55b3295d081f5777c0e642f7c7023552b5ae035ecc53f706fd90e63": "0xd2ce8e520792abd464cb2b5aa3c4d1e091e8ebdcdc72b29aa2f0580702f8c1ce", - "0xf12ef8015ea1ab65c40a62ad74a87c7a97bbc2736afd3f81f1cec73bc2290b45": "0xae42f9fbf2d802af15e70b2313a514e31e04d39a5f348baae2ed9dc2529f297b", - "0xf36332cb1efc8bc6ea44da0a8971f853fc081b8487c5d4d3e09c1de201a68bc5": "0x37a09d41bd8e44aea31d4bfc7a0ab6f1064d884354b6757a93d2def7dcd7efe5", - "0xf745ee60388fc42e05923e38f1c09237e8514387e3a4b328c576a52aaa29c9b3": "0xb1eb490af267790deb1bac5322223c552d5792852eb9047f8d8d2397f22f9e3d" - }, - "Test_TokenAllowlist": { - "0x11e024c2f0ada4ce2ce048af08354dfa64f38ad959564c55e6bbf48d2ed3822e": "0xf2a54fd5502d17021466768875918dfe0f368bc8a618f66221d0a51d9bf49efe", - "0x78a7c23f669f5df656575693f45f928b7af2ed4bc981cf6dec77bef2c03bb081": "0xd98975cd3e8edc584667d7d31fbfe5dc8f3322c3caa6167cd3db8d59304b437f" - }, - "Test_UniswapV2DirectToLiquidity": { - "0x35b3ed32a998b280e2946e62a3b903c76205813f0ffab1b212bf8a13ea64b508": "0x01e0ba27db009f5e2dfbf22d2ddf9f951075a2c5924831ab9abf79fb89889587" - }, - "Test_UniswapV2Router": { - "0xe6204aa211921628df345ff0b909c863298684cd8ca65de5479af6b70662e622": "0xf5700f795856223d45b9e1b76fa0f23db9d770b25c44cae8f556ae6d1e7bee5e" - }, - "Test_UniswapV3DirectToLiquidity": { - "0xcd0bd9d3a87710a3eee35256e3dc681741c061ca27237997bfbe4a2f60e82742": "0xb80314ff3158ad878c9ea318c4d66a0634c58440b6022b9e9900f22f92e26392" - }, - "Test_UniswapV3Factory": { - "0xbcd657c3390ecd2e1782b6473400c51fa124922eb98b69f1b5192eb0f8e3d3df": "0xfad08a6eaa7974f06cec79e15064de7f6fa17b22ecdb3764988b2c4b1571c613" - }, - "TokenAllowlist": { - "0x09db47d395a68db033a3b222b9d1a212cec8422b03aeafc313aa4d2813c6dd60": "0xe07a005213f35e1f050a4da040d6bc3cae2ad333647b51a6ffa2e7941980043a", - "0x30d8cf89cc8c815884740dc27e72a1f8b5dacbbe39f3d1e35deb436176390b20": "0xaa12d3f9826fbc3d54f789bfc36030a3dfe0ea0a538d4968716e10eecc2b91b2", - "0x48612e5a97a3e434e0158a8ece7bf1c0876f0a82987580936e63084228144cd6": "0xd51382b4a80b7fa68a37f611bf095a15818465788fead6a0a9a0515251cb66e5", - "0x57df0bf7cfe081111b36726104f5bf23ec172de0ba96f2fb36c2e41108989b71": "0x7e184f1697deb99d9bc7ba50324c40e98b987f83a14245174e6eacc6ab240330", - "0x90da485cf65fddc4badddf32cea25b4bd9bb73886c8c43efd9bd24023ae5ae3e": "0xde52518303adaeab837dbb64e6ef884ef3e1851f659e52795c375a465f400799", - "0x9c02e32281bdc5e8d243f1888eca0f993061ed7f21f28cd90582d59b1c3b0b67": "0xa139dbe82632af667302739d6a4ff8f87b7c235a0cfc2a677865264cc7154507", - "0xa4b72411c68147f4439bf4211d12dfbada62d17aba88a86648226a2cb61feff6": "0x18133c11f2fba3e102d2900a469e89202dd55927014a0a4062f21f2444bfcc9e", - "0xcc0cb46859311aa362f48add9ffc284efd8aad3e4ec5a29b68eee7ab1b4cd8c4": "0x99628f6902caaf046d171a8754943a29a3906a9b32f3ee471a12b470363999c7", - "0xcc3bdd1460c690d76ecd2a6068b712cac53eb622458a6246e13a9f22114c33ea": "0x69c7006142e7b85d6c199c18ab3274df41e776aede6923972c1434b4dcc0931c", - "0xdf5415e95420bc8deaf38312453772d847f73c7131a11dcd4bb9b5abdd289d13": "0x0ceea63bb6cc59164b6cabb6605bef340f456cc0e5ce5eca62ec5d981c97afd6", - "0xf30f7c9cc7b51f335e23d73e1aca7e8b8a9bbc357c580d7cf4deb34209d2fd2e": "0xeb55ef52a3b1f1dd0a1afeac73957dffa2d091fe2356f9a53393cf4df3c7d103" - }, - "UniswapV2DirectToLiquidity": { - "0x2952f587868594ee4aed1e483cdbb653d4ef61c9c662a737fc6ae8f271225fe1": "0x000174bce07575898f52c13859450718eea202638a7089ff3d358a023b48bbfb", - "0x32dcc0983af67a522f275494ce3a9a2aa88e6402989414825c965c9ca5fba907": "0xf588d14ef594a9c7c4fa378cfdebcbec0356153259bfe8a58d168f4866f7f2fb", - "0x3da878eaa4aa411d061618a12b80bd1a2896d0c89cdfc57bf95f335ec4c95544": "0xc281eab2cbc2fa51cc5bf3dde7cf9bef394d9db473c797d48a7da85e2c4bfb95", - "0x49a44765f82e21a2455ecafadfd36f1dd7066ae8733dab3bf13fa33f271faabe": "0x036007589a41359e5858eddc394a9e4c2fe917360175a38d6139d77c8d8b0a89", - "0x5e493cf7f7157b59101a569467e19f4a2618cb03f6414d4a8b4f1d2b4ac2912e": "0x43996039523bd2f955e18733dafabd2ab45c0e40865e93cca76dd2773c453d97", - "0x60bc649627ebd535e11e848bd93dbbb4dc819e0279d20e1d3088983f65562dbf": "0xc4534d72b992c13813b52daa775c9dbe230eaf0b139a76fdc78baf72487148d0", - "0x72c2f4c8abb52265f37b52eb8732d93bdf72ff14512a77bb62d85f44283f81c1": "0x193e02d9a140f48949d8e6d06639c2b6f07aa2ac3aede83f1c2806fb603fde06", - "0x77834a13e33676dc8468301cbfe5d88575a3619535b8a8ad47860465e78c5c8b": "0x68b95f9ecf712e05599e2f2a12c0fad379c27bc930d96697fc5e32047ba91b2f", - "0x8b4463835dc772630989c2d09011d747347fc03f6cdf5b4e820ed1ef05f26942": "0xc3a15bdea9242368d2db15a46055a9bf88b551562eda6217f0a02f1d6a93f73b", - "0xbc71cbf901d67b58727ed8599032f3d8b926976ee3cc5881125e2b088a7bde0b": "0x7ebdc84ca6ef21adca9994a32af3690e0ae6a81d2a05caeb96d184fd2e68fa9a", - "0xc985d500ac6c9d631be52d45c756fe09f80e5b40d556953272bbd89b357085cf": "0x64dbbf7b7777277d1a8527e8395c92e4681ec29b5716bb5f9d0a5fd8920bab58", - "0xd1807b8e8fef23d2bd5acb7fe74e7dab661f1ef2f7aaaa66e286398a6d9e8011": "0xec56a79198c3d690cad3e6e39521bd7dd90dc8692cf50a7ab027408d139bd189", - "0xd2933152e78d2d8b4bc2fd47ec67df6c92de359d55ada6804e2071bbe3597d29": "0x8a132dcd9dd6726916af25a65e707d2d6e654b73df598b3b3edd92360b16d4e7", - "0xdc59367cddedf0ee421d7ee6f138d758617043d0f33169b7cb21627362c8715e": "0x2c543613342ae228284625a7e8e9c696d1d816c4fdbf2c49148e91c7eb8a4644", - "0xe8242d2e1eae0d89d0ca278cea284cd4056496fb12fd0405237827e252efdfea": "0x65a71869dd1c30cc12ac786991b9492a5286c8cd942161d738ca34b3e0e29053", - "0xf40b0b3a6c36f510d58633db604bcd978fe1e804891ce9792ac9bbb064cbe97a": "0x4fdd82a331ef80cde3af5905bd2b39c5b1d2f1da38e059fc7e077a355f4caa92", - "0xfbaca62f01c99e602fa7ba74d5be6deb601550f6e77659246f80fec8fa9c8170": "0x729c4bdbdea56155220a562d0e398c08e3273ac5bafe974f18e9fa7148f23f46" - }, - "UniswapV3DirectToLiquidity": { - "0x076b93782e37198c2a62c801267d4971c0da2276424f4232d380714790b596fa": "0xb61cd26ee29ace89139c3ac9f8bc6a81a77449e35a3e1929e1bcf58963784719", - "0x234ab2726d35ce5664ce25cfc80a9e32fc21f0155ca0773e69f737daaab440df": "0x5f83e1a288cbafb92518c563b1f4655de2f3802e9e648897610501cba50cd92d", - "0x7994e3c9afaffb722300f0aaa71ebeeceab756245e82e981180edb84fc0896c6": "0xb8ca51788fb6f83a631aa3f288f8976542c83998f4249a948cc9d6cb9eee227f", - "0x8a637231772ce045881e7e2f78f90b0627e46e92edd646e5ec2a953546603e7d": "0xa02f5d32bca01b1a3c58fa4ae4ba0c5684e02b571271414ab2950a7a80746ba7", - "0x8d22341b4d62cede70950a3665bf0dbf6d26f2f06155bc07e1520b6f8a479b57": "0x4a13f3bb700e88e4d4d98f1d78fc5c8b0f2e112ed4ec1fe9efbaa2e72dcb03e9", - "0x9e46c4894fb34752211ed50d65bd9d28c0bc64b05efbfa8bc2016985dcf8c854": "0xe14c04ae17c798f930e1d15f488a9d97d6aab2ad2f031779d332c6e533cd6531", - "0xa05e45a45cfefb72dfa29ad3818c1cf08e0bd7fddc447d6c999a8e59249958de": "0xad19f43b52bb1d7c2ed09a095ed50eb1f97d17caaa52965932c0eaeabd38cfeb", - "0xa6f487fc2314140d65433ac5c4c88db938b3c5060d2f6606ad5385635960b7df": "0xd6d8d35d364012dc5356867ae1e611cb49a52ff044b669b74038801dc8d38c25", - "0xbec20283ce7bc93c64136a26a297a60583dfc16d6f3f0e82e187c0e22cf5f65c": "0xa9fcd092c072800515406d4d6f36c7338211dfdafce54f7178480f1d89d47efa", - "0xc0e4ff339d51c71014ab77dd1ea8d79eb1aeb129ef9f2bbdd3b725e95a128a0e": "0x1ce3937a3784e7993ad893daf7368bd17b49721935b92d78caacae70ae31c336", - "0xc20973bca1d02a267a6621b19e57e978ed7a4d36d7ffe8a46d4db09026a21a59": "0x0d05817446e0a1831722ea74a58f3b675bfb5abf8b575a2c23a0abaed90f294c", - "0xdb1aca9d9d747dbf091b839f28419e861b79502fa4598efd84b9a7857e9c4ad9": "0xf63a1c74edaa9327592fd21199595de6052e34fca6e81a1236ae14e018eaa1a5", - "0xec0f4ce3ca7fd526e8ee9ec1a9d36ecfca69b1725bfcbe2609ade044c4b858bb": "0xb1edac890bf849adfd17886a15f2dd2e41cae91820536c09fa22233333159564", - "0xeff9c7afc4489c7e0a42e1d83cbd3388e811ab517b6a9a5887c815c6a2f7069c": "0x934b1c21f3402d7497d77c62e824ca83ce44113ffbb8bdb8150085586e9b3c81", - "0xf0a5dea336a37fa63979efe11d875ee7fb6453e5d78244d30113a087b7455f61": "0x71f0e171054a9dd4fd79719da9d8d19603ce79b95d8f8f4a29d8a59da612771b" + "0x426cf8226b10a13d04f17ba04e521d7daaf03e645b464ba54efc07fad6dc8a8c": "0xb7abf06c3751c706a69f0232baa450718a43ac09cbc116c0e82dd21704da40db", + "0x43d106b6a2fe3c4a0e9fee4a0a465361805d10c49ce172d68f7f83ace1349932": "0x2eb7a76b12a9465ee9d39e866a42f906f844e2b46de5e7b063f5bad2c0ba6188", + "0x5432f9e160982177c2a3fbb2a2fcc620a226496c4e007ed6dd629f7d57614033": "0x831023d4aac03aa6f2e0454da07495a8a1340e531d0907af5333c777ca05544e", + "0x54ff55b6d1ebb46c0fe1461a761e4a07e205a0640389fd2811d6be3549ac8baa": "0x7d5bd83be12dc467e6486995580723f0ef6aca66e2dee70534c00f89f4215a7d", + "0x60169f88eea4d35e42a0bec47442a3f97de4e0884fe7475f9f998cdf48c96a0b": "0xe5a7fd384e0a5f96307ca54033e794dd5058289ebac52ff2b71ab0d3004a59f6", + "0x604680995923aa5434fe5cd8cfad100113b0508c54daa044c8f61d7c969c8085": "0x58042b9b6d9cd28a981951e66b3475b621a0d5b3902f26d87ab176ef521cd629", + "0x6dc584de032803d792ee519d45da7c51f8b7e488fba99e94df9df5eb0c115c44": "0x9ea720fb42063511eeab7bf3acb8e75888df354e2c8f51f177934f749f1a107b", + "0x902c0362b35843c3f65af518d988cb3a134095795b6f05e8c3d9da8ea75f4c7c": "0x05c5bcbd3a7d6922281dcdbe7228a72dde98509a5df55215b5311efc4c18e7cb", + "0xa6890d932c1fee9ff91a5b8d1e3bf11b23a0c5436ef17aa4ea8c39ff7b8ab776": "0x90483d809fb0dfdc4f58d4e9e953ba596afcc9221b757ca5ed02f9666a2cb5be", + "0xac98903e3e6f0e92b225e512185e310cf7ef9e0af48ad7851ccf99a069abfd7e": "0x9ea0b85c5c718452ffc299813d6b2097b2d40bcd0f49242ec1e0546676a75707", + "0xafae22bbef56258b70732dc56a9553e764d05e74db546d73240fc9361514ad04": "0xe884bb86432a493606b07af801c2a1393acfb4a335d8866f0e193d97e33fe36d", + "0xb723641b4f109fd8c36db9b4d522df216e6f4e8524b5003979382cc40a524e7d": "0x1cf74b62692be8436dcfa19160004cb61457d997f2bea3a2ac2cbdf2478f5768", + "0xb87246f84fb005bf2631e1cdfc98c9286e5b8af979f898713658b7c4ddf4feab": "0x6e3fc44d8fc9a60f8887727b8c83a9f448fcf66a73eefae8474b1cabae0e98c1", + "0xc19c4b461c3e3606c50bfe2cf6bea1c952126ad6d1c7ea93c973b6cbe4f843c8": "0xa35b8a693457031a4c878b58bd45068324c2f126d89dd960fb1eefe58542339f", + "0xdd942cb042a47e3770725d9b26a96c75c5d11496e737e0c8a3511343ed15228f": "0x830a8f559ff6674a4b642a3c57295d94cdcc77b55762abc3294d3c2399b54a9e", + "0xec5400489893d4b899500876462c2ab1368f77ae49ceaeae3919910e888433a1": "0xf39189255219fcc619abc4c829603915da5814e61ac5a37762f06f7e9afde4ce", + "0xffb73d16a441bf4e1b59d3a9c210265c5b9642345ed0385fc6271193b9f9618e": "0xe6be3c24fff69b572a81fd0afc6276a7a87f73795f39bedf12436a71709d6c26", + "0xffbe71ffa17aa3860707d69f078e4aeebd5010f8ffc02927a5e907931b568bb3": "0x2573f913b445d5f7272c9b424dad5cde157eed554f683d32a2a5e95adf68b788" } } diff --git a/script/salts/test/TestSalts.s.sol b/script/salts/test/TestSalts.s.sol index 55318e11c..c12717c3b 100644 --- a/script/salts/test/TestSalts.s.sol +++ b/script/salts/test/TestSalts.s.sol @@ -2,34 +2,18 @@ pragma solidity 0.8.19; // Scripting libraries -import {Script} from "lib/forge-std/src/Script.sol"; -import {WithEnvironment} from "script/deploy/WithEnvironment.s.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; -import {WithSalts} from "script/salts/WithSalts.s.sol"; -import {console2} from "forge-std/console2.sol"; +import {Script} from "@forge-std-1.9.1/Script.sol"; +import {WithEnvironment} from "../../deploy/WithEnvironment.s.sol"; +import {Permit2User} from "../../../test/lib/permit2/Permit2User.sol"; +import {WithSalts} from "../WithSalts.s.sol"; -import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; -import {MockCallback} from "test/callbacks/MockCallback.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; -import {CappedMerkleAllowlist} from "src/callbacks/allowlists/CappedMerkleAllowlist.sol"; -import {AllocatedMerkleAllowlist} from "src/callbacks/allowlists/AllocatedMerkleAllowlist.sol"; -import {TokenAllowlist} from "src/callbacks/allowlists/TokenAllowlist.sol"; -import {UniswapV2DirectToLiquidity} from "src/callbacks/liquidity/UniswapV2DTL.sol"; -import {UniswapV3DirectToLiquidity} from "src/callbacks/liquidity/UniswapV3DTL.sol"; -// import {BaselineAxisLaunch} from "src/callbacks/liquidity/BaselineV2/BaselineAxisLaunch.sol"; -// import {BALwithAllocatedAllowlist} from -// "src/callbacks/liquidity/BaselineV2/BALwithAllocatedAllowlist.sol"; -import {UniswapV3Factory} from "test/lib/uniswap-v3/UniswapV3Factory.sol"; -import {GUniFactory} from "lib/g-uni-v1-core/contracts/GUniFactory.sol"; -import {UniswapV2Router02} from "uniswap-v2-periphery/UniswapV2Router02.sol"; +import {MockCallback} from "../../../test/callbacks/MockCallback.sol"; +import {Callbacks} from "../../../src/lib/Callbacks.sol"; -import {TestConstants} from "test/Constants.sol"; +import {TestConstants} from "../../../test/Constants.sol"; contract TestSalts is Script, WithEnvironment, Permit2User, WithSalts, TestConstants { string internal constant _MOCK_CALLBACK = "MockCallback"; - string internal constant _CAPPED_MERKLE_ALLOWLIST = "CappedMerkleAllowlist"; - string internal constant _ALLOCATED_MERKLE_ALLOWLIST = "AllocatedMerkleAllowlist"; - string internal constant _TOKEN_ALLOWLIST = "TokenAllowlist"; function _setUp(string calldata chain_) internal { _loadEnv(chain_); @@ -376,231 +360,4 @@ contract TestSalts is Script, WithEnvironment, Permit2User, WithSalts, TestConst (bytecodePath, bytecodeHash) = _writeBytecode(_MOCK_CALLBACK, contractCode, args); _setTestSalt(bytecodePath, "11", _MOCK_CALLBACK, bytecodeHash); } - - function generateCappedMerkleAllowlist() public { - // 10001000 = 0x88 - bytes memory args = abi.encode( - _AUCTION_HOUSE, - Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: false, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }) - ); - bytes memory contractCode = type(CappedMerkleAllowlist).creationCode; - (string memory bytecodePath, bytes32 bytecodeHash) = - _writeBytecode(_CAPPED_MERKLE_ALLOWLIST, contractCode, args); - _setTestSalt(bytecodePath, "88", _CAPPED_MERKLE_ALLOWLIST, bytecodeHash); - - // 10010000 = 0x90 - args = abi.encode( - _AUCTION_HOUSE, - Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: false, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }) - ); - (bytecodePath, bytecodeHash) = _writeBytecode(_CAPPED_MERKLE_ALLOWLIST, contractCode, args); - _setTestSalt(bytecodePath, "90", _CAPPED_MERKLE_ALLOWLIST, bytecodeHash); - } - - function generateAllocatedMerkleAllowlist() public { - // 10001000 = 0x88 - bytes memory args = abi.encode( - _AUCTION_HOUSE, - Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: false, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }) - ); - bytes memory contractCode = type(AllocatedMerkleAllowlist).creationCode; - (string memory bytecodePath, bytes32 bytecodeHash) = - _writeBytecode(_ALLOCATED_MERKLE_ALLOWLIST, contractCode, args); - _setTestSalt(bytecodePath, "88", _ALLOCATED_MERKLE_ALLOWLIST, bytecodeHash); - - // 10010000 = 0x90 - args = abi.encode( - _AUCTION_HOUSE, - Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: false, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }) - ); - (bytecodePath, bytecodeHash) = - _writeBytecode(_ALLOCATED_MERKLE_ALLOWLIST, contractCode, args); - _setTestSalt(bytecodePath, "90", _ALLOCATED_MERKLE_ALLOWLIST, bytecodeHash); - } - - function generateTokenAllowlist() public { - // 10001000 = 0x88 - bytes memory args = abi.encode( - _AUCTION_HOUSE, - Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: false, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }) - ); - bytes memory contractCode = type(TokenAllowlist).creationCode; - (string memory bytecodePath, bytes32 bytecodeHash) = - _writeBytecode(_TOKEN_ALLOWLIST, contractCode, args); - _setTestSalt(bytecodePath, "88", _TOKEN_ALLOWLIST, bytecodeHash); - - // 10010000 = 0x90 - args = abi.encode( - _AUCTION_HOUSE, - Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: false, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }) - ); - (bytecodePath, bytecodeHash) = _writeBytecode(_TOKEN_ALLOWLIST, contractCode, args); - _setTestSalt(bytecodePath, "90", _TOKEN_ALLOWLIST, bytecodeHash); - } - - function generateUniswapV2Router() public { - bytes memory args = abi.encode(_UNISWAP_V2_FACTORY, address(0)); - bytes memory contractCode = type(UniswapV2Router02).creationCode; - (string memory bytecodePath, bytes32 bytecodeHash) = - _writeBytecode("UniswapV2Router", contractCode, args); - _setTestSalt(bytecodePath, "AA", "UniswapV2Router", bytecodeHash); - - // Fetch the salt that was set - bytes32 uniswapV2RouterSalt = _getSalt("Test_UniswapV2Router", contractCode, args); - - // Get the address of the UniswapV2Router - // Update the `_UNISWAP_V2_ROUTER` constant with this value - vm.prank(_CREATE2_DEPLOYER); - UniswapV2Router02 uniswapV2Router = - new UniswapV2Router02{salt: uniswapV2RouterSalt}(_UNISWAP_V2_FACTORY, address(0)); - console2.log("UniswapV2Router address: ", address(uniswapV2Router)); - } - - function generateUniswapV2DirectToLiquidity() public { - bytes memory args = abi.encode(_AUCTION_HOUSE, _UNISWAP_V2_FACTORY, _UNISWAP_V2_ROUTER); - bytes memory contractCode = type(UniswapV2DirectToLiquidity).creationCode; - (string memory bytecodePath, bytes32 bytecodeHash) = - _writeBytecode("UniswapV2DirectToLiquidity", contractCode, args); - _setTestSalt(bytecodePath, "E6", "UniswapV2DirectToLiquidity", bytecodeHash); - } - - function generateUniswapV3DirectToLiquidity() public { - bytes memory args = abi.encode(_AUCTION_HOUSE, _UNISWAP_V3_FACTORY, _GUNI_FACTORY); - bytes memory contractCode = type(UniswapV3DirectToLiquidity).creationCode; - (string memory bytecodePath, bytes32 bytecodeHash) = - _writeBytecode("UniswapV3DirectToLiquidity", contractCode, args); - _setTestSalt(bytecodePath, "E6", "UniswapV3DirectToLiquidity", bytecodeHash); - } - - function generateGUniFactory() public { - // Generate a salt for a GUniFactory - bytes memory args = abi.encode(_UNISWAP_V3_FACTORY); - bytes memory contractCode = type(GUniFactory).creationCode; - (string memory bytecodePath, bytes32 bytecodeHash) = - _writeBytecode("GUniFactory", contractCode, args); - _setTestSaltWithDeployer(bytecodePath, "AA", "GUniFactory", bytecodeHash, _CREATE2_DEPLOYER); - - // Fetch the salt that was set - bytes32 gUniFactorySalt = _getSalt("Test_GUniFactory", contractCode, args); - - // Get the address of the GUniFactory - // Update the `_GUNI_FACTORY` constant with this value - vm.prank(_CREATE2_DEPLOYER); - GUniFactory gUniFactory = new GUniFactory{salt: gUniFactorySalt}(_UNISWAP_V3_FACTORY); - console2.log("GUniFactory address: ", address(gUniFactory)); - } - - function generateUniswapV3Factory() public { - // Generate a salt for a GUniFactory - bytes memory args = abi.encode(); - bytes memory contractCode = type(UniswapV3Factory).creationCode; - (string memory bytecodePath, bytes32 bytecodeHash) = - _writeBytecode("UniswapV3Factory", contractCode, args); - _setTestSaltWithDeployer( - bytecodePath, "AA", "UniswapV3Factory", bytecodeHash, _CREATE2_DEPLOYER - ); - - // Fetch the salt that was set - bytes32 uniswapV3FactorySalt = _getSalt("Test_UniswapV3Factory", contractCode, args); - - // Get the address of the UniswapV3Factory - // Update the `_UNISWAP_V3_FACTORY` constant with this value - vm.prank(_CREATE2_DEPLOYER); - UniswapV3Factory uniswapV3Factory = new UniswapV3Factory{salt: uniswapV3FactorySalt}(); - console2.log("UniswapV3Factory address: ", address(uniswapV3Factory)); - } - - // function generateBaselineQuoteToken() public { - // // Generate a salt for a MockERC20 quote token - // bytes memory qtArgs = abi.encode("Quote Token", "QT", 18); - // bytes memory qtContractCode = type(MockERC20).creationCode; - // (string memory qtBytecodePath, bytes32 qtBytecodeHash) = - // _writeBytecode("QuoteToken", qtContractCode, qtArgs); - // _setTestSaltWithDeployer( - // qtBytecodePath, "AA", "QuoteToken", qtBytecodeHash, _CREATE2_DEPLOYER - // ); - - // // Fetch the salt that was set - // bytes32 quoteTokenSalt = _getSalt("Test_QuoteToken", qtContractCode, qtArgs); - - // // Get the address of the quote token - // // Update the `_BASELINE_QUOTE_TOKEN` constants with this value - // vm.prank(_CREATE2_DEPLOYER); - // MockERC20 quoteToken = new MockERC20{salt: quoteTokenSalt}("Quote Token", "QT", 18); - // console2.log("Quote Token address: ", address(quoteToken)); - // } - - // function generateBaselineAxisLaunch() public { - // // Get the salt - // bytes memory callbackArgs = - // abi.encode(_AUCTION_HOUSE, _BASELINE_KERNEL, _BASELINE_QUOTE_TOKEN, _OWNER); - // (string memory callbackBytecodePath, bytes32 callbackBytecodeHash) = _writeBytecode( - // "BaselineAxisLaunch", type(BaselineAxisLaunch).creationCode, callbackArgs - // ); - // _setTestSalt(callbackBytecodePath, "EF", "BaselineAxisLaunch", callbackBytecodeHash); - // } - - // function generateBaselineAllocatedAllowlist() public { - // // Get the salt - // bytes memory callbackArgs = - // abi.encode(_AUCTION_HOUSE, _BASELINE_KERNEL, _BASELINE_QUOTE_TOKEN, _OWNER); - // (string memory callbackBytecodePath, bytes32 callbackBytecodeHash) = _writeBytecode( - // "BaselineAllocatedAllowlist", type(BALwithAllocatedAllowlist).creationCode, callbackArgs - // ); - // _setTestSalt(callbackBytecodePath, "EF", "BaselineAllocatedAllowlist", callbackBytecodeHash); - // } } diff --git a/soldeer.lock b/soldeer.lock new file mode 100644 index 000000000..a6863b27c --- /dev/null +++ b/soldeer.lock @@ -0,0 +1,30 @@ + +[[dependencies]] +name = "forge-std" +version = "1.9.1" +source = "https://soldeer-revisions.s3.amazonaws.com/forge-std/v1_9_1_03-07-2024_14:44:59_forge-std-v1.9.1.zip" +checksum = "110b35ad3604d91a919c521c71206c18cd07b29c750bd90b5cbbaf37288c9636" + +[[dependencies]] +name = "solmate" +version = "6.7.0" +source = "git@github.com:transmissions11/solmate.git" +checksum = "97bdb2003b70382996a79a406813f76417b1cf90" + +[[dependencies]] +name = "solady" +version = "0.0.124" +source = "https://soldeer-revisions.s3.amazonaws.com/solady/0_0_124_22-01-2024_13:28:04_solady.zip" +checksum = "9342385eaad08f9bb5408be0b41b241dd2b974c001f7da8c3b1ac552b52ce16b" + +[[dependencies]] +name = "@openzeppelin-contracts" +version = "4.9.2" +source = "https://soldeer-revisions.s3.amazonaws.com/@openzeppelin-contracts/4_9_2_22-01-2024_13:13:52_contracts.zip" +checksum = "0f4450671798ea5659e6391876a3cf443ca50a696d9b556ac622ec7660bce306" + +[[dependencies]] +name = "clones-with-immutable-args" +version = "1.1.1" +source = "git@github.com:wighawag/clones-with-immutable-args.git" +checksum = "f5ca191afea933d50a36d101009b5644dc28bc99" diff --git a/src/AtomicAuctionHouse.sol b/src/AtomicAuctionHouse.sol index a87d4d50b..d6fc1bbcf 100644 --- a/src/AtomicAuctionHouse.sol +++ b/src/AtomicAuctionHouse.sol @@ -2,21 +2,21 @@ pragma solidity 0.8.19; // Interfaces -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAtomicAuctionHouse} from "src/interfaces/IAtomicAuctionHouse.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; +import {IAuction} from "./interfaces/modules/IAuction.sol"; +import {IAtomicAuctionHouse} from "./interfaces/IAtomicAuctionHouse.sol"; +import {ICallback} from "./interfaces/ICallback.sol"; // External libraries -import {ERC20} from "lib/solmate/src/tokens/ERC20.sol"; +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; // Internal libaries -import {Transfer} from "src/lib/Transfer.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; +import {Transfer} from "./lib/Transfer.sol"; +import {Callbacks} from "./lib/Callbacks.sol"; // Auction -import {AuctionHouse} from "src/bases/AuctionHouse.sol"; -import {AuctionModule} from "src/modules/Auction.sol"; -import {AtomicAuctionModule} from "src/modules/auctions/AtomicAuctionModule.sol"; +import {AuctionHouse} from "./bases/AuctionHouse.sol"; +import {AuctionModule} from "./modules/Auction.sol"; +import {AtomicAuctionModule} from "./modules/auctions/AtomicAuctionModule.sol"; /// @title AtomicAuctionHouse /// @notice As its name implies, the AtomicAuctionHouse is where atomic auction lots are created and purchased. The core protocol logic is implemented here. diff --git a/src/AtomicCatalogue.sol b/src/AtomicCatalogue.sol index ac326760e..f04dfbb38 100644 --- a/src/AtomicCatalogue.sol +++ b/src/AtomicCatalogue.sol @@ -2,13 +2,13 @@ pragma solidity 0.8.19; // Interfaces -import {IAtomicAuction} from "src/interfaces/modules/IAtomicAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {IFeeManager} from "src/interfaces/IFeeManager.sol"; -import {IAtomicCatalogue} from "src/interfaces/IAtomicCatalogue.sol"; +import {IAtomicAuction} from "./interfaces/modules/IAtomicAuction.sol"; +import {IAuctionHouse} from "./interfaces/IAuctionHouse.sol"; +import {IFeeManager} from "./interfaces/IFeeManager.sol"; +import {IAtomicCatalogue} from "./interfaces/IAtomicCatalogue.sol"; // Base contracts -import {Catalogue} from "src/bases/Catalogue.sol"; +import {Catalogue} from "./bases/Catalogue.sol"; /// @notice Contract that provides view and aggregation functions for atomic auctions without having to know the specific auction module address contract AtomicCatalogue is IAtomicCatalogue, Catalogue { diff --git a/src/BatchAuctionHouse.sol b/src/BatchAuctionHouse.sol index b96b0d130..732dc7f44 100644 --- a/src/BatchAuctionHouse.sol +++ b/src/BatchAuctionHouse.sol @@ -2,24 +2,24 @@ pragma solidity 0.8.19; // Interfaces -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; -import {IBatchAuctionHouse} from "src/interfaces/IBatchAuctionHouse.sol"; +import {IAuction} from "./interfaces/modules/IAuction.sol"; +import {ICallback} from "./interfaces/ICallback.sol"; +import {IBatchAuction} from "./interfaces/modules/IBatchAuction.sol"; +import {IBatchAuctionHouse} from "./interfaces/IBatchAuctionHouse.sol"; // Internal libraries -import {Transfer} from "src/lib/Transfer.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; +import {Transfer} from "./lib/Transfer.sol"; +import {Callbacks} from "./lib/Callbacks.sol"; // External libraries -import {ERC20} from "solmate/tokens/ERC20.sol"; +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; // Auctions -import {AuctionHouse} from "src/bases/AuctionHouse.sol"; -import {AuctionModule} from "src/modules/Auction.sol"; -import {BatchAuctionModule} from "src/modules/auctions/BatchAuctionModule.sol"; +import {AuctionHouse} from "./bases/AuctionHouse.sol"; +import {AuctionModule} from "./modules/Auction.sol"; +import {BatchAuctionModule} from "./modules/auctions/BatchAuctionModule.sol"; -import {fromVeecode} from "src/modules/Keycode.sol"; +import {fromVeecode} from "./modules/Keycode.sol"; /// @title BatchAuctionHouse /// @notice As its name implies, the BatchAuctionHouse is where batch auctions are created, bid on, and settled. The core protocol logic is implemented here. diff --git a/src/BatchCatalogue.sol b/src/BatchCatalogue.sol index f44f4eaf6..b188ed920 100644 --- a/src/BatchCatalogue.sol +++ b/src/BatchCatalogue.sol @@ -2,12 +2,12 @@ pragma solidity 0.8.19; // Interfaces -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {IBatchCatalogue} from "src/interfaces/IBatchCatalogue.sol"; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; +import {IAuctionHouse} from "./interfaces/IAuctionHouse.sol"; +import {IBatchCatalogue} from "./interfaces/IBatchCatalogue.sol"; +import {IBatchAuction} from "./interfaces/modules/IBatchAuction.sol"; // Base contracts -import {Catalogue} from "src/bases/Catalogue.sol"; +import {Catalogue} from "./bases/Catalogue.sol"; /// @notice Contract that provides view and aggregation functions for batch auctions without having to know the specific auction module address contract BatchCatalogue is IBatchCatalogue, Catalogue { diff --git a/src/bases/AuctionHouse.sol b/src/bases/AuctionHouse.sol index 54980e572..90b3cf6d4 100644 --- a/src/bases/AuctionHouse.sol +++ b/src/bases/AuctionHouse.sol @@ -2,30 +2,30 @@ pragma solidity 0.8.19; // Interfaces -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; -import {IDerivative} from "src/interfaces/modules/IDerivative.sol"; -import {IFeeManager} from "src/interfaces/IFeeManager.sol"; +import {IAuction} from "../interfaces/modules/IAuction.sol"; +import {IAuctionHouse} from "../interfaces/IAuctionHouse.sol"; +import {ICallback} from "../interfaces/ICallback.sol"; +import {IDerivative} from "../interfaces/modules/IDerivative.sol"; +import {IFeeManager} from "../interfaces/IFeeManager.sol"; // Internal libraries -import {Transfer} from "src/lib/Transfer.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; +import {Transfer} from "../lib/Transfer.sol"; +import {Callbacks} from "../lib/Callbacks.sol"; // External libraries -import {ERC20} from "lib/solmate/src/tokens/ERC20.sol"; -import {ReentrancyGuard} from "lib/solmate/src/utils/ReentrancyGuard.sol"; +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; +import {ReentrancyGuard} from "@solmate-6.7.0/utils/ReentrancyGuard.sol"; // Internal dependencies import { fromKeycode, fromVeecode, keycodeFromVeecode, Keycode, Veecode -} from "src/modules/Keycode.sol"; -import {Module, WithModules} from "src/modules/Modules.sol"; -import {FeeManager} from "src/bases/FeeManager.sol"; +} from "../modules/Keycode.sol"; +import {Module, WithModules} from "../modules/Modules.sol"; +import {FeeManager} from "../bases/FeeManager.sol"; -import {AuctionModule} from "src/modules/Auction.sol"; -import {DerivativeModule} from "src/modules/Derivative.sol"; -import {CondenserModule} from "src/modules/Condenser.sol"; +import {AuctionModule} from "../modules/Auction.sol"; +import {DerivativeModule} from "../modules/Derivative.sol"; +import {CondenserModule} from "../modules/Condenser.sol"; /// @title AuctionHouse /// @notice The base AuctionHouse contract defines common structures and functions across auction types (atomic and batch). diff --git a/src/callbacks/BaseCallback.sol b/src/bases/BaseCallback.sol similarity index 98% rename from src/callbacks/BaseCallback.sol rename to src/bases/BaseCallback.sol index 9a612006a..d885718ee 100644 --- a/src/callbacks/BaseCallback.sol +++ b/src/bases/BaseCallback.sol @@ -2,10 +2,10 @@ pragma solidity 0.8.19; // Interfaces -import {ICallback} from "src/interfaces/ICallback.sol"; +import {ICallback} from "../interfaces/ICallback.sol"; // Internal libraries -import {Callbacks} from "src/lib/Callbacks.sol"; +import {Callbacks} from "../lib/Callbacks.sol"; /// @title BaseCallback /// @notice This contract implements standard behaviours for callbacks to the Axis auction system. diff --git a/src/bases/Catalogue.sol b/src/bases/Catalogue.sol index 1c9418de2..b5e325381 100644 --- a/src/bases/Catalogue.sol +++ b/src/bases/Catalogue.sol @@ -2,15 +2,15 @@ pragma solidity 0.8.19; // Interfaces -import {ICallback} from "src/interfaces/ICallback.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {ICatalogue} from "src/interfaces/ICatalogue.sol"; +import {ICallback} from "../interfaces/ICallback.sol"; +import {IAuction} from "../interfaces/modules/IAuction.sol"; +import {IAuctionHouse} from "../interfaces/IAuctionHouse.sol"; +import {ICatalogue} from "../interfaces/ICatalogue.sol"; // Internal dependencies import { Keycode, keycodeFromVeecode, fromKeycode, Veecode, fromVeecode -} from "src/modules/Keycode.sol"; +} from "../modules/Keycode.sol"; /// @notice Contract that provides view functions for auctions abstract contract Catalogue is ICatalogue { diff --git a/src/bases/FeeManager.sol b/src/bases/FeeManager.sol index 90fb8d5fe..73e408544 100644 --- a/src/bases/FeeManager.sol +++ b/src/bases/FeeManager.sol @@ -2,17 +2,17 @@ pragma solidity 0.8.19; // Interfaces -import {IFeeManager} from "src/interfaces/IFeeManager.sol"; +import {IFeeManager} from "../interfaces/IFeeManager.sol"; // Internal libraries -import {Transfer} from "src/lib/Transfer.sol"; +import {Transfer} from "../lib/Transfer.sol"; // External libraries -import {ERC20} from "lib/solmate/src/tokens/ERC20.sol"; -import {ReentrancyGuard} from "lib/solmate/src/utils/ReentrancyGuard.sol"; -import {FixedPointMathLib as Math} from "lib/solmate/src/utils/FixedPointMathLib.sol"; +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; +import {ReentrancyGuard} from "@solmate-6.7.0/utils/ReentrancyGuard.sol"; +import {FixedPointMathLib as Math} from "@solmate-6.7.0/utils/FixedPointMathLib.sol"; -import {Keycode} from "src/modules/Keycode.sol"; +import {Keycode} from "../modules/Keycode.sol"; /// @title FeeManager /// @notice Defines fees for auctions and manages the collection and distribution of fees diff --git a/src/blast/BlastAtomicAuctionHouse.sol b/src/blast/BlastAtomicAuctionHouse.sol index 8fee04e4f..f8188e5ab 100644 --- a/src/blast/BlastAtomicAuctionHouse.sol +++ b/src/blast/BlastAtomicAuctionHouse.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; -import {BlastAuctionHouse} from "src/blast/BlastAuctionHouse.sol"; +import {AtomicAuctionHouse} from "../AtomicAuctionHouse.sol"; +import {BlastAuctionHouse} from "./BlastAuctionHouse.sol"; contract BlastAtomicAuctionHouse is AtomicAuctionHouse, BlastAuctionHouse { // ========== CONSTRUCTOR ========== // diff --git a/src/blast/BlastAuctionHouse.sol b/src/blast/BlastAuctionHouse.sol index ee061b4ee..bc9a5c841 100644 --- a/src/blast/BlastAuctionHouse.sol +++ b/src/blast/BlastAuctionHouse.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -import {AuctionHouse} from "src/bases/AuctionHouse.sol"; -import {Veecode} from "src/modules/Modules.sol"; +import {AuctionHouse} from "../bases/AuctionHouse.sol"; +import {Veecode} from "../modules/Modules.sol"; enum YieldMode { AUTOMATIC, diff --git a/src/blast/BlastBatchAuctionHouse.sol b/src/blast/BlastBatchAuctionHouse.sol index 442207fb4..3212489b1 100644 --- a/src/blast/BlastBatchAuctionHouse.sol +++ b/src/blast/BlastBatchAuctionHouse.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; -import {BlastAuctionHouse} from "src/blast/BlastAuctionHouse.sol"; +import {BatchAuctionHouse} from "../BatchAuctionHouse.sol"; +import {BlastAuctionHouse} from "./BlastAuctionHouse.sol"; contract BlastBatchAuctionHouse is BatchAuctionHouse, BlastAuctionHouse { // ========== CONSTRUCTOR ========== // diff --git a/src/blast/modules/auctions/atomic/BlastFPS.sol b/src/blast/modules/auctions/atomic/BlastFPS.sol index c7c80139d..d9424e4cd 100644 --- a/src/blast/modules/auctions/atomic/BlastFPS.sol +++ b/src/blast/modules/auctions/atomic/BlastFPS.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -import {FixedPriceSale} from "src/modules/auctions/atomic/FPS.sol"; -import {BlastGas} from "src/blast/modules/BlastGas.sol"; +import {FixedPriceSale} from "../../../../modules/auctions/atomic/FPS.sol"; +import {BlastGas} from "../../BlastGas.sol"; contract BlastFPS is FixedPriceSale, BlastGas { // ========== CONSTRUCTOR ========== // diff --git a/src/blast/modules/auctions/batch/BlastEMP.sol b/src/blast/modules/auctions/batch/BlastEMP.sol index 47481922f..31d9b7375 100644 --- a/src/blast/modules/auctions/batch/BlastEMP.sol +++ b/src/blast/modules/auctions/batch/BlastEMP.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {BlastGas} from "src/blast/modules/BlastGas.sol"; +import {EncryptedMarginalPrice} from "../../../../modules/auctions/batch/EMP.sol"; +import {BlastGas} from "../../BlastGas.sol"; contract BlastEMP is EncryptedMarginalPrice, BlastGas { // ========== CONSTRUCTOR ========== // diff --git a/src/blast/modules/auctions/batch/BlastFPB.sol b/src/blast/modules/auctions/batch/BlastFPB.sol index 2086b6c18..9bcd2ca9d 100644 --- a/src/blast/modules/auctions/batch/BlastFPB.sol +++ b/src/blast/modules/auctions/batch/BlastFPB.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -import {FixedPriceBatch} from "src/modules/auctions/batch/FPB.sol"; -import {BlastGas} from "src/blast/modules/BlastGas.sol"; +import {FixedPriceBatch} from "../../../../modules/auctions/batch/FPB.sol"; +import {BlastGas} from "../../BlastGas.sol"; contract BlastFPB is FixedPriceBatch, BlastGas { // ========== CONSTRUCTOR ========== // diff --git a/src/blast/modules/derivatives/BlastLinearVesting.sol b/src/blast/modules/derivatives/BlastLinearVesting.sol index e2e1306ad..cf7596c81 100644 --- a/src/blast/modules/derivatives/BlastLinearVesting.sol +++ b/src/blast/modules/derivatives/BlastLinearVesting.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -import {LinearVesting} from "src/modules/derivatives/LinearVesting.sol"; -import {BlastGas} from "src/blast/modules/BlastGas.sol"; +import {LinearVesting} from "../../../modules/derivatives/LinearVesting.sol"; +import {BlastGas} from "../BlastGas.sol"; contract BlastLinearVesting is LinearVesting, BlastGas { // ========== CONSTRUCTOR ========== // diff --git a/src/callbacks/allowlists/AllocatedMerkleAllowlist.sol b/src/callbacks/allowlists/AllocatedMerkleAllowlist.sol deleted file mode 100644 index 30d47e90c..000000000 --- a/src/callbacks/allowlists/AllocatedMerkleAllowlist.sol +++ /dev/null @@ -1,106 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import {MerkleProof} from "lib/openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol"; - -import {MerkleAllowlist} from "src/callbacks/allowlists/MerkleAllowlist.sol"; -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; - -/// @title AllocatedMerkleAllowlist -/// @notice This contract extends the MerkleAllowlist contract to implement a merkle tree-based allowlist for buyers to participate in an auction. -/// In this implementation, each buyer has an individual purchase limit that is set. -contract AllocatedMerkleAllowlist is MerkleAllowlist { - // ========== ERRORS ========== // - - /// @notice Error message when the bid amount exceeds the limit assigned to a buyer - error Callback_ExceedsLimit(); - - // ========== STATE VARIABLES ========== // - - /// @notice Tracks the cumulative amount spent by a buyer on a lot - mapping(uint96 lotId => mapping(address buyer => uint256 spent)) public lotBuyerSpent; - - // ========== CONSTRUCTOR ========== // - - // PERMISSIONS - // onCreate: true - // onCancel: false - // onCurate: false - // onPurchase: true - // onBid: true - // onSettle: false - // receiveQuoteTokens: false - // sendBaseTokens: false - // Contract prefix should be: 10011000 = 0x98 - - constructor( - address auctionHouse_, - Callbacks.Permissions memory permissions_ - ) MerkleAllowlist(auctionHouse_, permissions_) {} - - // ========== CALLBACK FUNCTIONS ========== // - - /// @inheritdoc BaseCallback - /// @dev This function performs the following: - /// - Calls the `_onBuy()` function to validate the buyer's purchase - /// - /// @param callbackData_ abi-encoded data: (bytes32[], uint256) representing the merkle proof and allocated amount - function _onPurchase( - uint96 lotId_, - address buyer_, - uint256 amount_, - uint256, - bool, - bytes calldata callbackData_ - ) internal override { - _onBuy(lotId_, buyer_, amount_, callbackData_); - } - - /// @inheritdoc BaseCallback - /// @dev This function performs the following: - /// - Calls the `_onBuy()` function to validate the buyer's bid - /// - /// @param callbackData_ abi-encoded data: (bytes32[], uint256) representing the proof and allocated amount - function _onBid( - uint96 lotId_, - uint64, - address buyer_, - uint256 amount_, - bytes calldata callbackData_ - ) internal override { - _onBuy(lotId_, buyer_, amount_, callbackData_); - } - - // ========== INTERNAL FUNCTIONS ========== // - - function _onBuy( - uint96 lotId_, - address buyer_, - uint256 amount_, - bytes calldata callbackData_ - ) internal { - // Validate that the buyer is allowed to participate - - // Decode the merkle proof and allocated amount from buyer submitted callback data - (bytes32[] memory proof, uint256 allocatedAmount) = - abi.decode(callbackData_, (bytes32[], uint256)); - - // Get the leaf for the buyer - bytes32 leaf = keccak256(bytes.concat(keccak256(abi.encode(buyer_, allocatedAmount)))); - - // Validate the merkle proof - if (!MerkleProof.verify(proof, lotMerkleRoot[lotId_], leaf)) { - revert Callback_NotAuthorized(); - } - - // Validate that the buyer can spend the amount - // They cannot spend over the allocated amount - if (lotBuyerSpent[lotId_][buyer_] + amount_ > allocatedAmount) { - revert Callback_ExceedsLimit(); - } - - // Update the buyer's spent amount - lotBuyerSpent[lotId_][buyer_] += amount_; - } -} diff --git a/src/callbacks/allowlists/CappedMerkleAllowlist.sol b/src/callbacks/allowlists/CappedMerkleAllowlist.sol deleted file mode 100644 index 9565de771..000000000 --- a/src/callbacks/allowlists/CappedMerkleAllowlist.sol +++ /dev/null @@ -1,105 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import {MerkleAllowlist} from "src/callbacks/allowlists/MerkleAllowlist.sol"; -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; - -/// @title CappedMerkleAllowlist -/// @notice This contract extends the MerkleAllowlist contract to implement a merkle tree-based allowlist for buyers to participate in an auction. -/// In this implementation, each buyer has a purchase limit that is set for all buyers in an auction lot. -contract CappedMerkleAllowlist is MerkleAllowlist { - // ========== ERRORS ========== // - - /// @notice Error message when the bid amount exceeds the limit assigned to a buyer - error Callback_ExceedsLimit(); - - // ========== STATE VARIABLES ========== // - - /// @notice Stores the purchase limit for each lot - mapping(uint96 => uint256) public lotBuyerLimit; - - /// @notice Tracks the cumulative amount spent by a buyer on a lot - mapping(uint96 => mapping(address => uint256)) public lotBuyerSpent; - - // ========== CONSTRUCTOR ========== // - - // PERMISSIONS - // onCreate: true - // onCancel: false - // onCurate: false - // onPurchase: true - // onBid: true - // onSettle: false - // receiveQuoteTokens: false - // sendBaseTokens: false - // Contract prefix should be: 10011000 = 0x98 - - constructor( - address auctionHouse_, - Callbacks.Permissions memory permissions_ - ) MerkleAllowlist(auctionHouse_, permissions_) {} - - // ========== CALLBACK FUNCTIONS ========== // - - /// @inheritdoc BaseCallback - /// - /// @param callbackData_ abi-encoded data: (bytes32, uint256) representing the merkle root and buyer limit - function _onCreate( - uint96 lotId_, - address, - address, - address, - uint256, - bool, - bytes calldata callbackData_ - ) internal override { - // Check that the parameters are of the correct length - if (callbackData_.length != 64) { - revert Callback_InvalidParams(); - } - - // Decode the merkle root from the callback data - (bytes32 merkleRoot, uint256 buyerLimit) = abi.decode(callbackData_, (bytes32, uint256)); - - // Set the merkle root and lot buyer limit - lotMerkleRoot[lotId_] = merkleRoot; - lotBuyerLimit[lotId_] = buyerLimit; - emit MerkleRootSet(lotId_, merkleRoot); - } - - /// @inheritdoc MerkleAllowlist - function __onPurchase( - uint96 lotId_, - address buyer_, - uint256 amount_, - uint256, - bool, - bytes calldata - ) internal override { - _canBuy(lotId_, buyer_, amount_); - } - - /// @inheritdoc MerkleAllowlist - function __onBid( - uint96 lotId_, - uint64, - address buyer_, - uint256 amount_, - bytes calldata - ) internal override { - _canBuy(lotId_, buyer_, amount_); - } - - // ========== INTERNAL FUNCTIONS ========== // - - function _canBuy(uint96 lotId_, address buyer_, uint256 amount_) internal { - // Check if the buyer has already spent their limit - if (lotBuyerSpent[lotId_][buyer_] + amount_ > lotBuyerLimit[lotId_]) { - revert Callback_ExceedsLimit(); - } - - // Update the buyer spent amount - lotBuyerSpent[lotId_][buyer_] += amount_; - } -} diff --git a/src/callbacks/allowlists/MerkleAllowlist.sol b/src/callbacks/allowlists/MerkleAllowlist.sol deleted file mode 100644 index 12a6d5e78..000000000 --- a/src/callbacks/allowlists/MerkleAllowlist.sol +++ /dev/null @@ -1,223 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import {MerkleProof} from "lib/openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol"; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; - -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; - -/// @title MerkleAllowlist -/// @notice This contract implements a merkle tree-based allowlist for buyers to participate in an auction. -/// In this implementation, buyers do not have a limit on the amount they can purchase/bid. -contract MerkleAllowlist is BaseCallback { - // ========== EVENTS ========== // - - /// @notice Emitted when the merkle root is set - event MerkleRootSet(uint96 lotId, bytes32 merkleRoot); - - // ========== STATE VARIABLES ========== // - - /// @notice The root of the merkle tree that represents the allowlist for a lot - /// @dev The merkle tree should adhere to the format specified in the OpenZeppelin MerkleProof library at https://github.com/OpenZeppelin/merkle-tree - /// In particular, leaf values (such as `(address)` or `(address,uint256)`) should be double-hashed. - mapping(uint96 lotId => bytes32 merkleRoot) public lotMerkleRoot; - - // ========== CONSTRUCTOR ========== // - - // PERMISSIONS - // onCreate: true - // onCancel: false - // onCurate: false - // onPurchase: true - // onBid: true - // onSettle: false - // receiveQuoteTokens: false - // sendBaseTokens: false - // Contract prefix should be: 10011000 = 0x98 - - constructor( - address auctionHouse_, - Callbacks.Permissions memory permissions_ - ) BaseCallback(auctionHouse_, permissions_) {} - - // ========== CALLBACK FUNCTIONS ========== // - - /// @inheritdoc BaseCallback - /// @dev This function performs the following: - /// - Validates the callback data - /// - Sets the merkle root - /// - Emits a MerkleRootSet event - /// - /// This function reverts if: - /// - The callback data is of an invalid length - /// - /// @param lotId_ The id of the lot - /// @param callbackData_ abi-encoded data: (bytes32) representing the merkle root - function _onCreate( - uint96 lotId_, - address, - address, - address, - uint256, - bool, - bytes calldata callbackData_ - ) internal virtual override { - // Check that the parameters are of the correct length - if (callbackData_.length != 32) { - revert Callback_InvalidParams(); - } - - // Decode the merkle root from the callback data - bytes32 merkleRoot = abi.decode(callbackData_, (bytes32)); - - // Set the merkle root - lotMerkleRoot[lotId_] = merkleRoot; - emit MerkleRootSet(lotId_, merkleRoot); - } - - /// @inheritdoc BaseCallback - /// @dev Not implemented - function _onCancel(uint96, uint256, bool, bytes calldata) internal pure override { - // Not implemented - revert Callback_NotImplemented(); - } - - /// @inheritdoc BaseCallback - /// @dev Not implemented - function _onCurate(uint96, uint256, bool, bytes calldata) internal pure override { - // Not implemented - revert Callback_NotImplemented(); - } - - /// @inheritdoc BaseCallback - /// @dev This function performs the following: - /// - Validates that the buyer is allowed to participate - /// - Calls any additional implementation-specific logic - /// - /// This function reverts if: - /// - The buyer is not allowed to participate - /// - /// @param callbackData_ abi-encoded data: (bytes32[]) representing the merkle proof - function _onPurchase( - uint96 lotId_, - address buyer_, - uint256 amount_, - uint256 payout_, - bool prefunded_, - bytes calldata callbackData_ - ) internal virtual override { - // Validate that the buyer is allowed to participate - _canParticipate(lotId_, buyer_, callbackData_); - - // Call any additional implementation-specific logic - __onPurchase(lotId_, buyer_, amount_, payout_, prefunded_, callbackData_); - } - - /// @notice Additional implementation-specific logic for the purchase callback - /// @dev This function can be overridden by an inheriting contract to implement additional logic - /// - /// @param lotId_ The id of the lot - /// @param buyer_ The address of the buyer - /// @param amount_ The amount of quote tokens sent - /// @param payout_ The amount of base tokens to be sent - /// @param prefunded_ Whether the lot is prefunded - /// @param callbackData_ abi-encoded callback data - function __onPurchase( - uint96 lotId_, - address buyer_, - uint256 amount_, - uint256 payout_, - bool prefunded_, - bytes calldata callbackData_ - ) internal virtual {} - - /// @inheritdoc BaseCallback - /// @dev This function performs the following: - /// - Validates that the buyer is allowed to participate - /// - Calls any additional implementation-specific logic - /// - /// This function reverts if: - /// - The buyer is not allowed to participate - /// - /// @param callbackData_ abi-encoded data: (bytes32[]) representing the merkle proof - function _onBid( - uint96 lotId_, - uint64 bidId_, - address buyer_, - uint256 amount_, - bytes calldata callbackData_ - ) internal virtual override { - // Validate that the buyer is allowed to participate - _canParticipate(lotId_, buyer_, callbackData_); - - // Call any additional implementation-specific logic - __onBid(lotId_, bidId_, buyer_, amount_, callbackData_); - } - - /// @notice Additional implementation-specific logic for the bid callback - /// @dev This function can be overridden by an inheriting contract to implement additional logic - function __onBid( - uint96 lotId_, - uint64 bidId_, - address buyer_, - uint256 amount_, - bytes calldata callbackData_ - ) internal virtual {} - - /// @inheritdoc BaseCallback - /// @dev Not implemented - function _onSettle(uint96, uint256, uint256, bytes calldata) internal pure override { - // Not implemented - revert Callback_NotImplemented(); - } - - // ========== INTERNAL FUNCTIONS ========== // - - function _canParticipate( - uint96 lotId_, - address buyer_, - bytes calldata callbackData_ - ) internal view virtual { - // Decode the merkle proof from the callback data - bytes32[] memory proof = abi.decode(callbackData_, (bytes32[])); - - // Get the leaf for the buyer - bytes32 leaf = keccak256(bytes.concat(keccak256(abi.encode(buyer_)))); - - // Validate the merkle proof - if (!MerkleProof.verify(proof, lotMerkleRoot[lotId_], leaf)) { - revert Callback_NotAuthorized(); - } - } - - // ========== ADMIN FUNCTIONS ========== // - - /// @notice Sets the merkle root for the allowlist - /// This function can be called by the lot's seller to update the merkle root after `onCreate()`. - /// @dev This function performs the following: - /// - Performs validation - /// - Sets the merkle root - /// - Emits a MerkleRootSet event - /// - /// This function reverts if: - /// - The caller is not the lot's seller - /// - The auction has not been registered - /// - /// @param merkleRoot_ The new merkle root - function setMerkleRoot(uint96 lotId_, bytes32 merkleRoot_) external onlyRegisteredLot(lotId_) { - // We check that the lot is registered on this callback - - // Check that the caller is the lot's seller - (address seller,,,,,,,,) = IAuctionHouse(AUCTION_HOUSE).lotRouting(lotId_); - if (msg.sender != seller) { - revert Callback_NotAuthorized(); - } - - // Set the new merkle root and emit an event - lotMerkleRoot[lotId_] = merkleRoot_; - - emit MerkleRootSet(lotId_, merkleRoot_); - } -} diff --git a/src/callbacks/allowlists/TokenAllowlist.sol b/src/callbacks/allowlists/TokenAllowlist.sol deleted file mode 100644 index d3fcd51e6..000000000 --- a/src/callbacks/allowlists/TokenAllowlist.sol +++ /dev/null @@ -1,144 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; - -/// @notice Generic interface for tokens that implement a balanceOf function (includes ERC-20 and ERC-721) -interface ITokenBalance { - /// @notice Get the user's token balance - function balanceOf(address user_) external view returns (uint256); -} - -/// @title TokenAllowlist Callback Contract -/// @notice Allowlist contract that checks if a user's balance of a token is above a threshold -/// @dev This shouldn't be used with liquid, transferable ERC-20s because it can easily be bypassed via flash loans or other swap mechanisms -/// @dev The intent is to use this with non-transferable tokens (e.g. vote escrow) or illiquid tokens that are not as easily manipulated, e.g. community NFTs -contract TokenAllowlist is BaseCallback { - // ========== ERRORS ========== // - - // ========== STATE VARIABLES ========== // - - struct TokenCheck { - ITokenBalance token; - uint256 threshold; - } - - /// @notice Stores the token and balance threshold for each lot - mapping(uint96 lotId => TokenCheck) public lotChecks; - - // ========== CONSTRUCTOR ========== // - - // PERMISSIONS - // onCreate: true - // onCancel: false - // onCurate: false - // onPurchase: true - // onBid: true - // onSettle: false - // receiveQuoteTokens: false - // sendBaseTokens: false - // Contract prefix should be: 10011000 = 0x98 - - constructor( - address auctionHouse_, - Callbacks.Permissions memory permissions_ - ) BaseCallback(auctionHouse_, permissions_) {} - - // ========== CALLBACK FUNCTIONS ========== // - - /// @inheritdoc BaseCallback - /// @dev This function reverts if: - /// - `callbackData_` is not of the correct length - /// - The token contract is not a contract - /// - The token contract does not have an ERC20 balanceOf function - /// - /// @param callbackData_ abi-encoded data: (ITokenBalance, uint96) representing the token contract and balance threshold - function _onCreate( - uint96 lotId_, - address, - address, - address, - uint256, - bool, - bytes calldata callbackData_ - ) internal override { - // Check that the parameters are of the correct length - if (callbackData_.length != 64) { - revert Callback_InvalidParams(); - } - - // Decode the params to get the token contract and balance threshold - (ITokenBalance token, uint96 threshold) = abi.decode(callbackData_, (ITokenBalance, uint96)); - - // Token must be a contract - if (address(token).code.length == 0) revert Callback_InvalidParams(); - - // Try to get balance for token, revert if it fails - try token.balanceOf(address(this)) returns (uint256) {} - catch { - revert Callback_InvalidParams(); - } - - // Set the lot check - lotChecks[lotId_] = TokenCheck(token, threshold); - } - - /// @inheritdoc BaseCallback - /// @dev Not implemented - function _onCancel(uint96, uint256, bool, bytes calldata) internal pure override { - // Not implemented - revert Callback_NotImplemented(); - } - - /// @inheritdoc BaseCallback - /// @dev Not implemented - function _onCurate(uint96, uint256, bool, bytes calldata) internal pure override { - // Not implemented - revert Callback_NotImplemented(); - } - - /// @inheritdoc BaseCallback - /// @dev This function reverts if: - /// - The buyer's balance is below the threshold - function _onPurchase( - uint96 lotId_, - address buyer_, - uint256, - uint256, - bool, - bytes calldata - ) internal view override { - _canParticipate(lotId_, buyer_); - } - - /// @inheritdoc BaseCallback - /// @dev This function reverts if: - /// - The buyer's balance is below the threshold - function _onBid( - uint96 lotId_, - uint64, - address buyer_, - uint256, - bytes calldata - ) internal view override { - _canParticipate(lotId_, buyer_); - } - - /// @inheritdoc BaseCallback - /// @dev Not implemented - function _onSettle(uint96, uint256, uint256, bytes calldata) internal pure override { - // Not implemented - revert Callback_NotImplemented(); - } - - // ========== INTERNAL FUNCTIONS ========== // - - function _canParticipate(uint96 lotId_, address buyer_) internal view { - // Get the token check - TokenCheck memory check = lotChecks[lotId_]; - - // Check if the buyer's balance is above the threshold - if (check.token.balanceOf(buyer_) < check.threshold) revert Callback_NotAuthorized(); - } -} diff --git a/src/callbacks/liquidity/BaseDTL.sol b/src/callbacks/liquidity/BaseDTL.sol deleted file mode 100644 index f7c3cd22d..000000000 --- a/src/callbacks/liquidity/BaseDTL.sol +++ /dev/null @@ -1,448 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -// Libraries -import {ERC20} from "solmate/tokens/ERC20.sol"; -import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol"; - -// Callbacks -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; - -// AuctionHouse -import {ILinearVesting} from "src/interfaces/modules/derivatives/ILinearVesting.sol"; -import {LinearVesting} from "src/modules/derivatives/LinearVesting.sol"; -import {AuctionHouse} from "src/bases/AuctionHouse.sol"; -import {Keycode, wrapVeecode} from "src/modules/Modules.sol"; - -abstract contract BaseDirectToLiquidity is BaseCallback { - using SafeTransferLib for ERC20; - - // ========== ERRORS ========== // - - error Callback_InsufficientBalance( - address token_, address account_, uint256 balance_, uint256 required_ - ); - - error Callback_Params_InvalidAddress(); - - error Callback_Params_PercentOutOfBounds(uint24 actual_, uint24 min_, uint24 max_); - - error Callback_Params_PoolExists(); - - error Callback_Params_InvalidVestingParams(); - - error Callback_LinearVestingModuleNotFound(); - - // ========== STRUCTS ========== // - - /// @notice Configuration for the DTL callback - /// - /// @param recipient The recipient of the LP tokens - /// @param lotCapacity The capacity of the lot - /// @param lotCuratorPayout The maximum curator payout of the lot - /// @param proceedsUtilisationPercent The percentage of the proceeds to deposit into the pool, in basis points (1% = 100) - /// @param vestingStart The start of the vesting period for the LP tokens (0 if disabled) - /// @param vestingExpiry The end of the vesting period for the LP tokens (0 if disabled) - /// @param linearVestingModule The LinearVesting module for the LP tokens (only set if linear vesting is enabled) - /// @param active Whether the lot is active - /// @param implParams The implementation-specific parameters - struct DTLConfiguration { - address recipient; - uint256 lotCapacity; - uint256 lotCuratorPayout; - uint24 proceedsUtilisationPercent; - uint48 vestingStart; - uint48 vestingExpiry; - LinearVesting linearVestingModule; - bool active; - bytes implParams; - } - - /// @notice Parameters used in the onCreate callback - /// - /// @param proceedsUtilisationPercent The percentage of the proceeds to use in the pool - /// @param vestingStart The start of the vesting period for the LP tokens (0 if disabled) - /// @param vestingExpiry The end of the vesting period for the LP tokens (0 if disabled) - /// @param recipient The recipient of the LP tokens - /// @param implParams The implementation-specific parameters - struct OnCreateParams { - uint24 proceedsUtilisationPercent; - uint48 vestingStart; - uint48 vestingExpiry; - address recipient; - bytes implParams; - } - - // ========== STATE VARIABLES ========== // - - uint24 public constant ONE_HUNDRED_PERCENT = 100e2; - bytes5 public constant LINEAR_VESTING_KEYCODE = 0x4c49560000; // "LIV" - - /// @notice Maps the lot id to the DTL configuration - mapping(uint96 lotId => DTLConfiguration) public lotConfiguration; - - // ========== CONSTRUCTOR ========== // - - constructor(address auctionHouse_) - BaseCallback( - auctionHouse_, - Callbacks.Permissions({ - onCreate: true, - onCancel: true, - onCurate: true, - onPurchase: false, - onBid: false, - onSettle: true, - receiveQuoteTokens: true, - sendBaseTokens: false - }) - ) - {} - - // ========== CALLBACK FUNCTIONS ========== // - - /// @inheritdoc BaseCallback - /// @notice Callback for when a lot is created - /// @dev This function performs the following: - /// - Validates the input data - /// - Calls the Uniswap-specific implementation - /// - Stores the configuration for the lot - /// - /// This function reverts if: - /// - OnCreateParams.proceedsUtilisationPercent is out of bounds - /// - OnCreateParams.vestingStart or OnCreateParams.vestingExpiry do not pass validation - /// - Vesting is enabled and the linear vesting module is not found - /// - The OnCreateParams.recipient address is the zero address - /// - /// @param lotId_ The lot ID - /// @param baseToken_ The base token address - /// @param quoteToken_ The quote token address - /// @param capacity_ The capacity of the lot - /// @param callbackData_ Encoded OnCreateParams struct - function _onCreate( - uint96 lotId_, - address seller_, - address baseToken_, - address quoteToken_, - uint256 capacity_, - bool prefund_, - bytes calldata callbackData_ - ) internal virtual override { - // Decode callback data into the params - OnCreateParams memory params = abi.decode(callbackData_, (OnCreateParams)); - - // Validate the parameters - // Proceeds utilisation - if ( - params.proceedsUtilisationPercent == 0 - || params.proceedsUtilisationPercent > ONE_HUNDRED_PERCENT - ) { - revert Callback_Params_PercentOutOfBounds( - params.proceedsUtilisationPercent, 1, ONE_HUNDRED_PERCENT - ); - } - - // Vesting - LinearVesting linearVestingModule; - - // If vesting is enabled - if (params.vestingStart != 0 || params.vestingExpiry != 0) { - // Get the linear vesting module (or revert) - linearVestingModule = LinearVesting(_getLatestLinearVestingModule()); - - // Validate - if ( - // We will actually use the LP tokens, but this is a placeholder as we really want to validate the vesting parameters - !linearVestingModule.validate( - address(baseToken_), - _getEncodedVestingParams(params.vestingStart, params.vestingExpiry) - ) - ) { - revert Callback_Params_InvalidVestingParams(); - } - } - - // If the recipient is the zero address - if (params.recipient == address(0)) { - revert Callback_Params_InvalidAddress(); - } - - // Store the configuration - lotConfiguration[lotId_] = DTLConfiguration({ - recipient: params.recipient, - lotCapacity: capacity_, - lotCuratorPayout: 0, - proceedsUtilisationPercent: params.proceedsUtilisationPercent, - vestingStart: params.vestingStart, - vestingExpiry: params.vestingExpiry, - linearVestingModule: linearVestingModule, - active: true, - implParams: params.implParams - }); - - // Call the Uniswap-specific implementation - __onCreate(lotId_, seller_, baseToken_, quoteToken_, capacity_, prefund_, callbackData_); - } - - /// @notice Uniswap-specific implementation of the onCreate callback - /// @dev The implementation will be called by the _onCreate function - /// after the `callbackData_` has been validated and after the - /// lot configuration is stored. - /// - /// The implementation should perform the following: - /// - Additional validation - /// - /// @param lotId_ The lot ID - /// @param seller_ The seller address - /// @param baseToken_ The base token address - /// @param quoteToken_ The quote token address - /// @param capacity_ The capacity of the lot - /// @param prefund_ Whether the lot is prefunded - /// @param callbackData_ Encoded OnCreateParams struct - function __onCreate( - uint96 lotId_, - address seller_, - address baseToken_, - address quoteToken_, - uint256 capacity_, - bool prefund_, - bytes calldata callbackData_ - ) internal virtual; - - /// @notice Callback for when a lot is cancelled - /// @dev This function performs the following: - /// - Marks the lot as inactive - /// - /// This function reverts if: - /// - The lot is not registered - /// - /// @param lotId_ The lot ID - function _onCancel(uint96 lotId_, uint256, bool, bytes calldata) internal override { - // Mark the lot as inactive to prevent further actions - DTLConfiguration storage config = lotConfiguration[lotId_]; - config.active = false; - } - - /// @notice Callback for when a lot is curated - /// @dev This function performs the following: - /// - Records the curator payout - /// - /// This function reverts if: - /// - The lot is not registered - /// - /// @param lotId_ The lot ID - /// @param curatorPayout_ The maximum curator payout - function _onCurate( - uint96 lotId_, - uint256 curatorPayout_, - bool, - bytes calldata - ) internal override { - // Update the funding - DTLConfiguration storage config = lotConfiguration[lotId_]; - config.lotCuratorPayout = curatorPayout_; - } - - /// @notice Callback for a purchase - /// @dev Not implemented - function _onPurchase( - uint96, - address, - uint256, - uint256, - bool, - bytes calldata - ) internal pure override { - // Not implemented - revert Callback_NotImplemented(); - } - - /// @notice Callback for a bid - /// @dev Not implemented - function _onBid(uint96, uint64, address, uint256, bytes calldata) internal pure override { - // Not implemented - revert Callback_NotImplemented(); - } - - /// @notice Callback for claiming the proceeds - /// @dev This function performs the following: - /// - Calculates the base and quote tokens to deposit into the pool - /// - Calls the Uniswap-specific implementation to mint and deposit into the pool - /// - If vesting is enabled, mints the vesting tokens, or transfers the LP tokens to the recipient - /// - Sends any remaining quote and base tokens to the seller - /// - /// The assumptions are: - /// - the callback has `proceeds_` quantity of quote tokens (as `receiveQuoteTokens` flag is set) - /// - the seller has the required balance of base tokens - /// - the seller has approved the callback to spend the base tokens - /// - /// This function reverts if: - /// - The lot is not registered - /// - /// @param lotId_ The lot ID - /// @param proceeds_ The proceeds from the auction - /// @param refund_ The refund from the auction - /// @param callbackData_ Implementation-specific data - function _onSettle( - uint96 lotId_, - uint256 proceeds_, - uint256 refund_, - bytes calldata callbackData_ - ) internal virtual override { - DTLConfiguration memory config = lotConfiguration[lotId_]; - address seller; - address baseToken; - address quoteToken; - { - (seller, baseToken, quoteToken,,,,,,) = AuctionHouse(AUCTION_HOUSE).lotRouting(lotId_); - } - - uint256 baseTokensRequired; - uint256 quoteTokensRequired; - { - // Calculate the actual lot capacity that was used - uint256 capacityUtilised; - { - // If curation is enabled, refund_ will also contain the refund on the curator payout. Adjust for that. - // Example: - // 100 capacity + 10 curator - // 90 capacity sold, 9 curator payout - // 11 refund - // Utilisation = 1 - 11/110 = 90% - uint256 utilisationPercent = - 100e2 - refund_ * 100e2 / (config.lotCapacity + config.lotCuratorPayout); - - capacityUtilised = (config.lotCapacity * utilisationPercent) / ONE_HUNDRED_PERCENT; - } - - // Calculate the base tokens required to create the pool - baseTokensRequired = - _tokensRequiredForPool(capacityUtilised, config.proceedsUtilisationPercent); - quoteTokensRequired = - _tokensRequiredForPool(proceeds_, config.proceedsUtilisationPercent); - } - - // Ensure the required tokens are present before minting - { - // Check that sufficient balance exists - uint256 baseTokenBalance = ERC20(baseToken).balanceOf(seller); - if (baseTokenBalance < baseTokensRequired) { - revert Callback_InsufficientBalance( - baseToken, seller, baseTokensRequired, baseTokenBalance - ); - } - - ERC20(baseToken).safeTransferFrom(seller, address(this), baseTokensRequired); - } - - // Mint and deposit into the pool - (ERC20 poolToken) = _mintAndDeposit( - lotId_, quoteToken, quoteTokensRequired, baseToken, baseTokensRequired, callbackData_ - ); - uint256 poolTokenQuantity = poolToken.balanceOf(address(this)); - - // If vesting is enabled, create the vesting tokens - if (address(config.linearVestingModule) != address(0)) { - // Approve spending of the tokens - poolToken.approve(address(config.linearVestingModule), poolTokenQuantity); - - // Mint the vesting tokens (it will deploy if necessary) - config.linearVestingModule.mint( - config.recipient, - address(poolToken), - _getEncodedVestingParams(config.vestingStart, config.vestingExpiry), - poolTokenQuantity, - true // Wrap vesting LP tokens so they are easily visible - ); - } - // Send the LP tokens to the seller - else { - poolToken.safeTransfer(config.recipient, poolTokenQuantity); - } - - // Send any remaining quote tokens to the seller - { - uint256 quoteTokenBalance = ERC20(quoteToken).balanceOf(address(this)); - if (quoteTokenBalance > 0) { - ERC20(quoteToken).safeTransfer(seller, quoteTokenBalance); - } - } - - // Send any remaining base tokens to the seller - { - uint256 baseTokenBalance = ERC20(baseToken).balanceOf(address(this)); - if (baseTokenBalance > 0) { - ERC20(baseToken).safeTransfer(seller, baseTokenBalance); - } - } - } - - /// @notice Mint and deposit into the pool - /// @dev This function should be implemented by the Uniswap-specific callback - /// - /// It is expected to: - /// - Create and initialize the pool - /// - Deposit the quote and base tokens into the pool - /// - The pool tokens should be received by this contract - /// - Return the ERC20 pool token - /// - /// @param lotId_ The lot ID - /// @param quoteToken_ The quote token address - /// @param quoteTokenAmount_ The amount of quote tokens to deposit - /// @param baseToken_ The base token address - /// @param baseTokenAmount_ The amount of base tokens to deposit - /// @param callbackData_ Implementation-specific data - /// @return poolToken The ERC20 pool token - function _mintAndDeposit( - uint96 lotId_, - address quoteToken_, - uint256 quoteTokenAmount_, - address baseToken_, - uint256 baseTokenAmount_, - bytes memory callbackData_ - ) internal virtual returns (ERC20 poolToken); - - // ========== INTERNAL FUNCTIONS ========== // - - function _getAmountWithSlippage( - uint256 amount_, - uint24 slippage_ - ) internal pure returns (uint256) { - if (slippage_ > ONE_HUNDRED_PERCENT) { - revert Callback_Params_PercentOutOfBounds(slippage_, 0, ONE_HUNDRED_PERCENT); - } - - return (amount_ * (ONE_HUNDRED_PERCENT - slippage_)) / ONE_HUNDRED_PERCENT; - } - - function _tokensRequiredForPool( - uint256 amount_, - uint24 proceedsUtilisationPercent_ - ) internal pure returns (uint256) { - return (amount_ * proceedsUtilisationPercent_) / ONE_HUNDRED_PERCENT; - } - - function _getLatestLinearVestingModule() internal view returns (address) { - AuctionHouse auctionHouseContract = AuctionHouse(AUCTION_HOUSE); - Keycode moduleKeycode = Keycode.wrap(LINEAR_VESTING_KEYCODE); - - // Get the module status - (uint8 latestVersion, bool isSunset) = auctionHouseContract.getModuleStatus(moduleKeycode); - - if (isSunset || latestVersion == 0) { - revert Callback_LinearVestingModuleNotFound(); - } - - return address( - auctionHouseContract.getModuleForVeecode(wrapVeecode(moduleKeycode, latestVersion)) - ); - } - - function _getEncodedVestingParams( - uint48 start_, - uint48 expiry_ - ) internal pure returns (bytes memory) { - return abi.encode(ILinearVesting.VestingParams({start: start_, expiry: expiry_})); - } -} diff --git a/src/callbacks/liquidity/UniswapV2DTL.sol b/src/callbacks/liquidity/UniswapV2DTL.sol deleted file mode 100644 index 105f22791..000000000 --- a/src/callbacks/liquidity/UniswapV2DTL.sol +++ /dev/null @@ -1,137 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -// Libraries -import {ERC20} from "solmate/tokens/ERC20.sol"; - -// Uniswap -import {IUniswapV2Factory} from "src/lib/uniswap-v2/IUniswapV2Factory.sol"; -import {IUniswapV2Router02} from "src/lib/uniswap-v2/IUniswapV2Router02.sol"; - -// Callbacks -import {BaseDirectToLiquidity} from "src/callbacks/liquidity/BaseDTL.sol"; - -/// @title UniswapV2DirectToLiquidity -/// @notice This Callback contract deposits the proceeds from a batch auction into a Uniswap V2 pool -/// in order to create liquidity immediately. -/// -/// The LP tokens are transferred to `DTLConfiguration.recipient`, or can optionally vest to the auction seller. -/// -/// An important risk to consider: if the auction's base token is available and liquid, a third-party -/// could front-run the auction by creating the pool before the auction ends. This would allow them to -/// manipulate the price of the pool and potentially profit from the eventual deposit of the auction proceeds. -/// -/// @dev As a general rule, this callback contract does not retain balances of tokens between calls. -/// Transfers are performed within the same function that requires the balance. -contract UniswapV2DirectToLiquidity is BaseDirectToLiquidity { - // ========== STRUCTS ========== // - - /// @notice Parameters for the onClaimProceeds callback - /// @dev This will be encoded in the `callbackData_` parameter - /// - /// @param maxSlippage The maximum slippage allowed when adding liquidity (in terms of `ONE_HUNDRED_PERCENT`) - struct OnSettleParams { - uint24 maxSlippage; - } - - // ========== STATE VARIABLES ========== // - - /// @notice The Uniswap V2 factory - /// @dev This contract is used to create Uniswap V2 pools - IUniswapV2Factory public uniV2Factory; - - /// @notice The Uniswap V2 router - /// @dev This contract is used to add liquidity to Uniswap V2 pools - IUniswapV2Router02 public uniV2Router; - - // ========== CONSTRUCTOR ========== // - - constructor( - address auctionHouse_, - address uniswapV2Factory_, - address uniswapV2Router_ - ) BaseDirectToLiquidity(auctionHouse_) { - if (uniswapV2Factory_ == address(0)) { - revert Callback_Params_InvalidAddress(); - } - uniV2Factory = IUniswapV2Factory(uniswapV2Factory_); - - if (uniswapV2Router_ == address(0)) { - revert Callback_Params_InvalidAddress(); - } - uniV2Router = IUniswapV2Router02(uniswapV2Router_); - } - - // ========== CALLBACK FUNCTIONS ========== // - - /// @inheritdoc BaseDirectToLiquidity - /// @dev This function implements the following: - /// - Validates the parameters - /// - /// This function reverts if: - /// - The pool for the token combination already exists - function __onCreate( - uint96, - address, - address baseToken_, - address quoteToken_, - uint256, - bool, - bytes calldata - ) internal virtual override { - // Check that the pool does not exist - if (uniV2Factory.getPair(baseToken_, quoteToken_) != address(0)) { - revert Callback_Params_PoolExists(); - } - } - - /// @inheritdoc BaseDirectToLiquidity - /// @dev This function implements the following: - /// - Creates the pool if necessary - /// - Deposits the tokens into the pool - function _mintAndDeposit( - uint96, - address quoteToken_, - uint256 quoteTokenAmount_, - address baseToken_, - uint256 baseTokenAmount_, - bytes memory callbackData_ - ) internal virtual override returns (ERC20 poolToken) { - // Decode the callback data - OnSettleParams memory params = abi.decode(callbackData_, (OnSettleParams)); - - // Create and initialize the pool if necessary - // Token orientation is irrelevant - address pairAddress = uniV2Factory.getPair(baseToken_, quoteToken_); - if (pairAddress == address(0)) { - pairAddress = uniV2Factory.createPair(baseToken_, quoteToken_); - } - - // Calculate the minimum amount out for each token - uint256 quoteTokenAmountMin = _getAmountWithSlippage(quoteTokenAmount_, params.maxSlippage); - uint256 baseTokenAmountMin = _getAmountWithSlippage(baseTokenAmount_, params.maxSlippage); - - // Approve the router to spend the tokens - ERC20(quoteToken_).approve(address(uniV2Router), quoteTokenAmount_); - ERC20(baseToken_).approve(address(uniV2Router), baseTokenAmount_); - - // Deposit into the pool - uniV2Router.addLiquidity( - quoteToken_, - baseToken_, - quoteTokenAmount_, - baseTokenAmount_, - quoteTokenAmountMin, - baseTokenAmountMin, - address(this), - block.timestamp - ); - - // Remove any dangling approvals - // This is necessary, since the router may not spend all available tokens - ERC20(quoteToken_).approve(address(uniV2Router), 0); - ERC20(baseToken_).approve(address(uniV2Router), 0); - - return ERC20(pairAddress); - } -} diff --git a/src/callbacks/liquidity/UniswapV3DTL.sol b/src/callbacks/liquidity/UniswapV3DTL.sol deleted file mode 100644 index b7f472502..000000000 --- a/src/callbacks/liquidity/UniswapV3DTL.sol +++ /dev/null @@ -1,242 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -// Libraries -import {ERC20} from "solmate/tokens/ERC20.sol"; -import {SqrtPriceMath} from "src/lib/uniswap-v3/SqrtPriceMath.sol"; - -// Uniswap -import {IUniswapV3Pool} from "uniswap-v3-core/interfaces/IUniswapV3Pool.sol"; -import {IUniswapV3Factory} from "uniswap-v3-core/interfaces/IUniswapV3Factory.sol"; -import {TickMath} from "uniswap-v3-core/libraries/TickMath.sol"; - -// G-UNI -import {IGUniFactory} from "g-uni-v1-core/interfaces/IGUniFactory.sol"; -import {GUniPool} from "g-uni-v1-core/GUniPool.sol"; - -// Callbacks -import {BaseDirectToLiquidity} from "src/callbacks/liquidity/BaseDTL.sol"; - -/// @title UniswapV3DirectToLiquidity -/// @notice This Callback contract deposits the proceeds from a batch auction into a Uniswap V3 pool -/// in order to create liquidity immediately. -/// -/// The Uniswap V3 position is tokenised as an ERC-20 using [G-UNI](https://github.com/gelatodigital/g-uni-v1-core). -/// -/// The LP tokens are transferred to `DTLConfiguration.recipient`, or can optionally vest to the auction seller. -/// -/// An important risk to consider: if the auction's base token is available and liquid, a third-party -/// could front-run the auction by creating the pool before the auction ends. This would allow them to -/// manipulate the price of the pool and potentially profit from the eventual deposit of the auction proceeds. -/// -/// @dev As a general rule, this callback contract does not retain balances of tokens between calls. -/// Transfers are performed within the same function that requires the balance. -contract UniswapV3DirectToLiquidity is BaseDirectToLiquidity { - // ========== ERRORS ========== // - - error Callback_Params_PoolFeeNotEnabled(); - - error Callback_Slippage(address token_, uint256 amountActual_, uint256 amountMin_); - - // ========== STRUCTS ========== // - - /// @notice Parameters for the onSettle callback - /// @dev This will be encoded in the `callbackData_` parameter - /// - /// @param maxSlippage The maximum slippage allowed when adding liquidity (in terms of `ONE_HUNDRED_PERCENT`) - struct OnSettleParams { - uint24 maxSlippage; - } - - // ========== STATE VARIABLES ========== // - - /// @notice The Uniswap V3 Factory contract - /// @dev This contract is used to create Uniswap V3 pools - IUniswapV3Factory public uniV3Factory; - - /// @notice The G-UNI Factory contract - /// @dev This contract is used to create the ERC20 LP tokens - IGUniFactory public gUniFactory; - - // ========== CONSTRUCTOR ========== // - - constructor( - address auctionHouse_, - address uniV3Factory_, - address gUniFactory_ - ) BaseDirectToLiquidity(auctionHouse_) { - if (uniV3Factory_ == address(0)) { - revert Callback_Params_InvalidAddress(); - } - uniV3Factory = IUniswapV3Factory(uniV3Factory_); - - if (gUniFactory_ == address(0)) { - revert Callback_Params_InvalidAddress(); - } - gUniFactory = IGUniFactory(gUniFactory_); - } - - // ========== CALLBACK FUNCTIONS ========== // - - /// @inheritdoc BaseDirectToLiquidity - /// @dev This function performs the following: - /// - Validates the input data - /// - /// This function reverts if: - /// - OnCreateParams.implParams.poolFee is not enabled - /// - The pool for the token and fee combination already exists - function __onCreate( - uint96, - address, - address baseToken_, - address quoteToken_, - uint256, - bool, - bytes calldata callbackData_ - ) internal virtual override { - OnCreateParams memory params = abi.decode(callbackData_, (OnCreateParams)); - (uint24 poolFee) = abi.decode(params.implParams, (uint24)); - - // Validate the parameters - // Pool fee - // Fee not enabled - if (uniV3Factory.feeAmountTickSpacing(poolFee) == 0) { - revert Callback_Params_PoolFeeNotEnabled(); - } - - // Check that the pool does not exist - if (uniV3Factory.getPool(baseToken_, quoteToken_, poolFee) != address(0)) { - revert Callback_Params_PoolExists(); - } - } - - /// @inheritdoc BaseDirectToLiquidity - /// @dev This function performs the following: - /// - Creates and initializes the pool, if necessary - /// - Deploys a pool token to wrap the Uniswap V3 position as an ERC-20 using GUni - /// - Uses the `GUniPool.getMintAmounts()` function to calculate the quantity of quote and base tokens required, given the current pool liquidity - /// - Mint the LP tokens - /// - /// The assumptions are: - /// - the callback has `quoteTokenAmount_` quantity of quote tokens (as `receiveQuoteTokens` flag is set) - /// - the callback has `baseTokenAmount_` quantity of base tokens - function _mintAndDeposit( - uint96 lotId_, - address quoteToken_, - uint256 quoteTokenAmount_, - address baseToken_, - uint256 baseTokenAmount_, - bytes memory callbackData_ - ) internal virtual override returns (ERC20 poolToken) { - // Decode the callback data - OnSettleParams memory params = abi.decode(callbackData_, (OnSettleParams)); - - // Extract the pool fee from the implParams - (uint24 poolFee) = abi.decode(lotConfiguration[lotId_].implParams, (uint24)); - - // Determine the ordering of tokens - bool quoteTokenIsToken0 = quoteToken_ < baseToken_; - - // Create and initialize the pool if necessary - { - // Determine sqrtPriceX96 - uint160 sqrtPriceX96 = SqrtPriceMath.getSqrtPriceX96( - quoteToken_, baseToken_, quoteTokenAmount_, baseTokenAmount_ - ); - - // If the pool already exists and is initialized, it will have no effect - // Please see the risks section in the contract documentation for more information - _createAndInitializePoolIfNecessary( - quoteTokenIsToken0 ? quoteToken_ : baseToken_, - quoteTokenIsToken0 ? baseToken_ : quoteToken_, - poolFee, - sqrtPriceX96 - ); - } - - // Deploy the pool token - address poolTokenAddress; - { - // Adjust the full-range ticks according to the tick spacing for the current fee - int24 tickSpacing = uniV3Factory.feeAmountTickSpacing(poolFee); - - // Create an unmanaged pool - // The range of the position will not be changed after deployment - // Fees will also be collected at the time of withdrawal - poolTokenAddress = gUniFactory.createPool( - quoteTokenIsToken0 ? quoteToken_ : baseToken_, - quoteTokenIsToken0 ? baseToken_ : quoteToken_, - poolFee, - TickMath.MIN_TICK / tickSpacing * tickSpacing, - TickMath.MAX_TICK / tickSpacing * tickSpacing - ); - } - - // Deposit into the pool - { - GUniPool gUniPoolToken = GUniPool(poolTokenAddress); - - // Calculate the quantity of quote and base tokens required to deposit into the pool at the current tick - (uint256 amount0Actual, uint256 amount1Actual, uint256 poolTokenQuantity) = - gUniPoolToken.getMintAmounts( - quoteTokenIsToken0 ? quoteTokenAmount_ : baseTokenAmount_, - quoteTokenIsToken0 ? baseTokenAmount_ : quoteTokenAmount_ - ); - - // Revert if the slippage is too high - { - uint256 quoteTokenRequired = quoteTokenIsToken0 ? amount0Actual : amount1Actual; - - // Ensures that `quoteTokenRequired` (as specified by GUniPool) is within the slippage range from the actual quote token amount - uint256 lower = _getAmountWithSlippage(quoteTokenAmount_, params.maxSlippage); - if (quoteTokenRequired < lower) { - revert Callback_Slippage(quoteToken_, quoteTokenRequired, lower); - } - - // Approve the vault to spend the tokens - ERC20(quoteToken_).approve(address(poolTokenAddress), quoteTokenRequired); - } - { - uint256 baseTokenRequired = quoteTokenIsToken0 ? amount1Actual : amount0Actual; - - // Ensures that `baseTokenRequired` (as specified by GUniPool) is within the slippage range from the actual base token amount - uint256 lower = _getAmountWithSlippage(baseTokenAmount_, params.maxSlippage); - if (baseTokenRequired < lower) { - revert Callback_Slippage(baseToken_, baseTokenRequired, lower); - } - - // Approve the vault to spend the tokens - ERC20(baseToken_).approve(address(poolTokenAddress), baseTokenRequired); - } - - // Mint the LP tokens - // The parent callback is responsible for transferring any leftover quote and base tokens - gUniPoolToken.mint(poolTokenQuantity, address(this)); - } - - poolToken = ERC20(poolTokenAddress); - } - - // ========== INTERNAL FUNCTIONS ========== // - - /// @dev Copied from UniswapV3's PoolInitializer (which is GPL >= 2) - function _createAndInitializePoolIfNecessary( - address token0, - address token1, - uint24 fee, - uint160 sqrtPriceX96 - ) internal returns (address pool) { - require(token0 < token1); - pool = uniV3Factory.getPool(token0, token1, fee); - - if (pool == address(0)) { - pool = uniV3Factory.createPool(token0, token1, fee); - IUniswapV3Pool(pool).initialize(sqrtPriceX96); - } else { - (uint160 sqrtPriceX96Existing,,,,,,) = IUniswapV3Pool(pool).slot0(); - if (sqrtPriceX96Existing == 0) { - IUniswapV3Pool(pool).initialize(sqrtPriceX96); - } - } - } -} diff --git a/src/interfaces/IAtomicAuctionHouse.sol b/src/interfaces/IAtomicAuctionHouse.sol index 34245c8c1..edec637b9 100644 --- a/src/interfaces/IAtomicAuctionHouse.sol +++ b/src/interfaces/IAtomicAuctionHouse.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity >=0.8.0; -import "src/interfaces/IAuctionHouse.sol"; +import {IAuctionHouse} from "./IAuctionHouse.sol"; /// @title IAtomicAuctionHouse /// @notice An interface to define the AtomicAuctionHouse's buyer-facing functions diff --git a/src/interfaces/IAtomicCatalogue.sol b/src/interfaces/IAtomicCatalogue.sol index 193dba311..ccc32811c 100644 --- a/src/interfaces/IAtomicCatalogue.sol +++ b/src/interfaces/IAtomicCatalogue.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity >=0.8.0; -import "src/interfaces/ICatalogue.sol"; +import {ICatalogue} from "./ICatalogue.sol"; /// @title IAtomicCatalogue /// @notice Interface for the AtomicCatalogue contract, which provides view functions for atomic auctions diff --git a/src/interfaces/IAuctionHouse.sol b/src/interfaces/IAuctionHouse.sol index 56a8b5b32..02414d1f3 100644 --- a/src/interfaces/IAuctionHouse.sol +++ b/src/interfaces/IAuctionHouse.sol @@ -2,12 +2,12 @@ pragma solidity >=0.8.0; // Interfaces -import "src/interfaces/modules/IAuction.sol"; -import "src/interfaces/ICallback.sol"; -import "src/interfaces/modules/IDerivative.sol"; +import {IAuction} from "./modules/IAuction.sol"; +import {ICallback} from "./ICallback.sol"; +import {IDerivative} from "./modules/IDerivative.sol"; // Internal dependencies -import "src/modules/Keycode.sol"; +import {Keycode, Veecode} from "../modules/Keycode.sol"; /// @title IAuctionHouse /// @notice Interface for the Axis AuctionHouse contracts diff --git a/src/interfaces/IBatchAuctionHouse.sol b/src/interfaces/IBatchAuctionHouse.sol index 5dd60cb57..338d5b8d0 100644 --- a/src/interfaces/IBatchAuctionHouse.sol +++ b/src/interfaces/IBatchAuctionHouse.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity >=0.8.0; -import "src/interfaces/IAuctionHouse.sol"; +import {IAuctionHouse} from "./IAuctionHouse.sol"; /// @title IBatchAuctionHouse /// @notice An interface to define the BatchAuctionHouse's buyer-facing functions diff --git a/src/interfaces/IBatchCatalogue.sol b/src/interfaces/IBatchCatalogue.sol index 1f32b8e93..95a2f1320 100644 --- a/src/interfaces/IBatchCatalogue.sol +++ b/src/interfaces/IBatchCatalogue.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity >=0.8.0; -import "src/interfaces/ICatalogue.sol"; -import "src/interfaces/modules/IBatchAuction.sol"; +import {ICatalogue} from "./ICatalogue.sol"; +import {IBatchAuction} from "./modules/IBatchAuction.sol"; /// @title IBatchCatalogue /// @notice Interface for the BatchCatalogue contract, which provides view functions for batch auctions diff --git a/src/interfaces/ICatalogue.sol b/src/interfaces/ICatalogue.sol index a1f12d308..6b6371a2e 100644 --- a/src/interfaces/ICatalogue.sol +++ b/src/interfaces/ICatalogue.sol @@ -1,7 +1,9 @@ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity >=0.8.0; -import "src/interfaces/IAuctionHouse.sol"; +import {IAuctionHouse} from "./IAuctionHouse.sol"; + +import {Keycode, Veecode} from "../modules/Keycode.sol"; /// @title ICatalogue /// @notice Interface for the Catalogue contract, which provides view functions for auctions diff --git a/src/interfaces/IFeeManager.sol b/src/interfaces/IFeeManager.sol index ec55250b2..1f7905efd 100644 --- a/src/interfaces/IFeeManager.sol +++ b/src/interfaces/IFeeManager.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity >=0.8.0; -import "src/modules/Keycode.sol"; +import {Keycode} from "../modules/Keycode.sol"; /// @title IFeeManager /// @notice Defines the interface to interact with auction fees diff --git a/src/interfaces/modules/IAtomicAuction.sol b/src/interfaces/modules/IAtomicAuction.sol index 1463df13f..7a0f59b96 100644 --- a/src/interfaces/modules/IAtomicAuction.sol +++ b/src/interfaces/modules/IAtomicAuction.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity >=0.8.0; -import "src/interfaces/modules/IAuction.sol"; +import {IAuction} from "./IAuction.sol"; /// @title IAtomicAuction /// @notice Interface for atomic auctions diff --git a/src/interfaces/modules/IBatchAuction.sol b/src/interfaces/modules/IBatchAuction.sol index 556b73c63..d566f06b7 100644 --- a/src/interfaces/modules/IBatchAuction.sol +++ b/src/interfaces/modules/IBatchAuction.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity >=0.8.0; -import "src/interfaces/modules/IAuction.sol"; +import {IAuction} from "./IAuction.sol"; /// @title IBatchAuction /// @notice Interface for batch auctions diff --git a/src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol b/src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol index 0d5cfff13..fa3220131 100644 --- a/src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol +++ b/src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity >=0.8.0; -import {Point} from "src/lib/ECIES.sol"; +import {Point} from "../../../lib/ECIES.sol"; /// @title IEncryptedMarginalPrice /// @notice Interface for encrypted marginal price (batch) auctions diff --git a/src/interfaces/modules/auctions/IFixedPriceBatch.sol b/src/interfaces/modules/auctions/IFixedPriceBatch.sol index 73f41d7ee..37b51ba17 100644 --- a/src/interfaces/modules/auctions/IFixedPriceBatch.sol +++ b/src/interfaces/modules/auctions/IFixedPriceBatch.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.8.19; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; +import {IBatchAuction} from "../IBatchAuction.sol"; /// @notice Interface for fixed price batch auctions interface IFixedPriceBatch is IBatchAuction { diff --git a/src/lib/Callbacks.sol b/src/lib/Callbacks.sol index 17414e390..f091c40c3 100644 --- a/src/lib/Callbacks.sol +++ b/src/lib/Callbacks.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import {ICallback} from "src/interfaces/ICallback.sol"; +import {ICallback} from "../interfaces/ICallback.sol"; /// @notice Library for handling callbacks /// @dev This library is based on the design of UniswapV4's Hooks library (https://github.com/Uniswap/v4-core/blob/main/src/libraries/Hooks.sol) diff --git a/src/lib/MaxPriorityQueue.sol b/src/lib/MaxPriorityQueue.sol index 395f90ea7..9d73ba255 100644 --- a/src/lib/MaxPriorityQueue.sol +++ b/src/lib/MaxPriorityQueue.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BSL 1.1 pragma solidity ^0.8.0; -import {FixedPointMathLib as Math} from "lib/solady/src/utils/FixedPointMathLib.sol"; +import {FixedPointMathLib as Math} from "@solady-0.0.124/utils/FixedPointMathLib.sol"; library BidEncoding { function encode( diff --git a/src/lib/SVG.sol b/src/lib/SVG.sol index 9b693cca8..417bfe947 100644 --- a/src/lib/SVG.sol +++ b/src/lib/SVG.sol @@ -246,6 +246,8 @@ library svg { // an SVG attribute function prop(string memory _key, string memory _val) internal pure returns (string memory) { + // solhint-disable quotes return string.concat(_key, "=", '"', _val, '" '); + // solhint-enable quotes } } diff --git a/src/lib/Timestamp.sol b/src/lib/Timestamp.sol index 83aa004b9..42158acf0 100644 --- a/src/lib/Timestamp.sol +++ b/src/lib/Timestamp.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {uint2str} from "src/lib/Uint2Str.sol"; +import {uint2str} from "./Uint2Str.sol"; library Timestamp { function toPaddedString(uint48 timestamp) diff --git a/src/lib/Transfer.sol b/src/lib/Transfer.sol index c3d6cc449..541c59e5d 100644 --- a/src/lib/Transfer.sol +++ b/src/lib/Transfer.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.8.19; -import {ERC20} from "lib/solmate/src/tokens/ERC20.sol"; -import {SafeTransferLib} from "lib/solmate/src/utils/SafeTransferLib.sol"; -import {IPermit2} from "src/lib/permit2/interfaces/IPermit2.sol"; +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; +import {SafeTransferLib} from "@solmate-6.7.0/utils/SafeTransferLib.sol"; +import {IPermit2} from "./permit2/interfaces/IPermit2.sol"; library Transfer { using SafeTransferLib for ERC20; diff --git a/src/lib/clones/Clone.sol b/src/lib/clones/Clone.sol deleted file mode 100644 index 07771d5da..000000000 --- a/src/lib/clones/Clone.sol +++ /dev/null @@ -1,80 +0,0 @@ -// SPDX-License-Identifier: BSD -pragma solidity ^0.8.4; - -/// @title Clone -/// @author zefram.eth -/// @notice Provides helper functions for reading immutable args from calldata -contract Clone { - /// @notice Reads an immutable arg with type address - /// @param argOffset The offset of the arg in the packed data - /// @return arg The arg value - function _getArgAddress(uint256 argOffset) internal pure returns (address arg) { - uint256 offset = _getImmutableArgsOffset(); - // solhint-disable-next-line no-inline-assembly - assembly { - arg := shr(0x60, calldataload(add(offset, argOffset))) - } - } - - /// @notice Reads an immutable arg with type uint256 - /// @param argOffset The offset of the arg in the packed data - /// @return arg The arg value - function _getArgUint256(uint256 argOffset) internal pure returns (uint256 arg) { - uint256 offset = _getImmutableArgsOffset(); - // solhint-disable-next-line no-inline-assembly - assembly { - arg := calldataload(add(offset, argOffset)) - } - } - - /// @notice Reads a uint256 array stored in the immutable args. - /// @param argOffset The offset of the arg in the packed data - /// @param arrLen Number of elements in the array - /// @return arr The array - function _getArgUint256Array( - uint256 argOffset, - uint64 arrLen - ) internal pure returns (uint256[] memory arr) { - uint256 offset = _getImmutableArgsOffset(); - uint256 el; - arr = new uint256[](arrLen); - for (uint64 i = 0; i < arrLen; i++) { - // solhint-disable-next-line no-inline-assembly - assembly { - el := calldataload(add(add(offset, argOffset), mul(i, 32))) - } - arr[i] = el; - } - return arr; - } - - /// @notice Reads an immutable arg with type uint64 - /// @param argOffset The offset of the arg in the packed data - /// @return arg The arg value - function _getArgUint64(uint256 argOffset) internal pure returns (uint64 arg) { - uint256 offset = _getImmutableArgsOffset(); - // solhint-disable-next-line no-inline-assembly - assembly { - arg := shr(0xc0, calldataload(add(offset, argOffset))) - } - } - - /// @notice Reads an immutable arg with type uint8 - /// @param argOffset The offset of the arg in the packed data - /// @return arg The arg value - function _getArgUint8(uint256 argOffset) internal pure returns (uint8 arg) { - uint256 offset = _getImmutableArgsOffset(); - // solhint-disable-next-line no-inline-assembly - assembly { - arg := shr(0xf8, calldataload(add(offset, argOffset))) - } - } - - /// @return offset The offset of the packed immutable args in calldata - function _getImmutableArgsOffset() internal pure returns (uint256 offset) { - // solhint-disable-next-line no-inline-assembly - assembly { - offset := sub(calldatasize(), add(shr(240, calldataload(sub(calldatasize(), 2))), 2)) - } - } -} diff --git a/src/lib/clones/CloneERC20.sol b/src/lib/clones/CloneERC20.sol index 14d586c68..90a51f17c 100644 --- a/src/lib/clones/CloneERC20.sol +++ b/src/lib/clones/CloneERC20.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BSD pragma solidity >=0.8.0; -import {Clone} from "src/lib/clones/Clone.sol"; +import {Clone} from "@clones-with-immutable-args-1.1.1/Clone.sol"; /// @notice Modern and gas efficient ERC20 implementation. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol) diff --git a/src/lib/clones/ClonesWithImmutableArgs.sol b/src/lib/clones/ClonesWithImmutableArgs.sol deleted file mode 100644 index e8f234611..000000000 --- a/src/lib/clones/ClonesWithImmutableArgs.sol +++ /dev/null @@ -1,371 +0,0 @@ -// SPDX-License-Identifier: BSD - -pragma solidity ^0.8.4; - -/// @title ClonesWithImmutableArgs -/// @author wighawag, zefram.eth -/// @notice Enables creating clone contracts with immutable args -library ClonesWithImmutableArgs { - /// @dev The CREATE3 proxy bytecode. - uint256 private constant _CREATE3_PROXY_BYTECODE = 0x67363d3d37363d34f03d5260086018f3; - - /// @dev Hash of the `_CREATE3_PROXY_BYTECODE`. - /// Equivalent to `keccak256(abi.encodePacked(hex"67363d3d37363d34f03d5260086018f3"))`. - bytes32 private constant _CREATE3_PROXY_BYTECODE_HASH = - 0x21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f; - - error CreateFail(); - error InitializeFail(); - - /// @notice Creates a clone proxy of the implementation contract, with immutable args - /// @dev data cannot exceed 65535 bytes, since 2 bytes are used to store the data length - /// @param implementation The implementation contract to clone - /// @param data Encoded immutable args - /// @return instance The address of the created clone - function clone( - address implementation, - bytes memory data - ) internal returns (address payable instance) { - // unrealistic for memory ptr or data length to exceed 256 bits - unchecked { - uint256 extraLength = data.length + 2; // +2 bytes for telling how much data there is appended to the call - uint256 creationSize = 0x41 + extraLength; - uint256 runSize = creationSize - 10; - uint256 dataPtr; - uint256 ptr; - // solhint-disable-next-line no-inline-assembly - assembly { - ptr := mload(0x40) - - // ------------------------------------------------------------------------------------------------------------- - // CREATION (10 bytes) - // ------------------------------------------------------------------------------------------------------------- - - // 61 runtime | PUSH2 runtime (r) | r | – - mstore(ptr, 0x6100000000000000000000000000000000000000000000000000000000000000) - mstore(add(ptr, 0x01), shl(240, runSize)) // size of the contract running bytecode (16 bits) - - // creation size = 0a - // 3d | RETURNDATASIZE | 0 r | – - // 81 | DUP2 | r 0 r | – - // 60 creation | PUSH1 creation (c) | c r 0 r | – - // 3d | RETURNDATASIZE | 0 c r 0 r | – - // 39 | CODECOPY | 0 r | [0-runSize): runtime code - // f3 | RETURN | | [0-runSize): runtime code - - // ------------------------------------------------------------------------------------------------------------- - // RUNTIME (55 bytes + extraLength) - // ------------------------------------------------------------------------------------------------------------- - - // 3d | RETURNDATASIZE | 0 | – - // 3d | RETURNDATASIZE | 0 0 | – - // 3d | RETURNDATASIZE | 0 0 0 | – - // 3d | RETURNDATASIZE | 0 0 0 0 | – - // 36 | CALLDATASIZE | cds 0 0 0 0 | – - // 3d | RETURNDATASIZE | 0 cds 0 0 0 0 | – - // 3d | RETURNDATASIZE | 0 0 cds 0 0 0 0 | – - // 37 | CALLDATACOPY | 0 0 0 0 | [0, cds) = calldata - // 61 | PUSH2 extra | extra 0 0 0 0 | [0, cds) = calldata - mstore( - add(ptr, 0x03), - 0x3d81600a3d39f33d3d3d3d363d3d376100000000000000000000000000000000 - ) - mstore(add(ptr, 0x13), shl(240, extraLength)) - - // 60 0x37 | PUSH1 0x37 | 0x37 extra 0 0 0 0 | [0, cds) = calldata // 0x37 (55) is runtime size - data - // 36 | CALLDATASIZE | cds 0x37 extra 0 0 0 0 | [0, cds) = calldata - // 39 | CODECOPY | 0 0 0 0 | [0, cds) = calldata, [cds, cds+extra) = extraData - // 36 | CALLDATASIZE | cds 0 0 0 0 | [0, cds) = calldata, [cds, cds+extra) = extraData - // 61 extra | PUSH2 extra | extra cds 0 0 0 0 | [0, cds) = calldata, [cds, cds+extra) = extraData - mstore( - add(ptr, 0x15), - 0x6037363936610000000000000000000000000000000000000000000000000000 - ) - mstore(add(ptr, 0x1b), shl(240, extraLength)) - - // 01 | ADD | cds+extra 0 0 0 0 | [0, cds) = calldata, [cds, cds+extra) = extraData - // 3d | RETURNDATASIZE | 0 cds+extra 0 0 0 0 | [0, cds) = calldata, [cds, cds+extra) = extraData - // 73 addr | PUSH20 0x123… | addr 0 cds+extra 0 0 0 0 | [0, cds) = calldata, [cds, cds+extra) = extraData - mstore( - add(ptr, 0x1d), - 0x013d730000000000000000000000000000000000000000000000000000000000 - ) - mstore(add(ptr, 0x20), shl(0x60, implementation)) - - // 5a | GAS | gas addr 0 cds+extra 0 0 0 0 | [0, cds) = calldata, [cds, cds+extra) = extraData - // f4 | DELEGATECALL | success 0 0 | [0, cds) = calldata, [cds, cds+extra) = extraData - // 3d | RETURNDATASIZE | rds success 0 0 | [0, cds) = calldata, [cds, cds+extra) = extraData - // 3d | RETURNDATASIZE | rds rds success 0 0 | [0, cds) = calldata, [cds, cds+extra) = extraData - // 93 | SWAP4 | 0 rds success 0 rds | [0, cds) = calldata, [cds, cds+extra) = extraData - // 80 | DUP1 | 0 0 rds success 0 rds | [0, cds) = calldata, [cds, cds+extra) = extraData - // 3e | RETURNDATACOPY | success 0 rds | [0, rds) = return data (there might be some irrelevant leftovers in memory [rds, cds+0x37) when rds < cds+0x37) - // 60 0x35 | PUSH1 0x35 | 0x35 sucess 0 rds | [0, rds) = return data - // 57 | JUMPI | 0 rds | [0, rds) = return data - // fd | REVERT | – | [0, rds) = return data - // 5b | JUMPDEST | 0 rds | [0, rds) = return data - // f3 | RETURN | – | [0, rds) = return data - mstore( - add(ptr, 0x34), - 0x5af43d3d93803e603557fd5bf300000000000000000000000000000000000000 - ) - } - - // ------------------------------------------------------------------------------------------------------------- - // APPENDED DATA (Accessible from extcodecopy) - // (but also send as appended data to the delegatecall) - // ------------------------------------------------------------------------------------------------------------- - - extraLength -= 2; - uint256 counter = extraLength; - uint256 copyPtr = ptr + 0x41; - // solhint-disable-next-line no-inline-assembly - assembly { - dataPtr := add(data, 32) - } - for (; counter >= 32; counter -= 32) { - // solhint-disable-next-line no-inline-assembly - assembly { - mstore(copyPtr, mload(dataPtr)) - } - - copyPtr += 32; - dataPtr += 32; - } - uint256 mask = ~(256 ** (32 - counter) - 1); - // solhint-disable-next-line no-inline-assembly - assembly { - mstore(copyPtr, and(mload(dataPtr), mask)) - } - copyPtr += counter; - // solhint-disable-next-line no-inline-assembly - assembly { - mstore(copyPtr, shl(240, extraLength)) - } - // solhint-disable-next-line no-inline-assembly - assembly { - instance := create(0, ptr, creationSize) - } - if (instance == address(0)) { - revert CreateFail(); - } - } - } - - /// @notice Creates a clone proxy of the implementation contract, with immutable args. Uses CREATE3 - /// to implement deterministic deployment. - /// @dev data cannot exceed 65535 bytes, since 2 bytes are used to store the data length - /// @param implementation The implementation contract to clone - /// @param data Encoded immutable args - /// @return deployed The address of the created clone - function clone3( - address implementation, - bytes memory data, - bytes32 salt - ) internal returns (address deployed) { - // unrealistic for memory ptr or data length to exceed 256 bits - unchecked { - uint256 extraLength = data.length + 2; // +2 bytes for telling how much data there is appended to the call - uint256 creationSize = 0x43 + extraLength; - uint256 ptr; - // solhint-disable-next-line no-inline-assembly - assembly { - ptr := mload(0x40) - - // ------------------------------------------------------------------------------------------------------------- - // CREATION (11 bytes) - // ------------------------------------------------------------------------------------------------------------- - - // 3d | RETURNDATASIZE | 0 | – - // 61 runtime | PUSH2 runtime (r) | r 0 | – - mstore(ptr, 0x3d61000000000000000000000000000000000000000000000000000000000000) - mstore(add(ptr, 0x02), shl(240, sub(creationSize, 11))) // size of the contract running bytecode (16 bits) - - // creation size = 0b - // 80 | DUP1 | r r 0 | – - // 60 creation | PUSH1 creation (c) | c r r 0 | – - // 3d | RETURNDATASIZE | 0 c r r 0 | – - // 39 | CODECOPY | r 0 | [0-2d]: runtime code - // 81 | DUP2 | 0 c 0 | [0-2d]: runtime code - // f3 | RETURN | 0 | [0-2d]: runtime code - mstore( - add(ptr, 0x04), - 0x80600b3d3981f300000000000000000000000000000000000000000000000000 - ) - - // ------------------------------------------------------------------------------------------------------------- - // RUNTIME - // ------------------------------------------------------------------------------------------------------------- - - // 36 | CALLDATASIZE | cds | – - // 3d | RETURNDATASIZE | 0 cds | – - // 3d | RETURNDATASIZE | 0 0 cds | – - // 37 | CALLDATACOPY | – | [0, cds] = calldata - // 61 | PUSH2 extra | extra | [0, cds] = calldata - mstore( - add(ptr, 0x0b), - 0x363d3d3761000000000000000000000000000000000000000000000000000000 - ) - mstore(add(ptr, 0x10), shl(240, extraLength)) - - // 60 0x38 | PUSH1 0x38 | 0x38 extra | [0, cds] = calldata // 0x38 (56) is runtime size - data - // 36 | CALLDATASIZE | cds 0x38 extra | [0, cds] = calldata - // 39 | CODECOPY | _ | [0, cds] = calldata - // 3d | RETURNDATASIZE | 0 | [0, cds] = calldata - // 3d | RETURNDATASIZE | 0 0 | [0, cds] = calldata - // 3d | RETURNDATASIZE | 0 0 0 | [0, cds] = calldata - // 36 | CALLDATASIZE | cds 0 0 0 | [0, cds] = calldata - // 61 extra | PUSH2 extra | extra cds 0 0 0 | [0, cds] = calldata - mstore( - add(ptr, 0x12), - 0x603836393d3d3d36610000000000000000000000000000000000000000000000 - ) - mstore(add(ptr, 0x1b), shl(240, extraLength)) - - // 01 | ADD | cds+extra 0 0 0 | [0, cds] = calldata - // 3d | RETURNDATASIZE | 0 cds 0 0 0 | [0, cds] = calldata - // 73 addr | PUSH20 0x123… | addr 0 cds 0 0 0 | [0, cds] = calldata - mstore( - add(ptr, 0x1d), - 0x013d730000000000000000000000000000000000000000000000000000000000 - ) - mstore(add(ptr, 0x20), shl(0x60, implementation)) - - // 5a | GAS | gas addr 0 cds 0 0 0 | [0, cds] = calldata - // f4 | DELEGATECALL | success 0 | [0, cds] = calldata - // 3d | RETURNDATASIZE | rds success 0 | [0, cds] = calldata - // 82 | DUP3 | 0 rds success 0 | [0, cds] = calldata - // 80 | DUP1 | 0 0 rds success 0 | [0, cds] = calldata - // 3e | RETURNDATACOPY | success 0 | [0, rds] = return data (there might be some irrelevant leftovers in memory [rds, cds] when rds < cds) - // 90 | SWAP1 | 0 success | [0, rds] = return data - // 3d | RETURNDATASIZE | rds 0 success | [0, rds] = return data - // 91 | SWAP2 | success 0 rds | [0, rds] = return data - // 60 0x36 | PUSH1 0x36 | 0x36 sucess 0 rds | [0, rds] = return data - // 57 | JUMPI | 0 rds | [0, rds] = return data - // fd | REVERT | – | [0, rds] = return data - // 5b | JUMPDEST | 0 rds | [0, rds] = return data - // f3 | RETURN | – | [0, rds] = return data - - mstore( - add(ptr, 0x34), - 0x5af43d82803e903d91603657fd5bf30000000000000000000000000000000000 - ) - } - - // ------------------------------------------------------------------------------------------------------------- - // APPENDED DATA (Accessible from extcodecopy) - // (but also send as appended data to the delegatecall) - // ------------------------------------------------------------------------------------------------------------- - - extraLength -= 2; - uint256 counter = extraLength; - uint256 copyPtr = ptr + 0x43; - uint256 dataPtr; - // solhint-disable-next-line no-inline-assembly - assembly { - dataPtr := add(data, 32) - } - for (; counter >= 32; counter -= 32) { - // solhint-disable-next-line no-inline-assembly - assembly { - mstore(copyPtr, mload(dataPtr)) - } - - copyPtr += 32; - dataPtr += 32; - } - uint256 mask = ~(256 ** (32 - counter) - 1); - // solhint-disable-next-line no-inline-assembly - assembly { - mstore(copyPtr, and(mload(dataPtr), mask)) - } - copyPtr += counter; - // solhint-disable-next-line no-inline-assembly - assembly { - mstore(copyPtr, shl(240, extraLength)) - } - - /// @solidity memory-safe-assembly - // solhint-disable-next-line no-inline-assembly - assembly { - // Store the `_PROXY_BYTECODE` into scratch space. - mstore(0x00, _CREATE3_PROXY_BYTECODE) - // Deploy a new contract with our pre-made bytecode via CREATE2. - let proxy := create2(0, 0x10, 0x10, salt) - - // If the result of `create2` is the zero address, revert. - if iszero(proxy) { - // Store the function selector of `CreateFail()`. - mstore(0x00, 0xebfef188) - // Revert with (offset, size). - revert(0x1c, 0x04) - } - - // Store the proxy's address. - mstore(0x14, proxy) - // 0xd6 = 0xc0 (short RLP prefix) + 0x16 (length of: 0x94 ++ proxy ++ 0x01). - // 0x94 = 0x80 + 0x14 (0x14 = the length of an address, 20 bytes, in hex). - mstore(0x00, 0xd694) - // Nonce of the proxy contract (1). - mstore8(0x34, 0x01) - - deployed := keccak256(0x1e, 0x17) - - // If the `call` fails or the code size of `deployed` is zero, revert. - // The second argument of the or() call is evaluated first, which is important - // here because extcodesize(deployed) is only non-zero after the call() to the proxy - // is made and the contract is successfully deployed. - if or( - iszero(extcodesize(deployed)), - iszero( - call( - gas(), // Gas remaining. - proxy, // Proxy's address. - 0, // Ether value. - ptr, // Pointer to the creation code - creationSize, // Size of the creation code - 0x00, // Offset of output. - 0x00 // Length of output. - ) - ) - ) { - // Store the function selector of `InitializeFail()`. - mstore(0x00, 0x8f86d2f1) - // Revert with (offset, size). - revert(0x1c, 0x04) - } - } - } - } - - /// @notice Returns the CREATE3 deterministic address of the contract deployed via cloneDeterministic(). - /// @dev Forked from https://github.com/Vectorized/solady/blob/main/src/utils/CREATE3.sol - /// @param salt The salt used by the CREATE3 deployment - function addressOfClone3(bytes32 salt) internal view returns (address deployed) { - /// @solidity memory-safe-assembly - // solhint-disable-next-line no-inline-assembly - assembly { - // Cache the free memory pointer. - let m := mload(0x40) - // Store `address(this)`. - mstore(0x00, address()) - // Store the prefix. - mstore8(0x0b, 0xff) - // Store the salt. - mstore(0x20, salt) - // Store the bytecode hash. - mstore(0x40, _CREATE3_PROXY_BYTECODE_HASH) - - // Store the proxy's address. - mstore(0x14, keccak256(0x0b, 0x55)) - // Restore the free memory pointer. - mstore(0x40, m) - // 0xd6 = 0xc0 (short RLP prefix) + 0x16 (length of: 0x94 ++ proxy ++ 0x01). - // 0x94 = 0x80 + 0x14 (0x14 = the length of an address, 20 bytes, in hex). - mstore(0x00, 0xd694) - // Nonce of the proxy contract (1). - mstore8(0x34, 0x01) - - deployed := keccak256(0x1e, 0x17) - } - } -} diff --git a/src/lib/uniswap-v2/IUniswapV2Factory.sol b/src/lib/uniswap-v2/IUniswapV2Factory.sol deleted file mode 100644 index 314e0755d..000000000 --- a/src/lib/uniswap-v2/IUniswapV2Factory.sol +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity >=0.5.0; - -interface IUniswapV2Factory { - event PairCreated(address indexed token0, address indexed token1, address pair, uint256); - - function feeTo() external view returns (address); - function feeToSetter() external view returns (address); - - function getPair(address tokenA, address tokenB) external view returns (address pair); - function allPairs(uint256) external view returns (address pair); - function allPairsLength() external view returns (uint256); - - function createPair(address tokenA, address tokenB) external returns (address pair); - - function setFeeTo(address) external; - function setFeeToSetter(address) external; -} diff --git a/src/lib/uniswap-v2/IUniswapV2Router01.sol b/src/lib/uniswap-v2/IUniswapV2Router01.sol deleted file mode 100644 index 323235b33..000000000 --- a/src/lib/uniswap-v2/IUniswapV2Router01.sol +++ /dev/null @@ -1,132 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity >=0.6.2; - -interface IUniswapV2Router01 { - function factory() external pure returns (address); - function WETH() external pure returns (address); - - function addLiquidity( - address tokenA, - address tokenB, - uint256 amountADesired, - uint256 amountBDesired, - uint256 amountAMin, - uint256 amountBMin, - address to, - uint256 deadline - ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity); - function addLiquidityETH( - address token, - uint256 amountTokenDesired, - uint256 amountTokenMin, - uint256 amountETHMin, - address to, - uint256 deadline - ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); - function removeLiquidity( - address tokenA, - address tokenB, - uint256 liquidity, - uint256 amountAMin, - uint256 amountBMin, - address to, - uint256 deadline - ) external returns (uint256 amountA, uint256 amountB); - function removeLiquidityETH( - address token, - uint256 liquidity, - uint256 amountTokenMin, - uint256 amountETHMin, - address to, - uint256 deadline - ) external returns (uint256 amountToken, uint256 amountETH); - function removeLiquidityWithPermit( - address tokenA, - address tokenB, - uint256 liquidity, - uint256 amountAMin, - uint256 amountBMin, - address to, - uint256 deadline, - bool approveMax, - uint8 v, - bytes32 r, - bytes32 s - ) external returns (uint256 amountA, uint256 amountB); - function removeLiquidityETHWithPermit( - address token, - uint256 liquidity, - uint256 amountTokenMin, - uint256 amountETHMin, - address to, - uint256 deadline, - bool approveMax, - uint8 v, - bytes32 r, - bytes32 s - ) external returns (uint256 amountToken, uint256 amountETH); - function swapExactTokensForTokens( - uint256 amountIn, - uint256 amountOutMin, - address[] calldata path, - address to, - uint256 deadline - ) external returns (uint256[] memory amounts); - function swapTokensForExactTokens( - uint256 amountOut, - uint256 amountInMax, - address[] calldata path, - address to, - uint256 deadline - ) external returns (uint256[] memory amounts); - function swapExactETHForTokens( - uint256 amountOutMin, - address[] calldata path, - address to, - uint256 deadline - ) external payable returns (uint256[] memory amounts); - function swapTokensForExactETH( - uint256 amountOut, - uint256 amountInMax, - address[] calldata path, - address to, - uint256 deadline - ) external returns (uint256[] memory amounts); - function swapExactTokensForETH( - uint256 amountIn, - uint256 amountOutMin, - address[] calldata path, - address to, - uint256 deadline - ) external returns (uint256[] memory amounts); - function swapETHForExactTokens( - uint256 amountOut, - address[] calldata path, - address to, - uint256 deadline - ) external payable returns (uint256[] memory amounts); - - function quote( - uint256 amountA, - uint256 reserveA, - uint256 reserveB - ) external pure returns (uint256 amountB); - function getAmountOut( - uint256 amountIn, - uint256 reserveIn, - uint256 reserveOut - ) external pure returns (uint256 amountOut); - function getAmountIn( - uint256 amountOut, - uint256 reserveIn, - uint256 reserveOut - ) external pure returns (uint256 amountIn); - function getAmountsOut( - uint256 amountIn, - address[] calldata path - ) external view returns (uint256[] memory amounts); - function getAmountsIn( - uint256 amountOut, - address[] calldata path - ) external view returns (uint256[] memory amounts); -} diff --git a/src/lib/uniswap-v2/IUniswapV2Router02.sol b/src/lib/uniswap-v2/IUniswapV2Router02.sol deleted file mode 100644 index 5ec562fcd..000000000 --- a/src/lib/uniswap-v2/IUniswapV2Router02.sol +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity >=0.6.2; - -import "src/lib/uniswap-v2/IUniswapV2Router01.sol"; - -interface IUniswapV2Router02 is IUniswapV2Router01 { - function removeLiquidityETHSupportingFeeOnTransferTokens( - address token, - uint256 liquidity, - uint256 amountTokenMin, - uint256 amountETHMin, - address to, - uint256 deadline - ) external returns (uint256 amountETH); - function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( - address token, - uint256 liquidity, - uint256 amountTokenMin, - uint256 amountETHMin, - address to, - uint256 deadline, - bool approveMax, - uint8 v, - bytes32 r, - bytes32 s - ) external returns (uint256 amountETH); - - function swapExactTokensForTokensSupportingFeeOnTransferTokens( - uint256 amountIn, - uint256 amountOutMin, - address[] calldata path, - address to, - uint256 deadline - ) external; - function swapExactETHForTokensSupportingFeeOnTransferTokens( - uint256 amountOutMin, - address[] calldata path, - address to, - uint256 deadline - ) external payable; - function swapExactTokensForETHSupportingFeeOnTransferTokens( - uint256 amountIn, - uint256 amountOutMin, - address[] calldata path, - address to, - uint256 deadline - ) external; -} diff --git a/src/lib/uniswap-v3/SqrtPriceMath.sol b/src/lib/uniswap-v3/SqrtPriceMath.sol deleted file mode 100644 index 62fa6704f..000000000 --- a/src/lib/uniswap-v3/SqrtPriceMath.sol +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -import {FixedPointMathLib} from "solmate/utils/FixedPointMathLib.sol"; -import {FullMath} from "uniswap-v3-core/libraries/FullMath.sol"; - -/// @notice Library to calculate sqrtPriceX96 from token amounts -library SqrtPriceMath { - /// @notice Calculates the sqrtPriceX96 from the token amounts - /// @dev The order of the tokens is irrelevant, as the values will be re-ordered. - /// - /// @param tokenA The address of a token - /// @param tokenB The address of the other token - /// @param amountA The amount of tokenA - /// @param amountB The amount of tokenB - /// @return sqrtPriceX96 The sqrtPriceX96 - function getSqrtPriceX96( - address tokenA, - address tokenB, - uint256 amountA, - uint256 amountB - ) internal pure returns (uint160 sqrtPriceX96) { - (uint256 amount0, uint256 amount1) = - tokenA < tokenB ? (amountA, amountB) : (amountB, amountA); - - // Source: https://github.com/Uniswap/v3-sdk/blob/2c8aa3a653831c6b9e842e810f5394a5b5ed937f/src/utils/encodeSqrtRatioX96.ts - // SqrtPriceX96 = sqrt(amount1/amount0) * 2^96 - // = sqrt(amount1 * 2^192 / amount0) - - // Use Uniswap's FullMath.mulDiv to prevent a phantom overflow - uint256 ratioX192 = FullMath.mulDiv(amount1, 2 ** 192, amount0); - uint256 sqrtPriceX96Temp = FixedPointMathLib.sqrt(ratioX192); - - if (sqrtPriceX96Temp > type(uint160).max) revert("overflow"); - - sqrtPriceX96 = uint160(sqrtPriceX96Temp); - } -} diff --git a/src/modules/Auction.sol b/src/modules/Auction.sol index e6f88f7fc..72f5f888c 100644 --- a/src/modules/Auction.sol +++ b/src/modules/Auction.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {Module} from "src/modules/Modules.sol"; +import {IAuction} from "../interfaces/modules/IAuction.sol"; +import {Module} from "./Modules.sol"; abstract contract AuctionModule is IAuction, Module { // ========= STATE ========== // diff --git a/src/modules/Condenser.sol b/src/modules/Condenser.sol index f1da8f17e..adaa4e935 100644 --- a/src/modules/Condenser.sol +++ b/src/modules/Condenser.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -import {ICondenser} from "src/interfaces/modules/ICondenser.sol"; +import {ICondenser} from "../interfaces/modules/ICondenser.sol"; -import {Module} from "src/modules/Modules.sol"; +import {Module} from "./Modules.sol"; /// @title CondenserModule /// @notice The CondenserModule contract is an abstract contract that provides condenser functionality for the AuctionHouse. diff --git a/src/modules/Derivative.sol b/src/modules/Derivative.sol index 702185ba7..5a4c2e420 100644 --- a/src/modules/Derivative.sol +++ b/src/modules/Derivative.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -import {ERC6909} from "lib/solmate/src/tokens/ERC6909.sol"; -import {ERC6909Metadata} from "src/lib/ERC6909Metadata.sol"; -import {Module} from "src/modules/Modules.sol"; -import {IDerivative} from "src/interfaces/modules/IDerivative.sol"; +import {ERC6909} from "@solmate-6.7.0/tokens/ERC6909.sol"; +import {ERC6909Metadata} from "../lib/ERC6909Metadata.sol"; +import {Module} from "./Modules.sol"; +import {IDerivative} from "../interfaces/modules/IDerivative.sol"; /// @title DerivativeModule /// @notice The DerivativeModule contract is an abstract contract that provides derivative functionality for the AuctionHouse. diff --git a/src/modules/Modules.sol b/src/modules/Modules.sol index 938c2a8f6..bd94dd6aa 100644 --- a/src/modules/Modules.sol +++ b/src/modules/Modules.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.8.19; -import {Owned} from "lib/solmate/src/auth/Owned.sol"; -import "src/modules/Keycode.sol"; +import {Owned} from "@solmate-6.7.0/auth/Owned.sol"; +import "./Keycode.sol"; /// @notice Abstract contract that provides functionality for installing and interacting with modules. /// @dev This contract is intended to be inherited by any contract that needs to install modules. diff --git a/src/modules/auctions/AtomicAuctionModule.sol b/src/modules/auctions/AtomicAuctionModule.sol index 701b85460..486884169 100644 --- a/src/modules/auctions/AtomicAuctionModule.sol +++ b/src/modules/auctions/AtomicAuctionModule.sol @@ -2,11 +2,11 @@ pragma solidity 0.8.19; // Interfaces -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAtomicAuction} from "src/interfaces/modules/IAtomicAuction.sol"; +import {IAuction} from "../../interfaces/modules/IAuction.sol"; +import {IAtomicAuction} from "../../interfaces/modules/IAtomicAuction.sol"; // Auctions -import {AuctionModule} from "src/modules/Auction.sol"; +import {AuctionModule} from "../Auction.sol"; /// @title Atomic Auction Module /// @notice A base contract for atomic auctions diff --git a/src/modules/auctions/BatchAuctionModule.sol b/src/modules/auctions/BatchAuctionModule.sol index 8930c6f45..b0e438c7f 100644 --- a/src/modules/auctions/BatchAuctionModule.sol +++ b/src/modules/auctions/BatchAuctionModule.sol @@ -2,11 +2,11 @@ pragma solidity 0.8.19; // Interfaces -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; +import {IAuction} from "../../interfaces/modules/IAuction.sol"; +import {IBatchAuction} from "../../interfaces/modules/IBatchAuction.sol"; // Auctions -import {AuctionModule} from "src/modules/Auction.sol"; +import {AuctionModule} from "../Auction.sol"; /// @title Batch Auction Module /// @notice A base contract for batch auctions diff --git a/src/modules/auctions/atomic/FPS.sol b/src/modules/auctions/atomic/FPS.sol index 4a3ef8413..0fbaf27a5 100644 --- a/src/modules/auctions/atomic/FPS.sol +++ b/src/modules/auctions/atomic/FPS.sol @@ -2,17 +2,17 @@ pragma solidity 0.8.19; // Interfaces -import {IAtomicAuction} from "src/interfaces/modules/IAtomicAuction.sol"; -import {IFixedPriceSale} from "src/interfaces/modules/auctions/IFixedPriceSale.sol"; +import {IAtomicAuction} from "../../../interfaces/modules/IAtomicAuction.sol"; +import {IFixedPriceSale} from "../../../interfaces/modules/auctions/IFixedPriceSale.sol"; // Protocol dependencies -import {Module} from "src/modules/Modules.sol"; -import {AuctionModule} from "src/modules/Auction.sol"; -import {Veecode, toVeecode} from "src/modules/Modules.sol"; -import {AtomicAuctionModule} from "src/modules/auctions/AtomicAuctionModule.sol"; +import {Module} from "../../Modules.sol"; +import {AuctionModule} from "../../Auction.sol"; +import {Veecode, toVeecode} from "../../Modules.sol"; +import {AtomicAuctionModule} from "../AtomicAuctionModule.sol"; // External libraries -import {FixedPointMathLib as Math} from "lib/solmate/src/utils/FixedPointMathLib.sol"; +import {FixedPointMathLib as Math} from "@solmate-6.7.0/utils/FixedPointMathLib.sol"; /// @title FixedPriceSale /// @notice A module for creating fixed price sale (atomic) auctions diff --git a/src/modules/auctions/batch/EMP.sol b/src/modules/auctions/batch/EMP.sol index b4e97ee1c..00a787d33 100644 --- a/src/modules/auctions/batch/EMP.sol +++ b/src/modules/auctions/batch/EMP.sol @@ -2,21 +2,22 @@ pragma solidity 0.8.19; // Interfaces -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; -import {IEncryptedMarginalPrice} from "src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; +import {IBatchAuction} from "../../../interfaces/modules/IBatchAuction.sol"; +import {IEncryptedMarginalPrice} from + "../../../interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; // Internal libraries -import {ECIES, Point} from "src/lib/ECIES.sol"; -import {MaxPriorityQueue, Queue} from "src/lib/MaxPriorityQueue.sol"; +import {ECIES, Point} from "../../../lib/ECIES.sol"; +import {MaxPriorityQueue, Queue} from "../../../lib/MaxPriorityQueue.sol"; // External libraries -import {FixedPointMathLib as Math} from "solady/utils/FixedPointMathLib.sol"; +import {FixedPointMathLib as Math} from "@solady-0.0.124/utils/FixedPointMathLib.sol"; // Auctions -import {AuctionModule} from "src/modules/Auction.sol"; -import {BatchAuctionModule} from "src/modules/auctions/BatchAuctionModule.sol"; +import {AuctionModule} from "../../Auction.sol"; +import {BatchAuctionModule} from "../BatchAuctionModule.sol"; -import {Module, Veecode, toVeecode} from "src/modules/Modules.sol"; +import {Module, Veecode, toVeecode} from "../../Modules.sol"; /// @notice Encrypted Marginal Price /// @dev This batch auction module allows for bids to be encrypted off-chain, then stored, decrypted and settled on-chain. diff --git a/src/modules/auctions/batch/FPB.sol b/src/modules/auctions/batch/FPB.sol index e65f1f2a4..82cfa2c99 100644 --- a/src/modules/auctions/batch/FPB.sol +++ b/src/modules/auctions/batch/FPB.sol @@ -2,17 +2,17 @@ pragma solidity 0.8.19; // Interfaces -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; -import {IFixedPriceBatch} from "src/interfaces/modules/auctions/IFixedPriceBatch.sol"; +import {IBatchAuction} from "../../../interfaces/modules/IBatchAuction.sol"; +import {IFixedPriceBatch} from "../../../interfaces/modules/auctions/IFixedPriceBatch.sol"; // External libraries -import {FixedPointMathLib as Math} from "solady/utils/FixedPointMathLib.sol"; +import {FixedPointMathLib as Math} from "@solady-0.0.124/utils/FixedPointMathLib.sol"; // Auctions -import {AuctionModule} from "src/modules/Auction.sol"; -import {BatchAuctionModule} from "src/modules/auctions/BatchAuctionModule.sol"; +import {AuctionModule} from "../../Auction.sol"; +import {BatchAuctionModule} from "../BatchAuctionModule.sol"; -import {Module, Veecode, toVeecode} from "src/modules/Modules.sol"; +import {Module, Veecode, toVeecode} from "../../Modules.sol"; /// @title FixedPriceBatch /// @notice A module for creating fixed price batch auctions diff --git a/src/modules/derivatives/CliffVesting.sol b/src/modules/derivatives/CliffVesting.sol index c399a2354..8252cb95b 100644 --- a/src/modules/derivatives/CliffVesting.sol +++ b/src/modules/derivatives/CliffVesting.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -// import {ClonesWithImmutableArgs} from "src/lib/clones/ClonesWithImmutableArgs.sol"; -// import {ERC20} from "solmate/tokens/ERC20.sol"; -// import "src/modules/Derivative.sol"; +// import {ClonesWithImmutableArgs} from "@clones-with-immutable-args-1.1.1/ClonesWithImmutableArgs.sol"; +// import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; +// import "./Derivative.sol"; // // TODO this only uses the ERC20 clones, need to convert to ERC6909 with optional ERC20 via wrapping the ERC6909 // contract CliffVesting is DerivativeModule { diff --git a/src/modules/derivatives/LinearVesting.sol b/src/modules/derivatives/LinearVesting.sol index 287c4ebb8..ce125b3d7 100644 --- a/src/modules/derivatives/LinearVesting.sol +++ b/src/modules/derivatives/LinearVesting.sol @@ -1,20 +1,22 @@ // SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -import {ERC20} from "solmate/tokens/ERC20.sol"; -import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol"; -import {ClonesWithImmutableArgs} from "src/lib/clones/ClonesWithImmutableArgs.sol"; -import {Timestamp} from "src/lib/Timestamp.sol"; -import {ERC6909Metadata} from "src/lib/ERC6909Metadata.sol"; -import {FixedPointMathLib} from "solmate/utils/FixedPointMathLib.sol"; -import {Base64} from "lib/openzeppelin-contracts/contracts/utils/Base64.sol"; - -import {IDerivative} from "src/interfaces/modules/IDerivative.sol"; -import {ILinearVesting} from "src/interfaces/modules/derivatives/ILinearVesting.sol"; -import {DerivativeModule} from "src/modules/Derivative.sol"; -import {Module, Veecode, toKeycode, wrapVeecode} from "src/modules/Modules.sol"; -import {SoulboundCloneERC20} from "src/modules/derivatives/SoulboundCloneERC20.sol"; -import {LinearVestingCard} from "src/modules/derivatives/LinearVestingCard.sol"; +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; +import {SafeTransferLib} from "@solmate-6.7.0/utils/SafeTransferLib.sol"; +import {ClonesWithImmutableArgs} from + "@clones-with-immutable-args-1.1.1/ClonesWithImmutableArgs.sol"; +import {FixedPointMathLib} from "@solmate-6.7.0/utils/FixedPointMathLib.sol"; +import {Base64} from "@openzeppelin-contracts-4.9.2/utils/Base64.sol"; + +import {Timestamp} from "../../lib/Timestamp.sol"; +import {ERC6909Metadata} from "../../lib/ERC6909Metadata.sol"; + +import {IDerivative} from "../../interfaces/modules/IDerivative.sol"; +import {ILinearVesting} from "../../interfaces/modules/derivatives/ILinearVesting.sol"; +import {DerivativeModule} from "../../modules/Derivative.sol"; +import {Module, Veecode, toKeycode, wrapVeecode} from "../../modules/Modules.sol"; +import {SoulboundCloneERC20} from "../../modules/derivatives/SoulboundCloneERC20.sol"; +import {LinearVestingCard} from "../../modules/derivatives/LinearVestingCard.sol"; /// @title LinearVesting /// @notice A derivative module that allows for the creation of linearly vesting tokens @@ -497,6 +499,16 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { // ========== VIEW FUNCTIONS ========== // + function _getTokenMetadata(uint256 tokenId_) + internal + view + returns (ERC20, VestingParams memory) + { + Token storage token = tokenMetadata[tokenId_]; + + return (ERC20(token.underlyingToken), abi.decode(token.data, (VestingParams))); + } + /// @inheritdoc ILinearVesting function getTokenVestingParams(uint256 tokenId_) external @@ -663,10 +675,10 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { onlyValidTokenId(tokenId_) returns (string memory) { - Token storage token = tokenMetadata[tokenId_]; - VestingParams memory data = abi.decode(token.data, (VestingParams)); + // Get the token data + (ERC20 underlyingToken, VestingParams memory data) = _getTokenMetadata(tokenId_); - (string memory name_,) = _computeNameAndSymbol(ERC20(token.underlyingToken), data.expiry); + (string memory name_,) = _computeNameAndSymbol(underlyingToken, data.expiry); return name_; } @@ -680,10 +692,10 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { onlyValidTokenId(tokenId_) returns (string memory) { - Token storage token = tokenMetadata[tokenId_]; - VestingParams memory data = abi.decode(token.data, (VestingParams)); + // Get the token data + (ERC20 underlyingToken, VestingParams memory data) = _getTokenMetadata(tokenId_); - (, string memory symbol_) = _computeNameAndSymbol(ERC20(token.underlyingToken), data.expiry); + (, string memory symbol_) = _computeNameAndSymbol(underlyingToken, data.expiry); return symbol_; } @@ -697,9 +709,10 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { onlyValidTokenId(tokenId_) returns (uint8) { - Token storage token = tokenMetadata[tokenId_]; + // Get the token data + (ERC20 underlyingToken,) = _getTokenMetadata(tokenId_); - return ERC20(token.underlyingToken).decimals(); + return underlyingToken.decimals(); } // ========== ERC6909 CONTENT EXTENSION ========== // @@ -714,16 +727,16 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { onlyValidTokenId(tokenId_) returns (string memory) { - Token storage token = tokenMetadata[tokenId_]; - VestingParams memory data = abi.decode(token.data, (VestingParams)); + // Get the token data + (ERC20 underlyingToken, VestingParams memory data) = _getTokenMetadata(tokenId_); // Get the underlying token symbol - string memory _symbol = ERC20(token.underlyingToken).symbol(); + string memory _symbol = underlyingToken.symbol(); // Create token info for rendering token card Info memory info = Info({ tokenId: tokenId_, - baseToken: token.underlyingToken, + baseToken: address(underlyingToken), baseTokenSymbol: _symbol, start: data.start, expiry: data.expiry, diff --git a/src/modules/derivatives/LinearVestingCard.sol b/src/modules/derivatives/LinearVestingCard.sol index 020278053..c7956d241 100644 --- a/src/modules/derivatives/LinearVestingCard.sol +++ b/src/modules/derivatives/LinearVestingCard.sol @@ -1,9 +1,10 @@ /// SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -import {svg} from "src/lib/SVG.sol"; -import {Timestamp} from "src/lib/Timestamp.sol"; -import {Strings} from "lib/openzeppelin-contracts/contracts/utils/Strings.sol"; +import {Strings} from "@openzeppelin-contracts-4.9.2/utils/Strings.sol"; + +import {svg} from "../../lib/SVG.sol"; +import {Timestamp} from "../../lib/Timestamp.sol"; contract LinearVestingCard { // solhint-disable quotes diff --git a/src/modules/derivatives/SoulboundCloneERC20.sol b/src/modules/derivatives/SoulboundCloneERC20.sol index 745648253..b531927e1 100644 --- a/src/modules/derivatives/SoulboundCloneERC20.sol +++ b/src/modules/derivatives/SoulboundCloneERC20.sol @@ -1,8 +1,9 @@ // SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.19; -import {CloneERC20} from "src/lib/clones/CloneERC20.sol"; -import {ERC20} from "solmate/tokens/ERC20.sol"; +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; + +import {CloneERC20} from "../../lib/clones/CloneERC20.sol"; /// @title SoulboundCloneERC20 /// @notice A cloneable ERC20 token with the following additional features: diff --git a/test/AtomicAuctionHouse/AuctionHouseTest.sol b/test/AtomicAuctionHouse/AuctionHouseTest.sol index 89d38fe4c..94156315d 100644 --- a/test/AtomicAuctionHouse/AuctionHouseTest.sol +++ b/test/AtomicAuctionHouse/AuctionHouseTest.sol @@ -2,35 +2,35 @@ pragma solidity 0.8.19; // Interfaces -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {IAtomicAuctionHouse} from "src/interfaces/IAtomicAuctionHouse.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; -import {IFeeManager} from "src/interfaces/IFeeManager.sol"; +import {IAuction} from "../../src/interfaces/modules/IAuction.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; +import {IAtomicAuctionHouse} from "../../src/interfaces/IAtomicAuctionHouse.sol"; +import {ICallback} from "../../src/interfaces/ICallback.sol"; +import {IFeeManager} from "../../src/interfaces/IFeeManager.sol"; // Internal libraries -import {Callbacks} from "src/lib/Callbacks.sol"; -import {Transfer} from "src/lib/Transfer.sol"; +import {Callbacks} from "../../src/lib/Callbacks.sol"; +import {Transfer} from "../../src/lib/Transfer.sol"; // External libraries -import {Test} from "forge-std/Test.sol"; -import {FixedPointMathLib} from "solmate/utils/FixedPointMathLib.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {FixedPointMathLib} from "@solmate-6.7.0/utils/FixedPointMathLib.sol"; // Mocks -import {MockAtomicAuctionModule} from "test/modules/Auction/MockAtomicAuctionModule.sol"; -import {MockDerivativeModule} from "test/modules/derivatives/mocks/MockDerivativeModule.sol"; -import {MockCondenserModule} from "test/modules/Condenser/MockCondenserModule.sol"; -import {MockCallback} from "test/callbacks/MockCallback.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; -import {MockFeeOnTransferERC20} from "test/lib/mocks/MockFeeOnTransferERC20.sol"; +import {MockAtomicAuctionModule} from "../modules/Auction/MockAtomicAuctionModule.sol"; +import {MockDerivativeModule} from "../modules/derivatives/mocks/MockDerivativeModule.sol"; +import {MockCondenserModule} from "../modules/Condenser/MockCondenserModule.sol"; +import {MockCallback} from "../callbacks/MockCallback.sol"; +import {Permit2User} from "../lib/permit2/Permit2User.sol"; +import {MockFeeOnTransferERC20} from "../lib/mocks/MockFeeOnTransferERC20.sol"; // Auctions -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; -import {AuctionModule} from "src/modules/Auction.sol"; +import {AtomicAuctionHouse} from "../../src/AtomicAuctionHouse.sol"; +import {AuctionModule} from "../../src/modules/Auction.sol"; -import {Veecode, toKeycode, keycodeFromVeecode, Keycode} from "src/modules/Keycode.sol"; +import {Veecode, toKeycode, keycodeFromVeecode, Keycode} from "../../src/modules/Keycode.sol"; -import {WithSalts} from "test/lib/WithSalts.sol"; +import {WithSalts} from "../lib/WithSalts.sol"; abstract contract AtomicAuctionHouseTest is Test, Permit2User, WithSalts { MockFeeOnTransferERC20 internal _baseToken; diff --git a/test/AtomicAuctionHouse/auction.t.sol b/test/AtomicAuctionHouse/auction.t.sol index ec793059e..6a76427da 100644 --- a/test/AtomicAuctionHouse/auction.t.sol +++ b/test/AtomicAuctionHouse/auction.t.sol @@ -2,15 +2,15 @@ pragma solidity 0.8.19; // Libraries -import {AtomicAuctionHouseTest} from "test/AtomicAuctionHouse/AuctionHouseTest.sol"; +import {AtomicAuctionHouseTest} from "./AuctionHouseTest.sol"; // Mocks -import {MockERC20} from "lib/solmate/src/test/utils/mocks/MockERC20.sol"; -import {MockBatchAuctionModule} from "test/modules/Auction/MockBatchAuctionModule.sol"; +import {MockERC20} from "@solmate-6.7.0/test/utils/mocks/MockERC20.sol"; +import {MockBatchAuctionModule} from "../modules/Auction/MockBatchAuctionModule.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; +import {IAuction} from "../../src/interfaces/modules/IAuction.sol"; +import {ICallback} from "../../src/interfaces/ICallback.sol"; import { Keycode, keycodeFromVeecode, @@ -18,7 +18,7 @@ import { WithModules, wrapVeecode, fromVeecode -} from "src/modules/Modules.sol"; +} from "../../src/modules/Modules.sol"; contract AtomicCreateAuctionTest is AtomicAuctionHouseTest { MockBatchAuctionModule internal _batchAuctionModule; diff --git a/test/AtomicAuctionHouse/cancelAuction.t.sol b/test/AtomicAuctionHouse/cancelAuction.t.sol index a14a34779..5cabf18eb 100644 --- a/test/AtomicAuctionHouse/cancelAuction.t.sol +++ b/test/AtomicAuctionHouse/cancelAuction.t.sol @@ -2,10 +2,10 @@ pragma solidity 0.8.19; // Auctions -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; +import {IAuction} from "../../src/interfaces/modules/IAuction.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; -import {AtomicAuctionHouseTest} from "test/AtomicAuctionHouse/AuctionHouseTest.sol"; +import {AtomicAuctionHouseTest} from "./AuctionHouseTest.sol"; contract AtomicCancelAuctionTest is AtomicAuctionHouseTest { uint256 internal constant _PURCHASE_AMOUNT = 2e18; diff --git a/test/AtomicAuctionHouse/claimRewards.t.sol b/test/AtomicAuctionHouse/claimRewards.t.sol index 647a9b350..d93d77a71 100644 --- a/test/AtomicAuctionHouse/claimRewards.t.sol +++ b/test/AtomicAuctionHouse/claimRewards.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {AtomicAuctionHouseTest} from "test/AtomicAuctionHouse/AuctionHouseTest.sol"; +import {AtomicAuctionHouseTest} from "./AuctionHouseTest.sol"; contract AtomicClaimRewardsTest is AtomicAuctionHouseTest { uint256 internal constant _AMOUNT_IN = 1e18; diff --git a/test/AtomicAuctionHouse/curate.t.sol b/test/AtomicAuctionHouse/curate.t.sol index 7c56b6546..827c4b5ab 100644 --- a/test/AtomicAuctionHouse/curate.t.sol +++ b/test/AtomicAuctionHouse/curate.t.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; -import {AtomicAuctionHouseTest} from "test/AtomicAuctionHouse/AuctionHouseTest.sol"; +import {AtomicAuctionHouseTest} from "./AuctionHouseTest.sol"; contract AtomicCurateTest is AtomicAuctionHouseTest { // ===== Modifiers ===== // diff --git a/test/AtomicAuctionHouse/purchase.t.sol b/test/AtomicAuctionHouse/purchase.t.sol index 085aceaa1..af3c7465d 100644 --- a/test/AtomicAuctionHouse/purchase.t.sol +++ b/test/AtomicAuctionHouse/purchase.t.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; +import {IAuction} from "../../src/interfaces/modules/IAuction.sol"; +import {AtomicAuctionHouse} from "../../src/AtomicAuctionHouse.sol"; -import {MockDerivativeModule} from "test/modules/derivatives/mocks/MockDerivativeModule.sol"; +import {MockDerivativeModule} from "../modules/derivatives/mocks/MockDerivativeModule.sol"; -import {AtomicAuctionHouseTest} from "test/AtomicAuctionHouse/AuctionHouseTest.sol"; +import {AtomicAuctionHouseTest} from "./AuctionHouseTest.sol"; contract AtomicPurchaseTest is AtomicAuctionHouseTest { uint256 internal constant _AMOUNT_IN = 2e18; diff --git a/test/AtomicAuctionHouse/setFee.t.sol b/test/AtomicAuctionHouse/setFee.t.sol index 1441676ef..2b1868319 100644 --- a/test/AtomicAuctionHouse/setFee.t.sol +++ b/test/AtomicAuctionHouse/setFee.t.sol @@ -2,20 +2,20 @@ pragma solidity 0.8.19; // Interfaces -import {IFeeManager} from "src/interfaces/IFeeManager.sol"; +import {IFeeManager} from "../../src/interfaces/IFeeManager.sol"; // Libraries -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; // Mocks -import {MockAtomicAuctionModule} from "test/modules/Auction/MockAtomicAuctionModule.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; +import {MockAtomicAuctionModule} from "../modules/Auction/MockAtomicAuctionModule.sol"; +import {Permit2User} from "../lib/permit2/Permit2User.sol"; // Auctions -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; +import {AtomicAuctionHouse} from "../../src/AtomicAuctionHouse.sol"; // Modules -import {Keycode, keycodeFromVeecode} from "src/modules/Modules.sol"; +import {Keycode, keycodeFromVeecode} from "../../src/modules/Modules.sol"; contract AtomicSetFeeTest is Test, Permit2User { MockAtomicAuctionModule internal _mockAuctionModule; diff --git a/test/AtomicAuctionHouse/setProtocol.t.sol b/test/AtomicAuctionHouse/setProtocol.t.sol index ad0794147..ba81d493c 100644 --- a/test/AtomicAuctionHouse/setProtocol.t.sol +++ b/test/AtomicAuctionHouse/setProtocol.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {AtomicAuctionHouseTest} from "test/AtomicAuctionHouse/AuctionHouseTest.sol"; +import {AtomicAuctionHouseTest} from "./AuctionHouseTest.sol"; contract AtomicSetProtocolTest is AtomicAuctionHouseTest { address internal immutable _NEW_PROTOCOL = address(0x7); diff --git a/test/AuctionHouse/MockAuctionHouse.sol b/test/AuctionHouse/MockAuctionHouse.sol index 26542a528..a0549a79b 100644 --- a/test/AuctionHouse/MockAuctionHouse.sol +++ b/test/AuctionHouse/MockAuctionHouse.sol @@ -1,14 +1,14 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; +import {IAuction} from "../../src/interfaces/modules/IAuction.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; -import {ERC20} from "solmate/tokens/ERC20.sol"; -import {Transfer} from "src/lib/Transfer.sol"; +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; +import {Transfer} from "../../src/lib/Transfer.sol"; -import {AuctionHouse} from "src/bases/AuctionHouse.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; +import {AuctionHouse} from "../../src/bases/AuctionHouse.sol"; +import {ICallback} from "../../src/interfaces/ICallback.sol"; /// @notice Mock AuctionHouse contract for testing /// @dev It currently exposes some internal functions so that they can be tested in isolation diff --git a/test/AuctionHouse/collectPayment.t.sol b/test/AuctionHouse/collectPayment.t.sol index a7e657214..671ab29ed 100644 --- a/test/AuctionHouse/collectPayment.t.sol +++ b/test/AuctionHouse/collectPayment.t.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Test} from "forge-std/Test.sol"; -import {Transfer} from "src/lib/Transfer.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {Transfer} from "../../src/lib/Transfer.sol"; -import {MockAuctionHouse} from "test/AuctionHouse/MockAuctionHouse.sol"; -import {MockFeeOnTransferERC20} from "test/lib/mocks/MockFeeOnTransferERC20.sol"; -import {Permit2Clone} from "test/lib/permit2/Permit2Clone.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; +import {MockAuctionHouse} from "./MockAuctionHouse.sol"; +import {MockFeeOnTransferERC20} from "../lib/mocks/MockFeeOnTransferERC20.sol"; +import {Permit2Clone} from "../lib/permit2/Permit2Clone.sol"; +import {Permit2User} from "../lib/permit2/Permit2User.sol"; contract CollectPaymentTest is Test, Permit2User { MockAuctionHouse internal _auctionHouse; diff --git a/test/AuctionHouse/sendPayment.t.sol b/test/AuctionHouse/sendPayment.t.sol index 68ea2b34a..603ab59c4 100644 --- a/test/AuctionHouse/sendPayment.t.sol +++ b/test/AuctionHouse/sendPayment.t.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; -import {MockCallback} from "test/callbacks/MockCallback.sol"; -import {MockAuctionHouse} from "test/AuctionHouse/MockAuctionHouse.sol"; -import {MockFeeOnTransferERC20} from "test/lib/mocks/MockFeeOnTransferERC20.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; +import {MockCallback} from "../callbacks/MockCallback.sol"; +import {MockAuctionHouse} from "./MockAuctionHouse.sol"; +import {MockFeeOnTransferERC20} from "../lib/mocks/MockFeeOnTransferERC20.sol"; +import {Permit2User} from "../lib/permit2/Permit2User.sol"; +import {Callbacks} from "../../src/lib/Callbacks.sol"; -import {WithSalts} from "test/lib/WithSalts.sol"; +import {WithSalts} from "../lib/WithSalts.sol"; contract SendPaymentTest is Test, Permit2User, WithSalts { MockAuctionHouse internal _auctionHouse; diff --git a/test/AuctionHouse/sendPayout.t.sol b/test/AuctionHouse/sendPayout.t.sol index 38f044f83..d22587766 100644 --- a/test/AuctionHouse/sendPayout.t.sol +++ b/test/AuctionHouse/sendPayout.t.sol @@ -1,22 +1,22 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Test} from "forge-std/Test.sol"; -import {Transfer} from "src/lib/Transfer.sol"; - -import {MockAuctionHouse} from "test/AuctionHouse/MockAuctionHouse.sol"; -import {MockAtomicAuctionModule} from "test/modules/Auction/MockAtomicAuctionModule.sol"; -import {MockDerivativeModule} from "test/modules/derivatives/mocks/MockDerivativeModule.sol"; -import {MockCondenserModule} from "test/modules/Condenser/MockCondenserModule.sol"; -import {MockFeeOnTransferERC20} from "test/lib/mocks/MockFeeOnTransferERC20.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; -import {MockWrappedDerivative} from "test/lib/mocks/MockWrappedDerivative.sol"; - -import {ERC20} from "solmate/tokens/ERC20.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; - -import {Veecode, toVeecode} from "src/modules/Modules.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {Transfer} from "../../src/lib/Transfer.sol"; + +import {MockAuctionHouse} from "./MockAuctionHouse.sol"; +import {MockAtomicAuctionModule} from "../modules/Auction/MockAtomicAuctionModule.sol"; +import {MockDerivativeModule} from "../modules/derivatives/mocks/MockDerivativeModule.sol"; +import {MockCondenserModule} from "../modules/Condenser/MockCondenserModule.sol"; +import {MockFeeOnTransferERC20} from "../lib/mocks/MockFeeOnTransferERC20.sol"; +import {Permit2User} from "../lib/permit2/Permit2User.sol"; +import {MockWrappedDerivative} from "../lib/mocks/MockWrappedDerivative.sol"; + +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; +import {ICallback} from "../../src/interfaces/ICallback.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; + +import {Veecode, toVeecode} from "../../src/modules/Modules.sol"; contract SendPayoutTest is Test, Permit2User { MockAuctionHouse internal _auctionHouse; diff --git a/test/AuctionHouse/setCondenser.t.sol b/test/AuctionHouse/setCondenser.t.sol index 558a9ca28..e0777e24a 100644 --- a/test/AuctionHouse/setCondenser.t.sol +++ b/test/AuctionHouse/setCondenser.t.sol @@ -2,22 +2,24 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; // Mocks -import {MockERC20} from "lib/solmate/src/test/utils/mocks/MockERC20.sol"; -import {MockAuctionHouse} from "test/AuctionHouse/MockAuctionHouse.sol"; -import {MockAtomicAuctionModule} from "test/modules/Auction/MockAtomicAuctionModule.sol"; -import {MockDerivativeModule} from "test/modules/derivatives/mocks/MockDerivativeModule.sol"; -import {MockCondenserModule} from "test/modules/Condenser/MockCondenserModule.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; +import {MockERC20} from "@solmate-6.7.0/test/utils/mocks/MockERC20.sol"; +import {MockAuctionHouse} from "./MockAuctionHouse.sol"; +import {MockAtomicAuctionModule} from "../modules/Auction/MockAtomicAuctionModule.sol"; +import {MockDerivativeModule} from "../modules/derivatives/mocks/MockDerivativeModule.sol"; +import {MockCondenserModule} from "../modules/Condenser/MockCondenserModule.sol"; +import {Permit2User} from "../lib/permit2/Permit2User.sol"; // Auctions -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {InvalidVeecode, keycodeFromVeecode} from "src/modules/Modules.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; +import {InvalidVeecode, keycodeFromVeecode} from "../../src/modules/Modules.sol"; // Modules -import {toKeycode, Veecode, toVeecode, fromVeecode, WithModules} from "src/modules/Modules.sol"; +import { + toKeycode, Veecode, toVeecode, fromVeecode, WithModules +} from "../../src/modules/Modules.sol"; contract SetCondenserTest is Test, Permit2User { MockERC20 internal _baseToken; diff --git a/test/BatchAuctionHouse/AuctionHouseTest.sol b/test/BatchAuctionHouse/AuctionHouseTest.sol index f0eeee7a9..a4b43b43b 100644 --- a/test/BatchAuctionHouse/AuctionHouseTest.sol +++ b/test/BatchAuctionHouse/AuctionHouseTest.sol @@ -2,35 +2,35 @@ pragma solidity 0.8.19; // Interfaces -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {IBatchAuctionHouse} from "src/interfaces/IBatchAuctionHouse.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; -import {IFeeManager} from "src/interfaces/IFeeManager.sol"; +import {IAuction} from "../../src/interfaces/modules/IAuction.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; +import {IBatchAuctionHouse} from "../../src/interfaces/IBatchAuctionHouse.sol"; +import {ICallback} from "../../src/interfaces/ICallback.sol"; +import {IFeeManager} from "../../src/interfaces/IFeeManager.sol"; // Internal libraries -import {Callbacks} from "src/lib/Callbacks.sol"; -import {Transfer} from "src/lib/Transfer.sol"; +import {Callbacks} from "../../src/lib/Callbacks.sol"; +import {Transfer} from "../../src/lib/Transfer.sol"; // External libraries -import {Test} from "forge-std/Test.sol"; -import {FixedPointMathLib} from "solmate/utils/FixedPointMathLib.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {FixedPointMathLib} from "@solmate-6.7.0/utils/FixedPointMathLib.sol"; // Mocks -import {MockBatchAuctionModule} from "test/modules/Auction/MockBatchAuctionModule.sol"; -import {MockDerivativeModule} from "test/modules/derivatives/mocks/MockDerivativeModule.sol"; -import {MockCondenserModule} from "test/modules/Condenser/MockCondenserModule.sol"; -import {MockCallback} from "test/callbacks/MockCallback.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; -import {MockFeeOnTransferERC20} from "test/lib/mocks/MockFeeOnTransferERC20.sol"; +import {MockBatchAuctionModule} from "../modules/Auction/MockBatchAuctionModule.sol"; +import {MockDerivativeModule} from "../modules/derivatives/mocks/MockDerivativeModule.sol"; +import {MockCondenserModule} from "../modules/Condenser/MockCondenserModule.sol"; +import {MockCallback} from "../callbacks/MockCallback.sol"; +import {Permit2User} from "../lib/permit2/Permit2User.sol"; +import {MockFeeOnTransferERC20} from "../lib/mocks/MockFeeOnTransferERC20.sol"; // Auctions -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; -import {AuctionModule} from "src/modules/Auction.sol"; +import {BatchAuctionHouse} from "../../src/BatchAuctionHouse.sol"; +import {AuctionModule} from "../../src/modules/Auction.sol"; -import {Veecode, toKeycode, keycodeFromVeecode, Keycode} from "src/modules/Keycode.sol"; +import {Veecode, toKeycode, keycodeFromVeecode, Keycode} from "../../src/modules/Keycode.sol"; -import {WithSalts} from "test/lib/WithSalts.sol"; +import {WithSalts} from "../lib/WithSalts.sol"; abstract contract BatchAuctionHouseTest is Test, Permit2User, WithSalts { MockFeeOnTransferERC20 internal _baseToken; diff --git a/test/BatchAuctionHouse/abort.t.sol b/test/BatchAuctionHouse/abort.t.sol index 4766be4e5..ab2f96da0 100644 --- a/test/BatchAuctionHouse/abort.t.sol +++ b/test/BatchAuctionHouse/abort.t.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; +import {BatchAuctionHouse} from "../../src/BatchAuctionHouse.sol"; +import {IAuction} from "../../src/interfaces/modules/IAuction.sol"; +import {IBatchAuction} from "../../src/interfaces/modules/IBatchAuction.sol"; -import {BatchAuctionHouseTest} from "test/BatchAuctionHouse/AuctionHouseTest.sol"; +import {BatchAuctionHouseTest} from "./AuctionHouseTest.sol"; contract BatchAbortTest is BatchAuctionHouseTest { // abort diff --git a/test/BatchAuctionHouse/auction.t.sol b/test/BatchAuctionHouse/auction.t.sol index 20b6a75d5..eb460fcda 100644 --- a/test/BatchAuctionHouse/auction.t.sol +++ b/test/BatchAuctionHouse/auction.t.sol @@ -2,16 +2,16 @@ pragma solidity 0.8.19; // Libraries -import {BatchAuctionHouseTest} from "test/BatchAuctionHouse/AuctionHouseTest.sol"; -import {Transfer} from "src/lib/Transfer.sol"; +import {BatchAuctionHouseTest} from "./AuctionHouseTest.sol"; +import {Transfer} from "../../src/lib/Transfer.sol"; // Mocks -import {MockAtomicAuctionModule} from "test/modules/Auction/MockAtomicAuctionModule.sol"; -import {MockERC20} from "lib/solmate/src/test/utils/mocks/MockERC20.sol"; +import {MockAtomicAuctionModule} from "../modules/Auction/MockAtomicAuctionModule.sol"; +import {MockERC20} from "@solmate-6.7.0/test/utils/mocks/MockERC20.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; +import {IAuction} from "../../src/interfaces/modules/IAuction.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; +import {ICallback} from "../../src/interfaces/ICallback.sol"; import { Veecode, keycodeFromVeecode, @@ -19,7 +19,7 @@ import { WithModules, wrapVeecode, fromVeecode -} from "src/modules/Modules.sol"; +} from "../../src/modules/Modules.sol"; contract BatchCreateAuctionTest is BatchAuctionHouseTest { MockAtomicAuctionModule internal _atomicAuctionModule; diff --git a/test/BatchAuctionHouse/bid.t.sol b/test/BatchAuctionHouse/bid.t.sol index 5a077a195..1afd89887 100644 --- a/test/BatchAuctionHouse/bid.t.sol +++ b/test/BatchAuctionHouse/bid.t.sol @@ -2,13 +2,13 @@ pragma solidity 0.8.19; // Mocks -import {MockBatchAuctionModule} from "test/modules/Auction/MockBatchAuctionModule.sol"; +import {MockBatchAuctionModule} from "../modules/Auction/MockBatchAuctionModule.sol"; // Auctions -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; +import {IAuction} from "../../src/interfaces/modules/IAuction.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; -import {BatchAuctionHouseTest} from "test/BatchAuctionHouse/AuctionHouseTest.sol"; +import {BatchAuctionHouseTest} from "./AuctionHouseTest.sol"; contract BatchBidTest is BatchAuctionHouseTest { uint256 internal constant _BID_AMOUNT = 1e18; diff --git a/test/BatchAuctionHouse/cancelAuction.t.sol b/test/BatchAuctionHouse/cancelAuction.t.sol index d314dd775..5ee1c0b11 100644 --- a/test/BatchAuctionHouse/cancelAuction.t.sol +++ b/test/BatchAuctionHouse/cancelAuction.t.sol @@ -2,10 +2,10 @@ pragma solidity 0.8.19; // Auctions -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; +import {IAuction} from "../../src/interfaces/modules/IAuction.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; -import {BatchAuctionHouseTest} from "test/BatchAuctionHouse/AuctionHouseTest.sol"; +import {BatchAuctionHouseTest} from "./AuctionHouseTest.sol"; contract BatchCancelAuctionTest is BatchAuctionHouseTest { // cancel diff --git a/test/BatchAuctionHouse/claimBids.t.sol b/test/BatchAuctionHouse/claimBids.t.sol index da7658a98..8536cc546 100644 --- a/test/BatchAuctionHouse/claimBids.t.sol +++ b/test/BatchAuctionHouse/claimBids.t.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; -import {BatchAuctionModule} from "src/modules/auctions/BatchAuctionModule.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; +import {IBatchAuction} from "../../src/interfaces/modules/IBatchAuction.sol"; +import {BatchAuctionModule} from "../../src/modules/auctions/BatchAuctionModule.sol"; -import {BatchAuctionHouseTest} from "test/BatchAuctionHouse/AuctionHouseTest.sol"; +import {BatchAuctionHouseTest} from "./AuctionHouseTest.sol"; contract BatchClaimBidsTest is BatchAuctionHouseTest { uint256 internal constant _BID_AMOUNT = 1e18; diff --git a/test/BatchAuctionHouse/curate.t.sol b/test/BatchAuctionHouse/curate.t.sol index a7fbf1047..86f1eac42 100644 --- a/test/BatchAuctionHouse/curate.t.sol +++ b/test/BatchAuctionHouse/curate.t.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; -import {BatchAuctionHouseTest} from "test/BatchAuctionHouse/AuctionHouseTest.sol"; +import {BatchAuctionHouseTest} from "./AuctionHouseTest.sol"; contract BatchCurateTest is BatchAuctionHouseTest { // ===== Modifiers ===== // diff --git a/test/BatchAuctionHouse/refundBid.t.sol b/test/BatchAuctionHouse/refundBid.t.sol index 3c1b41231..0af54f92c 100644 --- a/test/BatchAuctionHouse/refundBid.t.sol +++ b/test/BatchAuctionHouse/refundBid.t.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; +import {IAuction} from "../../src/interfaces/modules/IAuction.sol"; +import {IBatchAuction} from "../../src/interfaces/modules/IBatchAuction.sol"; -import {BatchAuctionHouseTest} from "test/BatchAuctionHouse/AuctionHouseTest.sol"; +import {BatchAuctionHouseTest} from "./AuctionHouseTest.sol"; contract BatchRefundBidTest is BatchAuctionHouseTest { uint256 internal constant _BID_AMOUNT = 1e18; diff --git a/test/BatchAuctionHouse/settle.t.sol b/test/BatchAuctionHouse/settle.t.sol index 93d7e55a0..1c6b8d9d2 100644 --- a/test/BatchAuctionHouse/settle.t.sol +++ b/test/BatchAuctionHouse/settle.t.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {BatchAuctionModule} from "src/modules/auctions/BatchAuctionModule.sol"; +import {IAuctionHouse} from "../../src/interfaces/IAuctionHouse.sol"; +import {BatchAuctionModule} from "../../src/modules/auctions/BatchAuctionModule.sol"; -import {MockBatchAuctionModule} from "test/modules/Auction/MockBatchAuctionModule.sol"; -import {BatchAuctionHouseTest} from "test/BatchAuctionHouse/AuctionHouseTest.sol"; +import {MockBatchAuctionModule} from "../modules/Auction/MockBatchAuctionModule.sol"; +import {BatchAuctionHouseTest} from "./AuctionHouseTest.sol"; contract BatchSettleTest is BatchAuctionHouseTest { uint256 internal constant _BID_AMOUNT_TOTAL = 20e18; diff --git a/test/Constants.sol b/test/Constants.sol index 8b9f46089..9d6d16044 100644 --- a/test/Constants.sol +++ b/test/Constants.sol @@ -4,16 +4,4 @@ pragma solidity 0.8.19; abstract contract TestConstants { address internal constant _OWNER = address(0x1); address internal constant _AUCTION_HOUSE = address(0x000000000000000000000000000000000000000A); - address internal constant _UNISWAP_V2_FACTORY = - address(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); - address internal constant _UNISWAP_V2_ROUTER = - address(0xAAe2b0bEf00E78705673DFc5c3a8Fb39Dba6E3E5); - address internal constant _UNISWAP_V3_FACTORY = - address(0xAA70C9Ef2969368cE15644696b63b0fcEb93e501); - address internal constant _GUNI_FACTORY = address(0xAA6180e11cf2118E9e9D766D67Bb8Bb9959DF17B); - address internal constant _BASELINE_KERNEL = address(0xBB); - address internal constant _BASELINE_QUOTE_TOKEN = - address(0xAA58516d932C482469914260268EEA7611BF0eb4); - address internal constant _CREATE2_DEPLOYER = - address(0x4e59b44847b379578588920cA78FbF26c0B4956C); } diff --git a/test/callbacks/AllocatedMerkleAllowlistAtomic.t.sol b/test/callbacks/AllocatedMerkleAllowlistAtomic.t.sol deleted file mode 100644 index ac41980f6..000000000 --- a/test/callbacks/AllocatedMerkleAllowlistAtomic.t.sol +++ /dev/null @@ -1,338 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {Test} from "forge-std/Test.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; - -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; - -import {AllocatedMerkleAllowlist} from "src/callbacks/allowlists/AllocatedMerkleAllowlist.sol"; - -import {toVeecode} from "src/modules/Keycode.sol"; -import {WithSalts} from "test/lib/WithSalts.sol"; - -contract AllocatedMerkleAllowlistAtomicTest is Test, Permit2User, WithSalts { - using Callbacks for AllocatedMerkleAllowlist; - - address internal constant _OWNER = address(0x1); - address internal constant _SELLER = address(0x2); - address internal constant _PROTOCOL = address(0x3); - address internal constant _BUYER = address(0x4); - address internal constant _BUYER_TWO = address(0x5); - address internal constant _BASE_TOKEN = address(0x6); - address internal constant _QUOTE_TOKEN = address(0x7); - address internal constant _SELLER_TWO = address(0x8); - address internal constant _BUYER_THREE = address(0x9); - - uint256 internal constant _LOT_CAPACITY = 10e18; - - uint96 internal _lotId = 1; - - AtomicAuctionHouse internal _auctionHouse; - AllocatedMerkleAllowlist internal _allowlist; - - // _BUYER: 5e18 - // 0x20: 0 - bytes32 internal constant _MERKLE_ROOT = - 0x0fdc3942d9af344db31ff2e80c06bc4e558dc967ca5b4d421d741870f5ea40df; - bytes32[] internal _merkleProof; - uint256 internal constant _BUYER_ALLOCATED_AMOUNT = 5e18; - - function setUp() public { - // Create an AuctionHouse at a deterministic address, since it is used as input to callbacks - AtomicAuctionHouse auctionHouse = new AtomicAuctionHouse(_OWNER, _PROTOCOL, _permit2Address); - _auctionHouse = AtomicAuctionHouse(address(0x000000000000000000000000000000000000000A)); - vm.etch(address(_auctionHouse), address(auctionHouse).code); - vm.store(address(_auctionHouse), bytes32(uint256(0)), bytes32(abi.encode(_OWNER))); // Owner - vm.store(address(_auctionHouse), bytes32(uint256(6)), bytes32(abi.encode(1))); // Reentrancy - vm.store(address(_auctionHouse), bytes32(uint256(10)), bytes32(abi.encode(_PROTOCOL))); // Protocol - - // Get the salt - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: false, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - bytes memory args = abi.encode(address(_auctionHouse), permissions); - bytes32 salt = _getTestSalt( - "AllocatedMerkleAllowlist", type(AllocatedMerkleAllowlist).creationCode, args - ); - - vm.broadcast(); - _allowlist = new AllocatedMerkleAllowlist{salt: salt}(address(_auctionHouse), permissions); - - _merkleProof.push( - bytes32(0x2eac7b0cadd960cd4457012a5e232aa3532d9365ba6df63c1b5a9c7846f77760) - ); // Corresponds to _BUYER - } - - function _mockLotRouting() internal { - vm.mockCall( - address(_auctionHouse), - abi.encodeWithSelector(IAuctionHouse.lotRouting.selector, _lotId), - abi.encode( - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - toVeecode("01FPSA"), - _LOT_CAPACITY, - address(_allowlist), - toVeecode(""), - false, - abi.encode("") - ) - ); - } - - modifier givenAtomicOnCreate() { - // Mock the Routing value on the auction house - _mockLotRouting(); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT) - ); - _; - } - - function _onPurchase( - uint96 lotId_, - address buyer_, - uint256 amount_, - uint256 allocatedAmount_ - ) internal { - vm.prank(address(_auctionHouse)); - _allowlist.onPurchase( - lotId_, buyer_, amount_, 0, false, abi.encode(_merkleProof, allocatedAmount_) - ); - } - - // onCreate - // [X] when the allowlist parameters are in an incorrect format - // [X] it reverts - // [X] if the caller is not the auction house - // [X] it reverts - // [X] if the seller is not the seller for the allowlist - // [X] it sets the merkle root and buyer limit - // [X] if the lot is already registered - // [X] it reverts - // [X] it sets the merkle root and buyer limit - - function test_onCreate_allowlistParametersIncorrectFormat_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT, 1e18) - ); - } - - function test_onCreate_callerNotAuctionHouse_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT) - ); - } - - function test_onCreate_sellerNotSeller() public { - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER_TWO, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT) - ); - - assertEq(_allowlist.lotIdRegistered(_lotId), true, "lotIdRegistered"); - assertEq(_allowlist.lotMerkleRoot(_lotId), _MERKLE_ROOT, "lotMerkleRoot"); - } - - function test_onCreate_alreadyRegistered_reverts() public givenAtomicOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT) - ); - } - - function test_onCreate() public givenAtomicOnCreate { - assertEq(_allowlist.lotIdRegistered(_lotId), true, "lotIdRegistered"); - assertEq(_allowlist.lotMerkleRoot(_lotId), _MERKLE_ROOT, "lotMerkleRoot"); - } - - // onPurchase - // [X] when the allowlist parameters are in an incorrect format - // [X] it reverts - // [X] if the caller is not the auction house - // [X] it reverts - // [X] if the lot is not registered - // [X] it reverts - // [X] if the buyer is not in the merkle tree - // [X] it reverts - // [X] if the amount is greater than the buyer limit - // [X] it reverts - // [X] if the previous buyer spent plus the amount is greater than the buyer limit - // [X] it reverts - // [X] when the buyer has a 0 limit - // [X] it reverts - // [X] it updates the buyer spent - - function test_onPurchase_allowlistParametersIncorrectFormat_reverts() - public - givenAtomicOnCreate - { - // Expect revert - vm.expectRevert(); - - vm.prank(address(_auctionHouse)); - _allowlist.onPurchase(_lotId, _BUYER, 1e18, 0, false, abi.encode(_MERKLE_ROOT, 1e18, 2e18)); - } - - function test_onPurchase_callerNotAuctionHouse_reverts() public givenAtomicOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.onPurchase( - _lotId, _BUYER, 1e18, 0, false, abi.encode(_merkleProof, _BUYER_ALLOCATED_AMOUNT) - ); - } - - function test_onPurchase_lotNotRegistered_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _onPurchase(_lotId, _BUYER, 1e18, _BUYER_ALLOCATED_AMOUNT); - } - - function test_onPurchase_buyerNotInMerkleTree_reverts() public givenAtomicOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _onPurchase(_lotId, _BUYER_THREE, 1e18, _BUYER_ALLOCATED_AMOUNT); - } - - function test_onPurchase_amountGreaterThanBuyerLimit_reverts() public givenAtomicOnCreate { - // Expect revert - bytes memory err = - abi.encodeWithSelector(AllocatedMerkleAllowlist.Callback_ExceedsLimit.selector); - vm.expectRevert(err); - - _onPurchase(_lotId, _BUYER, _BUYER_ALLOCATED_AMOUNT + 1, _BUYER_ALLOCATED_AMOUNT); - } - - function test_onPurchase_buyerHasZeroLimit_reverts() public givenAtomicOnCreate { - // Set the merkle proof - _merkleProof = new bytes32[](1); - _merkleProof[0] = - bytes32(0xe0a73973cd60d8cbabb978d1f3c983065148b388619b9176d3d30e47c16d4fd5); - - // Expect revert - bytes memory err = - abi.encodeWithSelector(AllocatedMerkleAllowlist.Callback_ExceedsLimit.selector); - vm.expectRevert(err); - - _onPurchase(_lotId, address(0x0000000000000000000000000000000000000020), 1, 0); - } - - function test_onPurchase_previousBuyerSpentPlusAmountGreaterThanBuyerLimit_reverts() - public - givenAtomicOnCreate - { - _onPurchase(_lotId, _BUYER, _BUYER_ALLOCATED_AMOUNT, _BUYER_ALLOCATED_AMOUNT); - - // Expect revert - bytes memory err = - abi.encodeWithSelector(AllocatedMerkleAllowlist.Callback_ExceedsLimit.selector); - vm.expectRevert(err); - - _onPurchase(_lotId, _BUYER, 1, _BUYER_ALLOCATED_AMOUNT); - } - - function test_onPurchase(uint256 amount_) public givenAtomicOnCreate { - uint256 amount = bound(amount_, 1, _BUYER_ALLOCATED_AMOUNT); - - _onPurchase(_lotId, _BUYER, amount, _BUYER_ALLOCATED_AMOUNT); - - assertEq(_allowlist.lotBuyerSpent(_lotId, _BUYER), amount, "lotBuyerSpent"); - } - - // setMerkleRoot - // [X] when the caller is not the lot seller - // [X] it reverts - // [X] when the lot is not registered - // [X] it reverts - // [X] the merkle root is updated - - function test_setMerkleRoot_callerNotSeller() public givenAtomicOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.setMerkleRoot(_lotId, _MERKLE_ROOT); - } - - function test_setMerkleRoot_lotNotRegistered_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - vm.prank(_SELLER); - _allowlist.setMerkleRoot(_lotId, _MERKLE_ROOT); - } - - function test_setMerkleRoot() public givenAtomicOnCreate { - bytes32 newMerkleRoot = 0x0fdc3942d9af344db31ff2e80c06bc4e558dc967ca5b4d421d741870f5ea40df; - - vm.prank(_SELLER); - _allowlist.setMerkleRoot(_lotId, newMerkleRoot); - - assertEq(_allowlist.lotMerkleRoot(_lotId), newMerkleRoot, "lotMerkleRoot"); - } -} diff --git a/test/callbacks/AllocatedMerkleAllowlistBatch.t.sol b/test/callbacks/AllocatedMerkleAllowlistBatch.t.sol deleted file mode 100644 index ab5720a62..000000000 --- a/test/callbacks/AllocatedMerkleAllowlistBatch.t.sol +++ /dev/null @@ -1,331 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {Test} from "forge-std/Test.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; - -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; - -import {AllocatedMerkleAllowlist} from "src/callbacks/allowlists/AllocatedMerkleAllowlist.sol"; - -import {toVeecode} from "src/modules/Keycode.sol"; -import {WithSalts} from "test/lib/WithSalts.sol"; - -contract AllocatedMerkleAllowlistBatchTest is Test, Permit2User, WithSalts { - using Callbacks for AllocatedMerkleAllowlist; - - address internal constant _OWNER = address(0x1); - address internal constant _SELLER = address(0x2); - address internal constant _PROTOCOL = address(0x3); - address internal constant _BUYER = address(0x4); - address internal constant _BUYER_TWO = address(0x5); - address internal constant _BASE_TOKEN = address(0x6); - address internal constant _QUOTE_TOKEN = address(0x7); - address internal constant _SELLER_TWO = address(0x8); - address internal constant _BUYER_THREE = address(0x9); - - uint256 internal constant _LOT_CAPACITY = 10e18; - - uint96 internal _lotId = 1; - - BatchAuctionHouse internal _auctionHouse; - AllocatedMerkleAllowlist internal _allowlist; - - // _BUYER: 5e18 - // 0x20: 0 - bytes32 internal constant _MERKLE_ROOT = - 0x0fdc3942d9af344db31ff2e80c06bc4e558dc967ca5b4d421d741870f5ea40df; - bytes32[] internal _merkleProof; - uint256 internal constant _BUYER_ALLOCATED_AMOUNT = 5e18; - - function setUp() public { - // Create an AuctionHouse at a deterministic address, since it is used as input to callbacks - BatchAuctionHouse auctionHouse = new BatchAuctionHouse(_OWNER, _PROTOCOL, _permit2Address); - _auctionHouse = BatchAuctionHouse(address(0x000000000000000000000000000000000000000A)); - vm.etch(address(_auctionHouse), address(auctionHouse).code); - vm.store(address(_auctionHouse), bytes32(uint256(0)), bytes32(abi.encode(_OWNER))); // Owner - vm.store(address(_auctionHouse), bytes32(uint256(6)), bytes32(abi.encode(1))); // Reentrancy - vm.store(address(_auctionHouse), bytes32(uint256(10)), bytes32(abi.encode(_PROTOCOL))); // Protocol - - // Get the salt - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: false, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - bytes memory args = abi.encode(address(_auctionHouse), permissions); - bytes32 salt = _getTestSalt( - "AllocatedMerkleAllowlist", type(AllocatedMerkleAllowlist).creationCode, args - ); - - vm.broadcast(); - _allowlist = new AllocatedMerkleAllowlist{salt: salt}(address(_auctionHouse), permissions); - - _merkleProof.push( - bytes32(0x2eac7b0cadd960cd4457012a5e232aa3532d9365ba6df63c1b5a9c7846f77760) - ); // Corresponds to _BUYER - } - - function _mockLotRouting() internal { - vm.mockCall( - address(_auctionHouse), - abi.encodeWithSelector(IAuctionHouse.lotRouting.selector, _lotId), - abi.encode( - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - toVeecode("01FPBA"), - _LOT_CAPACITY, - address(_allowlist), - toVeecode(""), - false, - abi.encode("") - ) - ); - } - - modifier givenBatchOnCreate() { - // Mock the Routing value on the auction house - _mockLotRouting(); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT) - ); - _; - } - - function _onBid( - uint96 lotId_, - address buyer_, - uint256 amount_, - uint256 allocatedAmount_ - ) internal { - vm.prank(address(_auctionHouse)); - _allowlist.onBid(lotId_, 1, buyer_, amount_, abi.encode(_merkleProof, allocatedAmount_)); - } - - // onCreate - // [X] when the allowlist parameters are in an incorrect format - // [X] it reverts - // [X] if the caller is not the auction house - // [X] it reverts - // [X] if the seller is not the seller for the allowlist - // [X] it sets the merkle root - // [X] if the lot is already registered - // [X] it reverts - // [X] it sets the merkle root - - function test_onCreate_allowlistParametersIncorrectFormat_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT, 1e18) - ); - } - - function test_onCreate_callerNotAuctionHouse_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT) - ); - } - - function test_onCreate_sellerNotSeller() public { - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER_TWO, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT) - ); - - assertEq(_allowlist.lotIdRegistered(_lotId), true, "lotIdRegistered"); - assertEq(_allowlist.lotMerkleRoot(_lotId), _MERKLE_ROOT, "lotMerkleRoot"); - } - - function test_onCreate_alreadyRegistered_reverts() public givenBatchOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT) - ); - } - - function test_onCreate() public givenBatchOnCreate { - assertEq(_allowlist.lotIdRegistered(_lotId), true, "lotIdRegistered"); - assertEq(_allowlist.lotMerkleRoot(_lotId), _MERKLE_ROOT, "lotMerkleRoot"); - } - - // onBid - // [X] when the allowlist parameters are in an incorrect format - // [X] it reverts - // [X] if the caller is not the auction house - // [X] it reverts - // [X] if the lot is not registered - // [X] it reverts - // [X] if the buyer is not in the merkle tree - // [X] it reverts - // [X] if the amount is greater than the buyer limit - // [X] it reverts - // [X] if the previous buyer spent plus the amount is greater than the buyer limit - // [X] it reverts - // [X] when the buyer has a 0 limit - // [X] it reverts - // [X] it updates the buyer spent - - function test_onBid_allowlistParametersIncorrectFormat_reverts() public givenBatchOnCreate { - // Expect revert - vm.expectRevert(); - - vm.prank(address(_auctionHouse)); - _allowlist.onBid(_lotId, 1, _BUYER, 1e18, abi.encode(_merkleProof, 1e18, 2e18)); - } - - function test_onBid_callerNotAuctionHouse_reverts() public givenBatchOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.onBid(_lotId, 1, _BUYER, 1e18, abi.encode(_merkleProof, _BUYER_ALLOCATED_AMOUNT)); - } - - function test_onBid_lotNotRegistered_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _onBid(_lotId, _BUYER, 1e18, _BUYER_ALLOCATED_AMOUNT); - } - - function test_onBid_buyerNotInMerkleTree_reverts() public givenBatchOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _onBid(_lotId, _BUYER_THREE, 1e18, 1e18); - } - - function test_onBid_allocatedAmountZero_reverts() public givenBatchOnCreate { - // Set the merkle proof - _merkleProof = new bytes32[](1); - _merkleProof[0] = - bytes32(0xe0a73973cd60d8cbabb978d1f3c983065148b388619b9176d3d30e47c16d4fd5); - - // Expect revert - bytes memory err = - abi.encodeWithSelector(AllocatedMerkleAllowlist.Callback_ExceedsLimit.selector); - vm.expectRevert(err); - - _onBid(_lotId, address(0x0000000000000000000000000000000000000020), 1e18, 0); - } - - function test_onBid_amountGreaterThanAllocatedAmount_reverts() public givenBatchOnCreate { - // Expect revert - bytes memory err = - abi.encodeWithSelector(AllocatedMerkleAllowlist.Callback_ExceedsLimit.selector); - vm.expectRevert(err); - - _onBid(_lotId, _BUYER, _BUYER_ALLOCATED_AMOUNT + 1, _BUYER_ALLOCATED_AMOUNT); - } - - function test_onBid_previousBuyerSpentPlusAmountGreaterThanAllocatedAmount_reverts() - public - givenBatchOnCreate - { - _onBid(_lotId, _BUYER, _BUYER_ALLOCATED_AMOUNT, _BUYER_ALLOCATED_AMOUNT); - - // Expect revert - bytes memory err = - abi.encodeWithSelector(AllocatedMerkleAllowlist.Callback_ExceedsLimit.selector); - vm.expectRevert(err); - - _onBid(_lotId, _BUYER, 1, _BUYER_ALLOCATED_AMOUNT); - } - - function test_onBid(uint256 amount_) public givenBatchOnCreate { - uint256 amount = bound(amount_, 1, _BUYER_ALLOCATED_AMOUNT); - - _onBid(_lotId, _BUYER, amount, _BUYER_ALLOCATED_AMOUNT); - - assertEq(_allowlist.lotBuyerSpent(_lotId, _BUYER), amount, "lotBuyerSpent"); - } - - // setMerkleRoot - // [X] when the caller is not the lot seller - // [X] it reverts - // [X] when the lot is not registered - // [X] it reverts - // [X] the merkle root is updated - - function test_setMerkleRoot_callerNotSeller() public givenBatchOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.setMerkleRoot(_lotId, _MERKLE_ROOT); - } - - function test_setMerkleRoot_lotNotRegistered_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - vm.prank(_SELLER); - _allowlist.setMerkleRoot(_lotId, _MERKLE_ROOT); - } - - function test_setMerkleRoot() public givenBatchOnCreate { - bytes32 newMerkleRoot = 0x0fdc3942d9af344db31ff2e80c06bc4e558dc967ca5b4d421d741870f5ea40df; - - vm.prank(_SELLER); - _allowlist.setMerkleRoot(_lotId, newMerkleRoot); - - assertEq(_allowlist.lotMerkleRoot(_lotId), newMerkleRoot, "lotMerkleRoot"); - } -} diff --git a/test/callbacks/Callbacks.t.sol b/test/callbacks/Callbacks.t.sol index 39abc93db..8ca9089d9 100644 --- a/test/callbacks/Callbacks.t.sol +++ b/test/callbacks/Callbacks.t.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; -import {Callbacks} from "src/lib/Callbacks.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; +import {Callbacks} from "../../src/lib/Callbacks.sol"; +import {ICallback} from "../../src/interfaces/ICallback.sol"; -import {MockCallback} from "test/callbacks/MockCallback.sol"; +import {MockCallback} from "./MockCallback.sol"; -import {Test} from "forge-std/Test.sol"; -import {WithSalts} from "test/lib/WithSalts.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {WithSalts} from "../lib/WithSalts.sol"; contract CallbacksTest is Test, WithSalts { using Callbacks for ICallback; diff --git a/test/callbacks/CappedMerkleAllowlistAtomic.t.sol b/test/callbacks/CappedMerkleAllowlistAtomic.t.sol deleted file mode 100644 index 402a31bca..000000000 --- a/test/callbacks/CappedMerkleAllowlistAtomic.t.sol +++ /dev/null @@ -1,244 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {Test} from "forge-std/Test.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; - -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; - -import {CappedMerkleAllowlist} from "src/callbacks/allowlists/CappedMerkleAllowlist.sol"; - -import {WithSalts} from "test/lib/WithSalts.sol"; - -contract CappedMerkleAllowlistAtomicTest is Test, Permit2User, WithSalts { - using Callbacks for CappedMerkleAllowlist; - - address internal constant _OWNER = address(0x1); - address internal constant _SELLER = address(0x2); - address internal constant _PROTOCOL = address(0x3); - address internal constant _BUYER = address(0x4); - address internal constant _BUYER_TWO = address(0x5); - address internal constant _BASE_TOKEN = address(0x6); - address internal constant _QUOTE_TOKEN = address(0x7); - address internal constant _SELLER_TWO = address(0x8); - address internal constant _BUYER_THREE = address(0x9); - - uint256 internal constant _LOT_CAPACITY = 10e18; - - uint96 internal _lotId = 1; - - AtomicAuctionHouse internal _auctionHouse; - CappedMerkleAllowlist internal _allowlist; - - uint256 internal constant _BUYER_LIMIT = 1e18; - // Includes _BUYER, _BUYER_TWO but not _BUYER_THREE - bytes32 internal constant _MERKLE_ROOT = - 0xc92348ba87c65979cc4f264810321a35efa64e795075908af2c507a22d4da472; - bytes32[] internal _merkleProof; - - function setUp() public { - // Create an AuctionHouse at a deterministic address, since it is used as input to callbacks - AtomicAuctionHouse auctionHouse = new AtomicAuctionHouse(_OWNER, _PROTOCOL, _permit2Address); - _auctionHouse = AtomicAuctionHouse(address(0x000000000000000000000000000000000000000A)); - vm.etch(address(_auctionHouse), address(auctionHouse).code); - vm.store(address(_auctionHouse), bytes32(uint256(0)), bytes32(abi.encode(_OWNER))); // Owner - vm.store(address(_auctionHouse), bytes32(uint256(6)), bytes32(abi.encode(1))); // Reentrancy - vm.store(address(_auctionHouse), bytes32(uint256(10)), bytes32(abi.encode(_PROTOCOL))); // Protocol - - // Get the salt - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: false, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - bytes memory args = abi.encode(address(_auctionHouse), permissions); - bytes32 salt = - _getTestSalt("CappedMerkleAllowlist", type(CappedMerkleAllowlist).creationCode, args); - - vm.broadcast(); - _allowlist = new CappedMerkleAllowlist{salt: salt}(address(_auctionHouse), permissions); - - _merkleProof.push( - bytes32(0x16db2e4b9f8dc120de98f8491964203ba76de27b27b29c2d25f85a325cd37477) - ); // Corresponds to _BUYER - } - - modifier givenAtomicOnCreate() { - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT, _BUYER_LIMIT) - ); - _; - } - - function _onPurchase(uint96 lotId_, address buyer_, uint256 amount_) internal { - vm.prank(address(_auctionHouse)); - _allowlist.onPurchase(lotId_, buyer_, amount_, 0, false, abi.encode(_merkleProof)); - } - - // onCreate - // [X] when the allowlist parameters are in an incorrect format - // [X] it reverts - // [X] if the caller is not the auction house - // [X] it reverts - // [X] if the seller is not the seller for the allowlist - // [X] it sets the merkle root and buyer limit - // [X] if the lot is already registered - // [X] it reverts - // [X] it sets the merkle root and buyer limit - - function test_onCreate_allowlistParametersIncorrectFormat_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT, _BUYER_LIMIT, uint256(20)) - ); - } - - function test_onCreate_callerNotAuctionHouse_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT, _BUYER_LIMIT) - ); - } - - function test_onCreate_sellerNotSeller() public { - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER_TWO, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT, _BUYER_LIMIT) - ); - - assertEq(_allowlist.lotIdRegistered(_lotId), true, "lotIdRegistered"); - assertEq(_allowlist.lotMerkleRoot(_lotId), _MERKLE_ROOT, "lotMerkleRoot"); - assertEq(_allowlist.lotBuyerLimit(_lotId), _BUYER_LIMIT, "lotBuyerLimit"); - } - - function test_onCreate_alreadyRegistered_reverts() public givenAtomicOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT, _BUYER_LIMIT) - ); - } - - function test_onCreate() public givenAtomicOnCreate { - assertEq(_allowlist.lotIdRegistered(_lotId), true, "lotIdRegistered"); - assertEq(_allowlist.lotMerkleRoot(_lotId), _MERKLE_ROOT, "lotMerkleRoot"); - assertEq(_allowlist.lotBuyerLimit(_lotId), _BUYER_LIMIT, "lotBuyerLimit"); - } - - // onPurchase - // [X] if the caller is not the auction house - // [X] it reverts - // [X] if the lot is not registered - // [X] it reverts - // [X] if the buyer is not in the merkle tree - // [X] it reverts - // [X] if the amount is greater than the buyer limit - // [X] it reverts - // [X] if the previous buyer spent plus the amount is greater than the buyer limit - // [X] it reverts - // [X] it updates the buyer spent - - function test_onPurchase_callerNotAuctionHouse_reverts() public givenAtomicOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.onPurchase(_lotId, _BUYER, 1e18, 0, false, ""); - } - - function test_onPurchase_lotNotRegistered_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _onPurchase(_lotId, _BUYER, 1e18); - } - - function test_onPurchase_buyerNotInMerkleTree_reverts() public givenAtomicOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _onPurchase(_lotId, _BUYER_THREE, 1e18); - } - - function test_onPurchase_amountGreaterThanBuyerLimit_reverts() public givenAtomicOnCreate { - // Expect revert - bytes memory err = - abi.encodeWithSelector(CappedMerkleAllowlist.Callback_ExceedsLimit.selector); - vm.expectRevert(err); - - _onPurchase(_lotId, _BUYER, _BUYER_LIMIT + 1); - } - - function test_onPurchase_previousBuyerSpentPlusAmountGreaterThanBuyerLimit_reverts() - public - givenAtomicOnCreate - { - _onPurchase(_lotId, _BUYER, _BUYER_LIMIT); - - // Expect revert - bytes memory err = - abi.encodeWithSelector(CappedMerkleAllowlist.Callback_ExceedsLimit.selector); - vm.expectRevert(err); - - _onPurchase(_lotId, _BUYER, 1); - } - - function test_onPurchase(uint256 amount_) public givenAtomicOnCreate { - uint256 amount = bound(amount_, 1, _BUYER_LIMIT); - - _onPurchase(_lotId, _BUYER, amount); - - assertEq(_allowlist.lotBuyerSpent(_lotId, _BUYER), amount, "lotBuyerSpent"); - } -} diff --git a/test/callbacks/CappedMerkleAllowlistBatch.t.sol b/test/callbacks/CappedMerkleAllowlistBatch.t.sol deleted file mode 100644 index 1a5622b89..000000000 --- a/test/callbacks/CappedMerkleAllowlistBatch.t.sol +++ /dev/null @@ -1,244 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {Test} from "forge-std/Test.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; - -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; - -import {CappedMerkleAllowlist} from "src/callbacks/allowlists/CappedMerkleAllowlist.sol"; - -import {WithSalts} from "test/lib/WithSalts.sol"; - -contract CappedMerkleAllowlistBatchTest is Test, Permit2User, WithSalts { - using Callbacks for CappedMerkleAllowlist; - - address internal constant _OWNER = address(0x1); - address internal constant _SELLER = address(0x2); - address internal constant _PROTOCOL = address(0x3); - address internal constant _BUYER = address(0x4); - address internal constant _BUYER_TWO = address(0x5); - address internal constant _BASE_TOKEN = address(0x6); - address internal constant _QUOTE_TOKEN = address(0x7); - address internal constant _SELLER_TWO = address(0x8); - address internal constant _BUYER_THREE = address(0x9); - - uint256 internal constant _LOT_CAPACITY = 10e18; - - uint96 internal _lotId = 1; - - BatchAuctionHouse internal _auctionHouse; - CappedMerkleAllowlist internal _allowlist; - - uint256 internal constant _BUYER_LIMIT = 1e18; - // Includes _BUYER, _BUYER_TWO but not _BUYER_THREE - bytes32 internal constant _MERKLE_ROOT = - 0xc92348ba87c65979cc4f264810321a35efa64e795075908af2c507a22d4da472; - bytes32[] internal _merkleProof; - - function setUp() public { - // Create an AuctionHouse at a deterministic address, since it is used as input to callbacks - BatchAuctionHouse auctionHouse = new BatchAuctionHouse(_OWNER, _PROTOCOL, _permit2Address); - _auctionHouse = BatchAuctionHouse(address(0x000000000000000000000000000000000000000A)); - vm.etch(address(_auctionHouse), address(auctionHouse).code); - vm.store(address(_auctionHouse), bytes32(uint256(0)), bytes32(abi.encode(_OWNER))); // Owner - vm.store(address(_auctionHouse), bytes32(uint256(6)), bytes32(abi.encode(1))); // Reentrancy - vm.store(address(_auctionHouse), bytes32(uint256(10)), bytes32(abi.encode(_PROTOCOL))); // Protocol - - // Get the salt - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: false, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - bytes memory args = abi.encode(address(_auctionHouse), permissions); - bytes32 salt = - _getTestSalt("CappedMerkleAllowlist", type(CappedMerkleAllowlist).creationCode, args); - - vm.broadcast(); - _allowlist = new CappedMerkleAllowlist{salt: salt}(address(_auctionHouse), permissions); - - _merkleProof.push( - bytes32(0x16db2e4b9f8dc120de98f8491964203ba76de27b27b29c2d25f85a325cd37477) - ); // Corresponds to _BUYER - } - - modifier givenBatchOnCreate() { - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT, _BUYER_LIMIT) - ); - _; - } - - function _onBid(uint96 lotId_, address buyer_, uint256 amount_) internal { - vm.prank(address(_auctionHouse)); - _allowlist.onBid(lotId_, 1, buyer_, amount_, abi.encode(_merkleProof)); - } - - // onCreate - // [X] when the allowlist parameters are in an incorrect format - // [X] it reverts - // [X] if the caller is not the auction house - // [X] it reverts - // [X] if the seller is not the seller for the allowlist - // [X] it sets the merkle root and buyer limit - // [X] if the lot is already registered - // [X] it reverts - // [X] it sets the merkle root and buyer limit - - function test_onCreate_allowlistParametersIncorrectFormat_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT, _BUYER_LIMIT, uint256(20)) - ); - } - - function test_onCreate_callerNotAuctionHouse_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT, _BUYER_LIMIT) - ); - } - - function test_onCreate_sellerNotSeller() public { - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER_TWO, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT, _BUYER_LIMIT) - ); - - assertEq(_allowlist.lotIdRegistered(_lotId), true, "lotIdRegistered"); - assertEq(_allowlist.lotMerkleRoot(_lotId), _MERKLE_ROOT, "lotMerkleRoot"); - assertEq(_allowlist.lotBuyerLimit(_lotId), _BUYER_LIMIT, "lotBuyerLimit"); - } - - function test_onCreate_alreadyRegistered_reverts() public givenBatchOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_MERKLE_ROOT, _BUYER_LIMIT) - ); - } - - function test_onCreate() public givenBatchOnCreate { - assertEq(_allowlist.lotIdRegistered(_lotId), true, "lotIdRegistered"); - assertEq(_allowlist.lotMerkleRoot(_lotId), _MERKLE_ROOT, "lotMerkleRoot"); - assertEq(_allowlist.lotBuyerLimit(_lotId), _BUYER_LIMIT, "lotBuyerLimit"); - } - - // onBid - // [X] if the caller is not the auction house - // [X] it reverts - // [X] if the lot is not registered - // [X] it reverts - // [X] if the buyer is not in the merkle tree - // [X] it reverts - // [X] if the amount is greater than the buyer limit - // [X] it reverts - // [X] if the previous buyer spent plus the amount is greater than the buyer limit - // [X] it reverts - // [X] it updates the buyer spent - - function test_onBid_callerNotAuctionHouse_reverts() public givenBatchOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.onBid(_lotId, 1, _BUYER, 1e18, ""); - } - - function test_onBid_lotNotRegistered_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _onBid(_lotId, _BUYER, 1e18); - } - - function test_onBid_buyerNotInMerkleTree_reverts() public givenBatchOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _onBid(_lotId, _BUYER_THREE, 1e18); - } - - function test_onBid_amountGreaterThanBuyerLimit_reverts() public givenBatchOnCreate { - // Expect revert - bytes memory err = - abi.encodeWithSelector(CappedMerkleAllowlist.Callback_ExceedsLimit.selector); - vm.expectRevert(err); - - _onBid(_lotId, _BUYER, _BUYER_LIMIT + 1); - } - - function test_onBid_previousBuyerSpentPlusAmountGreaterThanBuyerLimit_reverts() - public - givenBatchOnCreate - { - _onBid(_lotId, _BUYER, _BUYER_LIMIT); - - // Expect revert - bytes memory err = - abi.encodeWithSelector(CappedMerkleAllowlist.Callback_ExceedsLimit.selector); - vm.expectRevert(err); - - _onBid(_lotId, _BUYER, 1); - } - - function test_onBid(uint256 amount_) public givenBatchOnCreate { - uint256 amount = bound(amount_, 1, _BUYER_LIMIT); - - _onBid(_lotId, _BUYER, amount); - - assertEq(_allowlist.lotBuyerSpent(_lotId, _BUYER), amount, "lotBuyerSpent"); - } -} diff --git a/test/callbacks/MockCallback.sol b/test/callbacks/MockCallback.sol index 92fc8f050..ff873b0f6 100644 --- a/test/callbacks/MockCallback.sol +++ b/test/callbacks/MockCallback.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {ERC20} from "solmate/tokens/ERC20.sol"; +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; +import {BaseCallback} from "../../src/bases/BaseCallback.sol"; +import {Callbacks} from "../../src/lib/Callbacks.sol"; contract MockCallback is BaseCallback { constructor( diff --git a/test/callbacks/TokenAllowlistAtomic.t.sol b/test/callbacks/TokenAllowlistAtomic.t.sol deleted file mode 100644 index 13943a104..000000000 --- a/test/callbacks/TokenAllowlistAtomic.t.sol +++ /dev/null @@ -1,277 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {Test} from "forge-std/Test.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; - -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; - -import {TokenAllowlist, ITokenBalance} from "src/callbacks/allowlists/TokenAllowlist.sol"; - -import {toVeecode} from "src/modules/Keycode.sol"; -import {WithSalts} from "test/lib/WithSalts.sol"; -import {TestConstants} from "test/Constants.sol"; -import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; - -contract TokenAllowlistAtomicTest is Test, Permit2User, WithSalts, TestConstants { - using Callbacks for TokenAllowlist; - - address internal constant _SELLER = address(0x2); - address internal constant _PROTOCOL = address(0x3); - address internal constant _BUYER = address(0x4); - address internal constant _BUYER_TWO = address(0x5); - address internal constant _BASE_TOKEN = address(0x6); - address internal constant _QUOTE_TOKEN = address(0x7); - address internal constant _SELLER_TWO = address(0x8); - address internal constant _BUYER_THREE = address(0x9); - - uint256 internal constant _LOT_CAPACITY = 10e18; - - uint96 internal _lotId = 1; - - AtomicAuctionHouse internal _auctionHouse; - TokenAllowlist internal _allowlist; - - MockERC20 internal _token; - uint96 internal constant _BUYER_LIMIT = 1e18; - - function setUp() public { - // Create an AuctionHouse at a deterministic address, since it is used as input to callbacks - AtomicAuctionHouse auctionHouse = new AtomicAuctionHouse(_OWNER, _PROTOCOL, _permit2Address); - _auctionHouse = AtomicAuctionHouse(_AUCTION_HOUSE); - vm.etch(address(_auctionHouse), address(auctionHouse).code); - vm.store(address(_auctionHouse), bytes32(uint256(0)), bytes32(abi.encode(_OWNER))); // Owner - vm.store(address(_auctionHouse), bytes32(uint256(6)), bytes32(abi.encode(1))); // Reentrancy - vm.store(address(_auctionHouse), bytes32(uint256(10)), bytes32(abi.encode(_PROTOCOL))); // Protocol - - // Get the salt - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: true, - onBid: false, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - bytes memory args = abi.encode(address(_auctionHouse), permissions); - bytes32 salt = _getTestSalt("TokenAllowlist", type(TokenAllowlist).creationCode, args); - - vm.broadcast(); - _allowlist = new TokenAllowlist{salt: salt}(address(_auctionHouse), permissions); - - // Create the token - _token = new MockERC20("Gating Token", "GT", 18); - } - - modifier givenAtomicOnCreate() { - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(address(_token), _BUYER_LIMIT) - ); - _; - } - - function _onPurchase(uint96 lotId_, address buyer_, uint256 amount_) internal { - vm.prank(address(_auctionHouse)); - _allowlist.onPurchase(lotId_, buyer_, amount_, 0, false, abi.encode("")); - } - - // onCreate - // [X] when the allowlist parameters are in an incorrect format - // [X] it reverts - // [X] if the caller is not the auction house - // [X] it reverts - // [X] if the seller is not the seller for the allowlist - // [X] it sets the token address and buyer limit - // [X] if the lot is already registered - // [X] it reverts - // [X] if the token is not a contract - // [X] it reverts - // [X] if the token balance is not retrievable - // [X] it reverts - // [X] it sets the token address and buyer limit - - function test_onCreate_allowlistParametersIncorrectFormat_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(address(_token), _BUYER_LIMIT, uint256(20)) - ); - } - - function test_onCreate_callerNotAuctionHouse_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(address(_token), _BUYER_LIMIT) - ); - } - - function test_onCreate_sellerNotSeller() public { - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER_TWO, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(address(_token), _BUYER_LIMIT) - ); - - assertEq(_allowlist.lotIdRegistered(_lotId), true, "lotIdRegistered"); - - (ITokenBalance token_, uint256 threshold_) = _allowlist.lotChecks(_lotId); - assertEq(address(token_), address(token_), "token"); - assertEq(threshold_, _BUYER_LIMIT, "threshold"); - } - - function test_onCreate_alreadyRegistered_reverts() public givenAtomicOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(address(_token), _BUYER_LIMIT) - ); - } - - function test_onCreate_tokenNotContract_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(address(_SELLER), _BUYER_LIMIT) - ); - } - - function test_onCreate_tokenBalanceNotRetrievable_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_AUCTION_HOUSE, _BUYER_LIMIT) - ); - } - - function test_onCreate() public givenAtomicOnCreate { - assertEq(_allowlist.lotIdRegistered(_lotId), true, "lotIdRegistered"); - - (ITokenBalance token_, uint256 threshold_) = _allowlist.lotChecks(_lotId); - assertEq(address(token_), address(token_), "token"); - assertEq(threshold_, _BUYER_LIMIT, "threshold"); - } - - // onPurchase - // [X] if the caller is not the auction house - // [X] it reverts - // [X] if the lot is not registered - // [X] it reverts - // [X] if the buyer has below the threshold - // [X] it reverts - // [X] it success - - function test_onPurchase_callerNotAuctionHouse_reverts() public givenAtomicOnCreate { - // Mint the token balance - _token.mint(_BUYER, _BUYER_LIMIT); - - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.onBid(_lotId, 1, _BUYER, 1e18, ""); - } - - function test_onPurchase_lotNotRegistered_reverts() public { - // Mint the token balance - _token.mint(_BUYER, _BUYER_LIMIT); - - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _onPurchase(_lotId, _BUYER, 1e18); - } - - function test_onPurchase_belowThreshold_reverts( - uint256 bidAmount_, - uint256 tokenBalance_ - ) public givenAtomicOnCreate { - uint256 bidAmount = bound(bidAmount_, 1, _BUYER_LIMIT); - uint256 tokenBalance = bound(tokenBalance_, 0, _BUYER_LIMIT - 1); - - // Mint the token balance - _token.mint(_BUYER, tokenBalance); - - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _onPurchase(_lotId, _BUYER, bidAmount); - } - - function test_onPurchase( - uint256 bidAmount_, - uint256 tokenBalance_ - ) public givenAtomicOnCreate { - uint256 bidAmount = bound(bidAmount_, 1, _BUYER_LIMIT); - uint256 tokenBalance = bound(tokenBalance_, _BUYER_LIMIT, _BUYER_LIMIT * 2); - - // Mint the token balance - _token.mint(_BUYER, tokenBalance); - - _onPurchase(_lotId, _BUYER, bidAmount); - } -} diff --git a/test/callbacks/TokenAllowlistBatch.t.sol b/test/callbacks/TokenAllowlistBatch.t.sol deleted file mode 100644 index 293594609..000000000 --- a/test/callbacks/TokenAllowlistBatch.t.sol +++ /dev/null @@ -1,272 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {Test} from "forge-std/Test.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; - -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; - -import {TokenAllowlist, ITokenBalance} from "src/callbacks/allowlists/TokenAllowlist.sol"; - -import {WithSalts} from "test/lib/WithSalts.sol"; -import {TestConstants} from "test/Constants.sol"; -import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; - -contract TokenAllowlistBatchTest is Test, Permit2User, WithSalts, TestConstants { - using Callbacks for TokenAllowlist; - - address internal constant _SELLER = address(0x2); - address internal constant _PROTOCOL = address(0x3); - address internal constant _BUYER = address(0x4); - address internal constant _BUYER_TWO = address(0x5); - address internal constant _BASE_TOKEN = address(0x6); - address internal constant _QUOTE_TOKEN = address(0x7); - address internal constant _SELLER_TWO = address(0x8); - address internal constant _BUYER_THREE = address(0x9); - - uint256 internal constant _LOT_CAPACITY = 10e18; - - uint96 internal _lotId = 1; - - BatchAuctionHouse internal _auctionHouse; - TokenAllowlist internal _allowlist; - - MockERC20 internal _token; - uint96 internal constant _BUYER_LIMIT = 1e18; - - function setUp() public { - // Create an AuctionHouse at a deterministic address, since it is used as input to callbacks - BatchAuctionHouse auctionHouse = new BatchAuctionHouse(_OWNER, _PROTOCOL, _permit2Address); - _auctionHouse = BatchAuctionHouse(_AUCTION_HOUSE); - vm.etch(address(_auctionHouse), address(auctionHouse).code); - vm.store(address(_auctionHouse), bytes32(uint256(0)), bytes32(abi.encode(_OWNER))); // Owner - vm.store(address(_auctionHouse), bytes32(uint256(6)), bytes32(abi.encode(1))); // Reentrancy - vm.store(address(_auctionHouse), bytes32(uint256(10)), bytes32(abi.encode(_PROTOCOL))); // Protocol - - // Get the salt - Callbacks.Permissions memory permissions = Callbacks.Permissions({ - onCreate: true, - onCancel: false, - onCurate: false, - onPurchase: false, - onBid: true, - onSettle: false, - receiveQuoteTokens: false, - sendBaseTokens: false - }); - bytes memory args = abi.encode(address(_auctionHouse), permissions); - bytes32 salt = _getTestSalt("TokenAllowlist", type(TokenAllowlist).creationCode, args); - - vm.broadcast(); - _allowlist = new TokenAllowlist{salt: salt}(address(_auctionHouse), permissions); - - // Create the token - _token = new MockERC20("Gating Token", "GT", 18); - } - - modifier givenBatchOnCreate() { - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(address(_token), _BUYER_LIMIT) - ); - _; - } - - function _onBid(uint96 lotId_, address buyer_, uint256 amount_) internal { - vm.prank(address(_auctionHouse)); - _allowlist.onBid(lotId_, 1, buyer_, amount_, abi.encode("")); - } - - // onCreate - // [X] when the allowlist parameters are in an incorrect format - // [X] it reverts - // [X] if the caller is not the auction house - // [X] it reverts - // [X] if the seller is not the seller for the allowlist - // [X] it sets the token address and buyer limit - // [X] if the lot is already registered - // [X] it reverts - // [X] if the token is not a contract - // [X] it reverts - // [X] if the token balance is not retrievable - // [X] it reverts - // [X] it sets the token address and buyer limit - - function test_onCreate_allowlistParametersIncorrectFormat_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(address(_token), _BUYER_LIMIT, uint256(20)) - ); - } - - function test_onCreate_callerNotAuctionHouse_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(address(_token), _BUYER_LIMIT) - ); - } - - function test_onCreate_sellerNotSeller() public { - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER_TWO, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(address(_token), _BUYER_LIMIT) - ); - - assertEq(_allowlist.lotIdRegistered(_lotId), true, "lotIdRegistered"); - - (ITokenBalance token_, uint256 threshold_) = _allowlist.lotChecks(_lotId); - assertEq(address(token_), address(token_), "token"); - assertEq(threshold_, _BUYER_LIMIT, "threshold"); - } - - function test_onCreate_alreadyRegistered_reverts() public givenBatchOnCreate { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(address(_token), _BUYER_LIMIT) - ); - } - - function test_onCreate_tokenNotContract_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(address(_SELLER), _BUYER_LIMIT) - ); - } - - function test_onCreate_tokenBalanceNotRetrievable_reverts() public { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - - vm.prank(address(_auctionHouse)); - _allowlist.onCreate( - _lotId, - _SELLER, - _BASE_TOKEN, - _QUOTE_TOKEN, - _LOT_CAPACITY, - false, - abi.encode(_AUCTION_HOUSE, _BUYER_LIMIT) - ); - } - - function test_onCreate() public givenBatchOnCreate { - assertEq(_allowlist.lotIdRegistered(_lotId), true, "lotIdRegistered"); - - (ITokenBalance token_, uint256 threshold_) = _allowlist.lotChecks(_lotId); - assertEq(address(token_), address(token_), "token"); - assertEq(threshold_, _BUYER_LIMIT, "threshold"); - } - - // onBid - // [X] if the caller is not the auction house - // [X] it reverts - // [X] if the lot is not registered - // [X] it reverts - // [X] if the buyer has below the threshold - // [X] it reverts - // [X] it success - - function test_onBid_callerNotAuctionHouse_reverts() public givenBatchOnCreate { - // Mint the token balance - _token.mint(_BUYER, _BUYER_LIMIT); - - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _allowlist.onBid(_lotId, 1, _BUYER, 1e18, ""); - } - - function test_onBid_lotNotRegistered_reverts() public { - // Mint the token balance - _token.mint(_BUYER, _BUYER_LIMIT); - - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _onBid(_lotId, _BUYER, 1e18); - } - - function test_onBid_belowThreshold_reverts( - uint256 bidAmount_, - uint256 tokenBalance_ - ) public givenBatchOnCreate { - uint256 bidAmount = bound(bidAmount_, 1, _BUYER_LIMIT); - uint256 tokenBalance = bound(tokenBalance_, 0, _BUYER_LIMIT - 1); - - // Mint the token balance - _token.mint(_BUYER, tokenBalance); - - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - _onBid(_lotId, _BUYER, bidAmount); - } - - function test_onBid(uint256 bidAmount_, uint256 tokenBalance_) public givenBatchOnCreate { - uint256 bidAmount = bound(bidAmount_, 1, _BUYER_LIMIT); - uint256 tokenBalance = bound(tokenBalance_, _BUYER_LIMIT, _BUYER_LIMIT * 2); - - // Mint the token balance - _token.mint(_BUYER, tokenBalance); - - _onBid(_lotId, _BUYER, bidAmount); - } -} diff --git a/test/callbacks/liquidity/UniswapV2DTL/UniswapV2DTLTest.sol b/test/callbacks/liquidity/UniswapV2DTL/UniswapV2DTLTest.sol deleted file mode 100644 index ed5899a63..000000000 --- a/test/callbacks/liquidity/UniswapV2DTL/UniswapV2DTLTest.sol +++ /dev/null @@ -1,259 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {Test} from "forge-std/Test.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; - -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; - -import {IUniswapV2Factory} from "src/lib/uniswap-v2/IUniswapV2Factory.sol"; -import {UniswapV2FactoryClone} from "test/lib/uniswap-v2/UniswapV2FactoryClone.sol"; - -import {IUniswapV2Router02} from "uniswap-v2-periphery/interfaces/IUniswapV2Router02.sol"; -import {UniswapV2Router02} from "uniswap-v2-periphery/UniswapV2Router02.sol"; - -import {BaseDirectToLiquidity} from "src/callbacks/liquidity/BaseDTL.sol"; -import {UniswapV2DirectToLiquidity} from "src/callbacks/liquidity/UniswapV2DTL.sol"; -import {LinearVesting} from "src/modules/derivatives/LinearVesting.sol"; -import {MockBatchAuctionModule} from "test/modules/Auction/MockBatchAuctionModule.sol"; - -import {keycodeFromVeecode, toKeycode} from "src/modules/Keycode.sol"; - -import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; - -import {WithSalts} from "test/lib/WithSalts.sol"; -import {TestConstants} from "test/Constants.sol"; -import {console2} from "forge-std/console2.sol"; - -abstract contract UniswapV2DirectToLiquidityTest is Test, Permit2User, WithSalts, TestConstants { - using Callbacks for UniswapV2DirectToLiquidity; - - address internal constant _SELLER = address(0x2); - address internal constant _PROTOCOL = address(0x3); - address internal constant _BUYER = address(0x4); - address internal constant _NOT_SELLER = address(0x20); - - uint96 internal constant _LOT_CAPACITY = 10e18; - - uint48 internal constant _START = 1_000_000; - - uint96 internal _lotId = 1; - - BatchAuctionHouse internal _auctionHouse; - UniswapV2DirectToLiquidity internal _dtl; - address internal _dtlAddress; - IUniswapV2Factory internal _uniV2Factory; - IUniswapV2Router02 internal _uniV2Router; - LinearVesting internal _linearVesting; - MockBatchAuctionModule internal _batchAuctionModule; - - MockERC20 internal _quoteToken; - MockERC20 internal _baseToken; - - // Inputs - BaseDirectToLiquidity.OnCreateParams internal _dtlCreateParams = BaseDirectToLiquidity - .OnCreateParams({ - proceedsUtilisationPercent: 100e2, - vestingStart: 0, - vestingExpiry: 0, - recipient: _SELLER, - implParams: abi.encode("") - }); - - function setUp() public { - // Set reasonable timestamp - vm.warp(_START); - - // Create an BatchAuctionHouse at a deterministic address, since it is used as input to callbacks - BatchAuctionHouse auctionHouse = new BatchAuctionHouse(_OWNER, _PROTOCOL, _permit2Address); - _auctionHouse = BatchAuctionHouse(_AUCTION_HOUSE); - vm.etch(address(_auctionHouse), address(auctionHouse).code); - vm.store(address(_auctionHouse), bytes32(uint256(0)), bytes32(abi.encode(_OWNER))); // Owner - vm.store(address(_auctionHouse), bytes32(uint256(6)), bytes32(abi.encode(1))); // Reentrancy - vm.store(address(_auctionHouse), bytes32(uint256(10)), bytes32(abi.encode(_PROTOCOL))); // Protocol - - // Create a UniswapV2Factory at a deterministic address - UniswapV2FactoryClone uniV2Factory = new UniswapV2FactoryClone(); - _uniV2Factory = UniswapV2FactoryClone(_UNISWAP_V2_FACTORY); - vm.etch(address(_uniV2Factory), address(uniV2Factory).code); - // No storage slots to set - - // Create a UniswapV2Router at a deterministic address - vm.startBroadcast(); - bytes32 uniswapV2RouterSalt = _getTestSalt( - "UniswapV2Router", - type(UniswapV2Router02).creationCode, - abi.encode(address(_uniV2Factory), address(0)) - ); - _uniV2Router = - new UniswapV2Router02{salt: uniswapV2RouterSalt}(address(_uniV2Factory), address(0)); - vm.stopBroadcast(); - if (address(_uniV2Router) != _UNISWAP_V2_ROUTER) { - console2.log("UniswapV2Router address: {}", address(_uniV2Router)); - revert("UniswapV2Router address mismatch"); - } - - _linearVesting = new LinearVesting(address(_auctionHouse)); - _batchAuctionModule = new MockBatchAuctionModule(address(_auctionHouse)); - - // Install a mock batch auction module - vm.prank(_OWNER); - _auctionHouse.installModule(_batchAuctionModule); - - _quoteToken = new MockERC20("Quote Token", "QT", 18); - _baseToken = new MockERC20("Base Token", "BT", 18); - } - - // ========== MODIFIERS ========== // - - modifier givenLinearVestingModuleIsInstalled() { - vm.prank(_OWNER); - _auctionHouse.installModule(_linearVesting); - _; - } - - modifier givenCallbackIsCreated() { - // Get the salt - bytes memory args = - abi.encode(address(_auctionHouse), address(_uniV2Factory), address(_uniV2Router)); - bytes32 salt = _getTestSalt( - "UniswapV2DirectToLiquidity", type(UniswapV2DirectToLiquidity).creationCode, args - ); - - // Required for CREATE2 address to work correctly. doesn't do anything in a test - // Source: https://github.com/foundry-rs/foundry/issues/6402 - vm.startBroadcast(); - _dtl = new UniswapV2DirectToLiquidity{salt: salt}( - address(_auctionHouse), address(_uniV2Factory), address(_uniV2Router) - ); - vm.stopBroadcast(); - - _dtlAddress = address(_dtl); - _; - } - - modifier givenAddressHasQuoteTokenBalance(address address_, uint256 amount_) { - _quoteToken.mint(address_, amount_); - _; - } - - modifier givenAddressHasBaseTokenBalance(address address_, uint256 amount_) { - _baseToken.mint(address_, amount_); - _; - } - - modifier givenAddressHasQuoteTokenAllowance(address owner_, address spender_, uint256 amount_) { - vm.prank(owner_); - _quoteToken.approve(spender_, amount_); - _; - } - - modifier givenAddressHasBaseTokenAllowance(address owner_, address spender_, uint256 amount_) { - vm.prank(owner_); - _baseToken.approve(spender_, amount_); - _; - } - - function _createLot(address seller_) internal returns (uint96 lotId) { - // Mint and approve the capacity to the owner - _baseToken.mint(seller_, _LOT_CAPACITY); - vm.prank(seller_); - _baseToken.approve(address(_auctionHouse), _LOT_CAPACITY); - - // Prep the lot arguments - IAuctionHouse.RoutingParams memory routingParams = IAuctionHouse.RoutingParams({ - auctionType: keycodeFromVeecode(_batchAuctionModule.VEECODE()), - baseToken: address(_baseToken), - quoteToken: address(_quoteToken), - referrerFee: 0, // No referrer fee - curator: address(0), - callbacks: _dtl, - callbackData: abi.encode(_dtlCreateParams), - derivativeType: toKeycode(""), - derivativeParams: abi.encode(""), - wrapDerivative: false - }); - - IAuction.AuctionParams memory auctionParams = IAuction.AuctionParams({ - start: uint48(block.timestamp) + 1, - duration: 1 days, - capacityInQuote: false, - capacity: _LOT_CAPACITY, - implParams: abi.encode("") - }); - - // Create a new lot - vm.prank(seller_); - return _auctionHouse.auction(routingParams, auctionParams, ""); - } - - modifier givenOnCreate() { - _lotId = _createLot(_SELLER); - _; - } - - function _performOnCurate(uint96 curatorPayout_) internal { - vm.prank(address(_auctionHouse)); - _dtl.onCurate(_lotId, curatorPayout_, false, abi.encode("")); - } - - modifier givenOnCurate(uint96 curatorPayout_) { - _performOnCurate(curatorPayout_); - _; - } - - modifier givenProceedsUtilisationPercent(uint24 percent_) { - _dtlCreateParams.proceedsUtilisationPercent = percent_; - _; - } - - modifier givenVestingStart(uint48 start_) { - _dtlCreateParams.vestingStart = start_; - _; - } - - modifier givenVestingExpiry(uint48 end_) { - _dtlCreateParams.vestingExpiry = end_; - _; - } - - modifier whenRecipientIsNotSeller() { - _dtlCreateParams.recipient = _NOT_SELLER; - _; - } - - // ========== FUNCTIONS ========== // - - function _getDTLConfiguration(uint96 lotId_) - internal - view - returns (BaseDirectToLiquidity.DTLConfiguration memory) - { - ( - address recipient_, - uint256 lotCapacity_, - uint256 lotCuratorPayout_, - uint24 proceedsUtilisationPercent_, - uint48 vestingStart_, - uint48 vestingExpiry_, - LinearVesting linearVestingModule_, - bool active_, - bytes memory implParams_ - ) = _dtl.lotConfiguration(lotId_); - - return BaseDirectToLiquidity.DTLConfiguration({ - recipient: recipient_, - lotCapacity: lotCapacity_, - lotCuratorPayout: lotCuratorPayout_, - proceedsUtilisationPercent: proceedsUtilisationPercent_, - vestingStart: vestingStart_, - vestingExpiry: vestingExpiry_, - linearVestingModule: linearVestingModule_, - active: active_, - implParams: implParams_ - }); - } -} diff --git a/test/callbacks/liquidity/UniswapV2DTL/onCancel.t.sol b/test/callbacks/liquidity/UniswapV2DTL/onCancel.t.sol deleted file mode 100644 index 1ddc4f6c1..000000000 --- a/test/callbacks/liquidity/UniswapV2DTL/onCancel.t.sol +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {UniswapV2DirectToLiquidityTest} from "./UniswapV2DTLTest.sol"; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; -import {BaseDirectToLiquidity} from "src/callbacks/liquidity/BaseDTL.sol"; - -contract UniswapV2DirectToLiquidityOnCancelTest is UniswapV2DirectToLiquidityTest { - uint96 internal constant _REFUND_AMOUNT = 2e18; - - // ============ Modifiers ============ // - - function _performCallback(uint96 lotId_) internal { - vm.prank(address(_auctionHouse)); - _dtl.onCancel(lotId_, _REFUND_AMOUNT, false, abi.encode("")); - } - - // ============ Tests ============ // - - // [X] when the lot has not been registered - // [X] it reverts - // [X] when multiple lots are created - // [X] it marks the correct lot as inactive - // [X] it marks the lot as inactive - - function test_whenLotNotRegistered_reverts() public givenCallbackIsCreated { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - // Call the function - _performCallback(_lotId); - } - - function test_success() public givenCallbackIsCreated givenOnCreate { - // Call the function - _performCallback(_lotId); - - // Check the values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.active, false, "active"); - - // Check the balances - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "base token balance"); - assertEq(_baseToken.balanceOf(_SELLER), 0, "seller base token balance"); - assertEq(_baseToken.balanceOf(_NOT_SELLER), 0, "not seller base token balance"); - } - - function test_success_multiple() public givenCallbackIsCreated givenOnCreate { - uint96 lotIdOne = _lotId; - - // Create a second lot and cancel it - uint96 lotIdTwo = _createLot(_NOT_SELLER); - _performCallback(lotIdTwo); - - // Check the values - BaseDirectToLiquidity.DTLConfiguration memory configurationOne = - _getDTLConfiguration(lotIdOne); - assertEq(configurationOne.active, true, "lot one: active"); - - BaseDirectToLiquidity.DTLConfiguration memory configurationTwo = - _getDTLConfiguration(lotIdTwo); - assertEq(configurationTwo.active, false, "lot two: active"); - - // Check the balances - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "base token balance"); - assertEq(_baseToken.balanceOf(_SELLER), 0, "seller base token balance"); - assertEq(_baseToken.balanceOf(_NOT_SELLER), 0, "not seller base token balance"); - } -} diff --git a/test/callbacks/liquidity/UniswapV2DTL/onCreate.t.sol b/test/callbacks/liquidity/UniswapV2DTL/onCreate.t.sol deleted file mode 100644 index 86a0c370d..000000000 --- a/test/callbacks/liquidity/UniswapV2DTL/onCreate.t.sol +++ /dev/null @@ -1,349 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {UniswapV2DirectToLiquidityTest} from "./UniswapV2DTLTest.sol"; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; -import {BaseDirectToLiquidity} from "src/callbacks/liquidity/BaseDTL.sol"; - -contract UniswapV2DirectToLiquidityOnCreateTest is UniswapV2DirectToLiquidityTest { - // ============ Modifiers ============ // - - function _performCallback(address seller_) internal { - vm.prank(address(_auctionHouse)); - _dtl.onCreate( - _lotId, - seller_, - address(_baseToken), - address(_quoteToken), - _LOT_CAPACITY, - false, - abi.encode(_dtlCreateParams) - ); - } - - function _performCallback() internal { - _performCallback(_SELLER); - } - - // ============ Assertions ============ // - - function _expectTransferFrom() internal { - vm.expectRevert("TRANSFER_FROM_FAILED"); - } - - function _expectInvalidParams() internal { - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - } - - function _expectNotAuthorized() internal { - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - } - - function _assertBaseTokenBalances() internal { - assertEq(_baseToken.balanceOf(_SELLER), 0, "seller balance"); - assertEq(_baseToken.balanceOf(_NOT_SELLER), 0, "not seller balance"); - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "dtl balance"); - } - - // ============ Tests ============ // - - // [X] when the callback data is incorrect - // [X] it reverts - // [X] when the callback is not called by the auction house - // [X] it reverts - // [X] when the lot has already been registered - // [X] it reverts - // [X] when the proceeds utilisation is 0 - // [X] it reverts - // [X] when the proceeds utilisation is greater than 100% - // [X] it reverts - // [X] given uniswap v2 pool already exists - // [X] it reverts - // [X] when the start and expiry timestamps are the same - // [X] it reverts - // [X] when the start timestamp is after the expiry timestamp - // [X] it reverts - // [X] when the start timestamp is before the current timestamp - // [X] it succeeds - // [X] when the expiry timestamp is before the current timestamp - // [X] it reverts - // [X] when the start timestamp and expiry timestamp are specified - // [X] given the linear vesting module is not installed - // [X] it reverts - // [X] it records the address of the linear vesting module - // [X] when the recipient is the zero address - // [X] it reverts - // [X] when the recipient is not the seller - // [X] it records the recipient - // [X] when multiple lots are created - // [X] it registers each lot - // [X] it registers the lot - - function test_whenCallbackDataIsIncorrect_reverts() public givenCallbackIsCreated { - // Expect revert - vm.expectRevert(); - - vm.prank(address(_auctionHouse)); - _dtl.onCreate( - _lotId, - _SELLER, - address(_baseToken), - address(_quoteToken), - _LOT_CAPACITY, - false, - abi.encode(uint256(10)) - ); - } - - function test_whenCallbackIsNotCalledByAuctionHouse_reverts() public givenCallbackIsCreated { - _expectNotAuthorized(); - - _dtl.onCreate( - _lotId, - _SELLER, - address(_baseToken), - address(_quoteToken), - _LOT_CAPACITY, - false, - abi.encode(_dtlCreateParams) - ); - } - - function test_whenLotHasAlreadyBeenRegistered_reverts() public givenCallbackIsCreated { - _performCallback(); - - _expectInvalidParams(); - - _performCallback(); - } - - function test_whenProceedsUtilisationIs0_reverts() - public - givenCallbackIsCreated - givenProceedsUtilisationPercent(0) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_PercentOutOfBounds.selector, 0, 1, 100e2 - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenProceedsUtilisationIsGreaterThan100Percent_reverts() - public - givenCallbackIsCreated - givenProceedsUtilisationPercent(100e2 + 1) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_PercentOutOfBounds.selector, 100e2 + 1, 1, 100e2 - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_givenUniswapV2PoolAlreadyExists_reverts() public givenCallbackIsCreated { - // Create the pool - _uniV2Factory.createPair(address(_baseToken), address(_quoteToken)); - - // Expect revert - bytes memory err = - abi.encodeWithSelector(BaseDirectToLiquidity.Callback_Params_PoolExists.selector); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenStartAndExpiryTimestampsAreTheSame_reverts() - public - givenCallbackIsCreated - givenLinearVestingModuleIsInstalled - givenVestingStart(_START + 1) - givenVestingExpiry(_START + 1) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_InvalidVestingParams.selector - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenStartTimestampIsAfterExpiryTimestamp_reverts() - public - givenCallbackIsCreated - givenLinearVestingModuleIsInstalled - givenVestingStart(_START + 2) - givenVestingExpiry(_START + 1) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_InvalidVestingParams.selector - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenStartTimestampIsBeforeCurrentTimestamp_succeeds() - public - givenCallbackIsCreated - givenLinearVestingModuleIsInstalled - givenVestingStart(_START - 1) - givenVestingExpiry(_START + 1) - { - _performCallback(); - - // Assert values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.vestingStart, _START - 1, "vestingStart"); - assertEq(configuration.vestingExpiry, _START + 1, "vestingExpiry"); - assertEq( - address(configuration.linearVestingModule), - address(_linearVesting), - "linearVestingModule" - ); - - // Assert balances - _assertBaseTokenBalances(); - } - - function test_whenExpiryTimestampIsBeforeCurrentTimestamp_reverts() - public - givenCallbackIsCreated - givenLinearVestingModuleIsInstalled - givenVestingStart(_START + 1) - givenVestingExpiry(_START - 1) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_InvalidVestingParams.selector - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenVestingSpecified_givenLinearVestingModuleNotInstalled_reverts() - public - givenCallbackIsCreated - givenVestingStart(_START + 1) - givenVestingExpiry(_START + 2) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_LinearVestingModuleNotFound.selector - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenVestingSpecified() - public - givenCallbackIsCreated - givenLinearVestingModuleIsInstalled - givenVestingStart(_START + 1) - givenVestingExpiry(_START + 2) - { - _performCallback(); - - // Assert values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.vestingStart, _START + 1, "vestingStart"); - assertEq(configuration.vestingExpiry, _START + 2, "vestingExpiry"); - assertEq( - address(configuration.linearVestingModule), - address(_linearVesting), - "linearVestingModule" - ); - - // Assert balances - _assertBaseTokenBalances(); - } - - function test_whenRecipientIsZeroAddress_reverts() public givenCallbackIsCreated { - _dtlCreateParams.recipient = address(0); - - // Expect revert - bytes memory err = - abi.encodeWithSelector(BaseDirectToLiquidity.Callback_Params_InvalidAddress.selector); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenRecipientIsNotSeller_succeeds() - public - givenCallbackIsCreated - whenRecipientIsNotSeller - { - _performCallback(); - - // Assert values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.recipient, _NOT_SELLER, "recipient"); - - // Assert balances - _assertBaseTokenBalances(); - } - - function test_succeeds() public givenCallbackIsCreated { - _performCallback(); - - // Assert values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.recipient, _SELLER, "recipient"); - assertEq(configuration.lotCapacity, _LOT_CAPACITY, "lotCapacity"); - assertEq(configuration.lotCuratorPayout, 0, "lotCuratorPayout"); - assertEq( - configuration.proceedsUtilisationPercent, - _dtlCreateParams.proceedsUtilisationPercent, - "proceedsUtilisationPercent" - ); - assertEq(configuration.vestingStart, 0, "vestingStart"); - assertEq(configuration.vestingExpiry, 0, "vestingExpiry"); - assertEq(address(configuration.linearVestingModule), address(0), "linearVestingModule"); - assertEq(configuration.active, true, "active"); - assertEq(configuration.implParams, _dtlCreateParams.implParams, "implParams"); - - // Assert balances - _assertBaseTokenBalances(); - } - - function test_succeeds_multiple() public givenCallbackIsCreated { - // Lot one - _performCallback(); - - // Lot two - _dtlCreateParams.recipient = _NOT_SELLER; - _lotId = 2; - _performCallback(_NOT_SELLER); - - // Assert values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.recipient, _NOT_SELLER, "recipient"); - assertEq(configuration.lotCapacity, _LOT_CAPACITY, "lotCapacity"); - assertEq(configuration.lotCuratorPayout, 0, "lotCuratorPayout"); - assertEq( - configuration.proceedsUtilisationPercent, - _dtlCreateParams.proceedsUtilisationPercent, - "proceedsUtilisationPercent" - ); - assertEq(configuration.vestingStart, 0, "vestingStart"); - assertEq(configuration.vestingExpiry, 0, "vestingExpiry"); - assertEq(address(configuration.linearVestingModule), address(0), "linearVestingModule"); - assertEq(configuration.active, true, "active"); - assertEq(configuration.implParams, _dtlCreateParams.implParams, "implParams"); - - // Assert balances - _assertBaseTokenBalances(); - } -} diff --git a/test/callbacks/liquidity/UniswapV2DTL/onCurate.t.sol b/test/callbacks/liquidity/UniswapV2DTL/onCurate.t.sol deleted file mode 100644 index 5d7f5ed60..000000000 --- a/test/callbacks/liquidity/UniswapV2DTL/onCurate.t.sol +++ /dev/null @@ -1,83 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {UniswapV2DirectToLiquidityTest} from "./UniswapV2DTLTest.sol"; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; -import {BaseDirectToLiquidity} from "src/callbacks/liquidity/BaseDTL.sol"; - -contract UniswapV2DirectToLiquidityOnCurateTest is UniswapV2DirectToLiquidityTest { - uint96 internal constant _PAYOUT_AMOUNT = 1e18; - - // ============ Modifiers ============ // - - function _performCallback(uint96 lotId_) internal { - vm.prank(address(_auctionHouse)); - _dtl.onCurate(lotId_, _PAYOUT_AMOUNT, false, abi.encode("")); - } - - // ============ Tests ============ // - - // [X] when the lot has not been registered - // [X] it reverts - // [X] when multiple lots are created - // [X] it marks the correct lot as inactive - // [X] it registers the curator payout - - function test_whenLotNotRegistered_reverts() public givenCallbackIsCreated { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - // Call the function - _performCallback(_lotId); - } - - function test_success() public givenCallbackIsCreated givenOnCreate { - // Call the function - _performCallback(_lotId); - - // Check the values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.lotCuratorPayout, _PAYOUT_AMOUNT, "lotCuratorPayout"); - - // Check the balances - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "base token balance"); - assertEq(_baseToken.balanceOf(_SELLER), 0, "seller base token balance"); - assertEq(_baseToken.balanceOf(_NOT_SELLER), 0, "not seller base token balance"); - assertEq( - _baseToken.balanceOf(address(_auctionHouse)), - _LOT_CAPACITY, - "auction house base token balance" - ); - } - - function test_success_multiple() public givenCallbackIsCreated givenOnCreate { - uint96 lotIdOne = _lotId; - - // Create a second lot - uint96 lotIdTwo = _createLot(_NOT_SELLER); - - // Call the function - _performCallback(lotIdTwo); - - // Check the values - BaseDirectToLiquidity.DTLConfiguration memory configurationOne = - _getDTLConfiguration(lotIdOne); - assertEq(configurationOne.lotCuratorPayout, 0, "lot one: lotCuratorPayout"); - - BaseDirectToLiquidity.DTLConfiguration memory configurationTwo = - _getDTLConfiguration(lotIdTwo); - assertEq(configurationTwo.lotCuratorPayout, _PAYOUT_AMOUNT, "lot two: lotCuratorPayout"); - - // Check the balances - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "base token balance"); - assertEq(_baseToken.balanceOf(_SELLER), 0, "seller base token balance"); - assertEq(_baseToken.balanceOf(_NOT_SELLER), 0, "not seller base token balance"); - assertEq( - _baseToken.balanceOf(address(_auctionHouse)), - _LOT_CAPACITY * 2, - "auction house base token balance" - ); - } -} diff --git a/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol b/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol deleted file mode 100644 index 60bef1659..000000000 --- a/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol +++ /dev/null @@ -1,693 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {UniswapV2DirectToLiquidityTest} from "./UniswapV2DTLTest.sol"; - -// Libraries -import {FixedPointMathLib} from "solmate/utils/FixedPointMathLib.sol"; -import {ERC20} from "solmate/tokens/ERC20.sol"; - -// Uniswap -import {IUniswapV2Pair} from "uniswap-v2-core/interfaces/IUniswapV2Pair.sol"; - -// AuctionHouse -import {ILinearVesting} from "src/interfaces/modules/derivatives/ILinearVesting.sol"; -import {BaseDirectToLiquidity} from "src/callbacks/liquidity/BaseDTL.sol"; -import {UniswapV2DirectToLiquidity} from "src/callbacks/liquidity/UniswapV2DTL.sol"; - -contract UniswapV2DirectToLiquidityOnSettleTest is UniswapV2DirectToLiquidityTest { - uint96 internal constant _PROCEEDS = 20e18; - uint96 internal constant _REFUND = 0; - - /// @dev The minimum amount of liquidity retained in the pool - uint256 internal constant _MINIMUM_LIQUIDITY = 10 ** 3; - - uint96 internal _proceeds; - uint96 internal _refund; - uint96 internal _capacityUtilised; - uint96 internal _quoteTokensToDeposit; - uint96 internal _baseTokensToDeposit; - uint96 internal _curatorPayout; - - uint24 internal _maxSlippage = 1; // 0.01% - - // ========== Internal functions ========== // - - function _getUniswapV2Pool() internal view returns (IUniswapV2Pair) { - return IUniswapV2Pair(_uniV2Factory.getPair(address(_quoteToken), address(_baseToken))); - } - - function _getVestingTokenId() internal view returns (uint256) { - // Get the pools deployed by the DTL callback - address pool = address(_getUniswapV2Pool()); - - return _linearVesting.computeId( - pool, - abi.encode( - ILinearVesting.VestingParams({ - start: _dtlCreateParams.vestingStart, - expiry: _dtlCreateParams.vestingExpiry - }) - ) - ); - } - - // ========== Assertions ========== // - - function _assertLpTokenBalance() internal { - // Get the pools deployed by the DTL callback - IUniswapV2Pair pool = _getUniswapV2Pool(); - - // Exclude the LP token balance on this contract - uint256 testBalance = pool.balanceOf(address(this)); - - uint256 sellerExpectedBalance; - uint256 linearVestingExpectedBalance; - // Only has a balance if not vesting - if (_dtlCreateParams.vestingStart == 0) { - sellerExpectedBalance = pool.totalSupply() - testBalance - _MINIMUM_LIQUIDITY; - } else { - linearVestingExpectedBalance = pool.totalSupply() - testBalance - _MINIMUM_LIQUIDITY; - } - - assertEq( - pool.balanceOf(_SELLER), - _dtlCreateParams.recipient == _SELLER ? sellerExpectedBalance : 0, - "seller: LP token balance" - ); - assertEq( - pool.balanceOf(_NOT_SELLER), - _dtlCreateParams.recipient == _NOT_SELLER ? sellerExpectedBalance : 0, - "not seller: LP token balance" - ); - assertEq( - pool.balanceOf(address(_linearVesting)), - linearVestingExpectedBalance, - "linear vesting: LP token balance" - ); - } - - function _assertVestingTokenBalance() internal { - // Exit if not vesting - if (_dtlCreateParams.vestingStart == 0) { - return; - } - - // Get the pools deployed by the DTL callback - address pool = address(_getUniswapV2Pool()); - - // Get the wrapped address - (, address wrappedVestingTokenAddress) = _linearVesting.deploy( - pool, - abi.encode( - ILinearVesting.VestingParams({ - start: _dtlCreateParams.vestingStart, - expiry: _dtlCreateParams.vestingExpiry - }) - ), - true - ); - ERC20 wrappedVestingToken = ERC20(wrappedVestingTokenAddress); - uint256 sellerExpectedBalance = wrappedVestingToken.totalSupply(); - - assertEq( - wrappedVestingToken.balanceOf(_SELLER), - _dtlCreateParams.recipient == _SELLER ? sellerExpectedBalance : 0, - "seller: vesting token balance" - ); - assertEq( - wrappedVestingToken.balanceOf(_NOT_SELLER), - _dtlCreateParams.recipient == _NOT_SELLER ? sellerExpectedBalance : 0, - "not seller: vesting token balance" - ); - } - - function _assertQuoteTokenBalance() internal { - assertEq(_quoteToken.balanceOf(_dtlAddress), 0, "DTL: quote token balance"); - } - - function _assertBaseTokenBalance() internal { - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "DTL: base token balance"); - } - - function _assertApprovals() internal { - // Ensure there are no dangling approvals - assertEq( - _quoteToken.allowance(_dtlAddress, address(_uniV2Router)), - 0, - "DTL: quote token allowance" - ); - assertEq( - _baseToken.allowance(_dtlAddress, address(_uniV2Router)), 0, "DTL: base token allowance" - ); - } - - // ========== Modifiers ========== // - - function _performCallback(uint96 lotId_) internal { - vm.prank(address(_auctionHouse)); - _dtl.onSettle( - lotId_, - _proceeds, - _refund, - abi.encode(UniswapV2DirectToLiquidity.OnSettleParams({maxSlippage: _maxSlippage})) - ); - } - - function _performCallback() internal { - _performCallback(_lotId); - } - - function _createPool() internal returns (address) { - return _uniV2Factory.createPair(address(_quoteToken), address(_baseToken)); - } - - modifier givenPoolIsCreated() { - _createPool(); - _; - } - - modifier setCallbackParameters(uint96 proceeds_, uint96 refund_) { - _proceeds = proceeds_; - _refund = refund_; - - // Calculate the capacity utilised - // Any unspent curator payout is included in the refund - // However, curator payouts are linear to the capacity utilised - // Calculate the percent utilisation - uint96 capacityUtilisationPercent = 100e2 - - uint96(FixedPointMathLib.mulDivDown(_refund, 100e2, _LOT_CAPACITY + _curatorPayout)); - _capacityUtilised = _LOT_CAPACITY * capacityUtilisationPercent / 100e2; - - // The proceeds utilisation percent scales the quote tokens and base tokens linearly - _quoteTokensToDeposit = _proceeds * _dtlCreateParams.proceedsUtilisationPercent / 100e2; - _baseTokensToDeposit = - _capacityUtilised * _dtlCreateParams.proceedsUtilisationPercent / 100e2; - _; - } - - modifier givenUnboundedProceedsUtilisationPercent(uint24 percent_) { - // Bound the percent - uint24 percent = uint24(bound(percent_, 1, 100e2)); - - // Set the value on the DTL - _dtlCreateParams.proceedsUtilisationPercent = percent; - _; - } - - modifier givenUnboundedOnCurate(uint96 curationPayout_) { - // Bound the value - _curatorPayout = uint96(bound(curationPayout_, 1e17, _LOT_CAPACITY)); - - // Call the onCurate callback - _performOnCurate(_curatorPayout); - _; - } - - modifier whenRefundIsBounded(uint96 refund_) { - // Bound the refund - _refund = uint96(bound(refund_, 1e17, 5e18)); - _; - } - - modifier givenMaxSlippage(uint24 maxSlippage_) { - _maxSlippage = maxSlippage_; - _; - } - - modifier givenPoolHasDepositLowerPrice() { - uint256 quoteTokensToDeposit = _quoteTokensToDeposit * 95 / 100; - uint256 baseTokensToDeposit = _baseTokensToDeposit; - - // Mint additional tokens - _quoteToken.mint(address(this), quoteTokensToDeposit); - _baseToken.mint(address(this), baseTokensToDeposit); - - // Approve spending - _quoteToken.approve(address(_uniV2Router), quoteTokensToDeposit); - _baseToken.approve(address(_uniV2Router), baseTokensToDeposit); - - // Deposit tokens into the pool - _uniV2Router.addLiquidity( - address(_quoteToken), - address(_baseToken), - quoteTokensToDeposit, - baseTokensToDeposit, - quoteTokensToDeposit, - baseTokensToDeposit, - address(this), - block.timestamp - ); - _; - } - - modifier givenPoolHasDepositHigherPrice() { - uint256 quoteTokensToDeposit = _quoteTokensToDeposit; - uint256 baseTokensToDeposit = _baseTokensToDeposit * 95 / 100; - - // Mint additional tokens - _quoteToken.mint(address(this), quoteTokensToDeposit); - _baseToken.mint(address(this), baseTokensToDeposit); - - // Approve spending - _quoteToken.approve(address(_uniV2Router), quoteTokensToDeposit); - _baseToken.approve(address(_uniV2Router), baseTokensToDeposit); - - // Deposit tokens into the pool - _uniV2Router.addLiquidity( - address(_quoteToken), - address(_baseToken), - quoteTokensToDeposit, - baseTokensToDeposit, - quoteTokensToDeposit, - baseTokensToDeposit, - address(this), - block.timestamp - ); - _; - } - - // ========== Tests ========== // - - // [X] given the pool is created - // [X] it initializes the pool - // [X] given the pool is created and initialized - // [X] it succeeds - // [X] given the proceeds utilisation percent is set - // [X] it calculates the deposit amount correctly - // [X] given curation is enabled - // [X] the utilisation percent considers this - // [X] when the refund amount changes - // [X] the utilisation percent considers this - // [X] given minting pool tokens utilises less than the available amount of base tokens - // [X] the excess base tokens are returned - // [X] given minting pool tokens utilises less than the available amount of quote tokens - // [X] the excess quote tokens are returned - // [X] given the send base tokens flag is false - // [X] it transfers the base tokens from the seller - // [X] given vesting is enabled - // [X] given the recipient is not the seller - // [X] it mints the vesting tokens to the seller - // [X] it mints the vesting tokens to the seller - // [X] given the recipient is not the seller - // [X] it mints the LP token to the recipient - // [X] when multiple lots are created - // [X] it performs actions on the correct pool - // [X] it creates and initializes the pool, creates a pool token, deposits into the pool token, transfers the LP token to the seller and transfers any excess back to the seller - - function test_givenPoolIsCreated() - public - givenCallbackIsCreated - givenOnCreate - givenPoolIsCreated - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - _performCallback(); - - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenProceedsUtilisationPercent_fuzz(uint24 percent_) - public - givenCallbackIsCreated - givenUnboundedProceedsUtilisationPercent(percent_) - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - _performCallback(); - - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenCurationPayout_fuzz(uint96 curationPayout_) - public - givenCallbackIsCreated - givenOnCreate - givenUnboundedOnCurate(curationPayout_) - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - _performCallback(); - - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenProceedsUtilisationPercent_givenCurationPayout_fuzz( - uint24 percent_, - uint96 curationPayout_ - ) - public - givenCallbackIsCreated - givenUnboundedProceedsUtilisationPercent(percent_) - givenOnCreate - givenUnboundedOnCurate(curationPayout_) - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - _performCallback(); - - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_whenRefund_fuzz(uint96 refund_) - public - givenCallbackIsCreated - givenOnCreate - whenRefundIsBounded(refund_) - setCallbackParameters(_PROCEEDS, _refund) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - _performCallback(); - - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenPoolHasDepositWithLowerPrice_reverts() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenPoolIsCreated - givenPoolHasDepositLowerPrice - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - // Expect revert - vm.expectRevert("UniswapV2Router: INSUFFICIENT_A_AMOUNT"); - - _performCallback(); - } - - function test_givenPoolHasDepositWithLowerPrice_whenMaxSlippageIsSet() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenPoolIsCreated - givenPoolHasDepositLowerPrice - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - givenMaxSlippage(500) // 5% - { - _performCallback(); - - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenPoolHasDepositWithHigherPrice_reverts() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenPoolIsCreated - givenPoolHasDepositHigherPrice - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - // Expect revert - vm.expectRevert("UniswapV2Router: INSUFFICIENT_B_AMOUNT"); - - _performCallback(); - } - - function test_givenPoolHasDepositWithHigherPrice_whenMaxSlippageIsSet() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenPoolIsCreated - givenPoolHasDepositHigherPrice - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - givenMaxSlippage(500) // 5% - { - _performCallback(); - - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenVesting() - public - givenLinearVestingModuleIsInstalled - givenCallbackIsCreated - givenVestingStart(_START + 1) - givenVestingExpiry(_START + 2) - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - _performCallback(); - - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenVesting_whenRecipientIsNotSeller() - public - givenLinearVestingModuleIsInstalled - givenCallbackIsCreated - givenVestingStart(_START + 1) - givenVestingExpiry(_START + 2) - whenRecipientIsNotSeller - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - _performCallback(); - - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenVesting_redemption() - public - givenLinearVestingModuleIsInstalled - givenCallbackIsCreated - givenVestingStart(_START + 1) - givenVestingExpiry(_START + 2) - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - _performCallback(); - - // Warp to the end of the vesting period - vm.warp(_START + 3); - - // Redeem the vesting tokens - uint256 tokenId = _getVestingTokenId(); - vm.prank(_SELLER); - _linearVesting.redeemMax(tokenId); - - // Assert that the LP token has been transferred to the seller - IUniswapV2Pair pool = _getUniswapV2Pool(); - assertEq( - pool.balanceOf(_SELLER), - pool.totalSupply() - _MINIMUM_LIQUIDITY, - "seller: LP token balance" - ); - } - - function test_withdrawLpToken() - public - givenCallbackIsCreated - givenOnCreate - givenPoolIsCreated - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - _performCallback(); - - // Get the pools deployed by the DTL callback - IUniswapV2Pair pool = _getUniswapV2Pool(); - - // Approve the spending of the LP token - uint256 lpTokenAmount = pool.balanceOf(_SELLER); - vm.prank(_SELLER); - pool.approve(address(_uniV2Router), lpTokenAmount); - - // Withdraw the LP token - vm.prank(_SELLER); - _uniV2Router.removeLiquidity( - address(_quoteToken), - address(_baseToken), - lpTokenAmount, - _quoteTokensToDeposit * 99 / 100, - _baseTokensToDeposit * 99 / 100, - _SELLER, - block.timestamp - ); - - // Get the minimum liquidity retained in the pool - uint256 quoteTokenPoolAmount = _quoteToken.balanceOf(address(pool)); - uint256 baseTokenPoolAmount = _baseToken.balanceOf(address(pool)); - - // Check the balances - assertEq(pool.balanceOf(_SELLER), 0, "seller: LP token balance"); - assertEq( - _quoteToken.balanceOf(_SELLER), - _proceeds - quoteTokenPoolAmount, - "seller: quote token balance" - ); - assertEq( - _baseToken.balanceOf(_SELLER), - _capacityUtilised - baseTokenPoolAmount, - "seller: base token balance" - ); - assertEq(_quoteToken.balanceOf(_dtlAddress), 0, "DTL: quote token balance"); - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "DTL: base token balance"); - } - - function test_givenInsufficientBaseTokenBalance_reverts() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised - 1) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_InsufficientBalance.selector, - address(_baseToken), - _SELLER, - _baseTokensToDeposit, - _baseTokensToDeposit - 1 - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_givenInsufficientBaseTokenAllowance_reverts() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised - 1) - { - // Expect revert - vm.expectRevert("TRANSFER_FROM_FAILED"); - - _performCallback(); - } - - function test_success() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - _performCallback(); - - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_success_multiple() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_NOT_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_NOT_SELLER, _dtlAddress, _capacityUtilised) - { - // Create second lot - uint96 lotIdTwo = _createLot(_NOT_SELLER); - - _performCallback(lotIdTwo); - - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_whenRecipientIsNotSeller() - public - givenCallbackIsCreated - whenRecipientIsNotSeller - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - _performCallback(); - - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } -} diff --git a/test/callbacks/liquidity/UniswapV3DTL/UniswapV3DTLTest.sol b/test/callbacks/liquidity/UniswapV3DTL/UniswapV3DTLTest.sol deleted file mode 100644 index c2c7d984e..000000000 --- a/test/callbacks/liquidity/UniswapV3DTL/UniswapV3DTLTest.sol +++ /dev/null @@ -1,273 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {Test} from "forge-std/Test.sol"; -import {Callbacks} from "src/lib/Callbacks.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; - -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; - -import {GUniFactory} from "g-uni-v1-core/GUniFactory.sol"; -import {GUniPool} from "g-uni-v1-core/GUniPool.sol"; -import {IUniswapV3Factory} from "uniswap-v3-core/interfaces/IUniswapV3Factory.sol"; - -import {UniswapV3Factory} from "test/lib/uniswap-v3/UniswapV3Factory.sol"; - -import {BaseDirectToLiquidity} from "src/callbacks/liquidity/BaseDTL.sol"; -import {UniswapV3DirectToLiquidity} from "src/callbacks/liquidity/UniswapV3DTL.sol"; -import {LinearVesting} from "src/modules/derivatives/LinearVesting.sol"; -import {MockBatchAuctionModule} from "test/modules/Auction/MockBatchAuctionModule.sol"; - -import {keycodeFromVeecode, toKeycode} from "src/modules/Keycode.sol"; - -import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; - -import {WithSalts} from "test/lib/WithSalts.sol"; -import {console2} from "forge-std/console2.sol"; -import {TestConstants} from "test/Constants.sol"; - -abstract contract UniswapV3DirectToLiquidityTest is Test, Permit2User, WithSalts, TestConstants { - using Callbacks for UniswapV3DirectToLiquidity; - - address internal constant _SELLER = address(0x2); - address internal constant _PROTOCOL = address(0x3); - address internal constant _BUYER = address(0x4); - address internal constant _NOT_SELLER = address(0x20); - - uint96 internal constant _LOT_CAPACITY = 10e18; - - uint48 internal constant _START = 1_000_000; - - uint96 internal _lotId = 1; - - BatchAuctionHouse internal _auctionHouse; - UniswapV3DirectToLiquidity internal _dtl; - address internal _dtlAddress; - IUniswapV3Factory internal _uniV3Factory; - GUniFactory internal _gUniFactory; - LinearVesting internal _linearVesting; - MockBatchAuctionModule internal _batchAuctionModule; - - MockERC20 internal _quoteToken; - MockERC20 internal _baseToken; - - // Inputs - uint24 internal _poolFee = 500; - BaseDirectToLiquidity.OnCreateParams internal _dtlCreateParams = BaseDirectToLiquidity - .OnCreateParams({ - proceedsUtilisationPercent: 100e2, - vestingStart: 0, - vestingExpiry: 0, - recipient: _SELLER, - implParams: abi.encode(_poolFee) - }); - - function setUp() public { - // Set reasonable timestamp - vm.warp(_START); - - // Create an AuctionHouse at a deterministic address, since it is used as input to callbacks - BatchAuctionHouse auctionHouse = new BatchAuctionHouse(_OWNER, _PROTOCOL, _permit2Address); - _auctionHouse = BatchAuctionHouse(_AUCTION_HOUSE); - vm.etch(address(_auctionHouse), address(auctionHouse).code); - vm.store(address(_auctionHouse), bytes32(uint256(0)), bytes32(abi.encode(_OWNER))); // Owner - vm.store(address(_auctionHouse), bytes32(uint256(6)), bytes32(abi.encode(1))); // Reentrancy - vm.store(address(_auctionHouse), bytes32(uint256(10)), bytes32(abi.encode(_PROTOCOL))); // Protocol - - // Create a UniswapV3Factory at a deterministic address - vm.startBroadcast(_CREATE2_DEPLOYER); - bytes32 uniswapV3Salt = - _getTestSalt("UniswapV3Factory", type(UniswapV3Factory).creationCode, abi.encode()); - _uniV3Factory = new UniswapV3Factory{salt: uniswapV3Salt}(); - vm.stopBroadcast(); - if (address(_uniV3Factory) != _UNISWAP_V3_FACTORY) { - console2.log("UniswapV3Factory address: ", address(_uniV3Factory)); - revert("UniswapV3Factory address mismatch"); - } - - // Create a GUniFactory at a deterministic address - vm.startBroadcast(_CREATE2_DEPLOYER); - bytes32 gUniFactorySalt = _getTestSalt( - "GUniFactory", type(GUniFactory).creationCode, abi.encode(address(_uniV3Factory)) - ); - _gUniFactory = new GUniFactory{salt: gUniFactorySalt}(address(_uniV3Factory)); - vm.stopBroadcast(); - if (address(_gUniFactory) != _GUNI_FACTORY) { - console2.log("GUniFactory address: ", address(_gUniFactory)); - revert("GUniFactory address mismatch"); - } - - // Initialize the GUniFactory - address payable gelatoAddress = payable(address(0x10)); - GUniPool poolImplementation = new GUniPool(gelatoAddress); - _gUniFactory.initialize(address(poolImplementation), address(0), address(this)); - - _linearVesting = new LinearVesting(address(_auctionHouse)); - _batchAuctionModule = new MockBatchAuctionModule(address(_auctionHouse)); - - // Install a mock batch auction module - vm.prank(_OWNER); - _auctionHouse.installModule(_batchAuctionModule); - - _quoteToken = new MockERC20("Quote Token", "QT", 18); - _baseToken = new MockERC20("Base Token", "BT", 18); - } - - // ========== MODIFIERS ========== // - - modifier givenLinearVestingModuleIsInstalled() { - vm.prank(_OWNER); - _auctionHouse.installModule(_linearVesting); - _; - } - - modifier givenCallbackIsCreated() { - // Get the salt - bytes memory args = - abi.encode(address(_auctionHouse), address(_uniV3Factory), address(_gUniFactory)); - bytes32 salt = _getTestSalt( - "UniswapV3DirectToLiquidity", type(UniswapV3DirectToLiquidity).creationCode, args - ); - - // Required for CREATE2 address to work correctly. doesn't do anything in a test - // Source: https://github.com/foundry-rs/foundry/issues/6402 - vm.startBroadcast(); - _dtl = new UniswapV3DirectToLiquidity{salt: salt}( - address(_auctionHouse), address(_uniV3Factory), address(_gUniFactory) - ); - vm.stopBroadcast(); - - _dtlAddress = address(_dtl); - _; - } - - modifier givenAddressHasQuoteTokenBalance(address address_, uint256 amount_) { - _quoteToken.mint(address_, amount_); - _; - } - - modifier givenAddressHasBaseTokenBalance(address address_, uint256 amount_) { - _baseToken.mint(address_, amount_); - _; - } - - modifier givenAddressHasQuoteTokenAllowance(address owner_, address spender_, uint256 amount_) { - vm.prank(owner_); - _quoteToken.approve(spender_, amount_); - _; - } - - modifier givenAddressHasBaseTokenAllowance(address owner_, address spender_, uint256 amount_) { - vm.prank(owner_); - _baseToken.approve(spender_, amount_); - _; - } - - function _createLot(address seller_) internal returns (uint96 lotId) { - // Mint and approve the capacity to the owner - _baseToken.mint(seller_, _LOT_CAPACITY); - vm.prank(seller_); - _baseToken.approve(address(_auctionHouse), _LOT_CAPACITY); - - // Prep the lot arguments - IAuctionHouse.RoutingParams memory routingParams = IAuctionHouse.RoutingParams({ - auctionType: keycodeFromVeecode(_batchAuctionModule.VEECODE()), - baseToken: address(_baseToken), - quoteToken: address(_quoteToken), - referrerFee: 0, // No referrer fee - curator: address(0), - callbacks: _dtl, - callbackData: abi.encode(_dtlCreateParams), - derivativeType: toKeycode(""), - derivativeParams: abi.encode(""), - wrapDerivative: false - }); - - IAuction.AuctionParams memory auctionParams = IAuction.AuctionParams({ - start: uint48(block.timestamp) + 1, - duration: 1 days, - capacityInQuote: false, - capacity: _LOT_CAPACITY, - implParams: abi.encode("") - }); - - // Create a new lot - vm.prank(seller_); - return _auctionHouse.auction(routingParams, auctionParams, ""); - } - - modifier givenOnCreate() { - _lotId = _createLot(_SELLER); - _; - } - - function _performOnCurate(uint96 curatorPayout_) internal { - vm.prank(address(_auctionHouse)); - _dtl.onCurate(_lotId, curatorPayout_, false, abi.encode("")); - } - - modifier givenOnCurate(uint96 curatorPayout_) { - _performOnCurate(curatorPayout_); - _; - } - - modifier givenProceedsUtilisationPercent(uint24 percent_) { - _dtlCreateParams.proceedsUtilisationPercent = percent_; - _; - } - - modifier givenPoolFee(uint24 fee_) { - _poolFee = fee_; - _dtlCreateParams.implParams = abi.encode(_poolFee); - _; - } - - modifier givenVestingStart(uint48 start_) { - _dtlCreateParams.vestingStart = start_; - _; - } - - modifier givenVestingExpiry(uint48 end_) { - _dtlCreateParams.vestingExpiry = end_; - _; - } - - modifier whenRecipientIsNotSeller() { - _dtlCreateParams.recipient = _NOT_SELLER; - _; - } - - // ========== FUNCTIONS ========== // - - function _getDTLConfiguration(uint96 lotId_) - internal - view - returns (BaseDirectToLiquidity.DTLConfiguration memory) - { - ( - address recipient_, - uint256 lotCapacity_, - uint256 lotCuratorPayout_, - uint24 proceedsUtilisationPercent_, - uint48 vestingStart_, - uint48 vestingExpiry_, - LinearVesting linearVestingModule_, - bool active_, - bytes memory implParams_ - ) = _dtl.lotConfiguration(lotId_); - - return BaseDirectToLiquidity.DTLConfiguration({ - recipient: recipient_, - lotCapacity: lotCapacity_, - lotCuratorPayout: lotCuratorPayout_, - proceedsUtilisationPercent: proceedsUtilisationPercent_, - vestingStart: vestingStart_, - vestingExpiry: vestingExpiry_, - linearVestingModule: linearVestingModule_, - active: active_, - implParams: implParams_ - }); - } -} diff --git a/test/callbacks/liquidity/UniswapV3DTL/onCancel.t.sol b/test/callbacks/liquidity/UniswapV3DTL/onCancel.t.sol deleted file mode 100644 index da77bcb01..000000000 --- a/test/callbacks/liquidity/UniswapV3DTL/onCancel.t.sol +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {UniswapV3DirectToLiquidityTest} from "./UniswapV3DTLTest.sol"; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; -import {BaseDirectToLiquidity} from "src/callbacks/liquidity/BaseDTL.sol"; - -contract UniswapV3DirectToLiquidityOnCancelTest is UniswapV3DirectToLiquidityTest { - uint96 internal constant _REFUND_AMOUNT = 2e18; - - // ============ Modifiers ============ // - - function _performCallback(uint96 lotId_) internal { - vm.prank(address(_auctionHouse)); - _dtl.onCancel(lotId_, _REFUND_AMOUNT, false, abi.encode("")); - } - - // ============ Tests ============ // - - // [X] when the lot has not been registered - // [X] it reverts - // [X] when multiple lots are created - // [X] it marks the correct lot as inactive - // [X] it marks the lot as inactive - - function test_whenLotNotRegistered_reverts() public givenCallbackIsCreated { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - // Call the function - _performCallback(_lotId); - } - - function test_success() public givenCallbackIsCreated givenOnCreate { - // Call the function - _performCallback(_lotId); - - // Check the values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.active, false, "active"); - - // Check the balances - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "base token balance"); - assertEq(_baseToken.balanceOf(_SELLER), 0, "seller base token balance"); - assertEq(_baseToken.balanceOf(_NOT_SELLER), 0, "not seller base token balance"); - } - - function test_success_multiple() public givenCallbackIsCreated givenOnCreate { - uint96 lotIdOne = _lotId; - - // Create a second lot and cancel it - uint96 lotIdTwo = _createLot(_NOT_SELLER); - _performCallback(lotIdTwo); - - // Check the values - BaseDirectToLiquidity.DTLConfiguration memory configurationOne = - _getDTLConfiguration(lotIdOne); - assertEq(configurationOne.active, true, "lot one: active"); - - BaseDirectToLiquidity.DTLConfiguration memory configurationTwo = - _getDTLConfiguration(lotIdTwo); - assertEq(configurationTwo.active, false, "lot two: active"); - - // Check the balances - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "base token balance"); - assertEq(_baseToken.balanceOf(_SELLER), 0, "seller base token balance"); - assertEq(_baseToken.balanceOf(_NOT_SELLER), 0, "not seller base token balance"); - } -} diff --git a/test/callbacks/liquidity/UniswapV3DTL/onCreate.t.sol b/test/callbacks/liquidity/UniswapV3DTL/onCreate.t.sol deleted file mode 100644 index 966e2ab05..000000000 --- a/test/callbacks/liquidity/UniswapV3DTL/onCreate.t.sol +++ /dev/null @@ -1,373 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {UniswapV3DirectToLiquidityTest} from "./UniswapV3DTLTest.sol"; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; -import {BaseDirectToLiquidity} from "src/callbacks/liquidity/BaseDTL.sol"; -import {UniswapV3DirectToLiquidity} from "src/callbacks/liquidity/UniswapV3DTL.sol"; - -contract UniswapV3DirectToLiquidityOnCreateTest is UniswapV3DirectToLiquidityTest { - // ============ Modifiers ============ // - - function _performCallback(address seller_) internal { - vm.prank(address(_auctionHouse)); - _dtl.onCreate( - _lotId, - seller_, - address(_baseToken), - address(_quoteToken), - _LOT_CAPACITY, - false, - abi.encode(_dtlCreateParams) - ); - } - - function _performCallback() internal { - _performCallback(_SELLER); - } - - // ============ Assertions ============ // - - function _expectTransferFrom() internal { - vm.expectRevert("TRANSFER_FROM_FAILED"); - } - - function _expectInvalidParams() internal { - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); - vm.expectRevert(err); - } - - function _expectNotAuthorized() internal { - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - } - - function _assertBaseTokenBalances() internal { - assertEq(_baseToken.balanceOf(_SELLER), 0, "seller balance"); - assertEq(_baseToken.balanceOf(_NOT_SELLER), 0, "not seller balance"); - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "dtl balance"); - } - - // ============ Tests ============ // - - // [X] when the callback data is incorrect - // [X] it reverts - // [X] when the callback is not called by the auction house - // [X] it reverts - // [X] when the lot has already been registered - // [X] it reverts - // [X] when the proceeds utilisation is 0 - // [X] it reverts - // [X] when the proceeds utilisation is greater than 100% - // [X] it reverts - // [X] given the pool fee is not enabled - // [X] it reverts - // [X] given uniswap v3 pool already exists - // [X] it reverts - // [X] when the start and expiry timestamps are the same - // [X] it reverts - // [X] when the start timestamp is after the expiry timestamp - // [X] it reverts - // [X] when the start timestamp is before the current timestamp - // [X] it succeeds - // [X] when the expiry timestamp is before the current timestamp - // [X] it reverts - // [X] when the start timestamp and expiry timestamp are specified - // [X] given the linear vesting module is not installed - // [X] it reverts - // [X] it records the address of the linear vesting module - // [X] when the recipient is the zero address - // [X] it reverts - // [X] when the recipient is not the seller - // [X] it records the recipient - // [X] when multiple lots are created - // [X] it registers each lot - // [X] it registers the lot - - function test_whenCallbackDataIsIncorrect_reverts() public givenCallbackIsCreated { - // Expect revert - vm.expectRevert(); - - vm.prank(address(_auctionHouse)); - _dtl.onCreate( - _lotId, - _SELLER, - address(_baseToken), - address(_quoteToken), - _LOT_CAPACITY, - false, - abi.encode(uint256(10)) - ); - } - - function test_whenCallbackIsNotCalledByAuctionHouse_reverts() public givenCallbackIsCreated { - _expectNotAuthorized(); - - _dtl.onCreate( - _lotId, - _SELLER, - address(_baseToken), - address(_quoteToken), - _LOT_CAPACITY, - false, - abi.encode(_dtlCreateParams) - ); - } - - function test_whenLotHasAlreadyBeenRegistered_reverts() public givenCallbackIsCreated { - _performCallback(); - - _expectInvalidParams(); - - _performCallback(); - } - - function test_whenProceedsUtilisationIs0_reverts() - public - givenCallbackIsCreated - givenProceedsUtilisationPercent(0) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_PercentOutOfBounds.selector, 0, 1, 100e2 - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenProceedsUtilisationIsGreaterThan100Percent_reverts() - public - givenCallbackIsCreated - givenProceedsUtilisationPercent(100e2 + 1) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_PercentOutOfBounds.selector, 100e2 + 1, 1, 100e2 - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_givenPoolFeeIsNotEnabled_reverts() - public - givenCallbackIsCreated - givenPoolFee(0) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - UniswapV3DirectToLiquidity.Callback_Params_PoolFeeNotEnabled.selector - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_givenUniswapV3PoolAlreadyExists_reverts() - public - givenCallbackIsCreated - givenPoolFee(500) - { - // Create the pool - _uniV3Factory.createPool(address(_baseToken), address(_quoteToken), 500); - - // Expect revert - bytes memory err = - abi.encodeWithSelector(BaseDirectToLiquidity.Callback_Params_PoolExists.selector); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenStartAndExpiryTimestampsAreTheSame_reverts() - public - givenCallbackIsCreated - givenLinearVestingModuleIsInstalled - givenVestingStart(_START + 1) - givenVestingExpiry(_START + 1) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_InvalidVestingParams.selector - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenStartTimestampIsAfterExpiryTimestamp_reverts() - public - givenCallbackIsCreated - givenLinearVestingModuleIsInstalled - givenVestingStart(_START + 2) - givenVestingExpiry(_START + 1) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_InvalidVestingParams.selector - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenStartTimestampIsBeforeCurrentTimestamp_succeeds() - public - givenCallbackIsCreated - givenLinearVestingModuleIsInstalled - givenVestingStart(_START - 1) - givenVestingExpiry(_START + 1) - { - _performCallback(); - - // Assert values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.vestingStart, _START - 1, "vestingStart"); - assertEq(configuration.vestingExpiry, _START + 1, "vestingExpiry"); - assertEq( - address(configuration.linearVestingModule), - address(_linearVesting), - "linearVestingModule" - ); - - // Assert balances - _assertBaseTokenBalances(); - } - - function test_whenExpiryTimestampIsBeforeCurrentTimestamp_reverts() - public - givenCallbackIsCreated - givenLinearVestingModuleIsInstalled - givenVestingStart(_START + 1) - givenVestingExpiry(_START - 1) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_InvalidVestingParams.selector - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenVestingSpecified_givenLinearVestingModuleNotInstalled_reverts() - public - givenCallbackIsCreated - givenVestingStart(_START + 1) - givenVestingExpiry(_START + 2) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_LinearVestingModuleNotFound.selector - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenVestingSpecified() - public - givenCallbackIsCreated - givenLinearVestingModuleIsInstalled - givenVestingStart(_START + 1) - givenVestingExpiry(_START + 2) - { - _performCallback(); - - // Assert values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.vestingStart, _START + 1, "vestingStart"); - assertEq(configuration.vestingExpiry, _START + 2, "vestingExpiry"); - assertEq( - address(configuration.linearVestingModule), - address(_linearVesting), - "linearVestingModule" - ); - - // Assert balances - _assertBaseTokenBalances(); - } - - function test_whenRecipientIsZeroAddress_reverts() public givenCallbackIsCreated { - _dtlCreateParams.recipient = address(0); - - // Expect revert - bytes memory err = - abi.encodeWithSelector(BaseDirectToLiquidity.Callback_Params_InvalidAddress.selector); - vm.expectRevert(err); - - _performCallback(); - } - - function test_whenRecipientIsNotSeller_succeeds() - public - givenCallbackIsCreated - whenRecipientIsNotSeller - { - _performCallback(); - - // Assert values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.recipient, _NOT_SELLER, "recipient"); - - // Assert balances - _assertBaseTokenBalances(); - } - - function test_succeeds() public givenCallbackIsCreated { - _performCallback(); - - // Assert values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.recipient, _SELLER, "recipient"); - assertEq(configuration.lotCapacity, _LOT_CAPACITY, "lotCapacity"); - assertEq(configuration.lotCuratorPayout, 0, "lotCuratorPayout"); - assertEq( - configuration.proceedsUtilisationPercent, - _dtlCreateParams.proceedsUtilisationPercent, - "proceedsUtilisationPercent" - ); - assertEq(configuration.vestingStart, 0, "vestingStart"); - assertEq(configuration.vestingExpiry, 0, "vestingExpiry"); - assertEq(address(configuration.linearVestingModule), address(0), "linearVestingModule"); - assertEq(configuration.active, true, "active"); - - (uint24 configurationPoolFee) = abi.decode(configuration.implParams, (uint24)); - assertEq(configurationPoolFee, _poolFee, "poolFee"); - assertEq(configuration.implParams, _dtlCreateParams.implParams, "implParams"); - - // Assert balances - _assertBaseTokenBalances(); - } - - function test_succeeds_multiple() public givenCallbackIsCreated { - // Lot one - _performCallback(); - - // Lot two - _dtlCreateParams.recipient = _NOT_SELLER; - _lotId = 2; - _performCallback(_NOT_SELLER); - - // Assert values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.recipient, _NOT_SELLER, "recipient"); - assertEq(configuration.lotCapacity, _LOT_CAPACITY, "lotCapacity"); - assertEq(configuration.lotCuratorPayout, 0, "lotCuratorPayout"); - assertEq( - configuration.proceedsUtilisationPercent, - _dtlCreateParams.proceedsUtilisationPercent, - "proceedsUtilisationPercent" - ); - assertEq(configuration.vestingStart, 0, "vestingStart"); - assertEq(configuration.vestingExpiry, 0, "vestingExpiry"); - assertEq(address(configuration.linearVestingModule), address(0), "linearVestingModule"); - assertEq(configuration.active, true, "active"); - assertEq(configuration.implParams, _dtlCreateParams.implParams, "implParams"); - - // Assert balances - _assertBaseTokenBalances(); - } -} diff --git a/test/callbacks/liquidity/UniswapV3DTL/onCurate.t.sol b/test/callbacks/liquidity/UniswapV3DTL/onCurate.t.sol deleted file mode 100644 index 4e27ec741..000000000 --- a/test/callbacks/liquidity/UniswapV3DTL/onCurate.t.sol +++ /dev/null @@ -1,83 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {UniswapV3DirectToLiquidityTest} from "./UniswapV3DTLTest.sol"; - -import {BaseCallback} from "src/callbacks/BaseCallback.sol"; -import {BaseDirectToLiquidity} from "src/callbacks/liquidity/BaseDTL.sol"; - -contract UniswapV3DirectToLiquidityOnCurateTest is UniswapV3DirectToLiquidityTest { - uint96 internal constant _PAYOUT_AMOUNT = 1e18; - - // ============ Modifiers ============ // - - function _performCallback(uint96 lotId_) internal { - vm.prank(address(_auctionHouse)); - _dtl.onCurate(lotId_, _PAYOUT_AMOUNT, false, abi.encode("")); - } - - // ============ Tests ============ // - - // [X] when the lot has not been registered - // [X] it reverts - // [X] when multiple lots are created - // [X] it marks the correct lot as inactive - // [X] it registers the curator payout - - function test_whenLotNotRegistered_reverts() public givenCallbackIsCreated { - // Expect revert - bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_NotAuthorized.selector); - vm.expectRevert(err); - - // Call the function - _performCallback(_lotId); - } - - function test_success() public givenCallbackIsCreated givenOnCreate { - // Call the function - _performCallback(_lotId); - - // Check the values - BaseDirectToLiquidity.DTLConfiguration memory configuration = _getDTLConfiguration(_lotId); - assertEq(configuration.lotCuratorPayout, _PAYOUT_AMOUNT, "lotCuratorPayout"); - - // Check the balances - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "base token balance"); - assertEq(_baseToken.balanceOf(_SELLER), 0, "seller base token balance"); - assertEq(_baseToken.balanceOf(_NOT_SELLER), 0, "not seller base token balance"); - assertEq( - _baseToken.balanceOf(address(_auctionHouse)), - _LOT_CAPACITY, - "auction house base token balance" - ); - } - - function test_success_multiple() public givenCallbackIsCreated givenOnCreate { - uint96 lotIdOne = _lotId; - - // Create a second lot - uint96 lotIdTwo = _createLot(_NOT_SELLER); - - // Call the function - _performCallback(lotIdTwo); - - // Check the values - BaseDirectToLiquidity.DTLConfiguration memory configurationOne = - _getDTLConfiguration(lotIdOne); - assertEq(configurationOne.lotCuratorPayout, 0, "lot one: lotCuratorPayout"); - - BaseDirectToLiquidity.DTLConfiguration memory configurationTwo = - _getDTLConfiguration(lotIdTwo); - assertEq(configurationTwo.lotCuratorPayout, _PAYOUT_AMOUNT, "lot two: lotCuratorPayout"); - - // Check the balances - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "base token balance"); - assertEq(_baseToken.balanceOf(_SELLER), 0, "seller base token balance"); - assertEq(_baseToken.balanceOf(_NOT_SELLER), 0, "not seller base token balance"); - assertEq( - _baseToken.balanceOf(address(_auctionHouse)), - _LOT_CAPACITY * 2, - "auction house base token balance" - ); - } -} diff --git a/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol b/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol deleted file mode 100644 index ededd3023..000000000 --- a/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol +++ /dev/null @@ -1,745 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {UniswapV3DirectToLiquidityTest} from "./UniswapV3DTLTest.sol"; - -// Libraries -import {FixedPointMathLib} from "solmate/utils/FixedPointMathLib.sol"; -import {ERC20} from "solmate/tokens/ERC20.sol"; - -// Uniswap -import {IUniswapV3Pool} from "uniswap-v3-core/interfaces/IUniswapV3Pool.sol"; -import {SqrtPriceMath} from "src/lib/uniswap-v3/SqrtPriceMath.sol"; - -// G-UNI -import {GUniPool} from "g-uni-v1-core/GUniPool.sol"; - -// AuctionHouse -import {ILinearVesting} from "src/interfaces/modules/derivatives/ILinearVesting.sol"; -import {BaseDirectToLiquidity} from "src/callbacks/liquidity/BaseDTL.sol"; -import {UniswapV3DirectToLiquidity} from "src/callbacks/liquidity/UniswapV3DTL.sol"; - -contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTest { - uint96 internal constant _PROCEEDS = 20e18; - uint96 internal constant _REFUND = 0; - - uint96 internal _proceeds; - uint96 internal _refund; - uint96 internal _capacityUtilised; - uint96 internal _quoteTokensToDeposit; - uint96 internal _baseTokensToDeposit; - uint96 internal _curatorPayout; - uint24 internal _maxSlippage = 1; // 0.01% - - uint160 internal constant _SQRT_PRICE_X96_OVERRIDE = 125_270_724_187_523_965_593_206_000_000; // Different to what is normally calculated - - /// @dev Set via `setCallbackParameters` modifier - uint160 internal _sqrtPriceX96; - - // ========== Internal functions ========== // - - function _getGUniPool() internal view returns (GUniPool) { - // Get the pools deployed by the DTL callback - address[] memory pools = _gUniFactory.getPools(_dtlAddress); - - return GUniPool(pools[0]); - } - - function _getVestingTokenId() internal view returns (uint256) { - // Get the pools deployed by the DTL callback - address pool = address(_getGUniPool()); - - return _linearVesting.computeId( - pool, - abi.encode( - ILinearVesting.VestingParams({ - start: _dtlCreateParams.vestingStart, - expiry: _dtlCreateParams.vestingExpiry - }) - ) - ); - } - - // ========== Assertions ========== // - - function _assertPoolState(uint160 sqrtPriceX96_) internal { - // Get the pool - address pool = _getPool(); - - (uint160 sqrtPriceX96,,,,,,) = IUniswapV3Pool(pool).slot0(); - assertEq(sqrtPriceX96, sqrtPriceX96_, "pool sqrt price"); - } - - function _assertLpTokenBalance() internal { - // Get the pools deployed by the DTL callback - GUniPool pool = _getGUniPool(); - - uint256 sellerExpectedBalance; - uint256 linearVestingExpectedBalance; - // Only has a balance if not vesting - if (_dtlCreateParams.vestingStart == 0) { - sellerExpectedBalance = pool.totalSupply(); - } else { - linearVestingExpectedBalance = pool.totalSupply(); - } - - assertEq( - pool.balanceOf(_SELLER), - _dtlCreateParams.recipient == _SELLER ? sellerExpectedBalance : 0, - "seller: LP token balance" - ); - assertEq( - pool.balanceOf(_NOT_SELLER), - _dtlCreateParams.recipient == _NOT_SELLER ? sellerExpectedBalance : 0, - "not seller: LP token balance" - ); - assertEq( - pool.balanceOf(address(_linearVesting)), - linearVestingExpectedBalance, - "linear vesting: LP token balance" - ); - } - - function _assertVestingTokenBalance() internal { - // Exit if not vesting - if (_dtlCreateParams.vestingStart == 0) { - return; - } - - // Get the pools deployed by the DTL callback - address pool = address(_getGUniPool()); - - // Get the wrapped address - (, address wrappedVestingTokenAddress) = _linearVesting.deploy( - pool, - abi.encode( - ILinearVesting.VestingParams({ - start: _dtlCreateParams.vestingStart, - expiry: _dtlCreateParams.vestingExpiry - }) - ), - true - ); - ERC20 wrappedVestingToken = ERC20(wrappedVestingTokenAddress); - uint256 sellerExpectedBalance = wrappedVestingToken.totalSupply(); - - assertEq( - wrappedVestingToken.balanceOf(_SELLER), - _dtlCreateParams.recipient == _SELLER ? sellerExpectedBalance : 0, - "seller: vesting token balance" - ); - assertEq( - wrappedVestingToken.balanceOf(_NOT_SELLER), - _dtlCreateParams.recipient == _NOT_SELLER ? sellerExpectedBalance : 0, - "not seller: vesting token balance" - ); - } - - function _assertQuoteTokenBalance() internal { - assertEq(_quoteToken.balanceOf(_dtlAddress), 0, "DTL: quote token balance"); - } - - function _assertBaseTokenBalance() internal { - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "DTL: base token balance"); - } - - function _assertApprovals() internal { - // Ensure there are no dangling approvals - assertEq( - _quoteToken.allowance(_dtlAddress, address(_getGUniPool())), - 0, - "DTL: quote token allowance" - ); - assertEq( - _baseToken.allowance(_dtlAddress, address(_getGUniPool())), - 0, - "DTL: base token allowance" - ); - } - - // ========== Modifiers ========== // - - function _performCallback(uint96 lotId_) internal { - vm.prank(address(_auctionHouse)); - _dtl.onSettle( - lotId_, - _proceeds, - _refund, - abi.encode(UniswapV3DirectToLiquidity.OnSettleParams({maxSlippage: _maxSlippage})) - ); - } - - function _performCallback() internal { - _performCallback(_lotId); - } - - function _createPool() internal returns (address) { - (address token0, address token1) = address(_baseToken) < address(_quoteToken) - ? (address(_baseToken), address(_quoteToken)) - : (address(_quoteToken), address(_baseToken)); - - return _uniV3Factory.createPool(token0, token1, _poolFee); - } - - function _initializePool(address pool_, uint160 sqrtPriceX96_) internal { - IUniswapV3Pool(pool_).initialize(sqrtPriceX96_); - } - - modifier givenPoolIsCreated() { - _createPool(); - _; - } - - modifier givenPoolIsCreatedAndInitialized(uint160 sqrtPriceX96_) { - address pool = _createPool(); - _initializePool(pool, sqrtPriceX96_); - _; - } - - function _calculateSqrtPriceX96( - uint256 quoteTokenAmount_, - uint256 baseTokenAmount_ - ) internal view returns (uint160) { - return SqrtPriceMath.getSqrtPriceX96( - address(_quoteToken), address(_baseToken), quoteTokenAmount_, baseTokenAmount_ - ); - } - - modifier setCallbackParameters(uint96 proceeds_, uint96 refund_) { - _proceeds = proceeds_; - _refund = refund_; - - // Calculate the capacity utilised - // Any unspent curator payout is included in the refund - // However, curator payouts are linear to the capacity utilised - // Calculate the percent utilisation - uint96 capacityUtilisationPercent = 100e2 - - uint96(FixedPointMathLib.mulDivDown(_refund, 100e2, _LOT_CAPACITY + _curatorPayout)); - _capacityUtilised = _LOT_CAPACITY * capacityUtilisationPercent / 100e2; - - // The proceeds utilisation percent scales the quote tokens and base tokens linearly - _quoteTokensToDeposit = _proceeds * _dtlCreateParams.proceedsUtilisationPercent / 100e2; - _baseTokensToDeposit = - _capacityUtilised * _dtlCreateParams.proceedsUtilisationPercent / 100e2; - - _sqrtPriceX96 = _calculateSqrtPriceX96(_quoteTokensToDeposit, _baseTokensToDeposit); - _; - } - - modifier givenUnboundedProceedsUtilisationPercent(uint24 percent_) { - // Bound the percent - uint24 percent = uint24(bound(percent_, 1, 100e2)); - - // Set the value on the DTL - _dtlCreateParams.proceedsUtilisationPercent = percent; - _; - } - - modifier givenUnboundedOnCurate(uint96 curationPayout_) { - // Bound the value - _curatorPayout = uint96(bound(curationPayout_, 1e17, _LOT_CAPACITY)); - - // Call the onCurate callback - _performOnCurate(_curatorPayout); - _; - } - - modifier whenRefundIsBounded(uint96 refund_) { - // Bound the refund - _refund = uint96(bound(refund_, 1e17, 5e18)); - _; - } - - modifier givenPoolHasDepositLowerPrice() { - _sqrtPriceX96 = _calculateSqrtPriceX96(_PROCEEDS / 2, _LOT_CAPACITY); - _; - } - - modifier givenPoolHasDepositHigherPrice() { - _sqrtPriceX96 = _calculateSqrtPriceX96(_PROCEEDS * 2, _LOT_CAPACITY); - _; - } - - function _getPool() internal view returns (address) { - (address token0, address token1) = address(_baseToken) < address(_quoteToken) - ? (address(_baseToken), address(_quoteToken)) - : (address(_quoteToken), address(_baseToken)); - return _uniV3Factory.getPool(token0, token1, _poolFee); - } - - function _setMaxSlippage(uint24 maxSlippage_) internal { - _maxSlippage = maxSlippage_; - } - - modifier givenMaxSlippage(uint24 maxSlippage_) { - _setMaxSlippage(maxSlippage_); - _; - } - - // ========== Tests ========== // - - // [X] given the pool is created - // [X] it initializes the pool - // [X] given the pool is created and initialized - // [X] it succeeds - // [X] given the proceeds utilisation percent is set - // [X] it calculates the deposit amount correctly - // [X] given curation is enabled - // [X] the utilisation percent considers this - // [X] when the refund amount changes - // [X] the utilisation percent considers this - // [X] given minting pool tokens utilises less than the available amount of base tokens - // [X] the excess base tokens are returned - // [X] given minting pool tokens utilises less than the available amount of quote tokens - // [X] the excess quote tokens are returned - // [X] given the send base tokens flag is false - // [X] it transfers the base tokens from the seller - // [X] given vesting is enabled - // [X] given the recipient is not the seller - // [X] it mints the vesting tokens to the seller - // [X] it mints the vesting tokens to the seller - // [X] given the recipient is not the seller - // [X] it mints the LP token to the recipient - // [X] when multiple lots are created - // [X] it performs actions on the correct pool - // [X] it creates and initializes the pool, creates a pool token, deposits into the pool token, transfers the LP token to the seller and transfers any excess back to the seller - - function test_givenPoolIsCreated() - public - givenCallbackIsCreated - givenOnCreate - givenPoolIsCreated - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - _performCallback(); - - _assertPoolState(_sqrtPriceX96); - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenPoolIsCreatedAndInitialized_givenMaxSlippage() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenPoolIsCreatedAndInitialized(_SQRT_PRICE_X96_OVERRIDE) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - givenMaxSlippage(8100) // 81% - { - _performCallback(); - - _assertPoolState(_SQRT_PRICE_X96_OVERRIDE); - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenPoolIsCreatedAndInitialized_reverts() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenPoolIsCreatedAndInitialized(_SQRT_PRICE_X96_OVERRIDE) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - UniswapV3DirectToLiquidity.Callback_Slippage.selector, - address(_baseToken), - 7_999_999_999_999_999_999, // Hardcoded - 9_999_000_000_000_000_000 // Hardcoded - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_givenProceedsUtilisationPercent_fuzz(uint24 percent_) - public - givenCallbackIsCreated - givenUnboundedProceedsUtilisationPercent(percent_) - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - _performCallback(); - - _assertPoolState(_sqrtPriceX96); - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenCurationPayout_fuzz(uint96 curationPayout_) - public - givenCallbackIsCreated - givenOnCreate - givenUnboundedOnCurate(curationPayout_) - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - _performCallback(); - - _assertPoolState(_sqrtPriceX96); - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenProceedsUtilisationPercent_givenCurationPayout_fuzz( - uint24 percent_, - uint96 curationPayout_ - ) - public - givenCallbackIsCreated - givenUnboundedProceedsUtilisationPercent(percent_) - givenOnCreate - givenUnboundedOnCurate(curationPayout_) - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - _performCallback(); - - _assertPoolState(_sqrtPriceX96); - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_whenRefund_fuzz(uint96 refund_) - public - givenCallbackIsCreated - givenOnCreate - whenRefundIsBounded(refund_) - setCallbackParameters(_PROCEEDS, _refund) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - _performCallback(); - - _assertPoolState(_sqrtPriceX96); - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenPoolHasDepositWithLowerPrice() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenPoolHasDepositLowerPrice - givenPoolIsCreatedAndInitialized(_sqrtPriceX96) - givenMaxSlippage(5100) // 51% - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - _performCallback(); - - _assertPoolState(_sqrtPriceX96); - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenPoolHasDepositWithHigherPrice() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenPoolHasDepositHigherPrice - givenPoolIsCreatedAndInitialized(_sqrtPriceX96) - givenMaxSlippage(5100) // 51% - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - _performCallback(); - - _assertPoolState(_sqrtPriceX96); - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_lessThanMaxSlippage() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenMaxSlippage(1) // 0.01% - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - _performCallback(); - - _assertPoolState(_sqrtPriceX96); - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_greaterThanMaxSlippage_reverts() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenMaxSlippage(0) // 0% - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - UniswapV3DirectToLiquidity.Callback_Slippage.selector, - address(_quoteToken), - 19_999_999_999_999_999_999, // Hardcoded - _quoteTokensToDeposit - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_givenVesting() - public - givenLinearVestingModuleIsInstalled - givenCallbackIsCreated - givenVestingStart(_START + 1) - givenVestingExpiry(_START + 2) - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - _performCallback(); - - _assertPoolState(_sqrtPriceX96); - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenVesting_whenRecipientIsNotSeller() - public - givenLinearVestingModuleIsInstalled - givenCallbackIsCreated - givenVestingStart(_START + 1) - givenVestingExpiry(_START + 2) - whenRecipientIsNotSeller - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - _performCallback(); - - _assertPoolState(_sqrtPriceX96); - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_givenVesting_redemption() - public - givenLinearVestingModuleIsInstalled - givenCallbackIsCreated - givenVestingStart(_START + 1) - givenVestingExpiry(_START + 2) - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - { - _performCallback(); - - // Warp to the end of the vesting period - vm.warp(_START + 3); - - // Redeem the vesting tokens - uint256 tokenId = _getVestingTokenId(); - vm.prank(_SELLER); - _linearVesting.redeemMax(tokenId); - - // Assert that the LP token has been transferred to the seller - GUniPool pool = _getGUniPool(); - assertEq(pool.balanceOf(_SELLER), pool.totalSupply(), "seller: LP token balance"); - } - - function test_withdrawLpToken() - public - givenCallbackIsCreated - givenOnCreate - givenPoolIsCreated - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - _performCallback(); - - // Get the pools deployed by the DTL callback - address[] memory pools = _gUniFactory.getPools(_dtlAddress); - assertEq(pools.length, 1, "pools length"); - GUniPool pool = GUniPool(pools[0]); - - address uniPool = _getPool(); - - // Withdraw the LP token - uint256 sellerBalance = pool.balanceOf(_SELLER); - vm.prank(_SELLER); - pool.burn(sellerBalance, _SELLER); - - // Check the balances - assertEq(pool.balanceOf(_SELLER), 0, "seller: LP token balance"); - assertEq(_quoteToken.balanceOf(_SELLER), _proceeds - 1, "seller: quote token balance"); - assertEq(_baseToken.balanceOf(_SELLER), _capacityUtilised - 1, "seller: base token balance"); - assertEq(_quoteToken.balanceOf(pools[0]), 0, "pool: quote token balance"); - assertEq(_baseToken.balanceOf(pools[0]), 0, "pool: base token balance"); - assertEq(_quoteToken.balanceOf(_dtlAddress), 0, "DTL: quote token balance"); - assertEq(_baseToken.balanceOf(_dtlAddress), 0, "DTL: base token balance"); - // There is a rounding error when burning the LP token, which leaves dust in the pool - assertEq(_quoteToken.balanceOf(uniPool), 1, "uni pool: quote token balance"); - assertEq(_baseToken.balanceOf(uniPool), 1, "uni pool: base token balance"); - } - - function test_givenInsufficientBaseTokenBalance_reverts() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised - 1) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - // Expect revert - bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_InsufficientBalance.selector, - address(_baseToken), - _SELLER, - _baseTokensToDeposit, - _baseTokensToDeposit - 1 - ); - vm.expectRevert(err); - - _performCallback(); - } - - function test_givenInsufficientBaseTokenAllowance_reverts() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised - 1) - { - // Expect revert - vm.expectRevert("TRANSFER_FROM_FAILED"); - - _performCallback(); - } - - function test_success() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - _performCallback(); - - _assertPoolState(_sqrtPriceX96); - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_success_multiple() - public - givenCallbackIsCreated - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_NOT_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_NOT_SELLER, _dtlAddress, _capacityUtilised) - { - // Create second lot - uint96 lotIdTwo = _createLot(_NOT_SELLER); - - _performCallback(lotIdTwo); - - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } - - function test_whenRecipientIsNotSeller() - public - givenCallbackIsCreated - whenRecipientIsNotSeller - givenOnCreate - setCallbackParameters(_PROCEEDS, _REFUND) - givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) - givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) - givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - { - _performCallback(); - - _assertPoolState(_sqrtPriceX96); - _assertLpTokenBalance(); - _assertVestingTokenBalance(); - _assertQuoteTokenBalance(); - _assertBaseTokenBalance(); - _assertApprovals(); - } -} diff --git a/test/lib/BidEncoding.t.sol b/test/lib/BidEncoding.t.sol index 1dd6c5058..8230ec5a3 100644 --- a/test/lib/BidEncoding.t.sol +++ b/test/lib/BidEncoding.t.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Test} from "forge-std/Test.sol"; -import {BidEncoding} from "src/lib/MaxPriorityQueue.sol"; -import {FixedPointMathLib as Math} from "lib/solady/src/utils/FixedPointMathLib.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {BidEncoding} from "../../src/lib/MaxPriorityQueue.sol"; +import {FixedPointMathLib as Math} from "@solady-0.0.124/utils/FixedPointMathLib.sol"; contract BidEncodingTest is Test { using BidEncoding for bytes32; diff --git a/test/lib/ComputeAddress.sol b/test/lib/ComputeAddress.sol deleted file mode 100644 index 641c1199e..000000000 --- a/test/lib/ComputeAddress.sol +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; - -library ComputeAddress { - function computeAddress( - bytes memory creationCode, - bytes memory creationParams, - bytes32 salt, - address deployer - ) internal pure returns (address) { - return Create2.computeAddress( - bytes32(salt), keccak256(abi.encodePacked(creationCode, creationParams)), deployer - ); - } - - function generateSalt( - address comparisonAddress, - bool higher, - bytes memory creationCode, - bytes memory creationParams, - address deployer - ) internal pure returns (bytes32) { - // Start with an initial value for the salt - bytes32 salt = bytes32(0); - - // Iterate until we find a salt that produces an address that is either higher or lower than the comparison address - while (true) { - // Increment the salt value - salt = bytes32(uint256(salt) + 1); - - // Derive the address from the salt - address derivedAddress = computeAddress(creationCode, creationParams, salt, deployer); - - // If the derived address is higher than the comparison address, we're done - if (higher && derivedAddress > comparisonAddress) { - break; - } - - // If the derived address is lower than the comparison address, we're done - if (!higher && derivedAddress < comparisonAddress) { - break; - } - } - - return salt; - } -} diff --git a/test/lib/ECIES/ECIES_FFI.sol b/test/lib/ECIES/ECIES_FFI.sol index 0de714a7a..51348c11c 100644 --- a/test/lib/ECIES/ECIES_FFI.sol +++ b/test/lib/ECIES/ECIES_FFI.sol @@ -2,10 +2,10 @@ pragma solidity 0.8.19; // Testing Libraries -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; // ECIES -import {Point} from "src/lib/ECIES.sol"; +import {Point} from "../../../src/lib/ECIES.sol"; abstract contract ECIESFFITest is Test { string internal constant _EXECUTABLE = "./crates/ecies-cli/target/debug/ecies-cli"; diff --git a/test/lib/ECIES/decrypt.t.sol b/test/lib/ECIES/decrypt.t.sol index 7460779b5..db265703b 100644 --- a/test/lib/ECIES/decrypt.t.sol +++ b/test/lib/ECIES/decrypt.t.sol @@ -2,12 +2,12 @@ pragma solidity 0.8.19; // Testing Libraries -import {Test} from "forge-std/Test.sol"; -import {console2} from "forge-std/console2.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {console2} from "@forge-std-1.9.1/console2.sol"; import {ECIESFFITest} from "./ECIES_FFI.sol"; // ECIES -import {Point, ECIES} from "src/lib/ECIES.sol"; +import {Point, ECIES} from "../../../src/lib/ECIES.sol"; contract ECIESDecryptTest is Test { // [X] when the bid public key is invalid diff --git a/test/lib/ECIES/encrypt.t.sol b/test/lib/ECIES/encrypt.t.sol index 4291a1b4c..49da37227 100644 --- a/test/lib/ECIES/encrypt.t.sol +++ b/test/lib/ECIES/encrypt.t.sol @@ -2,12 +2,12 @@ pragma solidity 0.8.19; // Testing Libraries -import {Test} from "forge-std/Test.sol"; -import {console2} from "forge-std/console2.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {console2} from "@forge-std-1.9.1/console2.sol"; import {ECIESFFITest} from "./ECIES_FFI.sol"; // ECIES -import {Point, ECIES} from "src/lib/ECIES.sol"; +import {Point, ECIES} from "../../../src/lib/ECIES.sol"; contract ECIESEncryptTest is Test { // [X] when the public key is invalid diff --git a/test/lib/ECIES/isValid.t.sol b/test/lib/ECIES/isValid.t.sol index a5281a67d..728e1142f 100644 --- a/test/lib/ECIES/isValid.t.sol +++ b/test/lib/ECIES/isValid.t.sol @@ -2,11 +2,11 @@ pragma solidity 0.8.19; // Testing Libraries -import {Test} from "forge-std/Test.sol"; -// import {console2} from "forge-std/console2.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +// import {console2} from "@forge-std-1.9.1/console2.sol"; // ECIES -import {Point, ECIES} from "src/lib/ECIES.sol"; +import {Point, ECIES} from "../../../src/lib/ECIES.sol"; contract ECIESisValidTest is Test { // [X] when the public key is not on the curve y^2 = x^3 + 3 diff --git a/test/lib/ECIES/salt.t.sol b/test/lib/ECIES/salt.t.sol index 47a7e942f..beed7645f 100644 --- a/test/lib/ECIES/salt.t.sol +++ b/test/lib/ECIES/salt.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.19; // Testing Libraries import {ECIESFFITest} from "./ECIES_FFI.sol"; -import {console2} from "forge-std/console2.sol"; +import {console2} from "@forge-std-1.9.1/console2.sol"; contract SaltTest is ECIESFFITest { function test_salt() public { diff --git a/test/lib/MaxPriorityQueue.t.sol b/test/lib/MaxPriorityQueue.t.sol index 927cf725f..8bf6b5977 100644 --- a/test/lib/MaxPriorityQueue.t.sol +++ b/test/lib/MaxPriorityQueue.t.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Test} from "forge-std/Test.sol"; -import {MaxPriorityQueue, Queue, BidEncoding} from "src/lib/MaxPriorityQueue.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {MaxPriorityQueue, Queue, BidEncoding} from "../../src/lib/MaxPriorityQueue.sol"; contract MaxPriorityQueueTest is Test { using MaxPriorityQueue for Queue; diff --git a/test/lib/SqrtPriceMath.t.sol b/test/lib/SqrtPriceMath.t.sol deleted file mode 100644 index 5e0614994..000000000 --- a/test/lib/SqrtPriceMath.t.sol +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {Test} from "forge-std/Test.sol"; - -import {SqrtPriceMath} from "src/lib/uniswap-v3/SqrtPriceMath.sol"; - -contract SqrtPriceMathTest is Test { - address internal constant _TOKEN0 = 0x64aa3364F17a4D01c6f1751Fd97C2BD3D7e7f1D5; - address internal constant _TOKEN1 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; - - // From OHM-WETH pool - // Token id: 562564 - // https://revert.finance/#/account/0x245cc372C84B3645Bf0Ffe6538620B04a217988B (for current amounts) - // https://etherscan.io/address/0x88051b0eea095007d3bef21ab287be961f3d8598#readContract#F11 (for sqrtPriceX96) - uint256 internal constant _AMOUNT0 = 185_339_349_000_000; - uint256 internal constant _AMOUNT1 = 647_257_004_000_000_000_000; - uint160 internal constant __SQRTPRICEX96_ACTUAL = 148_058_773_132_005_407_513_152_397_312_640; - uint160 internal constant _SQRTPRICEX96 = 148_058_773_168_959_257_235_299_580_805_548; - // sqrt((647.257004*1e18)/(185339.349*1e9))*2**96 ~= 148058773132005407513152397312640 - - // [X] when tokenA is _TOKEN0 - // [X] it calculates the correct sqrtPriceX96 - // [X] when tokenA is _TOKEN1 - // [X] it calculates the correct sqrtPriceX96 - // [X] when tokenA decimals is greater than tokenB decimals - // [X] it calculates the correct sqrtPriceX96 - // [X] when tokenA decimals is less than tokenB decimals - // [X] it calculates the correct sqrtPriceX96 - - function test_whenTokenAIs_TOKEN0() public { - uint160 sqrtPriceX96 = SqrtPriceMath.getSqrtPriceX96(_TOKEN0, _TOKEN1, _AMOUNT0, _AMOUNT1); - assertEq(sqrtPriceX96, _SQRTPRICEX96, "SqrtPriceX96"); - } - - function test_whenTokenAIs_TOKEN1() public { - uint160 sqrtPriceX96 = SqrtPriceMath.getSqrtPriceX96(_TOKEN1, _TOKEN0, _AMOUNT1, _AMOUNT0); - assertEq(sqrtPriceX96, _SQRTPRICEX96, "SqrtPriceX96"); - } -} diff --git a/test/lib/Timestamp.t.sol b/test/lib/Timestamp.t.sol index 249ecb2f6..a526d17e2 100644 --- a/test/lib/Timestamp.t.sol +++ b/test/lib/Timestamp.t.sol @@ -2,9 +2,9 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; -import {Timestamp} from "src/lib/Timestamp.sol"; +import {Timestamp} from "../../src/lib/Timestamp.sol"; contract TimestampTest is Test { using Timestamp for uint48; diff --git a/test/lib/WithSalts.sol b/test/lib/WithSalts.sol index 343edf554..d4eec62cf 100644 --- a/test/lib/WithSalts.sol +++ b/test/lib/WithSalts.sol @@ -1,8 +1,8 @@ /// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Test} from "forge-std/Test.sol"; -import {stdJson} from "forge-std/StdJson.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {stdJson} from "@forge-std-1.9.1/StdJson.sol"; contract WithSalts is Test { using stdJson for string; diff --git a/test/lib/mocks/MockFeeOnTransferERC20.sol b/test/lib/mocks/MockFeeOnTransferERC20.sol index da623d74f..d57153894 100644 --- a/test/lib/mocks/MockFeeOnTransferERC20.sol +++ b/test/lib/mocks/MockFeeOnTransferERC20.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; +import {MockERC20} from "@solmate-6.7.0/test/utils/mocks/MockERC20.sol"; contract MockFeeOnTransferERC20 is MockERC20 { uint256 public transferFee; diff --git a/test/lib/mocks/MockWrappedDerivative.sol b/test/lib/mocks/MockWrappedDerivative.sol index 8fb216eb4..6e59ee418 100644 --- a/test/lib/mocks/MockWrappedDerivative.sol +++ b/test/lib/mocks/MockWrappedDerivative.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {ERC20} from "solmate/tokens/ERC20.sol"; -import {ERC6909} from "solmate/tokens/ERC6909.sol"; +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; +import {ERC6909} from "@solmate-6.7.0/tokens/ERC6909.sol"; -import {Clone} from "src/lib/clones/Clone.sol"; +import {Clone} from "@clones-with-immutable-args-1.1.1/Clone.sol"; contract MockWrappedDerivative is ERC20, Clone { constructor( diff --git a/test/lib/permit2/Permit2Clone.sol b/test/lib/permit2/Permit2Clone.sol index 2bb5b0d0d..318718a8a 100644 --- a/test/lib/permit2/Permit2Clone.sol +++ b/test/lib/permit2/Permit2Clone.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {IPermit2} from "src/lib/permit2/interfaces/IPermit2.sol"; +import {IPermit2} from "../../../src/lib/permit2/interfaces/IPermit2.sol"; // Local bytecode clone of the canonical Permit2 contract deployed to mainnet. contract Permit2Clone is IPermit2 { diff --git a/test/lib/permit2/Permit2User.sol b/test/lib/permit2/Permit2User.sol index 8d65ff29c..db5c19acc 100644 --- a/test/lib/permit2/Permit2User.sol +++ b/test/lib/permit2/Permit2User.sol @@ -1,10 +1,10 @@ /// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; -import {IPermit2} from "src/lib/permit2/interfaces/IPermit2.sol"; -import {Permit2Clone} from "test/lib/permit2/Permit2Clone.sol"; +import {IPermit2} from "../../../src/lib/permit2/interfaces/IPermit2.sol"; +import {Permit2Clone} from "./Permit2Clone.sol"; /// @title Permit2User /// @notice Helper functions for Permit2 diff --git a/test/lib/uniswap-v2/UniswapV2FactoryClone.sol b/test/lib/uniswap-v2/UniswapV2FactoryClone.sol deleted file mode 100644 index 0e49cb352..000000000 --- a/test/lib/uniswap-v2/UniswapV2FactoryClone.sol +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -import {IUniswapV2Factory} from "src/lib/uniswap-v2/IUniswapV2Factory.sol"; - -contract UniswapV2FactoryClone is IUniswapV2Factory { - // Clone of UniswapV2Factory deployed at: https://etherscan.io/address/0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f#code - constructor() { - bytes memory bytecode = - hex"608060405234801561001057600080fd5b50600436106100885760003560e01c8063a2e74af61161005b578063a2e74af6146100fd578063c9c6539614610132578063e6a439051461016d578063f46901ed146101a857610088565b8063017e7e581461008d578063094b7415146100be5780631e3dd18b146100c6578063574f2ba3146100e3575b600080fd5b6100956101db565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100956101f7565b610095600480360360208110156100dc57600080fd5b5035610213565b6100eb610247565b60408051918252519081900360200190f35b6101306004803603602081101561011357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661024d565b005b6100956004803603604081101561014857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661031a565b6100956004803603604081101561018357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661076d565b610130600480360360208110156101be57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166107a0565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6003818154811061022057fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60035490565b60015473ffffffffffffffffffffffffffffffffffffffff1633146102d357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60008173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156103b757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f556e697377617056323a204944454e544943414c5f4144445245535345530000604482015290519081900360640190fd5b6000808373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16106103f45783856103f7565b84845b909250905073ffffffffffffffffffffffffffffffffffffffff821661047e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f556e697377617056323a205a45524f5f41444452455353000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff82811660009081526002602090815260408083208585168452909152902054161561051f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f556e697377617056323a20504149525f45584953545300000000000000000000604482015290519081900360640190fd5b6060604051806020016105319061086d565b6020820181038252601f19601f82011660405250905060008383604051602001808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140192505050604051602081830303815290604052805190602001209050808251602084016000f5604080517f485cc95500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152868116602483015291519297509087169163485cc9559160448082019260009290919082900301818387803b15801561065e57600080fd5b505af1158015610672573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff84811660008181526002602081815260408084208987168086529083528185208054978d167fffffffffffffffffffffffff000000000000000000000000000000000000000098891681179091559383528185208686528352818520805488168517905560038054600181018255958190527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90950180549097168417909655925483519283529082015281517f0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9929181900390910190a35050505092915050565b600260209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff16331461082657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b612d748061087b8339019056fe60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429a265627a7a723158202760f92d7fa1db6f5aa16307bad65df4ebcc8550c4b1f03755ab8dfd830c178f64736f6c63430005100032"; - assembly { - return(add(bytecode, 0x20), mload(bytecode)) - } - } - - // STUBS - - function feeTo() external view override returns (address) {} - - function feeToSetter() external view override returns (address) {} - - function getPair( - address tokenA, - address tokenB - ) external view override returns (address pair) {} - - function allPairs(uint256) external view override returns (address pair) {} - - function allPairsLength() external view override returns (uint256) {} - - function createPair(address tokenA, address tokenB) external override returns (address pair) {} - - function setFeeTo(address) external override {} - - function setFeeToSetter(address) external override {} -} diff --git a/test/lib/uniswap-v3/NoDelegateCall.sol b/test/lib/uniswap-v3/NoDelegateCall.sol deleted file mode 100644 index 2246541ac..000000000 --- a/test/lib/uniswap-v3/NoDelegateCall.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.8.12; - -/// @title Prevents delegatecall to a contract -/// @notice Base contract that provides a modifier for preventing delegatecall to methods in a child contract -/// @dev Changed pragma to >=0.8.12 -abstract contract NoDelegateCall { - /// @dev The original address of this contract - address private immutable original; - - constructor() { - // Immutables are computed in the init code of the contract, and then inlined into the deployed bytecode. - // In other words, this variable won't change when it's checked at runtime. - original = address(this); - } - - /// @dev Private method is used instead of inlining into modifier because modifiers are copied into each method, - /// and the use of immutable means the address bytes are copied in every place the modifier is used. - function checkNotDelegateCall() private view { - require(address(this) == original); - } - - /// @notice Prevents delegatecall into the modified method - modifier noDelegateCall() { - checkNotDelegateCall(); - _; - } -} diff --git a/test/lib/uniswap-v3/UniswapV3Factory.sol b/test/lib/uniswap-v3/UniswapV3Factory.sol deleted file mode 100644 index bbd48e24a..000000000 --- a/test/lib/uniswap-v3/UniswapV3Factory.sol +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.8.12; - -import {IUniswapV3Factory} from "uniswap-v3-core/interfaces/IUniswapV3Factory.sol"; - -import {UniswapV3PoolDeployer} from "test/lib/uniswap-v3/UniswapV3PoolDeployer.sol"; -import {NoDelegateCall} from "test/lib/uniswap-v3/NoDelegateCall.sol"; - -import {UniswapV3Pool} from "test/lib/uniswap-v3/UniswapV3Pool.sol"; - -/// @title Canonical Uniswap V3 factory -/// @notice Deploys Uniswap V3 pools and manages ownership and control over pool protocol fees -/// @dev Changed pragma to >=0.8.12 -contract UniswapV3Factory is IUniswapV3Factory, UniswapV3PoolDeployer, NoDelegateCall { - /// @inheritdoc IUniswapV3Factory - address public override owner; - - /// @inheritdoc IUniswapV3Factory - mapping(uint24 => int24) public override feeAmountTickSpacing; - /// @inheritdoc IUniswapV3Factory - mapping(address => mapping(address => mapping(uint24 => address))) public override getPool; - - constructor() { - owner = msg.sender; - emit OwnerChanged(address(0), msg.sender); - - feeAmountTickSpacing[500] = 10; - emit FeeAmountEnabled(500, 10); - feeAmountTickSpacing[3000] = 60; - emit FeeAmountEnabled(3000, 60); - feeAmountTickSpacing[10_000] = 200; - emit FeeAmountEnabled(10_000, 200); - } - - /// @inheritdoc IUniswapV3Factory - function createPool( - address tokenA, - address tokenB, - uint24 fee - ) external override noDelegateCall returns (address pool) { - require(tokenA != tokenB); - (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); - require(token0 != address(0)); - int24 tickSpacing = feeAmountTickSpacing[fee]; - require(tickSpacing != 0); - require(getPool[token0][token1][fee] == address(0)); - pool = deploy(address(this), token0, token1, fee, tickSpacing); - getPool[token0][token1][fee] = pool; - // populate mapping in the reverse direction, deliberate choice to avoid the cost of comparing addresses - getPool[token1][token0][fee] = pool; - emit PoolCreated(token0, token1, fee, tickSpacing, pool); - } - - /// @inheritdoc IUniswapV3Factory - function setOwner(address _owner) external override { - require(msg.sender == owner); - emit OwnerChanged(owner, _owner); - owner = _owner; - } - - /// @inheritdoc IUniswapV3Factory - function enableFeeAmount(uint24 fee, int24 tickSpacing) public override { - require(msg.sender == owner); - require(fee < 1_000_000); - // tick spacing is capped at 16384 to prevent the situation where tickSpacing is so large that - // TickBitmap#nextInitializedTickWithinOneWord overflows int24 container from a valid tick - // 16384 ticks represents a >5x price change with ticks of 1 bips - require(tickSpacing > 0 && tickSpacing < 16_384); - require(feeAmountTickSpacing[fee] == 0); - - feeAmountTickSpacing[fee] = tickSpacing; - emit FeeAmountEnabled(fee, tickSpacing); - } -} diff --git a/test/lib/uniswap-v3/UniswapV3Pool.sol b/test/lib/uniswap-v3/UniswapV3Pool.sol deleted file mode 100644 index 0fc03c031..000000000 --- a/test/lib/uniswap-v3/UniswapV3Pool.sol +++ /dev/null @@ -1,928 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.8.12; - -import { - IUniswapV3PoolImmutables, - IUniswapV3PoolState, - IUniswapV3PoolActions, - IUniswapV3PoolDerivedState, - IUniswapV3PoolOwnerActions, - IUniswapV3Pool -} from "uniswap-v3-core/interfaces/IUniswapV3Pool.sol"; - -import {NoDelegateCall} from "test/lib/uniswap-v3/NoDelegateCall.sol"; - -import {SafeCast} from "uniswap-v3-core/libraries/SafeCast.sol"; -import {Tick} from "uniswap-v3-core/libraries/Tick.sol"; -import {TickBitmap} from "uniswap-v3-core/libraries/TickBitmap.sol"; -import {Position} from "uniswap-v3-core/libraries/Position.sol"; -import {Oracle} from "uniswap-v3-core/libraries/Oracle.sol"; - -import {FullMath} from "uniswap-v3-core/libraries/FullMath.sol"; -import {FixedPoint128} from "uniswap-v3-core/libraries/FixedPoint128.sol"; -import {TransferHelper} from "uniswap-v3-core/libraries/TransferHelper.sol"; -import {TickMath} from "uniswap-v3-core/libraries/TickMath.sol"; -import {SqrtPriceMath} from "uniswap-v3-core/libraries/SqrtPriceMath.sol"; -import {SwapMath} from "uniswap-v3-core/libraries/SwapMath.sol"; - -import {IUniswapV3PoolDeployer} from "uniswap-v3-core/interfaces/IUniswapV3PoolDeployer.sol"; -import {IUniswapV3Factory} from "uniswap-v3-core/interfaces/IUniswapV3Factory.sol"; -import {IERC20Minimal} from "uniswap-v3-core/interfaces/IERC20Minimal.sol"; -import {IUniswapV3MintCallback} from - "uniswap-v3-core/interfaces/callback/IUniswapV3MintCallback.sol"; -import {IUniswapV3SwapCallback} from - "uniswap-v3-core/interfaces/callback/IUniswapV3SwapCallback.sol"; -import {IUniswapV3FlashCallback} from - "uniswap-v3-core/interfaces/callback/IUniswapV3FlashCallback.sol"; - -/// @dev Changed pragma to >=0.8.12 -contract UniswapV3Pool is IUniswapV3Pool, NoDelegateCall { - using SafeCast for uint256; - using SafeCast for int256; - using Tick for mapping(int24 => Tick.Info); - using TickBitmap for mapping(int16 => uint256); - using Position for mapping(bytes32 => Position.Info); - using Position for Position.Info; - using Oracle for Oracle.Observation[65_535]; - - /// @inheritdoc IUniswapV3PoolImmutables - address public immutable override factory; - /// @inheritdoc IUniswapV3PoolImmutables - address public immutable override token0; - /// @inheritdoc IUniswapV3PoolImmutables - address public immutable override token1; - /// @inheritdoc IUniswapV3PoolImmutables - uint24 public immutable override fee; - - /// @inheritdoc IUniswapV3PoolImmutables - int24 public immutable override tickSpacing; - - /// @inheritdoc IUniswapV3PoolImmutables - uint128 public immutable override maxLiquidityPerTick; - - struct Slot0 { - // the current price - uint160 sqrtPriceX96; - // the current tick - int24 tick; - // the most-recently updated index of the observations array - uint16 observationIndex; - // the current maximum number of observations that are being stored - uint16 observationCardinality; - // the next maximum number of observations to store, triggered in observations.write - uint16 observationCardinalityNext; - // the current protocol fee as a percentage of the swap fee taken on withdrawal - // represented as an integer denominator (1/x)% - uint8 feeProtocol; - // whether the pool is locked - bool unlocked; - } - /// @inheritdoc IUniswapV3PoolState - - Slot0 public override slot0; - - /// @inheritdoc IUniswapV3PoolState - uint256 public override feeGrowthGlobal0X128; - /// @inheritdoc IUniswapV3PoolState - uint256 public override feeGrowthGlobal1X128; - - // accumulated protocol fees in token0/token1 units - struct ProtocolFees { - uint128 token0; - uint128 token1; - } - /// @inheritdoc IUniswapV3PoolState - - ProtocolFees public override protocolFees; - - /// @inheritdoc IUniswapV3PoolState - uint128 public override liquidity; - - /// @inheritdoc IUniswapV3PoolState - mapping(int24 => Tick.Info) public override ticks; - /// @inheritdoc IUniswapV3PoolState - mapping(int16 => uint256) public override tickBitmap; - /// @inheritdoc IUniswapV3PoolState - mapping(bytes32 => Position.Info) public override positions; - /// @inheritdoc IUniswapV3PoolState - Oracle.Observation[65_535] public override observations; - - /// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance - /// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because - /// we use balance checks to determine the payment status of interactions such as mint, swap and flash. - modifier lock() { - if (!slot0.unlocked) revert LOK(); - slot0.unlocked = false; - _; - slot0.unlocked = true; - } - - /// @dev Prevents calling a function from anyone except the address returned by IUniswapV3Factory#owner() - modifier onlyFactoryOwner() { - require(msg.sender == IUniswapV3Factory(factory).owner()); - _; - } - - constructor() { - int24 _tickSpacing; - (factory, token0, token1, fee, _tickSpacing) = - IUniswapV3PoolDeployer(msg.sender).parameters(); - tickSpacing = _tickSpacing; - - maxLiquidityPerTick = Tick.tickSpacingToMaxLiquidityPerTick(_tickSpacing); - } - - /// @dev Common checks for valid tick inputs. - function checkTicks(int24 tickLower, int24 tickUpper) private pure { - if (tickLower >= tickUpper) revert TLU(); - if (tickLower < TickMath.MIN_TICK) revert TLM(); - if (tickUpper > TickMath.MAX_TICK) revert TUM(); - } - - /// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests. - function _blockTimestamp() internal view virtual returns (uint32) { - return uint32(block.timestamp); // truncation is desired - } - - /// @dev Get the pool's balance of token0 - /// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize - /// check - function balance0() private view returns (uint256) { - (bool success, bytes memory data) = token0.staticcall( - abi.encodeWithSelector(IERC20Minimal.balanceOf.selector, address(this)) - ); - require(success && data.length >= 32); - return abi.decode(data, (uint256)); - } - - /// @dev Get the pool's balance of token1 - /// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize - /// check - function balance1() private view returns (uint256) { - (bool success, bytes memory data) = token1.staticcall( - abi.encodeWithSelector(IERC20Minimal.balanceOf.selector, address(this)) - ); - require(success && data.length >= 32); - return abi.decode(data, (uint256)); - } - - /// @inheritdoc IUniswapV3PoolDerivedState - function snapshotCumulativesInside( - int24 tickLower, - int24 tickUpper - ) - external - view - override - noDelegateCall - returns ( - int56 tickCumulativeInside, - uint160 secondsPerLiquidityInsideX128, - uint32 secondsInside - ) - { - checkTicks(tickLower, tickUpper); - - int56 tickCumulativeLower; - int56 tickCumulativeUpper; - uint160 secondsPerLiquidityOutsideLowerX128; - uint160 secondsPerLiquidityOutsideUpperX128; - uint32 secondsOutsideLower; - uint32 secondsOutsideUpper; - - { - Tick.Info storage lower = ticks[tickLower]; - Tick.Info storage upper = ticks[tickUpper]; - bool initializedLower; - ( - tickCumulativeLower, - secondsPerLiquidityOutsideLowerX128, - secondsOutsideLower, - initializedLower - ) = ( - lower.tickCumulativeOutside, - lower.secondsPerLiquidityOutsideX128, - lower.secondsOutside, - lower.initialized - ); - require(initializedLower); - - bool initializedUpper; - ( - tickCumulativeUpper, - secondsPerLiquidityOutsideUpperX128, - secondsOutsideUpper, - initializedUpper - ) = ( - upper.tickCumulativeOutside, - upper.secondsPerLiquidityOutsideX128, - upper.secondsOutside, - upper.initialized - ); - require(initializedUpper); - } - - Slot0 memory _slot0 = slot0; - - unchecked { - if (_slot0.tick < tickLower) { - return ( - tickCumulativeLower - tickCumulativeUpper, - secondsPerLiquidityOutsideLowerX128 - secondsPerLiquidityOutsideUpperX128, - secondsOutsideLower - secondsOutsideUpper - ); - } else if (_slot0.tick < tickUpper) { - uint32 time = _blockTimestamp(); - (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) = observations - .observeSingle( - time, - 0, - _slot0.tick, - _slot0.observationIndex, - liquidity, - _slot0.observationCardinality - ); - return ( - tickCumulative - tickCumulativeLower - tickCumulativeUpper, - secondsPerLiquidityCumulativeX128 - secondsPerLiquidityOutsideLowerX128 - - secondsPerLiquidityOutsideUpperX128, - time - secondsOutsideLower - secondsOutsideUpper - ); - } else { - return ( - tickCumulativeUpper - tickCumulativeLower, - secondsPerLiquidityOutsideUpperX128 - secondsPerLiquidityOutsideLowerX128, - secondsOutsideUpper - secondsOutsideLower - ); - } - } - } - - /// @inheritdoc IUniswapV3PoolDerivedState - function observe(uint32[] calldata secondsAgos) - external - view - override - noDelegateCall - returns ( - int56[] memory tickCumulatives, - uint160[] memory secondsPerLiquidityCumulativeX128s - ) - { - return observations.observe( - _blockTimestamp(), - secondsAgos, - slot0.tick, - slot0.observationIndex, - liquidity, - slot0.observationCardinality - ); - } - - /// @inheritdoc IUniswapV3PoolActions - function increaseObservationCardinalityNext(uint16 observationCardinalityNext) - external - override - lock - noDelegateCall - { - uint16 observationCardinalityNextOld = slot0.observationCardinalityNext; // for the event - uint16 observationCardinalityNextNew = - observations.grow(observationCardinalityNextOld, observationCardinalityNext); - slot0.observationCardinalityNext = observationCardinalityNextNew; - if (observationCardinalityNextOld != observationCardinalityNextNew) { - emit IncreaseObservationCardinalityNext( - observationCardinalityNextOld, observationCardinalityNextNew - ); - } - } - - /// @inheritdoc IUniswapV3PoolActions - /// @dev not locked because it initializes unlocked - function initialize(uint160 sqrtPriceX96) external override { - if (slot0.sqrtPriceX96 != 0) revert AI(); - - int24 tick = TickMath.getTickAtSqrtRatio(sqrtPriceX96); - - (uint16 cardinality, uint16 cardinalityNext) = observations.initialize(_blockTimestamp()); - - slot0 = Slot0({ - sqrtPriceX96: sqrtPriceX96, - tick: tick, - observationIndex: 0, - observationCardinality: cardinality, - observationCardinalityNext: cardinalityNext, - feeProtocol: 0, - unlocked: true - }); - - emit Initialize(sqrtPriceX96, tick); - } - - struct ModifyPositionParams { - // the address that owns the position - address owner; - // the lower and upper tick of the position - int24 tickLower; - int24 tickUpper; - // any change in liquidity - int128 liquidityDelta; - } - - /// @dev Effect some changes to a position - /// @param params the position details and the change to the position's liquidity to effect - /// @return position a storage pointer referencing the position with the given owner and tick range - /// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient - /// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient - function _modifyPosition(ModifyPositionParams memory params) - private - noDelegateCall - returns (Position.Info storage position, int256 amount0, int256 amount1) - { - checkTicks(params.tickLower, params.tickUpper); - - Slot0 memory _slot0 = slot0; // SLOAD for gas optimization - - position = _updatePosition( - params.owner, params.tickLower, params.tickUpper, params.liquidityDelta, _slot0.tick - ); - - if (params.liquidityDelta != 0) { - if (_slot0.tick < params.tickLower) { - // current tick is below the passed range; liquidity can only become in range by crossing from left to - // right, when we'll need _more_ token0 (it's becoming more valuable) so user must provide it - amount0 = SqrtPriceMath.getAmount0Delta( - TickMath.getSqrtRatioAtTick(params.tickLower), - TickMath.getSqrtRatioAtTick(params.tickUpper), - params.liquidityDelta - ); - } else if (_slot0.tick < params.tickUpper) { - // current tick is inside the passed range - uint128 liquidityBefore = liquidity; // SLOAD for gas optimization - - // write an oracle entry - (slot0.observationIndex, slot0.observationCardinality) = observations.write( - _slot0.observationIndex, - _blockTimestamp(), - _slot0.tick, - liquidityBefore, - _slot0.observationCardinality, - _slot0.observationCardinalityNext - ); - - amount0 = SqrtPriceMath.getAmount0Delta( - _slot0.sqrtPriceX96, - TickMath.getSqrtRatioAtTick(params.tickUpper), - params.liquidityDelta - ); - amount1 = SqrtPriceMath.getAmount1Delta( - TickMath.getSqrtRatioAtTick(params.tickLower), - _slot0.sqrtPriceX96, - params.liquidityDelta - ); - - liquidity = params.liquidityDelta < 0 - ? liquidityBefore - uint128(-params.liquidityDelta) - : liquidityBefore + uint128(params.liquidityDelta); - } else { - // current tick is above the passed range; liquidity can only become in range by crossing from right to - // left, when we'll need _more_ token1 (it's becoming more valuable) so user must provide it - amount1 = SqrtPriceMath.getAmount1Delta( - TickMath.getSqrtRatioAtTick(params.tickLower), - TickMath.getSqrtRatioAtTick(params.tickUpper), - params.liquidityDelta - ); - } - } - } - - /// @dev Gets and updates a position with the given liquidity delta - /// @param owner the owner of the position - /// @param tickLower the lower tick of the position's tick range - /// @param tickUpper the upper tick of the position's tick range - /// @param tick the current tick, passed to avoid sloads - function _updatePosition( - address owner, - int24 tickLower, - int24 tickUpper, - int128 liquidityDelta, - int24 tick - ) private returns (Position.Info storage position) { - position = positions.get(owner, tickLower, tickUpper); - - uint256 _feeGrowthGlobal0X128 = feeGrowthGlobal0X128; // SLOAD for gas optimization - uint256 _feeGrowthGlobal1X128 = feeGrowthGlobal1X128; // SLOAD for gas optimization - - // if we need to update the ticks, do it - bool flippedLower; - bool flippedUpper; - if (liquidityDelta != 0) { - uint32 time = _blockTimestamp(); - (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) = observations - .observeSingle( - time, 0, slot0.tick, slot0.observationIndex, liquidity, slot0.observationCardinality - ); - - flippedLower = ticks.update( - tickLower, - tick, - liquidityDelta, - _feeGrowthGlobal0X128, - _feeGrowthGlobal1X128, - secondsPerLiquidityCumulativeX128, - tickCumulative, - time, - false, - maxLiquidityPerTick - ); - flippedUpper = ticks.update( - tickUpper, - tick, - liquidityDelta, - _feeGrowthGlobal0X128, - _feeGrowthGlobal1X128, - secondsPerLiquidityCumulativeX128, - tickCumulative, - time, - true, - maxLiquidityPerTick - ); - - if (flippedLower) { - tickBitmap.flipTick(tickLower, tickSpacing); - } - if (flippedUpper) { - tickBitmap.flipTick(tickUpper, tickSpacing); - } - } - - (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) = ticks.getFeeGrowthInside( - tickLower, tickUpper, tick, _feeGrowthGlobal0X128, _feeGrowthGlobal1X128 - ); - - position.update(liquidityDelta, feeGrowthInside0X128, feeGrowthInside1X128); - - // clear any tick data that is no longer needed - if (liquidityDelta < 0) { - if (flippedLower) { - ticks.clear(tickLower); - } - if (flippedUpper) { - ticks.clear(tickUpper); - } - } - } - - /// @inheritdoc IUniswapV3PoolActions - /// @dev noDelegateCall is applied indirectly via _modifyPosition - function mint( - address recipient, - int24 tickLower, - int24 tickUpper, - uint128 amount, - bytes calldata data - ) external override lock returns (uint256 amount0, uint256 amount1) { - require(amount > 0); - (, int256 amount0Int, int256 amount1Int) = _modifyPosition( - ModifyPositionParams({ - owner: recipient, - tickLower: tickLower, - tickUpper: tickUpper, - liquidityDelta: int256(uint256(amount)).toInt128() - }) - ); - - amount0 = uint256(amount0Int); - amount1 = uint256(amount1Int); - - uint256 balance0Before; - uint256 balance1Before; - if (amount0 > 0) balance0Before = balance0(); - if (amount1 > 0) balance1Before = balance1(); - IUniswapV3MintCallback(msg.sender).uniswapV3MintCallback(amount0, amount1, data); - if (amount0 > 0 && balance0Before + amount0 > balance0()) revert M0(); - if (amount1 > 0 && balance1Before + amount1 > balance1()) revert M1(); - - emit Mint(msg.sender, recipient, tickLower, tickUpper, amount, amount0, amount1); - } - - /// @inheritdoc IUniswapV3PoolActions - function collect( - address recipient, - int24 tickLower, - int24 tickUpper, - uint128 amount0Requested, - uint128 amount1Requested - ) external override lock returns (uint128 amount0, uint128 amount1) { - // we don't need to checkTicks here, because invalid positions will never have non-zero tokensOwed{0,1} - Position.Info storage position = positions.get(msg.sender, tickLower, tickUpper); - - amount0 = amount0Requested > position.tokensOwed0 ? position.tokensOwed0 : amount0Requested; - amount1 = amount1Requested > position.tokensOwed1 ? position.tokensOwed1 : amount1Requested; - - unchecked { - if (amount0 > 0) { - position.tokensOwed0 -= amount0; - TransferHelper.safeTransfer(token0, recipient, amount0); - } - if (amount1 > 0) { - position.tokensOwed1 -= amount1; - TransferHelper.safeTransfer(token1, recipient, amount1); - } - } - - emit Collect(msg.sender, recipient, tickLower, tickUpper, amount0, amount1); - } - - /// @inheritdoc IUniswapV3PoolActions - /// @dev noDelegateCall is applied indirectly via _modifyPosition - function burn( - int24 tickLower, - int24 tickUpper, - uint128 amount - ) external override lock returns (uint256 amount0, uint256 amount1) { - unchecked { - (Position.Info storage position, int256 amount0Int, int256 amount1Int) = _modifyPosition( - ModifyPositionParams({ - owner: msg.sender, - tickLower: tickLower, - tickUpper: tickUpper, - liquidityDelta: -int256(uint256(amount)).toInt128() - }) - ); - - amount0 = uint256(-amount0Int); - amount1 = uint256(-amount1Int); - - if (amount0 > 0 || amount1 > 0) { - (position.tokensOwed0, position.tokensOwed1) = ( - position.tokensOwed0 + uint128(amount0), position.tokensOwed1 + uint128(amount1) - ); - } - - emit Burn(msg.sender, tickLower, tickUpper, amount, amount0, amount1); - } - } - - struct SwapCache { - // the protocol fee for the input token - uint8 feeProtocol; - // liquidity at the beginning of the swap - uint128 liquidityStart; - // the timestamp of the current block - uint32 blockTimestamp; - // the current value of the tick accumulator, computed only if we cross an initialized tick - int56 tickCumulative; - // the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick - uint160 secondsPerLiquidityCumulativeX128; - // whether we've computed and cached the above two accumulators - bool computedLatestObservation; - } - - // the top level state of the swap, the results of which are recorded in storage at the end - struct SwapState { - // the amount remaining to be swapped in/out of the input/output asset - int256 amountSpecifiedRemaining; - // the amount already swapped out/in of the output/input asset - int256 amountCalculated; - // current sqrt(price) - uint160 sqrtPriceX96; - // the tick associated with the current price - int24 tick; - // the global fee growth of the input token - uint256 feeGrowthGlobalX128; - // amount of input token paid as protocol fee - uint128 protocolFee; - // the current liquidity in range - uint128 liquidity; - } - - struct StepComputations { - // the price at the beginning of the step - uint160 sqrtPriceStartX96; - // the next tick to swap to from the current tick in the swap direction - int24 tickNext; - // whether tickNext is initialized or not - bool initialized; - // sqrt(price) for the next tick (1/0) - uint160 sqrtPriceNextX96; - // how much is being swapped in in this step - uint256 amountIn; - // how much is being swapped out - uint256 amountOut; - // how much fee is being paid in - uint256 feeAmount; - } - - /// @inheritdoc IUniswapV3PoolActions - function swap( - address recipient, - bool zeroForOne, - int256 amountSpecified, - uint160 sqrtPriceLimitX96, - bytes calldata data - ) external override noDelegateCall returns (int256 amount0, int256 amount1) { - if (amountSpecified == 0) revert AS(); - - Slot0 memory slot0Start = slot0; - - if (!slot0Start.unlocked) revert LOK(); - require( - zeroForOne - ? sqrtPriceLimitX96 < slot0Start.sqrtPriceX96 - && sqrtPriceLimitX96 > TickMath.MIN_SQRT_RATIO - : sqrtPriceLimitX96 > slot0Start.sqrtPriceX96 - && sqrtPriceLimitX96 < TickMath.MAX_SQRT_RATIO, - "SPL" - ); - - slot0.unlocked = false; - - SwapCache memory cache = SwapCache({ - liquidityStart: liquidity, - blockTimestamp: _blockTimestamp(), - feeProtocol: zeroForOne ? (slot0Start.feeProtocol % 16) : (slot0Start.feeProtocol >> 4), - secondsPerLiquidityCumulativeX128: 0, - tickCumulative: 0, - computedLatestObservation: false - }); - - bool exactInput = amountSpecified > 0; - - SwapState memory state = SwapState({ - amountSpecifiedRemaining: amountSpecified, - amountCalculated: 0, - sqrtPriceX96: slot0Start.sqrtPriceX96, - tick: slot0Start.tick, - feeGrowthGlobalX128: zeroForOne ? feeGrowthGlobal0X128 : feeGrowthGlobal1X128, - protocolFee: 0, - liquidity: cache.liquidityStart - }); - - // continue swapping as long as we haven't used the entire input/output and haven't reached the price limit - while (state.amountSpecifiedRemaining != 0 && state.sqrtPriceX96 != sqrtPriceLimitX96) { - StepComputations memory step; - - step.sqrtPriceStartX96 = state.sqrtPriceX96; - - (step.tickNext, step.initialized) = - tickBitmap.nextInitializedTickWithinOneWord(state.tick, tickSpacing, zeroForOne); - - // ensure that we do not overshoot the min/max tick, as the tick bitmap is not aware of these bounds - if (step.tickNext < TickMath.MIN_TICK) { - step.tickNext = TickMath.MIN_TICK; - } else if (step.tickNext > TickMath.MAX_TICK) { - step.tickNext = TickMath.MAX_TICK; - } - - // get the price for the next tick - step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext); - - // compute values to swap to the target tick, price limit, or point where input/output amount is exhausted - (state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount) = SwapMath - .computeSwapStep( - state.sqrtPriceX96, - ( - zeroForOne - ? step.sqrtPriceNextX96 < sqrtPriceLimitX96 - : step.sqrtPriceNextX96 > sqrtPriceLimitX96 - ) ? sqrtPriceLimitX96 : step.sqrtPriceNextX96, - state.liquidity, - state.amountSpecifiedRemaining, - fee - ); - - if (exactInput) { - // safe because we test that amountSpecified > amountIn + feeAmount in SwapMath - unchecked { - state.amountSpecifiedRemaining -= (step.amountIn + step.feeAmount).toInt256(); - } - state.amountCalculated -= step.amountOut.toInt256(); - } else { - unchecked { - state.amountSpecifiedRemaining += step.amountOut.toInt256(); - } - state.amountCalculated += (step.amountIn + step.feeAmount).toInt256(); - } - - // if the protocol fee is on, calculate how much is owed, decrement feeAmount, and increment protocolFee - if (cache.feeProtocol > 0) { - unchecked { - uint256 delta = step.feeAmount / cache.feeProtocol; - step.feeAmount -= delta; - state.protocolFee += uint128(delta); - } - } - - // update global fee tracker - if (state.liquidity > 0) { - unchecked { - state.feeGrowthGlobalX128 += - FullMath.mulDiv(step.feeAmount, FixedPoint128.Q128, state.liquidity); - } - } - - // shift tick if we reached the next price - if (state.sqrtPriceX96 == step.sqrtPriceNextX96) { - // if the tick is initialized, run the tick transition - if (step.initialized) { - // check for the placeholder value, which we replace with the actual value the first time the swap - // crosses an initialized tick - if (!cache.computedLatestObservation) { - (cache.tickCumulative, cache.secondsPerLiquidityCumulativeX128) = - observations.observeSingle( - cache.blockTimestamp, - 0, - slot0Start.tick, - slot0Start.observationIndex, - cache.liquidityStart, - slot0Start.observationCardinality - ); - cache.computedLatestObservation = true; - } - int128 liquidityNet = ticks.cross( - step.tickNext, - (zeroForOne ? state.feeGrowthGlobalX128 : feeGrowthGlobal0X128), - (zeroForOne ? feeGrowthGlobal1X128 : state.feeGrowthGlobalX128), - cache.secondsPerLiquidityCumulativeX128, - cache.tickCumulative, - cache.blockTimestamp - ); - // if we're moving leftward, we interpret liquidityNet as the opposite sign - // safe because liquidityNet cannot be type(int128).min - unchecked { - if (zeroForOne) liquidityNet = -liquidityNet; - } - - state.liquidity = liquidityNet < 0 - ? state.liquidity - uint128(-liquidityNet) - : state.liquidity + uint128(liquidityNet); - } - - unchecked { - state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext; - } - } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) { - // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved - state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96); - } - } - - // update tick and write an oracle entry if the tick change - if (state.tick != slot0Start.tick) { - (uint16 observationIndex, uint16 observationCardinality) = observations.write( - slot0Start.observationIndex, - cache.blockTimestamp, - slot0Start.tick, - cache.liquidityStart, - slot0Start.observationCardinality, - slot0Start.observationCardinalityNext - ); - (slot0.sqrtPriceX96, slot0.tick, slot0.observationIndex, slot0.observationCardinality) = - (state.sqrtPriceX96, state.tick, observationIndex, observationCardinality); - } else { - // otherwise just update the price - slot0.sqrtPriceX96 = state.sqrtPriceX96; - } - - // update liquidity if it changed - if (cache.liquidityStart != state.liquidity) liquidity = state.liquidity; - - // update fee growth global and, if necessary, protocol fees - // overflow is acceptable, protocol has to withdraw before it hits type(uint128).max fees - if (zeroForOne) { - feeGrowthGlobal0X128 = state.feeGrowthGlobalX128; - unchecked { - if (state.protocolFee > 0) protocolFees.token0 += state.protocolFee; - } - } else { - feeGrowthGlobal1X128 = state.feeGrowthGlobalX128; - unchecked { - if (state.protocolFee > 0) protocolFees.token1 += state.protocolFee; - } - } - - unchecked { - (amount0, amount1) = zeroForOne == exactInput - ? (amountSpecified - state.amountSpecifiedRemaining, state.amountCalculated) - : (state.amountCalculated, amountSpecified - state.amountSpecifiedRemaining); - } - - // do the transfers and collect payment - if (zeroForOne) { - unchecked { - if (amount1 < 0) TransferHelper.safeTransfer(token1, recipient, uint256(-amount1)); - } - - uint256 balance0Before = balance0(); - IUniswapV3SwapCallback(msg.sender).uniswapV3SwapCallback(amount0, amount1, data); - if (balance0Before + uint256(amount0) > balance0()) revert IIA(); - } else { - unchecked { - if (amount0 < 0) TransferHelper.safeTransfer(token0, recipient, uint256(-amount0)); - } - - uint256 balance1Before = balance1(); - IUniswapV3SwapCallback(msg.sender).uniswapV3SwapCallback(amount0, amount1, data); - if (balance1Before + uint256(amount1) > balance1()) revert IIA(); - } - - emit Swap( - msg.sender, recipient, amount0, amount1, state.sqrtPriceX96, state.liquidity, state.tick - ); - slot0.unlocked = true; - } - - /// @inheritdoc IUniswapV3PoolActions - function flash( - address recipient, - uint256 amount0, - uint256 amount1, - bytes calldata data - ) external override lock noDelegateCall { - uint128 _liquidity = liquidity; - if (_liquidity <= 0) revert L(); - - uint256 fee0 = FullMath.mulDivRoundingUp(amount0, fee, 1e6); - uint256 fee1 = FullMath.mulDivRoundingUp(amount1, fee, 1e6); - uint256 balance0Before = balance0(); - uint256 balance1Before = balance1(); - - if (amount0 > 0) TransferHelper.safeTransfer(token0, recipient, amount0); - if (amount1 > 0) TransferHelper.safeTransfer(token1, recipient, amount1); - - IUniswapV3FlashCallback(msg.sender).uniswapV3FlashCallback(fee0, fee1, data); - - uint256 balance0After = balance0(); - uint256 balance1After = balance1(); - - if (balance0Before + fee0 > balance0After) revert F0(); - if (balance1Before + fee1 > balance1After) revert F1(); - - unchecked { - // sub is safe because we know balanceAfter is gt balanceBefore by at least fee - uint256 paid0 = balance0After - balance0Before; - uint256 paid1 = balance1After - balance1Before; - - if (paid0 > 0) { - uint8 feeProtocol0 = slot0.feeProtocol % 16; - uint256 pFees0 = feeProtocol0 == 0 ? 0 : paid0 / feeProtocol0; - if (uint128(pFees0) > 0) protocolFees.token0 += uint128(pFees0); - feeGrowthGlobal0X128 += - FullMath.mulDiv(paid0 - pFees0, FixedPoint128.Q128, _liquidity); - } - if (paid1 > 0) { - uint8 feeProtocol1 = slot0.feeProtocol >> 4; - uint256 pFees1 = feeProtocol1 == 0 ? 0 : paid1 / feeProtocol1; - if (uint128(pFees1) > 0) protocolFees.token1 += uint128(pFees1); - feeGrowthGlobal1X128 += - FullMath.mulDiv(paid1 - pFees1, FixedPoint128.Q128, _liquidity); - } - - emit Flash(msg.sender, recipient, amount0, amount1, paid0, paid1); - } - } - - /// @inheritdoc IUniswapV3PoolOwnerActions - function setFeeProtocol( - uint8 feeProtocol0, - uint8 feeProtocol1 - ) external override lock onlyFactoryOwner { - unchecked { - require( - (feeProtocol0 == 0 || (feeProtocol0 >= 4 && feeProtocol0 <= 10)) - && (feeProtocol1 == 0 || (feeProtocol1 >= 4 && feeProtocol1 <= 10)) - ); - uint8 feeProtocolOld = slot0.feeProtocol; - slot0.feeProtocol = feeProtocol0 + (feeProtocol1 << 4); - emit SetFeeProtocol( - feeProtocolOld % 16, feeProtocolOld >> 4, feeProtocol0, feeProtocol1 - ); - } - } - - /// @inheritdoc IUniswapV3PoolOwnerActions - function collectProtocol( - address recipient, - uint128 amount0Requested, - uint128 amount1Requested - ) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) { - amount0 = amount0Requested > protocolFees.token0 ? protocolFees.token0 : amount0Requested; - amount1 = amount1Requested > protocolFees.token1 ? protocolFees.token1 : amount1Requested; - - unchecked { - if (amount0 > 0) { - if (amount0 == protocolFees.token0) amount0--; // ensure that the slot is not cleared, for gas savings - protocolFees.token0 -= amount0; - TransferHelper.safeTransfer(token0, recipient, amount0); - } - if (amount1 > 0) { - if (amount1 == protocolFees.token1) amount1--; // ensure that the slot is not cleared, for gas savings - protocolFees.token1 -= amount1; - TransferHelper.safeTransfer(token1, recipient, amount1); - } - } - - emit CollectProtocol(msg.sender, recipient, amount0, amount1); - } -} diff --git a/test/lib/uniswap-v3/UniswapV3PoolDeployer.sol b/test/lib/uniswap-v3/UniswapV3PoolDeployer.sol deleted file mode 100644 index ff13069cc..000000000 --- a/test/lib/uniswap-v3/UniswapV3PoolDeployer.sol +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.8.12; - -import {IUniswapV3PoolDeployer} from "uniswap-v3-core/interfaces/IUniswapV3PoolDeployer.sol"; - -import {UniswapV3Pool} from "test/lib/uniswap-v3/UniswapV3Pool.sol"; - -/// @dev Changed pragma to >=0.8.12 -contract UniswapV3PoolDeployer is IUniswapV3PoolDeployer { - struct Parameters { - address factory; - address token0; - address token1; - uint24 fee; - int24 tickSpacing; - } - - /// @inheritdoc IUniswapV3PoolDeployer - Parameters public override parameters; - - /// @dev Deploys a pool with the given parameters by transiently setting the parameters storage slot and then - /// clearing it after deploying the pool. - /// @param factory The contract address of the Uniswap V3 factory - /// @param token0 The first token of the pool by address sort order - /// @param token1 The second token of the pool by address sort order - /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip - /// @param tickSpacing The spacing between usable ticks - function deploy( - address factory, - address token0, - address token1, - uint24 fee, - int24 tickSpacing - ) internal returns (address pool) { - parameters = Parameters({ - factory: factory, - token0: token0, - token1: token1, - fee: fee, - tickSpacing: tickSpacing - }); - pool = address(new UniswapV3Pool{salt: keccak256(abi.encode(token0, token1, fee))}()); - delete parameters; - } -} diff --git a/test/modules/Auction/MockAtomicAuctionModule.sol b/test/modules/Auction/MockAtomicAuctionModule.sol index a3ec9503d..368a5b2d1 100644 --- a/test/modules/Auction/MockAtomicAuctionModule.sol +++ b/test/modules/Auction/MockAtomicAuctionModule.sol @@ -2,11 +2,11 @@ pragma solidity 0.8.19; // Modules -import {Veecode, toKeycode, wrapVeecode} from "src/modules/Modules.sol"; +import {Veecode, toKeycode, wrapVeecode} from "../../../src/modules/Modules.sol"; // Auctions -import {AuctionModule} from "src/modules/Auction.sol"; -import {AtomicAuctionModule} from "src/modules/auctions/AtomicAuctionModule.sol"; +import {AuctionModule} from "../../../src/modules/Auction.sol"; +import {AtomicAuctionModule} from "../../../src/modules/auctions/AtomicAuctionModule.sol"; contract MockAtomicAuctionModule is AtomicAuctionModule { mapping(uint256 => uint256) public payoutData; diff --git a/test/modules/Auction/MockBatchAuctionModule.sol b/test/modules/Auction/MockBatchAuctionModule.sol index fb3fdd11c..2f8ef5aa7 100644 --- a/test/modules/Auction/MockBatchAuctionModule.sol +++ b/test/modules/Auction/MockBatchAuctionModule.sol @@ -2,13 +2,13 @@ pragma solidity 0.8.19; // Modules -import {Veecode, toKeycode, wrapVeecode} from "src/modules/Modules.sol"; -import {BatchAuctionModule} from "src/modules/auctions/BatchAuctionModule.sol"; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; +import {Veecode, toKeycode, wrapVeecode} from "../../../src/modules/Modules.sol"; +import {BatchAuctionModule} from "../../../src/modules/auctions/BatchAuctionModule.sol"; +import {IBatchAuction} from "../../../src/interfaces/modules/IBatchAuction.sol"; // Auctions -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {AuctionModule} from "src/modules/Auction.sol"; +import {IAuction} from "../../../src/interfaces/modules/IAuction.sol"; +import {AuctionModule} from "../../../src/modules/Auction.sol"; contract MockBatchAuctionModule is BatchAuctionModule { enum LotStatus { diff --git a/test/modules/Auction/auction.t.sol b/test/modules/Auction/auction.t.sol index 6e03e6b39..b9722c7ad 100644 --- a/test/modules/Auction/auction.t.sol +++ b/test/modules/Auction/auction.t.sol @@ -2,23 +2,23 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; -import {console2} from "forge-std/console2.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {console2} from "@forge-std-1.9.1/console2.sol"; // Mocks -import {MockERC20} from "lib/solmate/src/test/utils/mocks/MockERC20.sol"; -import {MockAtomicAuctionModule} from "test/modules/Auction/MockAtomicAuctionModule.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; +import {MockERC20} from "@solmate-6.7.0/test/utils/mocks/MockERC20.sol"; +import {MockAtomicAuctionModule} from "./MockAtomicAuctionModule.sol"; +import {Permit2User} from "../../lib/permit2/Permit2User.sol"; // Auctions -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; -import {IFeeManager} from "src/interfaces/IFeeManager.sol"; +import {AtomicAuctionHouse} from "../../../src/AtomicAuctionHouse.sol"; +import {IAuction} from "../../../src/interfaces/modules/IAuction.sol"; +import {IAuctionHouse} from "../../../src/interfaces/IAuctionHouse.sol"; +import {ICallback} from "../../../src/interfaces/ICallback.sol"; +import {IFeeManager} from "../../../src/interfaces/IFeeManager.sol"; // Modules -import {toKeycode, Module, Keycode, keycodeFromVeecode} from "src/modules/Modules.sol"; +import {toKeycode, Module, Keycode, keycodeFromVeecode} from "../../../src/modules/Modules.sol"; contract AuctionTest is Test, Permit2User { MockERC20 internal _baseToken; diff --git a/test/modules/Auction/cancel.t.sol b/test/modules/Auction/cancel.t.sol index 6bb3acea7..aac435d7b 100644 --- a/test/modules/Auction/cancel.t.sol +++ b/test/modules/Auction/cancel.t.sol @@ -2,22 +2,22 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; // Mocks -import {MockERC20} from "lib/solmate/src/test/utils/mocks/MockERC20.sol"; -import {MockAtomicAuctionModule} from "test/modules/Auction/MockAtomicAuctionModule.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; +import {MockERC20} from "@solmate-6.7.0/test/utils/mocks/MockERC20.sol"; +import {MockAtomicAuctionModule} from "./MockAtomicAuctionModule.sol"; +import {Permit2User} from "../../lib/permit2/Permit2User.sol"; // Auctions -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {ICallback} from "src/interfaces/ICallback.sol"; -import {IFeeManager} from "src/interfaces/IFeeManager.sol"; +import {AtomicAuctionHouse} from "../../../src/AtomicAuctionHouse.sol"; +import {IAuction} from "../../../src/interfaces/modules/IAuction.sol"; +import {IAuctionHouse} from "../../../src/interfaces/IAuctionHouse.sol"; +import {ICallback} from "../../../src/interfaces/ICallback.sol"; +import {IFeeManager} from "../../../src/interfaces/IFeeManager.sol"; // Modules -import {toKeycode, Module, Keycode, keycodeFromVeecode} from "src/modules/Modules.sol"; +import {toKeycode, Module, Keycode, keycodeFromVeecode} from "../../../src/modules/Modules.sol"; contract CancelTest is Test, Permit2User { MockERC20 internal _baseToken; diff --git a/test/modules/Auction/setMinAuctionDuration.t.sol b/test/modules/Auction/setMinAuctionDuration.t.sol index e2cd51692..62dd0007d 100644 --- a/test/modules/Auction/setMinAuctionDuration.t.sol +++ b/test/modules/Auction/setMinAuctionDuration.t.sol @@ -2,18 +2,18 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; // Mocks -import {MockAtomicAuctionModule} from "test/modules/Auction/MockAtomicAuctionModule.sol"; -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; +import {MockAtomicAuctionModule} from "./MockAtomicAuctionModule.sol"; +import {Permit2User} from "../../lib/permit2/Permit2User.sol"; // Auctions -import {AuctionModule} from "src/modules/Auction.sol"; -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; +import {AuctionModule} from "../../../src/modules/Auction.sol"; +import {AtomicAuctionHouse} from "../../../src/AtomicAuctionHouse.sol"; // Modules -import {Module} from "src/modules/Modules.sol"; +import {Module} from "../../../src/modules/Modules.sol"; contract SetMinAuctionDurationTest is Test, Permit2User { MockAtomicAuctionModule internal _mockAuctionModule; diff --git a/test/modules/Condenser/MockCondenserModule.sol b/test/modules/Condenser/MockCondenserModule.sol index cea597e74..005f498d0 100644 --- a/test/modules/Condenser/MockCondenserModule.sol +++ b/test/modules/Condenser/MockCondenserModule.sol @@ -2,13 +2,13 @@ pragma solidity 0.8.19; // Modules -import {Module, Veecode, toKeycode, wrapVeecode} from "src/modules/Modules.sol"; +import {Module, Veecode, toKeycode, wrapVeecode} from "../../../src/modules/Modules.sol"; -import {MockAtomicAuctionModule} from "test/modules/Auction/MockAtomicAuctionModule.sol"; -import {MockDerivativeModule} from "test/modules/derivatives/mocks/MockDerivativeModule.sol"; +import {MockAtomicAuctionModule} from "../Auction/MockAtomicAuctionModule.sol"; +import {MockDerivativeModule} from "../derivatives/mocks/MockDerivativeModule.sol"; // Condenser -import {CondenserModule} from "src/modules/Condenser.sol"; +import {CondenserModule} from "../../../src/modules/Condenser.sol"; contract MockCondenserModule is CondenserModule { constructor(address _owner) Module(_owner) {} diff --git a/test/modules/Modules/Keycode.t.sol b/test/modules/Modules/Keycode.t.sol index 5d2164641..3a85c114d 100644 --- a/test/modules/Modules/Keycode.t.sol +++ b/test/modules/Modules/Keycode.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; import { Keycode, @@ -13,7 +13,7 @@ import { unwrapVeecode, ensureValidVeecode, InvalidVeecode -} from "src/modules/Modules.sol"; +} from "../../../src/modules/Modules.sol"; contract KeycodeTest is Test { function test_keycode() external { diff --git a/test/modules/Modules/MockModule.sol b/test/modules/Modules/MockModule.sol index 92d2b3711..4c145daa0 100644 --- a/test/modules/Modules/MockModule.sol +++ b/test/modules/Modules/MockModule.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; // Contracts -import {Module, Veecode, toKeycode, wrapVeecode} from "src/modules/Modules.sol"; +import {Module, Veecode, toKeycode, wrapVeecode} from "../../../src/modules/Modules.sol"; contract MockModuleV1 is Module { constructor(address _owner) Module(_owner) {} diff --git a/test/modules/Modules/MockWithModules.sol b/test/modules/Modules/MockWithModules.sol index 47489888b..a22f6a034 100644 --- a/test/modules/Modules/MockWithModules.sol +++ b/test/modules/Modules/MockWithModules.sol @@ -2,9 +2,9 @@ pragma solidity 0.8.19; // Contracts -import {WithModules, Veecode} from "src/modules/Modules.sol"; +import {WithModules, Veecode} from "../../../src/modules/Modules.sol"; -import {MockModuleV1} from "test/modules/Modules/MockModule.sol"; +import {MockModuleV1} from "./MockModule.sol"; contract MockWithModules is WithModules { constructor(address _owner) WithModules(_owner) {} diff --git a/test/modules/Modules/execOnModule.t.sol b/test/modules/Modules/execOnModule.t.sol index da94faedc..0e960e5af 100644 --- a/test/modules/Modules/execOnModule.t.sol +++ b/test/modules/Modules/execOnModule.t.sol @@ -2,14 +2,14 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; // Mocks -import {MockWithModules} from "test/modules/Modules/MockWithModules.sol"; -import {MockModuleV1} from "test/modules/Modules/MockModule.sol"; +import {MockWithModules} from "./MockWithModules.sol"; +import {MockModuleV1} from "./MockModule.sol"; // Contracts -import {WithModules, Module, Veecode, toKeycode} from "src/modules/Modules.sol"; +import {WithModules, Module, Veecode, toKeycode} from "../../../src/modules/Modules.sol"; contract ExecOnModule is Test { MockWithModules internal _withModules; diff --git a/test/modules/Modules/getModuleForVeecode.t.sol b/test/modules/Modules/getModuleForVeecode.t.sol index e7bae204f..99ee24d6e 100644 --- a/test/modules/Modules/getModuleForVeecode.t.sol +++ b/test/modules/Modules/getModuleForVeecode.t.sol @@ -2,14 +2,14 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; // Mocks -import {MockWithModules} from "test/modules/Modules/MockWithModules.sol"; -import {MockModuleV1} from "test/modules/Modules/MockModule.sol"; +import {MockWithModules} from "./MockWithModules.sol"; +import {MockModuleV1} from "./MockModule.sol"; // Contracts -import {WithModules, Module} from "src/modules/Modules.sol"; +import {WithModules, Module} from "../../../src/modules/Modules.sol"; contract GetModuleForVeecodeTest is Test { WithModules internal _withModules; diff --git a/test/modules/Modules/getModuleStatus.t.sol b/test/modules/Modules/getModuleStatus.t.sol index 06859806b..f62266670 100644 --- a/test/modules/Modules/getModuleStatus.t.sol +++ b/test/modules/Modules/getModuleStatus.t.sol @@ -2,14 +2,14 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; // Mocks -import {MockWithModules} from "test/modules/Modules/MockWithModules.sol"; -import {MockModuleV1, MockModuleV2} from "test/modules/Modules/MockModule.sol"; +import {MockWithModules} from "./MockWithModules.sol"; +import {MockModuleV1, MockModuleV2} from "./MockModule.sol"; // Contracts -import {WithModules, toKeycode} from "src/modules/Modules.sol"; +import {WithModules, toKeycode} from "../../../src/modules/Modules.sol"; contract GetModuleStatusTest is Test { WithModules internal _withModules; diff --git a/test/modules/Modules/installModule.t.sol b/test/modules/Modules/installModule.t.sol index a02d66eac..bd91e3d78 100644 --- a/test/modules/Modules/installModule.t.sol +++ b/test/modules/Modules/installModule.t.sol @@ -2,22 +2,26 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; // Mocks -import {MockWithModules} from "test/modules/Modules/MockWithModules.sol"; +import {MockWithModules} from "./MockWithModules.sol"; import { MockModuleV0, MockModuleV1, MockModuleV2, MockModuleV3, MockInvalidModule -} from "test/modules/Modules/MockModule.sol"; +} from "./MockModule.sol"; // Contracts import { - WithModules, Module, fromKeycode, toKeycode, InvalidVeecode -} from "src/modules/Modules.sol"; + WithModules, + Module, + fromKeycode, + toKeycode, + InvalidVeecode +} from "../../../src/modules/Modules.sol"; contract InstallModuleTest is Test { WithModules internal _withModules; diff --git a/test/modules/Modules/sunsetModule.t.sol b/test/modules/Modules/sunsetModule.t.sol index 7b1af015e..faedee264 100644 --- a/test/modules/Modules/sunsetModule.t.sol +++ b/test/modules/Modules/sunsetModule.t.sol @@ -2,14 +2,14 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; // Mocks -import {MockWithModules} from "test/modules/Modules/MockWithModules.sol"; -import {MockModuleV1} from "test/modules/Modules/MockModule.sol"; +import {MockWithModules} from "./MockWithModules.sol"; +import {MockModuleV1} from "./MockModule.sol"; // Contracts -import {WithModules, toKeycode, fromKeycode} from "src/modules/Modules.sol"; +import {WithModules, toKeycode, fromKeycode} from "../../../src/modules/Modules.sol"; contract SunsetModuleTest is Test { WithModules internal _withModules; diff --git a/test/modules/auctions/EMP/EMPTest.sol b/test/modules/auctions/EMP/EMPTest.sol index 0443e23a6..f54a87a6d 100644 --- a/test/modules/auctions/EMP/EMPTest.sol +++ b/test/modules/auctions/EMP/EMPTest.sol @@ -2,19 +2,20 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; -import {console2} from "forge-std/console2.sol"; -import {Point, ECIES} from "src/lib/ECIES.sol"; -import {FixedPointMathLib as Math} from "solady/utils/FixedPointMathLib.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {console2} from "@forge-std-1.9.1/console2.sol"; +import {Point, ECIES} from "../../../../src/lib/ECIES.sol"; +import {FixedPointMathLib as Math} from "@solady-0.0.124/utils/FixedPointMathLib.sol"; // Mocks -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; +import {Permit2User} from "../../../lib/permit2/Permit2User.sol"; // Modules -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {IEncryptedMarginalPrice} from "src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; +import {BatchAuctionHouse} from "../../../../src/BatchAuctionHouse.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {EncryptedMarginalPrice} from "../../../../src/modules/auctions/batch/EMP.sol"; +import {IEncryptedMarginalPrice} from + "../../../../src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; abstract contract EmpTest is Test, Permit2User { uint256 internal constant _BASE_SCALE = 1e18; diff --git a/test/modules/auctions/EMP/abort.t.sol b/test/modules/auctions/EMP/abort.t.sol index 728721233..b93060b21 100644 --- a/test/modules/auctions/EMP/abort.t.sol +++ b/test/modules/auctions/EMP/abort.t.sol @@ -1,12 +1,13 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {IEncryptedMarginalPrice} from "src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {IBatchAuction} from "../../../../src/interfaces/modules/IBatchAuction.sol"; +import {EncryptedMarginalPrice} from "../../../../src/modules/auctions/batch/EMP.sol"; +import {IEncryptedMarginalPrice} from + "../../../../src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; -import {EmpTest} from "test/modules/auctions/EMP/EMPTest.sol"; +import {EmpTest} from "./EMPTest.sol"; contract EmpAbortTest is EmpTest { uint256 internal constant _BID_AMOUNT = 16e18; diff --git a/test/modules/auctions/EMP/auction.t.sol b/test/modules/auctions/EMP/auction.t.sol index 514223249..41a08d903 100644 --- a/test/modules/auctions/EMP/auction.t.sol +++ b/test/modules/auctions/EMP/auction.t.sol @@ -1,12 +1,13 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {IEncryptedMarginalPrice} from "src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {EncryptedMarginalPrice} from "../../../../src/modules/auctions/batch/EMP.sol"; +import {IEncryptedMarginalPrice} from + "../../../../src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; -import {EmpTest} from "test/modules/auctions/EMP/EMPTest.sol"; +import {EmpTest} from "./EMPTest.sol"; contract EmpCreateAuctionTest is EmpTest { // [X] when the caller is not the parent diff --git a/test/modules/auctions/EMP/bid.t.sol b/test/modules/auctions/EMP/bid.t.sol index 71fe9bf6c..2df53cd7a 100644 --- a/test/modules/auctions/EMP/bid.t.sol +++ b/test/modules/auctions/EMP/bid.t.sol @@ -1,13 +1,14 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IEncryptedMarginalPrice} from "src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {Point} from "src/lib/ECIES.sol"; - -import {EmpTest} from "test/modules/auctions/EMP/EMPTest.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {IEncryptedMarginalPrice} from + "../../../../src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; +import {EncryptedMarginalPrice} from "../../../../src/modules/auctions/batch/EMP.sol"; +import {Point} from "../../../../src/lib/ECIES.sol"; + +import {EmpTest} from "./EMPTest.sol"; contract EmpBidTest is EmpTest { uint256 internal constant _BID_AMOUNT = 2e18; diff --git a/test/modules/auctions/EMP/cancelAuction.t.sol b/test/modules/auctions/EMP/cancelAuction.t.sol index d9bae9482..a84890b4a 100644 --- a/test/modules/auctions/EMP/cancelAuction.t.sol +++ b/test/modules/auctions/EMP/cancelAuction.t.sol @@ -1,12 +1,13 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {IEncryptedMarginalPrice} from "src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {EncryptedMarginalPrice} from "../../../../src/modules/auctions/batch/EMP.sol"; +import {IEncryptedMarginalPrice} from + "../../../../src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; -import {EmpTest} from "test/modules/auctions/EMP/EMPTest.sol"; +import {EmpTest} from "./EMPTest.sol"; contract EmpCancelAuctionTest is EmpTest { // [X] when the caller is not the parent diff --git a/test/modules/auctions/EMP/claimBids.t.sol b/test/modules/auctions/EMP/claimBids.t.sol index 78f8cddbc..3df944937 100644 --- a/test/modules/auctions/EMP/claimBids.t.sol +++ b/test/modules/auctions/EMP/claimBids.t.sol @@ -1,16 +1,17 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {FixedPointMathLib as Math} from "lib/solady/src/utils/FixedPointMathLib.sol"; -import {console2} from "forge-std/console2.sol"; +import {FixedPointMathLib as Math} from "@solady-0.0.124/utils/FixedPointMathLib.sol"; +import {console2} from "@forge-std-1.9.1/console2.sol"; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IEncryptedMarginalPrice} from "src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {IEncryptedMarginalPrice} from + "../../../../src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; +import {EncryptedMarginalPrice} from "../../../../src/modules/auctions/batch/EMP.sol"; +import {IBatchAuction} from "../../../../src/interfaces/modules/IBatchAuction.sol"; -import {EmpTest} from "test/modules/auctions/EMP/EMPTest.sol"; +import {EmpTest} from "./EMPTest.sol"; contract EmpClaimBidsTest is EmpTest { uint256 internal constant _BID_AMOUNT = 8e18; diff --git a/test/modules/auctions/EMP/decryptAndSortBids.t.sol b/test/modules/auctions/EMP/decryptAndSortBids.t.sol index dfaf4480e..4e7f666bc 100644 --- a/test/modules/auctions/EMP/decryptAndSortBids.t.sol +++ b/test/modules/auctions/EMP/decryptAndSortBids.t.sol @@ -1,11 +1,12 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {IEncryptedMarginalPrice} from "src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {EncryptedMarginalPrice} from "../../../../src/modules/auctions/batch/EMP.sol"; +import {IEncryptedMarginalPrice} from + "../../../../src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; -import {EmpTest} from "test/modules/auctions/EMP/EMPTest.sol"; +import {EmpTest} from "./EMPTest.sol"; contract EmpDecryptBidsTest is EmpTest { uint256 internal constant _BID_AMOUNT = 2e18; diff --git a/test/modules/auctions/EMP/refundBid.t.sol b/test/modules/auctions/EMP/refundBid.t.sol index d18faa51e..cc1239a2e 100644 --- a/test/modules/auctions/EMP/refundBid.t.sol +++ b/test/modules/auctions/EMP/refundBid.t.sol @@ -1,15 +1,16 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {console2} from "forge-std/console2.sol"; +import {console2} from "@forge-std-1.9.1/console2.sol"; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IEncryptedMarginalPrice} from "src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {IEncryptedMarginalPrice} from + "../../../../src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; +import {EncryptedMarginalPrice} from "../../../../src/modules/auctions/batch/EMP.sol"; +import {IBatchAuction} from "../../../../src/interfaces/modules/IBatchAuction.sol"; -import {EmpTest} from "test/modules/auctions/EMP/EMPTest.sol"; +import {EmpTest} from "./EMPTest.sol"; contract EmpRefundBidTest is EmpTest { // [X] when the lot id is invalid diff --git a/test/modules/auctions/EMP/settle.t.sol b/test/modules/auctions/EMP/settle.t.sol index 078e8beb0..98d543777 100644 --- a/test/modules/auctions/EMP/settle.t.sol +++ b/test/modules/auctions/EMP/settle.t.sol @@ -1,17 +1,18 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {FixedPointMathLib as Math} from "solmate/utils/FixedPointMathLib.sol"; +import {FixedPointMathLib as Math} from "@solmate-6.7.0/utils/FixedPointMathLib.sol"; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {IEncryptedMarginalPrice} from "src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; -import {BidEncoding} from "src/lib/MaxPriorityQueue.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {EncryptedMarginalPrice} from "../../../../src/modules/auctions/batch/EMP.sol"; +import {IEncryptedMarginalPrice} from + "../../../../src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; +import {BidEncoding} from "../../../../src/lib/MaxPriorityQueue.sol"; -import {EmpTest} from "test/modules/auctions/EMP/EMPTest.sol"; +import {EmpTest} from "./EMPTest.sol"; -import {console2} from "forge-std/console2.sol"; +import {console2} from "@forge-std-1.9.1/console2.sol"; contract EmpSettleTest is EmpTest { using BidEncoding for bytes32; diff --git a/test/modules/auctions/EMP/submitPrivateKey.t.sol b/test/modules/auctions/EMP/submitPrivateKey.t.sol index 2fe48deca..7a0cea24e 100644 --- a/test/modules/auctions/EMP/submitPrivateKey.t.sol +++ b/test/modules/auctions/EMP/submitPrivateKey.t.sol @@ -1,11 +1,12 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IEncryptedMarginalPrice} from "src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {IEncryptedMarginalPrice} from + "../../../../src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; +import {EncryptedMarginalPrice} from "../../../../src/modules/auctions/batch/EMP.sol"; -import {EmpTest} from "test/modules/auctions/EMP/EMPTest.sol"; +import {EmpTest} from "./EMPTest.sol"; contract EmpSubmitPrivateKeyTest is EmpTest { // [X] when the lot id is invalid diff --git a/test/modules/auctions/FPB/FPBTest.sol b/test/modules/auctions/FPB/FPBTest.sol index 6252171b9..d77021858 100644 --- a/test/modules/auctions/FPB/FPBTest.sol +++ b/test/modules/auctions/FPB/FPBTest.sol @@ -2,18 +2,18 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; -import {FixedPointMathLib as Math} from "lib/solmate/src/utils/FixedPointMathLib.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {FixedPointMathLib as Math} from "@solmate-6.7.0/utils/FixedPointMathLib.sol"; // Mocks -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; +import {Permit2User} from "../../../lib/permit2/Permit2User.sol"; // Modules -import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; -import {FixedPriceBatch} from "src/modules/auctions/batch/FPB.sol"; -import {IFixedPriceBatch} from "src/interfaces/modules/auctions/IFixedPriceBatch.sol"; +import {BatchAuctionHouse} from "../../../../src/BatchAuctionHouse.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {IBatchAuction} from "../../../../src/interfaces/modules/IBatchAuction.sol"; +import {FixedPriceBatch} from "../../../../src/modules/auctions/batch/FPB.sol"; +import {IFixedPriceBatch} from "../../../../src/interfaces/modules/auctions/IFixedPriceBatch.sol"; abstract contract FpbTest is Test, Permit2User { uint256 internal constant _BASE_SCALE = 1e18; diff --git a/test/modules/auctions/FPB/auction.t.sol b/test/modules/auctions/FPB/auction.t.sol index 56e6750a3..346b7915f 100644 --- a/test/modules/auctions/FPB/auction.t.sol +++ b/test/modules/auctions/FPB/auction.t.sol @@ -1,12 +1,13 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IFixedPriceBatch} from "src/interfaces/modules/auctions/IFixedPriceBatch.sol"; -import {FixedPointMathLib as Math} from "solady/utils/FixedPointMathLib.sol"; +import {FixedPointMathLib as Math} from "@solady-0.0.124/utils/FixedPointMathLib.sol"; -import {FpbTest} from "test/modules/auctions/FPB/FPBTest.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {IFixedPriceBatch} from "../../../../src/interfaces/modules/auctions/IFixedPriceBatch.sol"; + +import {FpbTest} from "./FPBTest.sol"; contract FpbCreateAuctionTest is FpbTest { // [X] when the caller is not the parent diff --git a/test/modules/auctions/FPB/bid.t.sol b/test/modules/auctions/FPB/bid.t.sol index fab1de20f..f4943e9bf 100644 --- a/test/modules/auctions/FPB/bid.t.sol +++ b/test/modules/auctions/FPB/bid.t.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IFixedPriceBatch} from "src/interfaces/modules/auctions/IFixedPriceBatch.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {IFixedPriceBatch} from "../../../../src/interfaces/modules/auctions/IFixedPriceBatch.sol"; -import {FpbTest} from "test/modules/auctions/FPB/FPBTest.sol"; +import {FpbTest} from "./FPBTest.sol"; contract FpbBidTest is FpbTest { uint256 internal constant _BID_AMOUNT = 2e18; diff --git a/test/modules/auctions/FPB/cancelAuction.t.sol b/test/modules/auctions/FPB/cancelAuction.t.sol index bffaba69c..ea91d5b16 100644 --- a/test/modules/auctions/FPB/cancelAuction.t.sol +++ b/test/modules/auctions/FPB/cancelAuction.t.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IFixedPriceBatch} from "src/interfaces/modules/auctions/IFixedPriceBatch.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {IFixedPriceBatch} from "../../../../src/interfaces/modules/auctions/IFixedPriceBatch.sol"; -import {FpbTest} from "test/modules/auctions/FPB/FPBTest.sol"; +import {FpbTest} from "./FPBTest.sol"; contract FpbCancelAuctionTest is FpbTest { // [X] when the caller is not the parent diff --git a/test/modules/auctions/FPB/claimBids.t.sol b/test/modules/auctions/FPB/claimBids.t.sol index e50001907..c4f485658 100644 --- a/test/modules/auctions/FPB/claimBids.t.sol +++ b/test/modules/auctions/FPB/claimBids.t.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; -import {IFixedPriceBatch} from "src/interfaces/modules/auctions/IFixedPriceBatch.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {IBatchAuction} from "../../../../src/interfaces/modules/IBatchAuction.sol"; +import {IFixedPriceBatch} from "../../../../src/interfaces/modules/auctions/IFixedPriceBatch.sol"; -import {FpbTest} from "test/modules/auctions/FPB/FPBTest.sol"; +import {FpbTest} from "./FPBTest.sol"; contract FpbClaimBidsTest is FpbTest { // [X] when the caller is not the parent diff --git a/test/modules/auctions/FPB/refundBid.t.sol b/test/modules/auctions/FPB/refundBid.t.sol index e5cadb98f..0404d837a 100644 --- a/test/modules/auctions/FPB/refundBid.t.sol +++ b/test/modules/auctions/FPB/refundBid.t.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IBatchAuction} from "src/interfaces/modules/IBatchAuction.sol"; -import {IFixedPriceBatch} from "src/interfaces/modules/auctions/IFixedPriceBatch.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {IBatchAuction} from "../../../../src/interfaces/modules/IBatchAuction.sol"; +import {IFixedPriceBatch} from "../../../../src/interfaces/modules/auctions/IFixedPriceBatch.sol"; -import {FpbTest} from "test/modules/auctions/FPB/FPBTest.sol"; +import {FpbTest} from "./FPBTest.sol"; contract FpbRefundBidTest is FpbTest { // [X] when the caller is not the parent diff --git a/test/modules/auctions/FPB/settle.t.sol b/test/modules/auctions/FPB/settle.t.sol index c4473c566..77150118a 100644 --- a/test/modules/auctions/FPB/settle.t.sol +++ b/test/modules/auctions/FPB/settle.t.sol @@ -1,12 +1,13 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IFixedPriceBatch} from "src/interfaces/modules/auctions/IFixedPriceBatch.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {IFixedPriceBatch} from "../../../../src/interfaces/modules/auctions/IFixedPriceBatch.sol"; -import {FpbTest} from "test/modules/auctions/FPB/FPBTest.sol"; -import {console2} from "lib/forge-std/src/console2.sol"; +import {console2} from "@forge-std-1.9.1/console2.sol"; + +import {FpbTest} from "./FPBTest.sol"; contract FpbSettleTest is FpbTest { // [X] when the caller is not the parent @@ -195,27 +196,27 @@ contract FpbSettleTest is FpbTest { vm.prank(address(_auctionHouse)); _module.bid(_lotId, _BIDDER, _REFERRER, 2e19 - 1, abi.encode("")); - IFixedPriceBatch.AuctionData memory auctionData_before = _module.getAuctionData(_lotId); - IAuction.Lot memory lot_before = _module.getLot(_lotId); - console2.log("totalBidAmount before ==> ", auctionData_before.totalBidAmount); - console2.log("conclusion before ==> ", lot_before.conclusion); + IFixedPriceBatch.AuctionData memory auctionDataBefore = _module.getAuctionData(_lotId); + IAuction.Lot memory lotBefore = _module.getLot(_lotId); + console2.log("totalBidAmount before ==> ", auctionDataBefore.totalBidAmount); + console2.log("conclusion before ==> ", lotBefore.conclusion); vm.prank(address(_auctionHouse)); _module.bid(_lotId, _BIDDER, _REFERRER, 1e18 + 1, abi.encode("")); - IFixedPriceBatch.AuctionData memory auctionData_after = _module.getAuctionData(_lotId); - IAuction.Lot memory lot_after = _module.getLot(_lotId); + IFixedPriceBatch.AuctionData memory auctionDataAfter = _module.getAuctionData(_lotId); + IAuction.Lot memory lotAfter = _module.getLot(_lotId); - console2.log("totalBidAmount after ==> ", auctionData_after.totalBidAmount); - console2.log("conclusion after ==> ", lot_after.conclusion); - assertLt(lot_after.conclusion, lot_before.conclusion); + console2.log("totalBidAmount after ==> ", auctionDataAfter.totalBidAmount); + console2.log("conclusion after ==> ", lotAfter.conclusion); + assertLt(lotAfter.conclusion, lotBefore.conclusion); vm.prank(address(_auctionHouse)); _module.settle(_lotId, 100_000); - IFixedPriceBatch.AuctionData memory auctionData_final = _module.getAuctionData(_lotId); + IFixedPriceBatch.AuctionData memory auctionDataFinal = _module.getAuctionData(_lotId); - console2.log("settlementCleared final ==> ", auctionData_final.settlementCleared); - assert(auctionData_final.settlementCleared); + console2.log("settlementCleared final ==> ", auctionDataFinal.settlementCleared); + assert(auctionDataFinal.settlementCleared); } } diff --git a/test/modules/auctions/FPS/FPSTest.sol b/test/modules/auctions/FPS/FPSTest.sol index e89513d1c..8caad1bee 100644 --- a/test/modules/auctions/FPS/FPSTest.sol +++ b/test/modules/auctions/FPS/FPSTest.sol @@ -2,17 +2,17 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; -import {FixedPointMathLib as Math} from "lib/solmate/src/utils/FixedPointMathLib.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {FixedPointMathLib as Math} from "@solmate-6.7.0/utils/FixedPointMathLib.sol"; // Mocks -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; +import {Permit2User} from "../../../lib/permit2/Permit2User.sol"; // Modules -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {FixedPriceSale} from "src/modules/auctions/atomic/FPS.sol"; -import {IFixedPriceSale} from "src/interfaces/modules/auctions/IFixedPriceSale.sol"; +import {AtomicAuctionHouse} from "../../../../src/AtomicAuctionHouse.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {FixedPriceSale} from "../../../../src/modules/auctions/atomic/FPS.sol"; +import {IFixedPriceSale} from "../../../../src/interfaces/modules/auctions/IFixedPriceSale.sol"; abstract contract FpsTest is Test, Permit2User { uint256 internal constant _BASE_SCALE = 1e18; diff --git a/test/modules/auctions/FPS/auction.t.sol b/test/modules/auctions/FPS/auction.t.sol index f9d2ba9e6..84771e550 100644 --- a/test/modules/auctions/FPS/auction.t.sol +++ b/test/modules/auctions/FPS/auction.t.sol @@ -1,12 +1,13 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {FixedPriceSale} from "src/modules/auctions/atomic/FPS.sol"; -import {FixedPointMathLib as Math} from "solmate/utils/FixedPointMathLib.sol"; +import {FixedPointMathLib as Math} from "@solmate-6.7.0/utils/FixedPointMathLib.sol"; -import {FpsTest} from "test/modules/auctions/FPS/FPSTest.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {FixedPriceSale} from "../../../../src/modules/auctions/atomic/FPS.sol"; + +import {FpsTest} from "./FPSTest.sol"; contract FpsCreateAuctionTest is FpsTest { // [X] when the caller is not the parent diff --git a/test/modules/auctions/FPS/cancelAuction.t.sol b/test/modules/auctions/FPS/cancelAuction.t.sol index 85b9345e8..4596decf1 100644 --- a/test/modules/auctions/FPS/cancelAuction.t.sol +++ b/test/modules/auctions/FPS/cancelAuction.t.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; -import {FpsTest} from "test/modules/auctions/FPS/FPSTest.sol"; +import {FpsTest} from "./FPSTest.sol"; contract FpsCancelAuctionTest is FpsTest { // [X] when the caller is not the parent diff --git a/test/modules/auctions/FPS/purchase.t.sol b/test/modules/auctions/FPS/purchase.t.sol index 1a2e468dc..e850aee57 100644 --- a/test/modules/auctions/FPS/purchase.t.sol +++ b/test/modules/auctions/FPS/purchase.t.sol @@ -1,12 +1,13 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {Module} from "src/modules/Modules.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IFixedPriceSale} from "src/interfaces/modules/auctions/IFixedPriceSale.sol"; -import {FixedPointMathLib as Math} from "solmate/utils/FixedPointMathLib.sol"; +import {FixedPointMathLib as Math} from "@solmate-6.7.0/utils/FixedPointMathLib.sol"; -import {FpsTest} from "test/modules/auctions/FPS/FPSTest.sol"; +import {Module} from "../../../../src/modules/Modules.sol"; +import {IAuction} from "../../../../src/interfaces/modules/IAuction.sol"; +import {IFixedPriceSale} from "../../../../src/interfaces/modules/auctions/IFixedPriceSale.sol"; + +import {FpsTest} from "./FPSTest.sol"; contract FpsPurchaseTest is FpsTest { uint256 internal constant _PURCHASE_AMOUNT = 2e18; diff --git a/test/modules/derivatives/LinearVesting.t.sol b/test/modules/derivatives/LinearVesting.t.sol index ae8f23614..6da3948a0 100644 --- a/test/modules/derivatives/LinearVesting.t.sol +++ b/test/modules/derivatives/LinearVesting.t.sol @@ -2,19 +2,19 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; -import {console2} from "forge-std/console2.sol"; - -import {Permit2User} from "test/lib/permit2/Permit2User.sol"; -import {StringHelper} from "test/lib/String.sol"; -import {MockFeeOnTransferERC20} from "test/lib/mocks/MockFeeOnTransferERC20.sol"; -import {FixedPointMathLib} from "solmate/utils/FixedPointMathLib.sol"; - -import {AtomicAuctionHouse} from "src/AtomicAuctionHouse.sol"; -import {IDerivative} from "src/interfaces/modules/IDerivative.sol"; -import {ILinearVesting} from "src/interfaces/modules/derivatives/ILinearVesting.sol"; -import {LinearVesting} from "src/modules/derivatives/LinearVesting.sol"; -import {SoulboundCloneERC20} from "src/modules/derivatives/SoulboundCloneERC20.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {console2} from "@forge-std-1.9.1/console2.sol"; +import {FixedPointMathLib} from "@solmate-6.7.0/utils/FixedPointMathLib.sol"; + +import {Permit2User} from "../../lib/permit2/Permit2User.sol"; +import {StringHelper} from "../../lib/String.sol"; +import {MockFeeOnTransferERC20} from "../../lib/mocks/MockFeeOnTransferERC20.sol"; + +import {AtomicAuctionHouse} from "../../../src/AtomicAuctionHouse.sol"; +import {IDerivative} from "../../../src/interfaces/modules/IDerivative.sol"; +import {ILinearVesting} from "../../../src/interfaces/modules/derivatives/ILinearVesting.sol"; +import {LinearVesting} from "../../../src/modules/derivatives/LinearVesting.sol"; +import {SoulboundCloneERC20} from "../../../src/modules/derivatives/SoulboundCloneERC20.sol"; contract LinearVestingTest is Test, Permit2User { using StringHelper for string; diff --git a/test/modules/derivatives/LinearVestingEMPAIntegration.t.sol b/test/modules/derivatives/LinearVestingEMPAIntegration.t.sol index 718ca5fc5..c1882ece4 100644 --- a/test/modules/derivatives/LinearVestingEMPAIntegration.t.sol +++ b/test/modules/derivatives/LinearVestingEMPAIntegration.t.sol @@ -1,18 +1,19 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {IBatchAuctionHouse} from "src/interfaces/IBatchAuctionHouse.sol"; -import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {ILinearVesting} from "src/interfaces/modules/derivatives/ILinearVesting.sol"; -import {LinearVesting} from "src/modules/derivatives/LinearVesting.sol"; -import {Point, ECIES} from "src/lib/ECIES.sol"; -import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {IAuction} from "src/interfaces/modules/IAuction.sol"; -import {IEncryptedMarginalPrice} from "src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; - -import {keycodeFromVeecode, fromVeecode} from "src/modules/Modules.sol"; - -import {BatchAuctionHouseTest} from "test/BatchAuctionHouse/AuctionHouseTest.sol"; +import {IBatchAuctionHouse} from "../../../src/interfaces/IBatchAuctionHouse.sol"; +import {EncryptedMarginalPrice} from "../../../src/modules/auctions/batch/EMP.sol"; +import {ILinearVesting} from "../../../src/interfaces/modules/derivatives/ILinearVesting.sol"; +import {LinearVesting} from "../../../src/modules/derivatives/LinearVesting.sol"; +import {Point, ECIES} from "../../../src/lib/ECIES.sol"; +import {IAuctionHouse} from "../../../src/interfaces/IAuctionHouse.sol"; +import {IAuction} from "../../../src/interfaces/modules/IAuction.sol"; +import {IEncryptedMarginalPrice} from + "../../../src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol"; + +import {keycodeFromVeecode, fromVeecode} from "../../../src/modules/Modules.sol"; + +import {BatchAuctionHouseTest} from "../../BatchAuctionHouse/AuctionHouseTest.sol"; contract LinearVestingEMPAIntegrationTest is BatchAuctionHouseTest { EncryptedMarginalPrice internal _empaModule; diff --git a/test/modules/derivatives/SoulboundCloneERC20.t.sol b/test/modules/derivatives/SoulboundCloneERC20.t.sol index 23b41e71d..79af63190 100644 --- a/test/modules/derivatives/SoulboundCloneERC20.t.sol +++ b/test/modules/derivatives/SoulboundCloneERC20.t.sol @@ -2,12 +2,13 @@ pragma solidity 0.8.19; // Libraries -import {Test} from "forge-std/Test.sol"; -import {ClonesWithImmutableArgs} from "src/lib/clones/ClonesWithImmutableArgs.sol"; -import {StringHelper} from "test/lib/String.sol"; +import {Test} from "@forge-std-1.9.1/Test.sol"; +import {ClonesWithImmutableArgs} from + "@clones-with-immutable-args-1.1.1/ClonesWithImmutableArgs.sol"; +import {MockERC20} from "@solmate-6.7.0/test/utils/mocks/MockERC20.sol"; +import {StringHelper} from "../../lib/String.sol"; -import {SoulboundCloneERC20} from "src/modules/derivatives/SoulboundCloneERC20.sol"; -import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; +import {SoulboundCloneERC20} from "../../../src/modules/derivatives/SoulboundCloneERC20.sol"; contract SoulboundCloneERC20Test is Test { using ClonesWithImmutableArgs for address; diff --git a/test/modules/derivatives/mocks/MockDerivativeModule.sol b/test/modules/derivatives/mocks/MockDerivativeModule.sol index dfb1922fd..729394cc1 100644 --- a/test/modules/derivatives/mocks/MockDerivativeModule.sol +++ b/test/modules/derivatives/mocks/MockDerivativeModule.sol @@ -1,18 +1,19 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; -import {ClonesWithImmutableArgs} from "src/lib/clones/ClonesWithImmutableArgs.sol"; -import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol"; -import {ERC20} from "solmate/tokens/ERC20.sol"; +import {ClonesWithImmutableArgs} from + "@clones-with-immutable-args-1.1.1/ClonesWithImmutableArgs.sol"; +import {SafeTransferLib} from "@solmate-6.7.0/utils/SafeTransferLib.sol"; +import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; // Modules -import {Module, Veecode, toKeycode, wrapVeecode} from "src/modules/Modules.sol"; +import {Module, Veecode, toKeycode, wrapVeecode} from "../../../../src/modules/Modules.sol"; // Auctions -import {DerivativeModule} from "src/modules/Derivative.sol"; +import {DerivativeModule} from "../../../../src/modules/Derivative.sol"; -import {MockERC6909} from "solmate/test/utils/mocks/MockERC6909.sol"; -import {MockWrappedDerivative} from "test/lib/mocks/MockWrappedDerivative.sol"; +import {MockERC6909} from "@solmate-6.7.0/test/utils/mocks/MockERC6909.sol"; +import {MockWrappedDerivative} from "../../../lib/mocks/MockWrappedDerivative.sol"; contract MockDerivativeModule is DerivativeModule { using ClonesWithImmutableArgs for address;