From af2a5bbad0d3bc589ce45ca306006d0981573896 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 14 Jun 2024 11:46:23 +0400 Subject: [PATCH 01/82] Add official Uniswap V2 and V3 addresses --- script/env.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/script/env.json b/script/env.json index 4f854eb4..b749ed96 100644 --- a/script/env.json +++ b/script/env.json @@ -22,11 +22,11 @@ "factory": "0x0000000000000000000000000000000000000000" }, "uniswapV2": { - "factory": "0x0000000000000000000000000000000000000000", - "router": "0x0000000000000000000000000000000000000000" + "factory": "0xf1D7CC64Fb4452F05c498126312eBE29f30Fbcf9", + "router": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" }, "uniswapV3": { - "factory": "0x0000000000000000000000000000000000000000" + "factory": "0x1F98431c8aD98523631AE4a59f267346ea31F984" } }, "arbitrum-sepolia": { @@ -60,7 +60,7 @@ "router": "0x909F26919989167d051312fBB0a1Df4CD93Bf70b" }, "uniswapV3": { - "factory": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" + "factory": "0x248AB79Bbb9bC29bB72f7Cd42F17e054Fc40188e" } }, "base-sepolia": { @@ -124,11 +124,11 @@ "factory": "0x0000000000000000000000000000000000000000" }, "uniswapV2": { - "factory": "0x0000000000000000000000000000000000000000", - "router": "0x0000000000000000000000000000000000000000" + "factory": "0x5C346464d33F90bABaf70dB6388507CC889C1070", + "router": "0xBB66Eb1c5e875933D44DAe661dbD80e5D9B03035" }, "uniswapV3": { - "factory": "0x0000000000000000000000000000000000000000" + "factory": "0x792edAdE80af5fC680d96a2eD80A44247D2Cf6Fd" } }, "blast-sepolia": { @@ -189,14 +189,14 @@ "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" }, "gUni": { - "factory": "0x0000000000000000000000000000000000000000" + "factory": "0xEA1aFf9dbFfD1580F6b81A3ad3589E66652dB7D9" }, "uniswapV2": { - "factory": "0x0000000000000000000000000000000000000000", - "router": "0x0000000000000000000000000000000000000000" + "factory": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", + "router": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" }, "uniswapV3": { - "factory": "0x0000000000000000000000000000000000000000" + "factory": "0x1F98431c8aD98523631AE4a59f267346ea31F984" } }, "mode-sepolia": { @@ -255,11 +255,11 @@ "factory": "0x0000000000000000000000000000000000000000" }, "uniswapV2": { - "factory": "0x0000000000000000000000000000000000000000", - "router": "0x0000000000000000000000000000000000000000" + "factory": "0xB7f907f7A9eBC822a80BD25E224be42Ce0A698A0", + "router": "0x425141165d3DE9FEC831896C016617a52363b687" }, "uniswapV3": { - "factory": "0x0000000000000000000000000000000000000000" + "factory": "0x0227628f3F023bb0B980b67D528571c95c6DaC1c" } }, "tests": { From da3d2e574299f4bfaed570a2cac0fa3ea01b4b6c Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 14 Jun 2024 12:11:13 +0400 Subject: [PATCH 02/82] Cross-port salt and test script improvements from #155. --- .gitignore | 1 + script/deploy/README.md | 18 +- script/deploy/deploy.sh | 76 ++++++--- script/ops/test/FixedPriceBatch/README.md | 23 +++ .../ops/test/FixedPriceBatch/TestData.s.sol | 156 ++++++++++++++++++ .../ops/test/FixedPriceBatch/createAuction.sh | 87 ++++++++++ script/ops/test/FixedPriceBatch/placeBid.sh | 87 ++++++++++ .../ops/test/FixedPriceBatch/settleAuction.sh | 63 +++++++ script/ops/test/FixedPriceBatch/warp.sh | 44 +++++ script/ops/test/TestData.s.sol | 59 +------ script/ops/test/deployTokens.sh | 7 +- script/salts/README.md | 37 ++++- script/salts/WithSalts.s.sol | 53 +++++- .../salts/auctionHouse/auction_house_salts.sh | 50 ++++-- .../UniswapDTLSalts.s.sol | 0 script/salts/dtl-uniswap/uniswap_dtl_salts.sh | 58 +++++++ script/salts/dtl/uniswap_dtl_salts.sh | 40 ----- script/salts/test/TestSalts.s.sol | 152 +++++++++++------ script/salts/test/test_salts.sh | 53 ++++-- script/salts/write_salt.sh | 55 +++--- test/Constants.sol | 19 +++ .../UniswapV2DTL/UniswapV2DTLTest.sol | 24 ++- .../UniswapV2DTL/onCancel.t.sol | 0 .../UniswapV2DTL/onCreate.t.sol | 0 .../UniswapV2DTL/onCurate.t.sol | 0 .../UniswapV2DTL/onSettle.t.sol | 0 .../UniswapV3DTL/UniswapV3DTLTest.sol | 32 ++-- .../UniswapV3DTL/onCancel.t.sol | 0 .../UniswapV3DTL/onCreate.t.sol | 0 .../UniswapV3DTL/onCurate.t.sol | 0 .../UniswapV3DTL/onSettle.t.sol | 0 test/lib/ComputeAddress.sol | 49 ++++++ 32 files changed, 988 insertions(+), 255 deletions(-) create mode 100644 script/ops/test/FixedPriceBatch/README.md create mode 100644 script/ops/test/FixedPriceBatch/TestData.s.sol create mode 100644 script/ops/test/FixedPriceBatch/createAuction.sh create mode 100644 script/ops/test/FixedPriceBatch/placeBid.sh create mode 100644 script/ops/test/FixedPriceBatch/settleAuction.sh create mode 100644 script/ops/test/FixedPriceBatch/warp.sh rename script/salts/{dtl => dtl-uniswap}/UniswapDTLSalts.s.sol (100%) create mode 100755 script/salts/dtl-uniswap/uniswap_dtl_salts.sh delete mode 100755 script/salts/dtl/uniswap_dtl_salts.sh create mode 100644 test/Constants.sol rename test/callbacks/{ => liquidity}/UniswapV2DTL/UniswapV2DTLTest.sol (92%) rename test/callbacks/{ => liquidity}/UniswapV2DTL/onCancel.t.sol (100%) rename test/callbacks/{ => liquidity}/UniswapV2DTL/onCreate.t.sol (100%) rename test/callbacks/{ => liquidity}/UniswapV2DTL/onCurate.t.sol (100%) rename test/callbacks/{ => liquidity}/UniswapV2DTL/onSettle.t.sol (100%) rename test/callbacks/{ => liquidity}/UniswapV3DTL/UniswapV3DTLTest.sol (89%) rename test/callbacks/{ => liquidity}/UniswapV3DTL/onCancel.t.sol (100%) rename test/callbacks/{ => liquidity}/UniswapV3DTL/onCreate.t.sol (100%) rename test/callbacks/{ => liquidity}/UniswapV3DTL/onCurate.t.sol (100%) rename test/callbacks/{ => liquidity}/UniswapV3DTL/onSettle.t.sol (100%) create mode 100644 test/lib/ComputeAddress.sol diff --git a/.gitignore b/.gitignore index e53a6c2a..c79b712c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ docs/ # Dotenv file .env +.env.* node_modules/ diff --git a/script/deploy/README.md b/script/deploy/README.md index bd1835df..10e35d62 100644 --- a/script/deploy/README.md +++ b/script/deploy/README.md @@ -60,21 +60,27 @@ Notes: To perform a deployment, run the following script: ```bash -./script/deploy/deploy.sh < sequence_file > [broadcast=false] [verify=false] [resume=false] +./script/deploy/deploy.sh --deployFile --broadcast --verify --save --resume ``` For example, the following command will deploy using the specified sequence file, broadcast the changes and verify them using Etherscan: ```bash -./script/deploy/deploy.sh ./script/deploy/sequences/origin.json true true +./script/deploy/deploy.sh --deployFile ./script/deploy/sequences/origin.json --broadcast true --verify true ``` -Following deployment, the addresses need to be manually added into `./script/env.json`. +It will also save the deployment addresses to a file and update `env.json`. -If any problems are faced during deployment (or verification), set the third boolean argument to `true` in order to resume the previous transaction. For example: +To not save the deployment addresses, set the `--save` argument to `false`. For example: ```bash -./script/deploy/deploy.sh ./script/deploy/sequences/origin.json true true true +./script/deploy/deploy.sh --deployFile ./script/deploy/sequences/origin.json --broadcast true --verify true --save false +``` + +If any problems are faced during deployment (or verification), set the `--resume` argument to `true` in order to resume the previous transaction. For example: + +```bash +./script/deploy/deploy.sh --deployFile ./script/deploy/sequences/origin.json --broadcast true --verify true --save true --resume true ``` ##### Blast-Specific Version @@ -84,7 +90,7 @@ Deploying on Blast requires an AuctionHouse with additional constructor argument Example command: ```bash -CHAIN="blast-sepolia" ./script/deploy/deploy.sh ./script/deploy/sequences/origin.json true true +CHAIN="blast-sepolia" ./script/deploy/deploy.sh --deployFile ./script/deploy/sequences/origin.json --broadcast true --verify true ``` #### Verification diff --git a/script/deploy/deploy.sh b/script/deploy/deploy.sh index c1aa818f..2a871994 100755 --- a/script/deploy/deploy.sh +++ b/script/deploy/deploy.sh @@ -1,7 +1,7 @@ #!/bin/bash # Usage: -# ./deploy.sh +# ./deploy.sh --deployFile --broadcast --verify --save --resume --envFile <.env> # # Environment variables: # CHAIN: Chain name to deploy to. Corresponds to names in "./script/env.json". @@ -9,28 +9,57 @@ # RPC_URL: URL for the RPC node. Should be specified in .env. # VERIFIER_URL: URL for the Etherscan API verifier. Should be specified when used on an unsupported chain. -# Load environment variables, but respect overrides -curenv=$(declare -p -x) -source .env -eval "$curenv" +# 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 -# Get command-line arguments -DEPLOY_FILE=$1 -BROADCAST=${2:-false} -VERIFY=${3:-false} -RESUME=${4:-false} +# Apply defaults to command-line arguments +DEPLOY_FILE=$deployFile +BROADCAST=${broadcast:-false} +VERIFY=${verify:-false} +SAVE=${save:-true} +RESUME=${resume:-false} + +# 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 if DEPLOY_FILE is set if [ -z "$DEPLOY_FILE" ] then - echo "No deploy file specified. Provide the relative path after the command." + echo "No deploy file specified. Provide the relative path after the --deployFile flag." exit 1 fi # Check if DEPLOY_FILE exists if [ ! -f "$DEPLOY_FILE" ] then - echo "Deploy file ($DEPLOY_FILE) not found. Provide the correct relative path after the command." + echo "Deploy file ($DEPLOY_FILE) not found. Provide the correct relative path after the --deployFile flag." + exit 1 +fi + +# Validate if SAVE is "true" or "false", otherwise throw an error +if [ "$SAVE" != "true" ] && [ "$SAVE" != "false" ]; then + echo "Invalid value for --save. Use 'true' or 'false'." exit 1 fi @@ -48,8 +77,8 @@ fi echo "Using deploy script and contract: $DEPLOY_SCRIPT:$DEPLOY_CONTRACT" echo "Using deployment configuration: $DEPLOY_FILE" -echo "Using RPC at URL: $RPC_URL" echo "Using chain: $CHAIN" +echo "Using RPC at URL: $RPC_URL" if [ -n "$VERIFIER_URL" ]; then echo "Using verifier at URL: $VERIFIER_URL" fi @@ -60,9 +89,9 @@ echo "" BROADCAST_FLAG="" if [ "$BROADCAST" = "true" ] || [ "$BROADCAST" = "TRUE" ]; then BROADCAST_FLAG="--broadcast" - echo "Broadcasting is enabled" + echo "Broadcast: enabled" else - echo "Broadcasting is disabled" + echo "Broadcast: disabled" fi # Set VERIFY_FLAG based on VERIFY @@ -88,22 +117,29 @@ if [ "$VERIFY" = "true" ] || [ "$VERIFY" = "TRUE" ]; then VERIFY_FLAG="--verify --verifier $VERIFIER" fi fi - echo "Verification is enabled" + echo "Verification: enabled" +else + echo "Verification: disabled" +fi + +# Report if SAVE is enabled +if [ "$SAVE" = "true" ]; then + echo "Save deployment: enabled" else - echo "Verification is disabled" + echo "Save deployment: disabled" fi # Set RESUME_FLAG based on RESUME RESUME_FLAG="" if [ "$RESUME" = "true" ] || [ "$RESUME" = "TRUE" ]; then RESUME_FLAG="--resume" - echo "Resuming is enabled" + echo "Resume: enabled" else - echo "Resuming is disabled" + echo "Resume: disabled" fi # Deploy using script -forge script $DEPLOY_SCRIPT:$DEPLOY_CONTRACT --sig "deploy(string,string,bool)()" $CHAIN $DEPLOY_FILE $BROADCAST \ +forge script $DEPLOY_SCRIPT:$DEPLOY_CONTRACT --sig "deploy(string,string,bool)()" $CHAIN $DEPLOY_FILE $SAVE \ --rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvv \ $BROADCAST_FLAG \ $VERIFY_FLAG \ diff --git a/script/ops/test/FixedPriceBatch/README.md b/script/ops/test/FixedPriceBatch/README.md new file mode 100644 index 00000000..854a43ea --- /dev/null +++ b/script/ops/test/FixedPriceBatch/README.md @@ -0,0 +1,23 @@ +# FixedPriceBatch - Baseline Allocated Allowlist Testing + +## How to Test + +1. Create a virtual testnet on Tenderly +2. Store the environment variables in an environment file +3. Deploy the Axis stack +4. Deploy the Baseline v2 stack + - Record the kernel and reserve token addresses +5. Generate salts for the BaselineAllocatedAllowlist + - You will need to provide the kernel, owner, and reserveToken +6. Deploy the BaselineAllocatedAllowlist callback contract + - You will need to provide the kernel, owner, and reserveToken +7. Generate the Merkle root +8. Create the auction + - You will need to provide the quote token, base token, BaselineAllocatedAllowlist address and Merkle root + +## To Settle an Auction + +Assumes you are using a Tenderly Virtual Testnet + +1. Warp to the timestamp after the auction conclusion using the warp script +2. Run the settle auction script diff --git a/script/ops/test/FixedPriceBatch/TestData.s.sol b/script/ops/test/FixedPriceBatch/TestData.s.sol new file mode 100644 index 00000000..0aa3a5d8 --- /dev/null +++ b/script/ops/test/FixedPriceBatch/TestData.s.sol @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +// Scripting libraries +import {Script, console2} from "forge-std/Script.sol"; +import {WithEnvironment} from "script/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 {BALwithAllocatedAllowlist} from +// "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"; + +contract TestData is Script, WithEnvironment { + BatchAuctionHouse public auctionHouse; + + function mintTestTokens(address token, address receiver) public { + // Mint tokens to address + vm.broadcast(); + MockERC20(token).mint(receiver, 1e24); + } + + function createAuction( + string calldata chain_, + address quoteToken_, + address baseToken_, + address callback_, + bytes32 merkleRoot + ) public returns (uint96) { + // Load addresses from .env + _loadEnv(chain_); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + + vm.startBroadcast(); + + // Create Fixed Price Batch auction + IAuctionHouse.RoutingParams memory routingParams; + routingParams.auctionType = toKeycode("FPBA"); + routingParams.baseToken = baseToken_; + routingParams.quoteToken = quoteToken_; + routingParams.callbacks = ICallback(callback_); + if (callback_ != address(0)) { + console2.log("Setting callback parameters"); + // routingParams.callbackData = abi.encode( + // BaselineAxisLaunch.CreateData({ + // discoveryTickWidth: 100, + // allowlistParams: abi.encode(merkleRoot) + // }) + // ); + + // No spending approval necessary, since the callback will handle it + } else { + console2.log("Callback disabled"); + + // Approve spending of the base token + ERC20(baseToken_).approve(address(auctionHouse), 10e18); + } + + IFixedPriceBatch.AuctionDataParams memory auctionDataParams; + auctionDataParams.price = 1e18; // 1 quote tokens per base token + auctionDataParams.minFillPercent = uint24(10_000); // 10% + bytes memory implParams = abi.encode(auctionDataParams); + + uint48 duration = 86_400; // 1 day + + IFixedPriceBatch.AuctionParams memory auctionParams; + auctionParams.start = uint48(0); // immediately + auctionParams.duration = duration; + // capaity is in base token + auctionParams.capacity = 10e18; // 10 base tokens + auctionParams.implParams = implParams; + + string memory infoHash = ""; + + uint96 lotId = auctionHouse.auction(routingParams, auctionParams, infoHash); + + vm.stopBroadcast(); + + console2.log("Fixed Price Batch auction created with lot ID: ", lotId); + + // Get the conclusion timestamp from the auction + (, uint48 conclusion,,,,,,) = + IAuction(address(auctionHouse.getBatchModuleForId(lotId))).lotData(lotId); + console2.log("Auction ends at timestamp", conclusion); + + return lotId; + } + + function cancelAuction(string calldata chain_, uint96 lotId_) public { + _loadEnv(chain_); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + vm.broadcast(); + auctionHouse.cancel(lotId_, bytes("")); + } + + function placeBid( + string calldata chain_, + uint96 lotId_, + uint256 amount_, + bytes32 merkleProof_, + uint256 allocatedAmount_ + ) public { + _loadEnv(chain_); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + + // Approve spending of the quote token + { + (,, address quoteTokenAddress,,,,,,) = auctionHouse.lotRouting(lotId_); + + vm.broadcast(); + ERC20(quoteTokenAddress).approve(address(auctionHouse), amount_); + + console2.log("Approved spending of quote token by BatchAuctionHouse"); + } + + bytes32[] memory allowlistProof = new bytes32[](1); + allowlistProof[0] = merkleProof_; + + vm.broadcast(); + uint64 bidId = auctionHouse.bid( + IBatchAuctionHouse.BidParams({ + lotId: lotId_, + bidder: msg.sender, + referrer: address(0), + amount: amount_, + auctionData: abi.encode(""), + permit2Data: bytes("") + }), + abi.encode(allowlistProof, allocatedAmount_) + ); + + console2.log("Bid placed with ID: ", bidId); + } + + function settleAuction(string calldata chain_, uint96 lotId_) public { + _loadEnv(chain_); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + + console2.log("Timestamp is", block.timestamp); + + vm.broadcast(); + auctionHouse.settle(lotId_, 100, abi.encode("")); + + console2.log("Auction settled with lot ID: ", lotId_); + } +} diff --git a/script/ops/test/FixedPriceBatch/createAuction.sh b/script/ops/test/FixedPriceBatch/createAuction.sh new file mode 100644 index 00000000..97864c58 --- /dev/null +++ b/script/ops/test/FixedPriceBatch/createAuction.sh @@ -0,0 +1,87 @@ +#!/bin/bash + +# Usage: +# ./createAuction.sh --quoteToken
--baseToken
--callback
--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 + +# Apply defaults to command-line arguments +BROADCAST=${broadcast:-false} + +# Check that the CHAIN is defined +if [ -z "$CHAIN" ] +then + echo "No chain specified. Set the CHAIN environment variable." + exit 1 +fi + +# Check that the quote token is defined and is an address +if [[ ! "$quoteToken" =~ ^0x[0-9a-fA-F]{40}$ ]] +then + echo "Invalid quote token specified. Provide the address after the --quoteToken flag." + exit 1 +fi + +# Check that the base token is defined and is an address +if [[ ! "$baseToken" =~ ^0x[a-fA-F0-9]{40}$ ]] +then + echo "Invalid base token specified. Provide the address after the --baseToken flag." + exit 1 +fi + +# Check that the callback is defined and is an address +if [[ ! "$callback" =~ ^0x[a-fA-F0-9]{40}$ ]] +then + echo "Invalid callback specified. Provide the address after the --callback flag." + exit 1 +fi + +# Check that the allowlist merkle root is defined and is a bytes32 string +if [[ ! "$allowlistMerkleRoot" =~ ^0x[a-fA-F0-9]{64}$ ]] +then + echo "Invalid allowlist merkle root specified. Provide the bytes32 string after the --allowlistMerkleRoot flag." + exit 1 +fi + +echo "Using chain: $CHAIN" +echo "Using RPC at URL: $RPC_URL" +echo "Using quote token: $quoteToken" +echo "Using base token: $baseToken" +echo "Using callback: $callback" +echo "Using allowlist merkle root: $allowlistMerkleRoot" +echo "Deployer: $DEPLOYER_ADDRESS" + +# Set BROADCAST_FLAG based on BROADCAST +BROADCAST_FLAG="" +if [ "$BROADCAST" = "true" ] || [ "$BROADCAST" = "TRUE" ]; then + BROADCAST_FLAG="--broadcast" + echo "Broadcast: enabled" +else + echo "Broadcast: disabled" +fi + +# Create auction +forge script ./script/ops/test/FixedPriceBatch/TestData.s.sol:TestData --sig "createAuction(string,address,address,address,bytes32)()" $CHAIN $quoteToken $baseToken $callback $allowlistMerkleRoot \ +--rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvvv \ +$BROADCAST_FLAG diff --git a/script/ops/test/FixedPriceBatch/placeBid.sh b/script/ops/test/FixedPriceBatch/placeBid.sh new file mode 100644 index 00000000..1e090957 --- /dev/null +++ b/script/ops/test/FixedPriceBatch/placeBid.sh @@ -0,0 +1,87 @@ +#!/bin/bash + +# Usage: +# ./placeBid.sh --lotId --amount --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 + +# Apply defaults to command-line arguments +BROADCAST=${broadcast:-false} + +# Check that the CHAIN is defined +if [ -z "$CHAIN" ] +then + echo "No chain specified. Set the CHAIN environment variable." + exit 1 +fi + +# Check that the lotId is defined and is an integer +if [[ ! "$lotId" =~ ^[0-9]+$ ]] +then + echo "Invalid lotId specified. Provide the integer value after the --lotId flag." + exit 1 +fi + +# Check that the amount is defined and is an integer +if [[ ! "$amount" =~ ^[0-9]+$ ]] +then + echo "Invalid amount specified. Provide the integer value after the --amount flag." + exit 1 +fi + +# Check that the merkle proof is defined and is a bytes32 string +if [[ ! "$merkleProof" =~ ^0x[a-fA-F0-9]{64}$ ]] +then + echo "Invalid merkle proof specified. Provide the bytes32 string after the --merkleProof flag." + exit 1 +fi + +# Check that the allocated amount is defined and is an integer +if [[ ! "$allocatedAmount" =~ ^[0-9]+$ ]] +then + echo "Invalid allocated amount specified. Provide the integer value after the --allocatedAmount flag." + exit 1 +fi + +echo "Using chain: $CHAIN" +echo "Using RPC at URL: $RPC_URL" +echo "Lot ID: $lotId" +echo "Amount: $amount" +echo "Merkle proof: $merkleProof" +echo "Allocated amount: $allocatedAmount" +echo "Deployer: $DEPLOYER_ADDRESS" + +# Set BROADCAST_FLAG based on BROADCAST +BROADCAST_FLAG="" +if [ "$BROADCAST" = "true" ] || [ "$BROADCAST" = "TRUE" ]; then + BROADCAST_FLAG="--broadcast" + echo "Broadcast: enabled" +else + echo "Broadcast: disabled" +fi + +# Create auction +forge script ./script/ops/test/FixedPriceBatch/TestData.s.sol:TestData --sig "placeBid(string,uint96,uint256,bytes32,uint256)()" $CHAIN $lotId $amount $merkleProof $allocatedAmount \ +--rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvvv \ +$BROADCAST_FLAG diff --git a/script/ops/test/FixedPriceBatch/settleAuction.sh b/script/ops/test/FixedPriceBatch/settleAuction.sh new file mode 100644 index 00000000..f62e446a --- /dev/null +++ b/script/ops/test/FixedPriceBatch/settleAuction.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# Usage: +# ./settleAuction.sh --lotId --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 + +# Apply defaults to command-line arguments +BROADCAST=${broadcast:-false} + +# Check that the CHAIN is defined +if [ -z "$CHAIN" ] +then + echo "No chain specified. Set the CHAIN environment variable." + exit 1 +fi + +# Check that the lotId is defined and is an integer +if [[ ! "$lotId" =~ ^[0-9]+$ ]] +then + echo "Invalid lotId specified. Provide the integer value after the --lotId flag." + exit 1 +fi + +echo "Using chain: $CHAIN" +echo "Using RPC at URL: $RPC_URL" +echo "Lot ID: $lotId" +echo "Deployer: $DEPLOYER_ADDRESS" + +# Set BROADCAST_FLAG based on BROADCAST +BROADCAST_FLAG="" +if [ "$BROADCAST" = "true" ] || [ "$BROADCAST" = "TRUE" ]; then + BROADCAST_FLAG="--broadcast" + echo "Broadcast: enabled" +else + echo "Broadcast: disabled" +fi + +# Create auction +forge script ./script/ops/test/FixedPriceBatch/TestData.s.sol:TestData --sig "settleAuction(string,uint96)()" $CHAIN $lotId \ +--rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvvv \ +$BROADCAST_FLAG diff --git a/script/ops/test/FixedPriceBatch/warp.sh b/script/ops/test/FixedPriceBatch/warp.sh new file mode 100644 index 00000000..9cec7cfa --- /dev/null +++ b/script/ops/test/FixedPriceBatch/warp.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# Usage: +# ./warp.sh --timestamp --envFile <.env> + +# 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 ADMIN_RPC_URL is defined +if [ -z "$ADMIN_RPC_URL" ] +then + echo "No RPC URL specified. Set the ADMIN_RPC_URL environment variable." + exit 1 +fi + +# Check that the timestamp is defined and is an integer +if [[ ! "$timestamp" =~ ^[0-9]+$ ]] +then + echo "Invalid timestamp specified. Provide an integer after the --timestamp flag." + exit 1 +fi + +echo "Using RPC at URL: $ADMIN_RPC_URL" + +# Call +cast rpc evm_setNextBlockTimestamp "[\"$timestamp\"]" --raw --rpc-url $ADMIN_RPC_URL +echo "Warped to timestamp: $timestamp" diff --git a/script/ops/test/TestData.s.sol b/script/ops/test/TestData.s.sol index edfbe1b9..8126360c 100644 --- a/script/ops/test/TestData.s.sol +++ b/script/ops/test/TestData.s.sol @@ -7,14 +7,12 @@ import {Script, console2} from "forge-std/Script.sol"; // System contracts import {BatchAuctionHouse} from "src/BatchAuctionHouse.sol"; import {IAuctionHouse} from "src/interfaces/IAuctionHouse.sol"; -import {toKeycode, toVeecode} from "src/modules/Modules.sol"; +import {toKeycode} from "src/modules/Modules.sol"; import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; -import {ECIES, Point} from "src/lib/ECIES.sol"; -import {uint2str} from "src/lib/Uint2Str.sol"; -import {FixedPriceBatch} from "src/modules/auctions/batch/FPB.sol"; +import {Point} from "src/lib/ECIES.sol"; // Generic contracts -import {MockERC20, ERC20} from "lib/solmate/src/test/utils/mocks/MockERC20.sol"; +import {MockERC20} from "lib/solmate/src/test/utils/mocks/MockERC20.sol"; contract TestData is Script { BatchAuctionHouse public auctionHouse; @@ -45,19 +43,12 @@ contract TestData is Script { MockERC20(token).mint(receiver, 1e24); } - function createAuction( - uint256 pubKeyX, - uint256 pubKeyY, - address buyer - ) public returns (uint96) { + function createAuction(uint256 pubKeyX, uint256 pubKeyY) public returns (uint96) { // Load addresses from .env auctionHouse = BatchAuctionHouse(vm.envAddress("AUCTION_HOUSE")); Point memory publicKey = Point(pubKeyX, pubKeyY); - // // Deploy test tokens and store addresses - // deployTestTokens(msg.sender, buyer); - vm.startBroadcast(); quoteToken = MockERC20(address(0x8e5a555bcaB474C91dcA326bE3DFdDa7e30c3765)); @@ -66,7 +57,7 @@ contract TestData is Script { // Approve auction house for base token since it will be pre-funded baseToken.approve(address(auctionHouse), 1e24); - // Create LSBBA auction with the provided public key + // Create EMP auction with the provided public key IAuctionHouse.RoutingParams memory routingParams; routingParams.auctionType = toKeycode("EMPA"); routingParams.baseToken = address(baseToken); @@ -96,46 +87,6 @@ contract TestData is Script { return lotId; } - function createFPBAuction() public returns (uint96) { - // Load addresses from .env - auctionHouse = BatchAuctionHouse(vm.envAddress("AUCTION_HOUSE")); - - vm.startBroadcast(); - - quoteToken = MockERC20(address(0x47F12ccE28D1A2ac9184777fa8a993C6067Df728)); - baseToken = MockERC20(address(0x914e2477Cb36273db3E4c6c6D4cefF1B75aC1Db0)); - - // Approve auction house for base token since it will be pre-funded - baseToken.approve(address(auctionHouse), 1e24); - - // Create LSBBA auction with the provided public key - IAuctionHouse.RoutingParams memory routingParams; - routingParams.auctionType = toKeycode("FPBA"); - routingParams.baseToken = address(baseToken); - routingParams.quoteToken = address(quoteToken); - // No callbacks, allowlist, derivative, or other routing params needed - - FixedPriceBatch.AuctionDataParams memory auctionDataParams; - auctionDataParams.price = 5e18; // 5 quote tokens per base token - auctionDataParams.minFillPercent = uint24(10_000); // 10% - bytes memory implParams = abi.encode(auctionDataParams); - - FixedPriceBatch.AuctionParams memory auctionParams; - auctionParams.start = uint48(0); // immediately - auctionParams.duration = uint48(86_400); // 1 day - // capaity is in base token - auctionParams.capacity = 100e18; // 100 base tokens - auctionParams.implParams = implParams; - - string memory infoHash = ""; - - uint96 lotId = auctionHouse.auction(routingParams, auctionParams, infoHash); - - vm.stopBroadcast(); - - return lotId; - } - function cancelAuction(uint96 lotId) public { auctionHouse = BatchAuctionHouse(vm.envAddress("AUCTION_HOUSE")); vm.broadcast(); diff --git a/script/ops/test/deployTokens.sh b/script/ops/test/deployTokens.sh index 9a79bf90..22bbed82 100644 --- a/script/ops/test/deployTokens.sh +++ b/script/ops/test/deployTokens.sh @@ -3,7 +3,12 @@ # Load environment variables source .env +echo "RPC: $RPC_URL" +echo "Deployer: $DEPLOYER_ADDRESS" +echo "Seller: $1" +echo "Buyer: $2" + # Create auction forge script ./script/ops/test/TestData.s.sol:TestData --sig "deployTestTokens(address,address)()" $1 $2 \ --rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvv \ ---broadcast \ No newline at end of file +--broadcast diff --git a/script/salts/README.md b/script/salts/README.md index dfdc359d..1f8825ec 100644 --- a/script/salts/README.md +++ b/script/salts/README.md @@ -9,13 +9,13 @@ This document provides instructions on how to generate and use salts for CREATE2 Many of the tests use salts to deploy callbacks at addresses with a specific prefix. Changes to the state variables in the test contract can require the re-generation of the salt. To do so, perform the following: ```bash -./script/salts/test/test_salts.sh +./script/salts/test/test_salts.sh --saltKey ``` For example, if re-generating salts for the `MockCallback` contract, make the following call: ```bash -./script/salts/test/test_salts.sh MockCallback +./script/salts/test/test_salts.sh --saltKey MockCallback ``` The resulting salts will be written to the `./script/salts/salts.json` file, which the test cases will read from. @@ -33,11 +33,40 @@ For the AtomicAuctionHouse and BatchAuctionHouse, a specific script can be used Assuming that the developer wants to deploy an AtomicAuctionHouse at an address that will start with `0xAA`, the following command would be run: ```bash -./script/salts/auctionHouse/auction_house_salts.sh atomic AA +./script/salts/auctionHouse/auction_house_salts.sh --type atomic --prefix AA ``` 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. @@ -52,4 +81,4 @@ The following steps need to be followed to generate the salt: ./scripts/salts/write_salt.sh ./bytecode/MockCallback98.bin 98 MockCallback 0x5080f4a157b896da527e936ac326bc3742c5d0239c63823b4d5c9939cc19ccb1 ``` -Provided the contract bytecode (contract code and constructor arguments) is the same, the saved salt will be used during deployment. +Provided the contract bytecode (contract code and constructor arguments) is the same, the saved salt will be used during deployment. \ No newline at end of file diff --git a/script/salts/WithSalts.s.sol b/script/salts/WithSalts.s.sol index 72962479..eca86edb 100644 --- a/script/salts/WithSalts.s.sol +++ b/script/salts/WithSalts.s.sol @@ -90,6 +90,19 @@ contract WithSalts is Script { _setSalt(bytecodePath_, prefix_, string.concat("Test_", saltKey_), bytecodeHash_); } + /// @notice Same as `_setSalt()`, but prefixes the salt key with "Test_" so they are co-located and separate from production salts. + function _setTestSaltWithDeployer( + string memory bytecodePath_, + string memory prefix_, + string memory saltKey_, + bytes32 bytecodeHash_, + address deployer_ + ) internal { + _setSaltWithDeployer( + bytecodePath_, prefix_, string.concat("Test_", saltKey_), bytecodeHash_, deployer_ + ); + } + /// @notice Calls a script to generate and write the salt for a given bytecode /// /// @param bytecodePath_ The path to the bytecode @@ -103,12 +116,42 @@ contract WithSalts is Script { bytes32 bytecodeHash_ ) internal { // Call the salts script to generate and write the salt - string[] memory inputs = new string[](5); + string[] memory inputs = new string[](9); + inputs[0] = "./script/salts/write_salt.sh"; + inputs[1] = "--bytecodeFile"; + inputs[2] = bytecodePath_; + inputs[3] = "--prefix"; + inputs[4] = prefix_; + inputs[5] = "--saltKey"; + inputs[6] = saltKey_; + inputs[7] = "--bytecodeHash"; + inputs[8] = vm.toString(bytecodeHash_); + + vm.ffi(inputs); + + console2.log("Salt set for", saltKey_, "with prefix", prefix_); + } + + function _setSaltWithDeployer( + string memory bytecodePath_, + string memory prefix_, + string memory saltKey_, + bytes32 bytecodeHash_, + address deployer_ + ) internal { + // Call the salts script to generate and write the salt + string[] memory inputs = new string[](11); inputs[0] = "./script/salts/write_salt.sh"; - inputs[1] = bytecodePath_; - inputs[2] = prefix_; - inputs[3] = saltKey_; - inputs[4] = vm.toString(bytecodeHash_); + inputs[1] = "--bytecodeFile"; + inputs[2] = bytecodePath_; + inputs[3] = "--prefix"; + inputs[4] = prefix_; + inputs[5] = "--saltKey"; + inputs[6] = saltKey_; + inputs[7] = "--bytecodeHash"; + inputs[8] = vm.toString(bytecodeHash_); + inputs[9] = "--deployer"; + inputs[10] = vm.toString(deployer_); vm.ffi(inputs); diff --git a/script/salts/auctionHouse/auction_house_salts.sh b/script/salts/auctionHouse/auction_house_salts.sh index 16bf1697..0a472ccc 100755 --- a/script/salts/auctionHouse/auction_house_salts.sh +++ b/script/salts/auctionHouse/auction_house_salts.sh @@ -1,45 +1,63 @@ #!/bin/bash # Usage: -# ./auction_house_salts.sh +# ./auction_house_salts.sh --type --prefix --envFile <.env> # # Expects the following environment variables: # CHAIN: The chain to deploy to, based on values from the ./script/env.json file. -# Load environment variables, but respect overrides -curenv=$(declare -p -x) -source .env -eval "$curenv" +# Iterate through named arguments +# Source: https://unix.stackexchange.com/a/388038 +while [ $# -gt 0 ]; do + if [[ $1 == *"--"* ]]; then + v="${1/--/}" + declare $v="$2" + fi -# Get command-line arguments -MODE=$1 -PREFIX=$2 + 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 [ "$MODE" != "atomic" ] && [ "$MODE" != "batch" ] +if [ "$type" != "atomic" ] && [ "$type" != "batch" ] then - echo "Invalid mode specified. Provide 'atomic' or 'batch' after the command as argument 1." + echo "Invalid auction type specified. Provide 'atomic' or 'batch' after the --type flag." exit 1 fi # Set flag for atomic or batch auction -ATOMIC=$( if [ "$MODE" == "atomic" ]; then echo "true"; else echo "false"; fi ) +ATOMIC=$( if [ "$type" == "atomic" ]; then echo "true"; else echo "false"; fi ) # Check that the prefix is specified -if [ -z "$PREFIX" ] +if [ -z "$prefix" ] then - echo "No search prefix specified. Provide the prefix after the command as argument 1." + echo "No search prefix specified. Provide the prefix after the --prefix flag." exit 1 fi -echo "Using RPC at URL: $RPC_URL" echo "Using chain: $CHAIN" +echo "Using RPC at URL: $RPC_URL" # If the chain contains "blast", use the Blast-specific contracts to generate bytecode if [[ $CHAIN == *"blast"* ]] then echo "Using Blast-specific contracts" - forge script ./script/salts/auctionHouse/AuctionHouseSaltsBlast.s.sol:AuctionHouseSaltsBlast --sig "generate(string,string,bool)()" $CHAIN $PREFIX $ATOMIC + forge script ./script/salts/auctionHouse/AuctionHouseSaltsBlast.s.sol:AuctionHouseSaltsBlast --sig "generate(string,string,bool)()" $CHAIN $prefix $ATOMIC # Set the bytecode file if [ $ATOMIC ] @@ -50,7 +68,7 @@ then fi else echo "Using standard contracts" - forge script ./script/salts/auctionHouse/AuctionHouseSalts.s.sol:AuctionHouseSalts --sig "generate(string,string,bool)()" $CHAIN $PREFIX $ATOMIC + forge script ./script/salts/auctionHouse/AuctionHouseSalts.s.sol:AuctionHouseSalts --sig "generate(string,string,bool)()" $CHAIN $prefix $ATOMIC # Set the bytecode file if [ $ATOMIC ] diff --git a/script/salts/dtl/UniswapDTLSalts.s.sol b/script/salts/dtl-uniswap/UniswapDTLSalts.s.sol similarity index 100% rename from script/salts/dtl/UniswapDTLSalts.s.sol rename to script/salts/dtl-uniswap/UniswapDTLSalts.s.sol diff --git a/script/salts/dtl-uniswap/uniswap_dtl_salts.sh b/script/salts/dtl-uniswap/uniswap_dtl_salts.sh new file mode 100755 index 00000000..68640f24 --- /dev/null +++ b/script/salts/dtl-uniswap/uniswap_dtl_salts.sh @@ -0,0 +1,58 @@ +#!/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/dtl/uniswap_dtl_salts.sh b/script/salts/dtl/uniswap_dtl_salts.sh deleted file mode 100755 index 36313b00..00000000 --- a/script/salts/dtl/uniswap_dtl_salts.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -# Usage: -# ./uniswap_dtl_salts.sh <2 | 3> -# -# Expects the following environment variables: -# CHAIN: The chain to deploy to, based on values from the ./script/env.json file. - -# Load environment variables, but respect overrides -curenv=$(declare -p -x) -source .env -eval "$curenv" - -# Get command-line arguments -VERSION=$1 -MODE=$2 - -# Check that the version is 2 or 3 -if [ "$VERSION" != "2" ] && [ "$VERSION" != "3" ] -then - echo "Invalid version specified. Provide '2' or '3' after the command as argument 1." - exit 1 -fi - -# Check that the mode is "atomic" or "batch" -if [ "$MODE" != "atomic" ] && [ "$MODE" != "batch" ] -then - echo "Invalid mode specified. Provide 'atomic' or 'batch' after the command as argument 2." - exit 1 -fi - -# Set flag for atomic or batch auction -ATOMIC=$( if [ "$MODE" == "atomic" ]; then echo "true"; else echo "false"; fi ) - -echo "Using RPC at URL: $RPC_URL" -echo "Using chain: $CHAIN" -echo "Using Uniswap version: $VERSION" -echo "Using variant: $MODE" - -forge script ./script/salts/dtl/UniswapDTLSalts.s.sol:UniswapDTLSalts --sig "generate(string,string,bool)()" $CHAIN $VERSION $ATOMIC diff --git a/script/salts/test/TestSalts.s.sol b/script/salts/test/TestSalts.s.sol index bfcaa134..5f420d73 100644 --- a/script/salts/test/TestSalts.s.sol +++ b/script/salts/test/TestSalts.s.sol @@ -6,29 +6,26 @@ 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 {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 {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"; -contract TestSalts is Script, WithEnvironment, Permit2User, WithSalts { - // TODO shift into abstract contract that tests also inherit from - 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(0x584A2a1F5eCdCDcB6c0616cd280a7Db89239872B); - address internal constant _UNISWAP_V3_FACTORY = - address(0x43de928116768b88F8BF8f768b3de90A0Aaf9551); - address internal constant _GUNI_FACTORY = address(0xc46b184e5521Cb87Fc5288Ff49D978A4BE4B055c); +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"; function _setUp(string calldata chain_) internal { _loadEnv(chain_); @@ -414,43 +411,22 @@ contract TestSalts is Script, WithEnvironment, Permit2User, WithSalts { _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; + 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(_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); + _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 { @@ -468,4 +444,82 @@ contract TestSalts is Script, WithEnvironment, Permit2User, WithSalts { _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/script/salts/test/test_salts.sh b/script/salts/test/test_salts.sh index 9799bfe4..24cc0836 100755 --- a/script/salts/test/test_salts.sh +++ b/script/salts/test/test_salts.sh @@ -1,35 +1,54 @@ #!/bin/bash # Usage: -# ./test_salts.sh - -# Get command-line arguments -SALT_KEY=$1 # Which key to clear the salts for - -# Load environment variables, but respect overrides -curenv=$(declare -p -x) -source .env -eval "$curenv" +# ./test_salts.sh --saltKey --envFile <.env> + +# 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 if SALT_KEY is specified -if [ -z "$SALT_KEY" ] +# Check if saltKey is specified +if [ -z "$saltKey" ] then - echo "No salt key specified. Provide the salt key after the command." + echo "No salt key specified. Provide the salt key after the --key flag." exit 1 fi -echo "Using RPC at URL: $RPC_URL" echo "Using chain: $CHAIN" -echo "Salt key: $SALT_KEY" +echo "Using RPC at URL: $RPC_URL" +echo "Salt key: $saltKey" salt_file="./script/salts/salts.json" salt_tmp_file="./script/salts/salts.json.tmp" # Clear the salts for the specified salt key if [ -f $salt_file ]; then - echo "Clearing old values for salt key: $SALT_KEY" - jq "del(.\"Test_$SALT_KEY\")" $salt_file > $salt_tmp_file && mv $salt_tmp_file $salt_file + echo "Clearing old values for salt key: $saltKey" + jq "del(.\"Test_$saltKey\")" $salt_file > $salt_tmp_file && mv $salt_tmp_file $salt_file fi # Generate bytecode -forge script ./script/salts/test/TestSalts.s.sol:TestSalts --sig "generate(string,string)()" $CHAIN $SALT_KEY +forge script ./script/salts/test/TestSalts.s.sol:TestSalts --sig "generate(string,string)()" $CHAIN $saltKey diff --git a/script/salts/write_salt.sh b/script/salts/write_salt.sh index 7f657e5e..1ca8551c 100755 --- a/script/salts/write_salt.sh +++ b/script/salts/write_salt.sh @@ -1,51 +1,62 @@ #!/bin/bash # Usage: -# ./write_salt.sh +# ./write_salt.sh --bytecode --prefix --saltKey --bytecodeHash [--deployer ] -# Get command-line arguments -BYTECODE_FILE=$1 # Which bytecode to use -PREFIX=$2 # Which prefix to search for -SALT_KEY=$3 # What key to save the generated salt as -BYTECODE_HASH=$4 # Hash of the bytecode to the contract +# Iterate through named arguments +# Source: https://unix.stackexchange.com/a/388038 +while [ $# -gt 0 ]; do + if [[ $1 == *"--"* ]]; then + v="${1/--/}" + declare $v="$2" + fi -# Check if BYTECODE_FILE is set -if [ -z "$BYTECODE_FILE" ] + shift +done + +# Check if bytecodeFile is set +if [ -z "$bytecodeFile" ] then echo "No bytecode file specified. Provide the relative path after the command." exit 1 fi -# Check if BYTECODE_FILE exists -if [ ! -f "$BYTECODE_FILE" ] +# Check if bytecodeFile exists +if [ ! -f "$bytecodeFile" ] then - echo "Bytecode file ($BYTECODE_FILE) not found. Provide the correct relative path after the command." + echo "Bytecode file ($bytecodeFile) not found. Provide the correct relative path after the command." exit 1 fi -# Check if PREFIX is set -if [ -z "$PREFIX" ] +# Check if prefix is set +if [ -z "$prefix" ] then echo "No prefix specified. Provide the prefix after the bytecode file." exit 1 fi -# Check if SALT_KEY is set -if [ -z "$SALT_KEY" ] +# Check if saltKey is set +if [ -z "$saltKey" ] then echo "No salt key specified. Provide the salt key after the prefix." exit 1 fi -# Check if BYTECODE_HASH is set -if [ -z "$BYTECODE_HASH" ] +# Check if bytecodeHash is set +if [ -z "$bytecodeHash" ] then echo "No args hash specified. Provide the args hash after the salt key." exit 1 fi +DEPLOYER_FLAG="" +if [ ! -z "$deployer" ] +then + DEPLOYER_FLAG="--deployer $deployer" +fi + # Generate salt using cast create2 -output=$(cast create2 -c -s $2 -i $(cat $1)) +output=$(cast create2 --case-sensitive --starts-with $prefix --init-code $(cat $bytecodeFile) $DEPLOYER_FLAG) # Get the first salt (as cast will often return the same salt multiple times) salt=$(echo "$output" | grep 'Salt: ' | head -n 1 | awk -F' ' '{print $2}') @@ -61,9 +72,9 @@ fi # jq will replace existing salts for the same key and args hash, or add new entries # It will write in the format of: # { -# "": { -# "": "" +# "": { +# "": "" # } # } -jq -S --arg contract "$SALT_KEY" --arg hash "$BYTECODE_HASH" --arg salt "$salt" '.[$contract] += { $hash: $salt }' $salt_file > $salt_tmp_file && mv $salt_tmp_file $salt_file -echo "Wrote salt for key $SALT_KEY to $salt_file" +jq -S --arg contract "$saltKey" --arg hash "$bytecodeHash" --arg salt "$salt" '.[$contract] += { $hash: $salt }' $salt_file > $salt_tmp_file && mv $salt_tmp_file $salt_file +echo "Wrote salt for key $saltKey to $salt_file" diff --git a/test/Constants.sol b/test/Constants.sol new file mode 100644 index 00000000..c26b4c34 --- /dev/null +++ b/test/Constants.sol @@ -0,0 +1,19 @@ +/// SPDX-License-Identifier: UNLICENSED +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(0xAA3Ad4FA1F1B80FfE1329f1B33246a1A11aA4Dc2); + address internal constant _UNISWAP_V3_FACTORY = + address(0xAA5112f28f20a28907a1754927c556dADE865ed4); + address internal constant _GUNI_FACTORY = address(0xAA9E05BB6ee2880a5c6127F486BCb4D624863dD6); + 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/UniswapV2DTL/UniswapV2DTLTest.sol b/test/callbacks/liquidity/UniswapV2DTL/UniswapV2DTLTest.sol similarity index 92% rename from test/callbacks/UniswapV2DTL/UniswapV2DTLTest.sol rename to test/callbacks/liquidity/UniswapV2DTL/UniswapV2DTLTest.sol index 3a62bc54..e62d3a4c 100644 --- a/test/callbacks/UniswapV2DTL/UniswapV2DTLTest.sol +++ b/test/callbacks/liquidity/UniswapV2DTL/UniswapV2DTLTest.sol @@ -25,19 +25,16 @@ 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 { +abstract contract UniswapV2DirectToLiquidityTest is Test, Permit2User, WithSalts, TestConstants { using Callbacks for UniswapV2DirectToLiquidity; - 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 _NOT_SELLER = address(0x20); - address internal constant _AUCTION_HOUSE = address(0x000000000000000000000000000000000000000A); - address internal constant _UNISWAP_V2_FACTORY = - address(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); uint96 internal constant _LOT_CAPACITY = 10e18; @@ -85,10 +82,19 @@ abstract contract UniswapV2DirectToLiquidityTest is Test, Permit2User, WithSalts // No storage slots to set // Create a UniswapV2Router at a deterministic address - _uniV2Router = new UniswapV2Router02{ - salt: bytes32(0x035ba535d735a8e92093764ec05c30d49ab56cfd0d3da306185ab02b1fcac4f4) - }(address(_uniV2Factory), address(0)); - console2.log("UniswapV2Router address: {}", address(_uniV2Router)); // 0x48a34D8572aC949eFDa3f70263499DdE1F160A26 + 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)); diff --git a/test/callbacks/UniswapV2DTL/onCancel.t.sol b/test/callbacks/liquidity/UniswapV2DTL/onCancel.t.sol similarity index 100% rename from test/callbacks/UniswapV2DTL/onCancel.t.sol rename to test/callbacks/liquidity/UniswapV2DTL/onCancel.t.sol diff --git a/test/callbacks/UniswapV2DTL/onCreate.t.sol b/test/callbacks/liquidity/UniswapV2DTL/onCreate.t.sol similarity index 100% rename from test/callbacks/UniswapV2DTL/onCreate.t.sol rename to test/callbacks/liquidity/UniswapV2DTL/onCreate.t.sol diff --git a/test/callbacks/UniswapV2DTL/onCurate.t.sol b/test/callbacks/liquidity/UniswapV2DTL/onCurate.t.sol similarity index 100% rename from test/callbacks/UniswapV2DTL/onCurate.t.sol rename to test/callbacks/liquidity/UniswapV2DTL/onCurate.t.sol diff --git a/test/callbacks/UniswapV2DTL/onSettle.t.sol b/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol similarity index 100% rename from test/callbacks/UniswapV2DTL/onSettle.t.sol rename to test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol diff --git a/test/callbacks/UniswapV3DTL/UniswapV3DTLTest.sol b/test/callbacks/liquidity/UniswapV3DTL/UniswapV3DTLTest.sol similarity index 89% rename from test/callbacks/UniswapV3DTL/UniswapV3DTLTest.sol rename to test/callbacks/liquidity/UniswapV3DTL/UniswapV3DTLTest.sol index 8ecdc99d..7d7edd0f 100644 --- a/test/callbacks/UniswapV3DTL/UniswapV3DTLTest.sol +++ b/test/callbacks/liquidity/UniswapV3DTL/UniswapV3DTLTest.sol @@ -26,16 +26,15 @@ 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 { +abstract contract UniswapV3DirectToLiquidityTest is Test, Permit2User, WithSalts, TestConstants { using Callbacks for UniswapV3DirectToLiquidity; - 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 _NOT_SELLER = address(0x20); - address internal constant _AUCTION_HOUSE = address(0x000000000000000000000000000000000000000A); uint96 internal constant _LOT_CAPACITY = 10e18; @@ -78,18 +77,27 @@ abstract contract UniswapV3DirectToLiquidityTest is Test, Permit2User, WithSalts vm.store(address(_auctionHouse), bytes32(uint256(10)), bytes32(abi.encode(_PROTOCOL))); // Protocol // Create a UniswapV3Factory at a deterministic address - vm.startBroadcast(); - _uniV3Factory = new UniswapV3Factory{ - salt: bytes32(0xbc65534283bdbbac4a95a3fb1933af63d55135566688dd54d1c55a626b1bc366) - }(); - console2.log("UniswapV3Factory address: ", address(_uniV3Factory)); // 0x43de928116768b88F8BF8f768b3de90A0Aaf9551 + 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 - _gUniFactory = new GUniFactory{ - salt: bytes32(0x31d4bb3a2cd73df799deceac86fa252d040e24c2ea206f4172d74f72cfa34e4b) - }(address(_uniV3Factory)); - console2.log("GUniFactory address: ", address(_gUniFactory)); // 0xc46b184e5521Cb87Fc5288Ff49D978A4BE4B055c + 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)); diff --git a/test/callbacks/UniswapV3DTL/onCancel.t.sol b/test/callbacks/liquidity/UniswapV3DTL/onCancel.t.sol similarity index 100% rename from test/callbacks/UniswapV3DTL/onCancel.t.sol rename to test/callbacks/liquidity/UniswapV3DTL/onCancel.t.sol diff --git a/test/callbacks/UniswapV3DTL/onCreate.t.sol b/test/callbacks/liquidity/UniswapV3DTL/onCreate.t.sol similarity index 100% rename from test/callbacks/UniswapV3DTL/onCreate.t.sol rename to test/callbacks/liquidity/UniswapV3DTL/onCreate.t.sol diff --git a/test/callbacks/UniswapV3DTL/onCurate.t.sol b/test/callbacks/liquidity/UniswapV3DTL/onCurate.t.sol similarity index 100% rename from test/callbacks/UniswapV3DTL/onCurate.t.sol rename to test/callbacks/liquidity/UniswapV3DTL/onCurate.t.sol diff --git a/test/callbacks/UniswapV3DTL/onSettle.t.sol b/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol similarity index 100% rename from test/callbacks/UniswapV3DTL/onSettle.t.sol rename to test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol diff --git a/test/lib/ComputeAddress.sol b/test/lib/ComputeAddress.sol new file mode 100644 index 00000000..641c1199 --- /dev/null +++ b/test/lib/ComputeAddress.sol @@ -0,0 +1,49 @@ +// 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; + } +} From 82d3753eeb3bf623351d111d832acc282c6f7d55 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 14 Jun 2024 12:25:49 +0400 Subject: [PATCH 03/82] Update test salts and addresses --- script/salts/salts.json | 13 +++++++++++-- test/Constants.sol | 6 +++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/script/salts/salts.json b/script/salts/salts.json index 651da0ba..b1327403 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -45,6 +45,9 @@ "0x240bdd876f7c0070009c234b8cde981c3865d49db15097f59cd4ffb15d818d1e": "0xe68b5bbeed8a53eb7e97b7bc84ec08e1e6a5b360cae16f0653c60eff312dec3f", "0xb8a17b3ee693ebdcfc6913bb2f65d0fadbe8812d9ef4d927595a7dc75db68727": "0x956b71c3545015d12e8bbefbad72019b673860f32a5b4313eeb866425d97be17" }, + "Test_GUniFactory": { + "0x3bf0e882023640f31bf861e1f13d306fd4fbb7afb7860e21a489062cbefcf885": "0x397acf3db4cc9c81f8c1975a5505e392e6b5f8eb3b22efcc094b3e0f39f6739b" + }, "Test_MockCallback": { "0x0825d99059fe0dc95e0b5cd7b853a5f3f50b58f25c5812fc7fd01d69ff4ec679": "0x222b47fd0259b3eacfbc04b9dddf5bb5ba060245c2c3c3673672ad4d815d01df", "0x51526251ca3003df174c65f2fb581f61820ce57c14720e0d67480ed8c8b77925": "0xd25a3174b866cae4f78f513123ffebf33114f3df0093e06159010b3d9fbadff3", @@ -66,10 +69,16 @@ "0xf2644573f57aea10dffac6e7215b409fa19236ae57b735b20b9fac9834391850": "0x3a824c912eb7f08b82a8d936c2e29cb2b6fdde7e33ea9af18d9ccbde9c454161" }, "Test_UniswapV2DirectToLiquidity": { - "0x174201fc5371e6b5c38ac3e8a150aac595a79929c11ade671773a4af96e796b2": "0xf79f6bfb74c7ea1422de906b5c897cbc4e8e282d391348930a7f75feaa4fc6ce" + "0xbce774b5c75ce6af2b000bd157d0966753042aba6fde38f5ea2eca76b585791f": "0x4a96efe15db180328cfc5296e72ceed9e7e3a10213a9c34d69b500733afc2d21" + }, + "Test_UniswapV2Router": { + "0xe6204aa211921628df345ff0b909c863298684cd8ca65de5479af6b70662e622": "0xf508fd71ff40f5d0640b01b9384f98d35db43c7ddb0d4abe274d61fdf1ea967f" }, "Test_UniswapV3DirectToLiquidity": { - "0xbbc3774034dce84cb792ad50a090b7c2b736a85af6e59e595e55e4f369523495": "0x2cb699095381555944575ef169da11fe4a944e6c6c382910eefd1a06c32b2c33" + "0x58b7674df101688da4f68d9cfad65390f1f35abe1c999bd0a251069b8883f528": "0xee9c953ecdad99f7aab8e6812d8b023c11ca7978a5324739a9e8987c44ac2e96" + }, + "Test_UniswapV3Factory": { + "0xbcd657c3390ecd2e1782b6473400c51fa124922eb98b69f1b5192eb0f8e3d3df": "0x3448ebb18cb03fae2e9153c621d46f1b9b8941cc66e7063b587fe4a284490b01" }, "TokenAllowlist": { "0x09db47d395a68db033a3b222b9d1a212cec8422b03aeafc313aa4d2813c6dd60": "0xe07a005213f35e1f050a4da040d6bc3cae2ad333647b51a6ffa2e7941980043a", diff --git a/test/Constants.sol b/test/Constants.sol index c26b4c34..04b9f4fe 100644 --- a/test/Constants.sol +++ b/test/Constants.sol @@ -7,10 +7,10 @@ abstract contract TestConstants { address internal constant _UNISWAP_V2_FACTORY = address(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); address internal constant _UNISWAP_V2_ROUTER = - address(0xAA3Ad4FA1F1B80FfE1329f1B33246a1A11aA4Dc2); + address(0xAA9E6CDA232112EBc0FC2Ca14B3178567a410224); address internal constant _UNISWAP_V3_FACTORY = - address(0xAA5112f28f20a28907a1754927c556dADE865ed4); - address internal constant _GUNI_FACTORY = address(0xAA9E05BB6ee2880a5c6127F486BCb4D624863dD6); + address(0xAA6E2347940f38546B6a1b804070899Ccb75c558); + address internal constant _GUNI_FACTORY = address(0xAA426C06A7D084E79bFa5B8cd0A15aeebA7693f1); address internal constant _BASELINE_KERNEL = address(0xBB); address internal constant _BASELINE_QUOTE_TOKEN = address(0xAA58516d932C482469914260268EEA7611BF0eb4); From 2832008ca4cbcf08fae6da87ded34d3cb3d788b7 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 14 Jun 2024 12:42:28 +0400 Subject: [PATCH 04/82] Test scripts for Uniswap DTLs --- .../test/FixedPriceBatch-BaseDTL/README.md | 23 +++ .../FixedPriceBatch-BaseDTL/TestData.s.sol | 154 ++++++++++++++++++ .../FixedPriceBatch-BaseDTL/createAuction.sh | 87 ++++++++++ .../test/FixedPriceBatch-BaseDTL/placeBid.sh | 87 ++++++++++ .../FixedPriceBatch-BaseDTL/settleAuction.sh | 63 +++++++ .../ops/test/FixedPriceBatch-BaseDTL/warp.sh | 44 +++++ 6 files changed, 458 insertions(+) create mode 100644 script/ops/test/FixedPriceBatch-BaseDTL/README.md create mode 100644 script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol create mode 100644 script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh create mode 100644 script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh create mode 100644 script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh create mode 100644 script/ops/test/FixedPriceBatch-BaseDTL/warp.sh diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/README.md b/script/ops/test/FixedPriceBatch-BaseDTL/README.md new file mode 100644 index 00000000..854a43ea --- /dev/null +++ b/script/ops/test/FixedPriceBatch-BaseDTL/README.md @@ -0,0 +1,23 @@ +# FixedPriceBatch - Baseline Allocated Allowlist Testing + +## How to Test + +1. Create a virtual testnet on Tenderly +2. Store the environment variables in an environment file +3. Deploy the Axis stack +4. Deploy the Baseline v2 stack + - Record the kernel and reserve token addresses +5. Generate salts for the BaselineAllocatedAllowlist + - You will need to provide the kernel, owner, and reserveToken +6. Deploy the BaselineAllocatedAllowlist callback contract + - You will need to provide the kernel, owner, and reserveToken +7. Generate the Merkle root +8. Create the auction + - You will need to provide the quote token, base token, BaselineAllocatedAllowlist address and Merkle root + +## To Settle an Auction + +Assumes you are using a Tenderly Virtual Testnet + +1. Warp to the timestamp after the auction conclusion using the warp script +2. Run the settle auction script diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol new file mode 100644 index 00000000..f200e335 --- /dev/null +++ b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol @@ -0,0 +1,154 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +// Scripting libraries +import {Script, console2} from "forge-std/Script.sol"; +import {WithEnvironment} from "script/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"; + +// Callbacks +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"; + +contract TestData is Script, WithEnvironment { + BatchAuctionHouse public auctionHouse; + + function mintTestTokens(address token, address receiver) public { + // Mint tokens to address + vm.broadcast(); + MockERC20(token).mint(receiver, 1e24); + } + + function createAuction( + string calldata chain_, + address quoteToken_, + address baseToken_, + address callback_ + ) public returns (uint96) { + // Load addresses from .env + _loadEnv(chain_); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + + vm.startBroadcast(); + + // Create Fixed Price Batch auction + IAuctionHouse.RoutingParams memory routingParams; + routingParams.auctionType = toKeycode("FPBA"); + routingParams.baseToken = baseToken_; + routingParams.quoteToken = quoteToken_; + routingParams.callbacks = ICallback(callback_); + if (callback_ != address(0)) { + console2.log("Callback enabled"); + routingParams.callbackData = abi.encode( + BaseDirectToLiquidity.OnCreateParams({ + proceedsUtilisationPercent: 50_000, // 50% + vestingStart: 0, + vestingExpiry: 0, + recipient: msg.sender, + implParams: abi.encode("") + }) + ); + + // Approve spending of the base token by the callback (for deposit into the liquidity pool) + ERC20(baseToken_).approve(callback_, 10e18); + } else { + console2.log("Callback disabled"); + } + + // Approve spending of the base token by the AuctionHouse + ERC20(baseToken_).approve(address(auctionHouse), 10e18); + + IFixedPriceBatch.AuctionDataParams memory auctionDataParams; + auctionDataParams.price = 2e18; // 2 quote tokens per base token + auctionDataParams.minFillPercent = uint24(10_000); // 10% + bytes memory implParams = abi.encode(auctionDataParams); + + uint48 duration = 86_400; // 1 day + + IFixedPriceBatch.AuctionParams memory auctionParams; + auctionParams.start = uint48(0); // immediately + auctionParams.duration = duration; + // capaity is in base token + auctionParams.capacity = 10e18; // 10 base tokens + auctionParams.implParams = implParams; + + string memory infoHash = ""; + + uint96 lotId = auctionHouse.auction(routingParams, auctionParams, infoHash); + + vm.stopBroadcast(); + + console2.log("Fixed Price Batch auction created with lot ID: ", lotId); + + // Get the conclusion timestamp from the auction + (, uint48 conclusion,,,,,,) = + IAuction(address(auctionHouse.getBatchModuleForId(lotId))).lotData(lotId); + console2.log("Auction ends at timestamp", conclusion); + + return lotId; + } + + function cancelAuction(string calldata chain_, uint96 lotId_) public { + _loadEnv(chain_); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + vm.broadcast(); + auctionHouse.cancel(lotId_, bytes("")); + } + + function placeBid(string calldata chain_, uint96 lotId_, uint256 amount_) public { + _loadEnv(chain_); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + + // Approve spending of the quote token + { + (,, address quoteTokenAddress,,,,,,) = auctionHouse.lotRouting(lotId_); + + vm.broadcast(); + ERC20(quoteTokenAddress).approve(address(auctionHouse), amount_); + + console2.log("Approved spending of quote token by BatchAuctionHouse"); + } + + vm.broadcast(); + uint64 bidId = auctionHouse.bid( + IBatchAuctionHouse.BidParams({ + lotId: lotId_, + bidder: msg.sender, + referrer: address(0), + amount: amount_, + auctionData: abi.encode(""), + permit2Data: bytes("") + }), + abi.encode("") + ); + + console2.log("Bid placed with ID: ", bidId); + } + + function settleAuction(string calldata chain_, uint96 lotId_) public { + _loadEnv(chain_); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + + console2.log("Timestamp is", block.timestamp); + + bytes memory callbackData = + abi.encode(UniswapV2DirectToLiquidity.OnSettleParams({maxSlippage: 500})); // 0.5% + + vm.broadcast(); + auctionHouse.settle(lotId_, 100, callbackData); + + console2.log("Auction settled with lot ID: ", lotId_); + } +} diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh b/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh new file mode 100644 index 00000000..97864c58 --- /dev/null +++ b/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh @@ -0,0 +1,87 @@ +#!/bin/bash + +# Usage: +# ./createAuction.sh --quoteToken
--baseToken
--callback
--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 + +# Apply defaults to command-line arguments +BROADCAST=${broadcast:-false} + +# Check that the CHAIN is defined +if [ -z "$CHAIN" ] +then + echo "No chain specified. Set the CHAIN environment variable." + exit 1 +fi + +# Check that the quote token is defined and is an address +if [[ ! "$quoteToken" =~ ^0x[0-9a-fA-F]{40}$ ]] +then + echo "Invalid quote token specified. Provide the address after the --quoteToken flag." + exit 1 +fi + +# Check that the base token is defined and is an address +if [[ ! "$baseToken" =~ ^0x[a-fA-F0-9]{40}$ ]] +then + echo "Invalid base token specified. Provide the address after the --baseToken flag." + exit 1 +fi + +# Check that the callback is defined and is an address +if [[ ! "$callback" =~ ^0x[a-fA-F0-9]{40}$ ]] +then + echo "Invalid callback specified. Provide the address after the --callback flag." + exit 1 +fi + +# Check that the allowlist merkle root is defined and is a bytes32 string +if [[ ! "$allowlistMerkleRoot" =~ ^0x[a-fA-F0-9]{64}$ ]] +then + echo "Invalid allowlist merkle root specified. Provide the bytes32 string after the --allowlistMerkleRoot flag." + exit 1 +fi + +echo "Using chain: $CHAIN" +echo "Using RPC at URL: $RPC_URL" +echo "Using quote token: $quoteToken" +echo "Using base token: $baseToken" +echo "Using callback: $callback" +echo "Using allowlist merkle root: $allowlistMerkleRoot" +echo "Deployer: $DEPLOYER_ADDRESS" + +# Set BROADCAST_FLAG based on BROADCAST +BROADCAST_FLAG="" +if [ "$BROADCAST" = "true" ] || [ "$BROADCAST" = "TRUE" ]; then + BROADCAST_FLAG="--broadcast" + echo "Broadcast: enabled" +else + echo "Broadcast: disabled" +fi + +# Create auction +forge script ./script/ops/test/FixedPriceBatch/TestData.s.sol:TestData --sig "createAuction(string,address,address,address,bytes32)()" $CHAIN $quoteToken $baseToken $callback $allowlistMerkleRoot \ +--rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvvv \ +$BROADCAST_FLAG diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh b/script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh new file mode 100644 index 00000000..1e090957 --- /dev/null +++ b/script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh @@ -0,0 +1,87 @@ +#!/bin/bash + +# Usage: +# ./placeBid.sh --lotId --amount --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 + +# Apply defaults to command-line arguments +BROADCAST=${broadcast:-false} + +# Check that the CHAIN is defined +if [ -z "$CHAIN" ] +then + echo "No chain specified. Set the CHAIN environment variable." + exit 1 +fi + +# Check that the lotId is defined and is an integer +if [[ ! "$lotId" =~ ^[0-9]+$ ]] +then + echo "Invalid lotId specified. Provide the integer value after the --lotId flag." + exit 1 +fi + +# Check that the amount is defined and is an integer +if [[ ! "$amount" =~ ^[0-9]+$ ]] +then + echo "Invalid amount specified. Provide the integer value after the --amount flag." + exit 1 +fi + +# Check that the merkle proof is defined and is a bytes32 string +if [[ ! "$merkleProof" =~ ^0x[a-fA-F0-9]{64}$ ]] +then + echo "Invalid merkle proof specified. Provide the bytes32 string after the --merkleProof flag." + exit 1 +fi + +# Check that the allocated amount is defined and is an integer +if [[ ! "$allocatedAmount" =~ ^[0-9]+$ ]] +then + echo "Invalid allocated amount specified. Provide the integer value after the --allocatedAmount flag." + exit 1 +fi + +echo "Using chain: $CHAIN" +echo "Using RPC at URL: $RPC_URL" +echo "Lot ID: $lotId" +echo "Amount: $amount" +echo "Merkle proof: $merkleProof" +echo "Allocated amount: $allocatedAmount" +echo "Deployer: $DEPLOYER_ADDRESS" + +# Set BROADCAST_FLAG based on BROADCAST +BROADCAST_FLAG="" +if [ "$BROADCAST" = "true" ] || [ "$BROADCAST" = "TRUE" ]; then + BROADCAST_FLAG="--broadcast" + echo "Broadcast: enabled" +else + echo "Broadcast: disabled" +fi + +# Create auction +forge script ./script/ops/test/FixedPriceBatch/TestData.s.sol:TestData --sig "placeBid(string,uint96,uint256,bytes32,uint256)()" $CHAIN $lotId $amount $merkleProof $allocatedAmount \ +--rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvvv \ +$BROADCAST_FLAG diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh b/script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh new file mode 100644 index 00000000..f62e446a --- /dev/null +++ b/script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# Usage: +# ./settleAuction.sh --lotId --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 + +# Apply defaults to command-line arguments +BROADCAST=${broadcast:-false} + +# Check that the CHAIN is defined +if [ -z "$CHAIN" ] +then + echo "No chain specified. Set the CHAIN environment variable." + exit 1 +fi + +# Check that the lotId is defined and is an integer +if [[ ! "$lotId" =~ ^[0-9]+$ ]] +then + echo "Invalid lotId specified. Provide the integer value after the --lotId flag." + exit 1 +fi + +echo "Using chain: $CHAIN" +echo "Using RPC at URL: $RPC_URL" +echo "Lot ID: $lotId" +echo "Deployer: $DEPLOYER_ADDRESS" + +# Set BROADCAST_FLAG based on BROADCAST +BROADCAST_FLAG="" +if [ "$BROADCAST" = "true" ] || [ "$BROADCAST" = "TRUE" ]; then + BROADCAST_FLAG="--broadcast" + echo "Broadcast: enabled" +else + echo "Broadcast: disabled" +fi + +# Create auction +forge script ./script/ops/test/FixedPriceBatch/TestData.s.sol:TestData --sig "settleAuction(string,uint96)()" $CHAIN $lotId \ +--rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvvv \ +$BROADCAST_FLAG diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/warp.sh b/script/ops/test/FixedPriceBatch-BaseDTL/warp.sh new file mode 100644 index 00000000..9cec7cfa --- /dev/null +++ b/script/ops/test/FixedPriceBatch-BaseDTL/warp.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# Usage: +# ./warp.sh --timestamp --envFile <.env> + +# 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 ADMIN_RPC_URL is defined +if [ -z "$ADMIN_RPC_URL" ] +then + echo "No RPC URL specified. Set the ADMIN_RPC_URL environment variable." + exit 1 +fi + +# Check that the timestamp is defined and is an integer +if [[ ! "$timestamp" =~ ^[0-9]+$ ]] +then + echo "Invalid timestamp specified. Provide an integer after the --timestamp flag." + exit 1 +fi + +echo "Using RPC at URL: $ADMIN_RPC_URL" + +# Call +cast rpc evm_setNextBlockTimestamp "[\"$timestamp\"]" --raw --rpc-url $ADMIN_RPC_URL +echo "Warped to timestamp: $timestamp" From f4dbabba5f985627387fefaedafb11f392c0a6b3 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 14 Jun 2024 12:45:03 +0400 Subject: [PATCH 05/82] Update script paths and arguments --- .../ops/test/FixedPriceBatch-BaseDTL/README.md | 13 +++---------- .../FixedPriceBatch-BaseDTL/createAuction.sh | 10 +--------- .../test/FixedPriceBatch-BaseDTL/placeBid.sh | 18 +----------------- .../FixedPriceBatch-BaseDTL/settleAuction.sh | 2 +- 4 files changed, 6 insertions(+), 37 deletions(-) diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/README.md b/script/ops/test/FixedPriceBatch-BaseDTL/README.md index 854a43ea..7cb34e87 100644 --- a/script/ops/test/FixedPriceBatch-BaseDTL/README.md +++ b/script/ops/test/FixedPriceBatch-BaseDTL/README.md @@ -1,19 +1,12 @@ -# FixedPriceBatch - Baseline Allocated Allowlist Testing +# FixedPriceBatch - Uniswap DTL Testing ## How to Test 1. Create a virtual testnet on Tenderly 2. Store the environment variables in an environment file 3. Deploy the Axis stack -4. Deploy the Baseline v2 stack - - Record the kernel and reserve token addresses -5. Generate salts for the BaselineAllocatedAllowlist - - You will need to provide the kernel, owner, and reserveToken -6. Deploy the BaselineAllocatedAllowlist callback contract - - You will need to provide the kernel, owner, and reserveToken -7. Generate the Merkle root -8. Create the auction - - You will need to provide the quote token, base token, BaselineAllocatedAllowlist address and Merkle root +4. Create the auction + - You will need to provide the quote token, base token ## To Settle an Auction diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh b/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh index 97864c58..2bcaf49d 100644 --- a/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh +++ b/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh @@ -57,19 +57,11 @@ then exit 1 fi -# Check that the allowlist merkle root is defined and is a bytes32 string -if [[ ! "$allowlistMerkleRoot" =~ ^0x[a-fA-F0-9]{64}$ ]] -then - echo "Invalid allowlist merkle root specified. Provide the bytes32 string after the --allowlistMerkleRoot flag." - exit 1 -fi - echo "Using chain: $CHAIN" echo "Using RPC at URL: $RPC_URL" echo "Using quote token: $quoteToken" echo "Using base token: $baseToken" echo "Using callback: $callback" -echo "Using allowlist merkle root: $allowlistMerkleRoot" echo "Deployer: $DEPLOYER_ADDRESS" # Set BROADCAST_FLAG based on BROADCAST @@ -82,6 +74,6 @@ else fi # Create auction -forge script ./script/ops/test/FixedPriceBatch/TestData.s.sol:TestData --sig "createAuction(string,address,address,address,bytes32)()" $CHAIN $quoteToken $baseToken $callback $allowlistMerkleRoot \ +forge script ./script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol:TestData --sig "createAuction(string,address,address,address)()" $CHAIN $quoteToken $baseToken $callback \ --rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvvv \ $BROADCAST_FLAG diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh b/script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh index 1e090957..84f9fa3b 100644 --- a/script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh +++ b/script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh @@ -50,26 +50,10 @@ then exit 1 fi -# Check that the merkle proof is defined and is a bytes32 string -if [[ ! "$merkleProof" =~ ^0x[a-fA-F0-9]{64}$ ]] -then - echo "Invalid merkle proof specified. Provide the bytes32 string after the --merkleProof flag." - exit 1 -fi - -# Check that the allocated amount is defined and is an integer -if [[ ! "$allocatedAmount" =~ ^[0-9]+$ ]] -then - echo "Invalid allocated amount specified. Provide the integer value after the --allocatedAmount flag." - exit 1 -fi - echo "Using chain: $CHAIN" echo "Using RPC at URL: $RPC_URL" echo "Lot ID: $lotId" echo "Amount: $amount" -echo "Merkle proof: $merkleProof" -echo "Allocated amount: $allocatedAmount" echo "Deployer: $DEPLOYER_ADDRESS" # Set BROADCAST_FLAG based on BROADCAST @@ -82,6 +66,6 @@ else fi # Create auction -forge script ./script/ops/test/FixedPriceBatch/TestData.s.sol:TestData --sig "placeBid(string,uint96,uint256,bytes32,uint256)()" $CHAIN $lotId $amount $merkleProof $allocatedAmount \ +forge script ./script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol:TestData --sig "placeBid(string,uint96,uint256)()" $CHAIN $lotId $amount \ --rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvvv \ $BROADCAST_FLAG diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh b/script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh index f62e446a..ff3b5e49 100644 --- a/script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh +++ b/script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh @@ -58,6 +58,6 @@ else fi # Create auction -forge script ./script/ops/test/FixedPriceBatch/TestData.s.sol:TestData --sig "settleAuction(string,uint96)()" $CHAIN $lotId \ +forge script ./script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol:TestData --sig "settleAuction(string,uint96)()" $CHAIN $lotId \ --rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvvv \ $BROADCAST_FLAG From 3e67699a11845686e18b37784cff6744e0de33e2 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 14 Jun 2024 12:55:29 +0400 Subject: [PATCH 06/82] Improve deployTokens script --- script/ops/test/TestData.s.sol | 2 ++ script/ops/test/deployTokens.sh | 61 +++++++++++++++++++++++++++++---- 2 files changed, 56 insertions(+), 7 deletions(-) mode change 100644 => 100755 script/ops/test/deployTokens.sh diff --git a/script/ops/test/TestData.s.sol b/script/ops/test/TestData.s.sol index 8126360c..72442c0c 100644 --- a/script/ops/test/TestData.s.sol +++ b/script/ops/test/TestData.s.sol @@ -30,9 +30,11 @@ contract TestData is Script { // Mint quote tokens to buyer quoteToken.mint(buyer, 1e25); + console2.log("Minted 1e25 quote tokens to buyer"); // Mint base tokens to seller baseToken.mint(seller, 1e25); + console2.log("Minted 1e25 base tokens to seller"); vm.stopBroadcast(); } diff --git a/script/ops/test/deployTokens.sh b/script/ops/test/deployTokens.sh old mode 100644 new mode 100755 index 22bbed82..786a6ae3 --- a/script/ops/test/deployTokens.sh +++ b/script/ops/test/deployTokens.sh @@ -1,14 +1,61 @@ #!/bin/bash -# Load environment variables -source .env +# Usage: +# ./deployTokens.sh --seller --buyer --envFile <.env> -echo "RPC: $RPC_URL" +# 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 + +# Apply defaults to command-line arguments +BROADCAST=${broadcast:-false} + +# Check that the seller is defined and is an address +if [[ ! "$seller" =~ ^0x[a-fA-F0-9]{40}$ ]] +then + echo "Invalid seller specified. Provide the address after the --seller flag." + exit 1 +fi + +# Check that the buyer is defined and is an address +if [[ ! "$buyer" =~ ^0x[a-fA-F0-9]{40}$ ]] +then + echo "Invalid buyer specified. Provide the address after the --buyer flag." + exit 1 +fi + +echo "Using chain: $CHAIN" +echo "Using RPC at URL: $RPC_URL" +echo "Seller: $seller" +echo "Buyer: $buyer" echo "Deployer: $DEPLOYER_ADDRESS" -echo "Seller: $1" -echo "Buyer: $2" + +# Set BROADCAST_FLAG based on BROADCAST +BROADCAST_FLAG="" +if [ "$BROADCAST" = "true" ] || [ "$BROADCAST" = "TRUE" ]; then + BROADCAST_FLAG="--broadcast" + echo "Broadcast: enabled" +else + echo "Broadcast: disabled" +fi # Create auction -forge script ./script/ops/test/TestData.s.sol:TestData --sig "deployTestTokens(address,address)()" $1 $2 \ +forge script ./script/ops/test/TestData.s.sol:TestData --sig "deployTestTokens(address,address)()" $seller $buyer \ --rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvv \ ---broadcast +$BROADCAST_FLAG From 94f2053f996d2bd9a60676448ad50f8edd033ae4 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 14 Jun 2024 12:56:02 +0400 Subject: [PATCH 07/82] Document broadcast flag --- script/ops/test/deployTokens.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/ops/test/deployTokens.sh b/script/ops/test/deployTokens.sh index 786a6ae3..7c89a378 100755 --- a/script/ops/test/deployTokens.sh +++ b/script/ops/test/deployTokens.sh @@ -1,7 +1,7 @@ #!/bin/bash # Usage: -# ./deployTokens.sh --seller --buyer --envFile <.env> +# ./deployTokens.sh --seller --buyer --envFile <.env> --broadcast # Iterate through named arguments # Source: https://unix.stackexchange.com/a/388038 From 4a3d9b708ab83f11119e23261c9ee43b19356f07 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 14 Jun 2024 12:57:58 +0400 Subject: [PATCH 08/82] Make scripts executable --- script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh | 0 script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh | 0 script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh | 0 script/ops/test/FixedPriceBatch-BaseDTL/warp.sh | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh mode change 100644 => 100755 script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh mode change 100644 => 100755 script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh mode change 100644 => 100755 script/ops/test/FixedPriceBatch-BaseDTL/warp.sh diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh b/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh old mode 100644 new mode 100755 diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh b/script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh old mode 100644 new mode 100755 diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh b/script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh old mode 100644 new mode 100755 diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/warp.sh b/script/ops/test/FixedPriceBatch-BaseDTL/warp.sh old mode 100644 new mode 100755 From baf04c2b8482144c080ab919946e817d903e6524 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 14 Jun 2024 12:58:51 +0400 Subject: [PATCH 09/82] Document broadcast flag --- script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh | 2 +- script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh | 2 +- script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh b/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh index 2bcaf49d..b8682754 100755 --- a/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh +++ b/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh @@ -1,7 +1,7 @@ #!/bin/bash # Usage: -# ./createAuction.sh --quoteToken
--baseToken
--callback
--envFile <.env> +# ./createAuction.sh --quoteToken
--baseToken
--callback
--envFile <.env> --broadcast # # Expects the following environment variables: # CHAIN: The chain to deploy to, based on values from the ./script/env.json file. diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh b/script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh index 84f9fa3b..3ffe8392 100755 --- a/script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh +++ b/script/ops/test/FixedPriceBatch-BaseDTL/placeBid.sh @@ -1,7 +1,7 @@ #!/bin/bash # Usage: -# ./placeBid.sh --lotId --amount --envFile <.env> +# ./placeBid.sh --lotId --amount --envFile <.env> --broadcast # # Expects the following environment variables: # CHAIN: The chain to deploy to, based on values from the ./script/env.json file. diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh b/script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh index ff3b5e49..0a3791fe 100755 --- a/script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh +++ b/script/ops/test/FixedPriceBatch-BaseDTL/settleAuction.sh @@ -1,7 +1,7 @@ #!/bin/bash # Usage: -# ./settleAuction.sh --lotId --envFile <.env> +# ./settleAuction.sh --lotId --envFile <.env> --broadcast # # Expects the following environment variables: # CHAIN: The chain to deploy to, based on values from the ./script/env.json file. From 25e61af5f0a5ea38de8f7d6c5eb4d29fb2229d39 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 14 Jun 2024 18:02:07 +0400 Subject: [PATCH 10/82] Add to script specifying the Uniswap V3 pool fee --- .../ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol | 12 ++++++++++-- .../test/FixedPriceBatch-BaseDTL/createAuction.sh | 11 +++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol index f200e335..19aff81d 100644 --- a/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol +++ b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol @@ -35,7 +35,8 @@ contract TestData is Script, WithEnvironment { string calldata chain_, address quoteToken_, address baseToken_, - address callback_ + address callback_, + uint24 uniswapV3PoolFee_ ) public returns (uint96) { // Load addresses from .env _loadEnv(chain_); @@ -51,13 +52,20 @@ contract TestData is Script, WithEnvironment { routingParams.callbacks = ICallback(callback_); if (callback_ != address(0)) { console2.log("Callback enabled"); + + bytes memory callbackImplParams = abi.encode(""); + if (uniswapV3PoolFee_ > 0) { + console2.log("Setting Uniswap V3 pool fee to", uniswapV3PoolFee_); + callbackImplParams = abi.encode(uniswapV3PoolFee_); + } + routingParams.callbackData = abi.encode( BaseDirectToLiquidity.OnCreateParams({ proceedsUtilisationPercent: 50_000, // 50% vestingStart: 0, vestingExpiry: 0, recipient: msg.sender, - implParams: abi.encode("") + implParams: callbackImplParams }) ); diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh b/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh index b8682754..18605801 100755 --- a/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh +++ b/script/ops/test/FixedPriceBatch-BaseDTL/createAuction.sh @@ -1,7 +1,7 @@ #!/bin/bash # Usage: -# ./createAuction.sh --quoteToken
--baseToken
--callback
--envFile <.env> --broadcast +# ./createAuction.sh --quoteToken
--baseToken
--callback
--poolFee --envFile <.env> --broadcast # # Expects the following environment variables: # CHAIN: The chain to deploy to, based on values from the ./script/env.json file. @@ -57,11 +57,18 @@ then exit 1 fi +# If the pool fee is not set, set it to 0 +if [ -z "$poolFee" ] +then + poolFee=0 +fi + echo "Using chain: $CHAIN" echo "Using RPC at URL: $RPC_URL" echo "Using quote token: $quoteToken" echo "Using base token: $baseToken" echo "Using callback: $callback" +echo "Using pool fee (Uniswap V3 only): $poolFee" echo "Deployer: $DEPLOYER_ADDRESS" # Set BROADCAST_FLAG based on BROADCAST @@ -74,6 +81,6 @@ else fi # Create auction -forge script ./script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol:TestData --sig "createAuction(string,address,address,address)()" $CHAIN $quoteToken $baseToken $callback \ +forge script ./script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol:TestData --sig "createAuction(string,address,address,address,uint24)()" $CHAIN $quoteToken $baseToken $callback $poolFee \ --rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvvv \ $BROADCAST_FLAG From 7dcd4f027b19780f2fe27789f9b3c956ebdbc210 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 14 Jun 2024 19:13:33 +0400 Subject: [PATCH 11/82] Zero out GUniFactory addresses --- script/env.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/env.json b/script/env.json index b749ed96..b4699155 100644 --- a/script/env.json +++ b/script/env.json @@ -53,7 +53,7 @@ "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" }, "gUni": { - "factory": "0x39AC4439e6CB9427C073259e5742529cE46DD663" + "factory": "0x0000000000000000000000000000000000000000" }, "uniswapV2": { "factory": "0x6c4f747ba42136f3F12E70c975AbBc194CBD39E4", @@ -87,7 +87,7 @@ "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" }, "gUni": { - "factory": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b" + "factory": "0x0000000000000000000000000000000000000000" }, "uniswapV2": { "factory": "0x5D7ddDFee9fB5709Ccdea49Acd51db3d73BC75Fa", @@ -160,7 +160,7 @@ "weth": "0x4200000000000000000000000000000000000023" }, "gUni": { - "factory": "0xED28E5230E934cf9C843C08818D0639176040297" + "factory": "0x0000000000000000000000000000000000000000" }, "uniswapV2": { "factory": "0x9371C6e657681923708CA6F621DE5e93E5d46F7e", @@ -189,7 +189,7 @@ "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" }, "gUni": { - "factory": "0xEA1aFf9dbFfD1580F6b81A3ad3589E66652dB7D9" + "factory": "0x0000000000000000000000000000000000000000" }, "uniswapV2": { "factory": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", @@ -223,7 +223,7 @@ "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" }, "gUni": { - "factory": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" + "factory": "0x0000000000000000000000000000000000000000" }, "uniswapV2": { "factory": "0x85c0A59A492C084d84eDcD7a8b785eaF620a9B0d", From 44f167fe6df49861a99104981a19b82363374257 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Sat, 15 Jun 2024 13:09:33 +0400 Subject: [PATCH 12/82] Add back removed salt key --- script/salts/test/TestSalts.s.sol | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/script/salts/test/TestSalts.s.sol b/script/salts/test/TestSalts.s.sol index 5f420d73..d0486e1a 100644 --- a/script/salts/test/TestSalts.s.sol +++ b/script/salts/test/TestSalts.s.sol @@ -12,6 +12,7 @@ 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 {UniswapV2DirectToLiquidity} from "src/callbacks/liquidity/UniswapV2DTL.sol"; import {UniswapV3DirectToLiquidity} from "src/callbacks/liquidity/UniswapV3DTL.sol"; // import {BaselineAxisLaunch} from "src/callbacks/liquidity/BaselineV2/BaselineAxisLaunch.sol"; @@ -26,6 +27,7 @@ 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"; function _setUp(string calldata chain_) internal { _loadEnv(chain_); @@ -411,6 +413,45 @@ contract TestSalts is Script, WithEnvironment, Permit2User, WithSalts, TestConst _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 generateUniswapV2Router() public { bytes memory args = abi.encode(_UNISWAP_V2_FACTORY, address(0)); bytes memory contractCode = type(UniswapV2Router02).creationCode; From 0d457132de6bd34739f7b919ebb4d3be7e489099 Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 17 Jun 2024 16:41:43 -0500 Subject: [PATCH 13/82] wip: LIV svg image --- src/lib/SVG.sol | 327 ++++++ src/modules/derivatives/DerivativeCard.sol | 372 +++++++ utils/hot-chain-svg/package.json | 25 + utils/hot-chain-svg/src/boot.js | 22 + utils/hot-chain-svg/src/call.js | 34 + utils/hot-chain-svg/src/compile.js | 69 ++ utils/hot-chain-svg/src/deploy.js | 27 + utils/hot-chain-svg/src/index.js | 29 + utils/hot-chain-svg/src/qa.js | 35 + utils/hot-chain-svg/src/serve.js | 48 + utils/hot-chain-svg/src/sync-nfts.js | 66 ++ utils/hot-chain-svg/yarn.lock | 1167 ++++++++++++++++++++ 12 files changed, 2221 insertions(+) create mode 100644 src/lib/SVG.sol create mode 100644 src/modules/derivatives/DerivativeCard.sol create mode 100644 utils/hot-chain-svg/package.json create mode 100644 utils/hot-chain-svg/src/boot.js create mode 100644 utils/hot-chain-svg/src/call.js create mode 100644 utils/hot-chain-svg/src/compile.js create mode 100644 utils/hot-chain-svg/src/deploy.js create mode 100644 utils/hot-chain-svg/src/index.js create mode 100644 utils/hot-chain-svg/src/qa.js create mode 100644 utils/hot-chain-svg/src/serve.js create mode 100644 utils/hot-chain-svg/src/sync-nfts.js create mode 100644 utils/hot-chain-svg/yarn.lock diff --git a/src/lib/SVG.sol b/src/lib/SVG.sol new file mode 100644 index 00000000..98054ba3 --- /dev/null +++ b/src/lib/SVG.sol @@ -0,0 +1,327 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.12; + +// hot-chain-svg: https://github.com/w1nt3r-eth/hot-chain-svg + +// Core utils used extensively to format CSS and numbers. +library utils { + // used to simulate empty strings + string internal constant NULL = ''; + + // formats a CSS variable line. includes a semicolon for formatting. + function setCssVar(string memory _key, string memory _val) + internal + pure + returns (string memory) + { + return string.concat('--', _key, ':', _val, ';'); + } + + // formats getting a css variable + function getCssVar(string memory _key) + internal + pure + returns (string memory) + { + return string.concat('var(--', _key, ')'); + } + + // formats getting a def URL + function getDefURL(string memory _id) + internal + pure + returns (string memory) + { + return string.concat('url(#', _id, ')'); + } + + // formats rgba white with a specified opacity / alpha + function white_a(uint256 _a) internal pure returns (string memory) { + return rgba(255, 255, 255, _a); + } + + // formats rgba black with a specified opacity / alpha + function black_a(uint256 _a) internal pure returns (string memory) { + return rgba(0, 0, 0, _a); + } + + // formats generic rgba color in css + function rgba( + uint256 _r, + uint256 _g, + uint256 _b, + uint256 _a + ) internal pure returns (string memory) { + string memory formattedA = _a < 100 + ? string.concat('0.', utils.uint2str(_a)) + : '1'; + return + string.concat( + 'rgba(', + utils.uint2str(_r), + ',', + utils.uint2str(_g), + ',', + utils.uint2str(_b), + ',', + formattedA, + ')' + ); + } + + // checks if two strings are equal + function stringsEqual(string memory _a, string memory _b) + internal + pure + returns (bool) + { + return + keccak256(abi.encodePacked(_a)) == keccak256(abi.encodePacked(_b)); + } + + // returns the length of a string in characters + function utfStringLength(string memory _str) + internal + pure + returns (uint256 length) + { + uint256 i = 0; + bytes memory string_rep = bytes(_str); + + while (i < string_rep.length) { + if (string_rep[i] >> 7 == 0) i += 1; + else if (string_rep[i] >> 5 == bytes1(uint8(0x6))) i += 2; + else if (string_rep[i] >> 4 == bytes1(uint8(0xE))) i += 3; + else if (string_rep[i] >> 3 == bytes1(uint8(0x1E))) + i += 4; + //For safety + else i += 1; + + length++; + } + } + + // converts an unsigned integer to a string + function uint2str(uint256 _i) + internal + pure + returns (string memory _uintAsString) + { + if (_i == 0) { + return '0'; + } + uint256 j = _i; + uint256 len; + while (j != 0) { + len++; + j /= 10; + } + bytes memory bstr = new bytes(len); + uint256 k = len; + while (_i != 0) { + k = k - 1; + uint8 temp = (48 + uint8(_i - (_i / 10) * 10)); + bytes1 b1 = bytes1(temp); + bstr[k] = b1; + _i /= 10; + } + return string(bstr); + } +} + +// Core SVG utilitiy library which helps us construct +// onchain SVG's with a simple, web-like API. +library svg { + /* MAIN ELEMENTS */ + function g(string memory _props, string memory _children) + internal + pure + returns (string memory) + { + return el('g', _props, _children); + } + + function path(string memory _props, string memory _children) + internal + pure + returns (string memory) + { + return el('path', _props, _children); + } + + function text(string memory _props, string memory _children) + internal + pure + returns (string memory) + { + return el('text', _props, _children); + } + + function line(string memory _props, string memory _children) + internal + pure + returns (string memory) + { + return el('line', _props, _children); + } + + function circle(string memory _props, string memory _children) + internal + pure + returns (string memory) + { + return el('circle', _props, _children); + } + + function circle(string memory _props) + internal + pure + returns (string memory) + { + return el('circle', _props); + } + + function ellipse(string memory _props, string memory _children) + internal + pure + returns (string memory) + { + return el('ellipse', _props, _children); + } + + function ellipse(string memory _props) internal pure returns (string memory) { + return el('ellipse', _props); + } + + function rect(string memory _props, string memory _children) + internal + pure + returns (string memory) + { + return el('rect', _props, _children); + } + + function rect(string memory _props) + internal + pure + returns (string memory) + { + return el('rect', _props); + } + + function filter(string memory _props, string memory _children) + internal + pure + returns (string memory) + { + return el('filter', _props, _children); + } + + function cdata(string memory _content) + internal + pure + returns (string memory) + { + return string.concat(''); + } + + /* GRADIENTS */ + function radialGradient(string memory _props, string memory _children) + internal + pure + returns (string memory) + { + return el('radialGradient', _props, _children); + } + + function linearGradient(string memory _props, string memory _children) + internal + pure + returns (string memory) + { + return el('linearGradient', _props, _children); + } + + function gradientStop( + uint256 offset, + string memory stopColor, + string memory _props + ) internal pure returns (string memory) { + return + el( + 'stop', + string.concat( + prop('stop-color', stopColor), + ' ', + prop('offset', string.concat(utils.uint2str(offset), '%')), + ' ', + _props + ) + ); + } + + function animateTransform(string memory _props) + internal + pure + returns (string memory) + { + return el('animateTransform', _props); + } + + function image(string memory _href, string memory _props) + internal + pure + returns (string memory) + { + return + el( + 'image', + string.concat(prop('href', _href), ' ', _props) + ); + } + + /* COMMON */ + // A generic element, can be used to construct any SVG (or HTML) element + function el( + string memory _tag, + string memory _props, + string memory _children + ) internal pure returns (string memory) { + return + string.concat( + '<', + _tag, + ' ', + _props, + '>', + _children, + '' + ); + } + + // A generic element, can be used to construct any SVG (or HTML) element without children + function el( + string memory _tag, + string memory _props + ) internal pure returns (string memory) { + return + string.concat( + '<', + _tag, + ' ', + _props, + '/>' + ); + } + + // an SVG attribute + function prop(string memory _key, string memory _val) + internal + pure + returns (string memory) + { + return string.concat(_key, '=', '"', _val, '" '); + } +} diff --git a/src/modules/derivatives/DerivativeCard.sol b/src/modules/derivatives/DerivativeCard.sol new file mode 100644 index 00000000..828a398e --- /dev/null +++ b/src/modules/derivatives/DerivativeCard.sol @@ -0,0 +1,372 @@ +/// SPDX-License-Identifier: BSL-1.1 +pragma solidity 0.8.19; + +import {svg, utils} from "src/lib/SVG.sol"; + +contract DerivativeCard { + + struct Info { + string derivativeType; + string baseAssetSymbol; + string quoteAssetSymbol; + Property[] properties; + } + + struct Property { + string key; + string value; + } + + struct Colors { + string blue; + string lightBlue; + string green; + string yellowGreen; + string yellow; + string orange; + string red; + } + + string internal constant STROKE = 'stroke="#000" stroke-miterlimit="10" stroke-width="4px" '; + Colors internal colors; + + constructor() { + colors = Colors({ + blue: 'rgb(110, 148, 240)', + lightBlue: 'rgb(118, 189, 242)', + green: 'rgb(206, 244, 117)', + yellowGreen: 'rgb(243, 244, 189)', + yellow: 'rgb(243, 244, 189)', + orange: 'rgb(246, 172, 84)', + red: 'rgb(242, 103, 64)' + }); + } + + function render(Info memory tokenInfo) internal view returns (string memory) { + return string.concat( + '', + svg.el('defs', utils.NULL, string.concat(fullGradient(), fullVertGradient(), blueGreenGradient(), orangeRedGradient())), + svg.rect( + string.concat( + svg.prop('x', '5'), + svg.prop('y', '5'), + svg.prop('width', '280'), + svg.prop('height', '490'), + svg.prop('fill', 'black'), + svg.prop('rx', '10'), + svg.prop('ry', '10') + ), + utils.NULL + ), + svg.text( + string.concat( + svg.prop('x', '145'), + svg.prop('y', '30'), + svg.prop('fill', 'white'), + svg.prop('font-size', '20'), + svg.prop('font-family', "\'Courier New\', monospace"), + svg.prop('text-anchor', 'middle') + ), + tokenInfo.derivativeType + ), + svg.text( + string.concat( + svg.prop('x', '145'), + svg.prop('y', '90'), + svg.prop('fill', 'white'), + svg.prop('font-size', '56'), + svg.prop('font-family', "\'Courier New\', monospace"), + svg.prop('text-anchor', 'middle') + ), + tokenInfo.baseAssetSymbol + ), + progressBar(100), + svg.g( + string.concat( + svg.prop('transform', 'translate(96, 200) scale(0.1)') + ), + logo() + ), + svg.text( + string.concat( + svg.prop('x', '20'), + svg.prop('y', '350'), + svg.prop('fill', 'white'), + svg.prop('font-size', '16'), + svg.prop('font-family', "\'Courier New\', monospace"), + svg.prop('text-anchor', 'left') + ), + string.concat( + tokenInfo.properties[0].key, + ': ', + tokenInfo.properties[0].value + ) + ), + svg.text( + string.concat( + svg.prop('x', '20'), + svg.prop('y', '380'), + svg.prop('fill', 'white'), + svg.prop('font-size', '16'), + svg.prop('font-family', "\'Courier New\', monospace"), + svg.prop('text-anchor', 'left') + ), + string.concat( + tokenInfo.properties[1].key, + ': ', + tokenInfo.properties[1].value + ) + ), + svg.g( + string.concat( + svg.prop('transform', 'translate(80, 430) scale(0.05)') + ), + wordmark() + ), + '' + ); + } + + function logo() internal pure returns (string memory) { + return svg.path( + string.concat( + svg.prop('fill' , "url('#fullVertGradient')"), + STROKE, + svg.prop('d', 'M0.34668 818.666L20.3467 852.666L474.347 590.666V838.666H513.347V590.666L966.347 852.666L986.347 818.666L532.347 556.666L746.347 433.666L726.347 399.666L513.347 522.666L514.347 0.665527H474.347V522.666L260.347 399.666L240.347 433.666L454.347 556.666L0.34668 818.666Z') + ), + utils.NULL + ); + } + + function wordmark() internal pure returns (string memory) { + return svg.path( + string.concat( + svg.prop('fill' , "url('#fullGradient')"), + STROKE, + svg.prop('d', 'M2078.65 610.666H2118.65C2118.65 720.666 2205.65 799.666 2327.65 799.666C2439.65 799.666 2528.65 738.666 2528.65 629.666C2528.65 526.666 2460.65 465.666 2318.65 428.666C2167.65 397.666 2090.65 318.666 2090.65 201.666C2090.65 84.6656 2204.65 -2.33439 2323.65 0.665612C2450.65 -2.33439 2559.65 90.6656 2559.65 223.666H2521.65C2521.65 112.666 2432.65 40.6656 2323.65 40.6656C2223.65 40.6656 2130.65 110.666 2130.65 201.666C2130.65 300.666 2200.65 360.666 2331.65 394.666C2492.65 431.666 2569.65 505.666 2569.65 624.666C2569.65 743.666 2461.65 839.666 2323.65 839.666C2185.65 839.666 2078.65 742.666 2078.65 610.666ZM1926.65 820.666V20.6656H1966.65V820.666H1926.65ZM1005.65 801.666L1035.65 831.666L1416.65 450.666L1797.65 830.666L1826.65 800.666L1445.65 419.666L1826.65 40.6656L1796.65 10.6656L1415.65 391.666L1034.65 11.6656L1005.65 41.6656L1386.65 419.666L1005.65 801.666ZM45.6533 419.666C45.6533 627.666 212.653 794.666 419.653 794.666C611.653 794.666 793.653 648.666 793.653 419.666C793.653 190.666 611.653 45.6656 419.653 45.6656C212.653 45.6656 45.6533 213.666 45.6533 419.666ZM0.65332 419.666C0.65332 188.666 188.653 0.665612 419.653 0.665612C582.653 0.665612 761.653 103.666 817.653 299.666L869.653 20.6656H910.653L833.653 419.666L910.653 820.666H869.653L817.653 540.666C761.653 736.666 582.653 839.666 419.653 839.666C188.653 839.666 0.65332 651.666 0.65332 419.666Z') + ), + utils.NULL + ); + } + + function fullGradient() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop('id', 'fullGradient') + ), + string.concat( + svg.gradientStop( + 2, + colors.blue, + utils.NULL + ), + svg.gradientStop( + 10, + colors.lightBlue, + utils.NULL + ), + svg.gradientStop( + 32, + colors.green, + utils.NULL + ), + svg.gradientStop( + 49, + colors.yellowGreen, + utils.NULL + ), + svg.gradientStop( + 52, + colors.yellow, + utils.NULL + ), + svg.gradientStop( + 79, + colors.orange, + utils.NULL + ), + svg.gradientStop( + 100, + colors.red, + utils.NULL + ) + ) + ); + } + + function fullVertGradient() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop('id', 'fullVertGradient'), + svg.prop('gradientTransform', 'rotate(90)') + ), + string.concat( + svg.gradientStop( + 8, + colors.blue, + utils.NULL + ), + svg.gradientStop( + 20, + colors.lightBlue, + utils.NULL + ), + svg.gradientStop( + 42, + colors.green, + utils.NULL + ), + svg.gradientStop( + 59, + colors.yellowGreen, + utils.NULL + ), + svg.gradientStop( + 65, + colors.yellow, + utils.NULL + ), + svg.gradientStop( + 79, + colors.orange, + utils.NULL + ), + svg.gradientStop( + 100, + colors.red, + utils.NULL + ) + ) + ); + } + + function blueGreenGradient() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop('id', 'blueGreenGradient'), + svg.prop('gradientUnits', 'userSpaceOnUse') + ), + string.concat( + svg.gradientStop( + 20, + colors.blue, + utils.NULL + ), + svg.gradientStop( + 40, + colors.lightBlue, + utils.NULL + ), + svg.gradientStop( + 60, + colors.green, + utils.NULL + ) + ) + ); + } + + function orangeRedGradient() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop('id', 'orangeRedGradient'), + svg.prop('gradientTransform', 'rotate(90)') + ), + string.concat( + svg.gradientStop( + 30, + colors.orange, + utils.NULL + ), + svg.gradientStop( + 90, + colors.red, + utils.NULL + ) + ) + ); + } + + function progressBar(uint256 _progress) internal view returns (string memory) { + + uint256 len = 168 * _progress / 100; + + string memory startBar = svg.line( + string.concat( + svg.prop('x1', '60'), + svg.prop('y1', '135'), + svg.prop('x2', '60'), + svg.prop('y2', '155'), + svg.prop('stroke', colors.blue), + svg.prop('stroke-width', '6') + ), + utils.NULL + ); + + string memory endBarColor = _progress == 100 ? colors.green : 'grey'; + + string memory endBar = svg.line( + string.concat( + svg.prop('x1', '230'), + svg.prop('y1', '135'), + svg.prop('x2', '230'), + svg.prop('y2', '155'), + svg.prop('stroke', endBarColor), + svg.prop('stroke-width', '6') + ), + utils.NULL + ); + + + string memory progressLine = svg.line( + string.concat( + svg.prop('x1', '63'), + svg.prop('y1', '145'), + svg.prop('x2', utils.uint2str(62 + len)), + svg.prop('y2', '145'), + svg.prop('stroke', "url('#blueGreenGradient')"), + svg.prop('stroke-width', '6') + ), + utils.NULL + ); + + string memory shadowLine = svg.line( + string.concat( + svg.prop('x1', '63'), + svg.prop('y1', '145'), + svg.prop('x2', '230'), + svg.prop('y2', '145'), + svg.prop('stroke', 'grey'), + svg.prop('stroke-width', '4') + ), + utils.NULL + ); + + return svg.g( + utils.NULL, + string.concat( + startBar, + shadowLine, + progressLine, + endBar + ) + ); + } + + function example() external view returns (string memory) { + Property[] memory properties = new Property[](2); + properties[0] = Property({key: "Vesting Start", value: "2024-07-01"}); + properties[1] = Property({key: "Vesting End", value: "2024-09-01"}); + + + Info memory info = Info({ + derivativeType: "Linear Vesting Token", + baseAssetSymbol: "XYZ", + quoteAssetSymbol: "", + properties: properties + }); + + return render(info); + } + +} \ No newline at end of file diff --git a/utils/hot-chain-svg/package.json b/utils/hot-chain-svg/package.json new file mode 100644 index 00000000..63697bb4 --- /dev/null +++ b/utils/hot-chain-svg/package.json @@ -0,0 +1,25 @@ +{ + "name": "hot-chain-svg", + "version": "0.0.1", + "main": "src/index.js", + "author": "w1nt3r.eth", + "license": "MIT", + "scripts": { + "start": "node .", + "qa": "node src/qa.js", + "sync-nfts": "node src/sync-nfts.js" + }, + "prettier": { + "singleQuote": true + }, + "dependencies": { + "@ethereumjs/vm": "^5.8.0", + "@ethersproject/abi": "^5.6.0", + "ethers": "^5.6.8", + "solc": "0.8.19", + "xmldom": "^0.6.0" + }, + "devDependencies": { + "prettier": "^2.6.2" + } +} diff --git a/utils/hot-chain-svg/src/boot.js b/utils/hot-chain-svg/src/boot.js new file mode 100644 index 00000000..1eeb4fff --- /dev/null +++ b/utils/hot-chain-svg/src/boot.js @@ -0,0 +1,22 @@ +const { Account, Address, BN } = require('ethereumjs-util'); +const VM = require('@ethereumjs/vm').default; + +async function boot() { + const pk = Buffer.from( + '1122334455667788112233445566778811223344556677881122334455667788', + 'hex' + ); + + const accountAddress = Address.fromPrivateKey(pk); + const account = Account.fromAccountData({ + nonce: 0, + balance: new BN(10).pow(new BN(18 + 2)), // 100 eth + }); + + const vm = new VM(); + await vm.stateManager.putAccount(accountAddress, account); + + return { vm, pk }; +} + +module.exports = boot; diff --git a/utils/hot-chain-svg/src/call.js b/utils/hot-chain-svg/src/call.js new file mode 100644 index 00000000..2a8e46cd --- /dev/null +++ b/utils/hot-chain-svg/src/call.js @@ -0,0 +1,34 @@ +const { defaultAbiCoder, Interface } = require('@ethersproject/abi'); + +async function call(vm, address, abi, name, args = []) { + const iface = new Interface(abi); + const data = iface.encodeFunctionData(name, args); + + const renderResult = await vm.runCall({ + to: address, + caller: address, + origin: address, + data: Buffer.from(data.slice(2), 'hex'), + }); + + if (renderResult.execResult.exceptionError) { + throw renderResult.execResult.exceptionError; + } + + const logs = renderResult.execResult.logs?.map(([address, topic, data]) => + data.toString().replace(/\x00/g, '') + ); + + if (logs?.length) { + console.log(logs); + } + + const results = defaultAbiCoder.decode( + ['string'], + renderResult.execResult.returnValue + ); + + return results[0]; +} + +module.exports = call; diff --git a/utils/hot-chain-svg/src/compile.js b/utils/hot-chain-svg/src/compile.js new file mode 100644 index 00000000..5077a8ad --- /dev/null +++ b/utils/hot-chain-svg/src/compile.js @@ -0,0 +1,69 @@ +const fs = require('fs'); +const path = require('path'); +const solc = require('solc'); + +function getSolcInput(source) { + return { + language: 'Solidity', + sources: { + [path.basename(source)]: { + content: fs.readFileSync(source, 'utf8'), + }, + }, + settings: { + optimizer: { + enabled: false, + runs: 1, + }, + evmVersion: 'london', + outputSelection: { + '*': { + '*': ['abi', 'evm.bytecode'], + }, + }, + }, + }; +} + +function findImports(path) { + try { + const file = fs.existsSync(path) + ? fs.readFileSync(path, 'utf8') + : fs.readFileSync(require.resolve(path), 'utf8'); + return { contents: file }; + } catch (error) { + console.error(error); + return { error }; + } +} + +function compile(source, project_dir) { + const input = getSolcInput(source); + process.chdir(project_dir); + const output = JSON.parse( + solc.compile(JSON.stringify(input), { import: findImports }) + ); + + let errors = []; + + if (output.errors) { + for (const error of output.errors) { + if (error.severity === 'error') { + errors.push(error.formattedMessage); + } + } + } + + if (errors.length > 0) { + throw new Error(errors.join('\n\n')); + } + + const result = output.contracts[path.basename(source)]; + const contractName = Object.keys(result)[0]; + return { + abi: result[contractName].abi, + bytecode: result[contractName].evm.bytecode.object, + }; +} + +module.exports = compile; diff --git a/utils/hot-chain-svg/src/deploy.js b/utils/hot-chain-svg/src/deploy.js new file mode 100644 index 00000000..b2d317b9 --- /dev/null +++ b/utils/hot-chain-svg/src/deploy.js @@ -0,0 +1,27 @@ +const { Address } = require('ethereumjs-util'); +const { Transaction } = require('@ethereumjs/tx'); + +async function deploy(vm, pk, bytecode) { + const address = Address.fromPrivateKey(pk); + const account = await vm.stateManager.getAccount(address); + + const txData = { + value: 0, + gasLimit: 200_000_000_000, + gasPrice: 1, + data: '0x' + bytecode.toString('hex'), + nonce: account.nonce, + }; + + const tx = Transaction.fromTxData(txData).sign(pk); + + const deploymentResult = await vm.runTx({ tx }); + + if (deploymentResult.execResult.exceptionError) { + throw deploymentResult.execResult.exceptionError; + } + + return deploymentResult.createdAddress; +} + +module.exports = deploy; diff --git a/utils/hot-chain-svg/src/index.js b/utils/hot-chain-svg/src/index.js new file mode 100644 index 00000000..4f71faea --- /dev/null +++ b/utils/hot-chain-svg/src/index.js @@ -0,0 +1,29 @@ +const fs = require('fs'); +const path = require('path'); +const serve = require('./serve'); +const boot = require('./boot'); +const call = require('./call'); +const compile = require('./compile'); +const deploy = require('./deploy'); + +const SOURCE = path.join(__dirname, '..', '..', '..', 'src', 'modules', 'derivatives', 'DerivativeCard.sol'); +const PROJECT_DIR = path.join(__dirname, '..', '..', '..'); + +async function main() { + const { vm, pk } = await boot(); + + async function handler() { + const { abi, bytecode } = compile(SOURCE, PROJECT_DIR); + const address = await deploy(vm, pk, bytecode); + const result = await call(vm, address, abi, 'example'); + return result; + } + + const { notify } = await serve(handler); + + fs.watch(path.dirname(SOURCE), notify); + console.log('Watching', path.dirname(SOURCE)); + console.log('Serving http://localhost:9901/'); +} + +main(); diff --git a/utils/hot-chain-svg/src/qa.js b/utils/hot-chain-svg/src/qa.js new file mode 100644 index 00000000..a967a4ee --- /dev/null +++ b/utils/hot-chain-svg/src/qa.js @@ -0,0 +1,35 @@ +const fs = require('fs'); +const os = require('os'); +const path = require('path'); +const boot = require('./boot'); +const call = require('./call'); +const compile = require('./compile'); +const deploy = require('./deploy'); +const { DOMParser } = require('xmldom'); + +const SOURCE = path.join(__dirname, '..', 'contracts', 'Renderer.sol'); +const DESTINATION = path.join(os.tmpdir(), 'hot-chain-svg-'); + +async function main() { + const { vm, pk } = await boot(); + const { abi, bytecode } = compile(SOURCE); + const address = await deploy(vm, pk, bytecode); + + const tempFolder = fs.mkdtempSync(DESTINATION); + console.log('Saving to', tempFolder); + + for (let i = 1; i < 256; i++) { + const fileName = path.join(tempFolder, i + '.svg'); + console.log('Rendering', fileName); + const svg = await call(vm, address, abi, 'render', [i]); + fs.writeFileSync(fileName, svg); + + // Throws on invalid XML + new DOMParser().parseFromString(svg); + } +} + +main().catch((error) => { + console.error(error); + process.exit(1); +}); diff --git a/utils/hot-chain-svg/src/serve.js b/utils/hot-chain-svg/src/serve.js new file mode 100644 index 00000000..a370b377 --- /dev/null +++ b/utils/hot-chain-svg/src/serve.js @@ -0,0 +1,48 @@ +const http = require('http'); +const EventEmitter = require('events'); + +async function serve(handler) { + const events = new EventEmitter(); + + function requestListener(req, res) { + if (req.url === '/changes') { + res.setHeader('Content-Type', 'text/event-stream'); + res.writeHead(200); + const sendEvent = () => res.write('event: change\ndata:\n\n'); + events.on('change', sendEvent); + req.on('close', () => events.off('change', sendEvent)); + return; + } + + if (req.url === '/') { + res.writeHead(200); + handler().then( + (content) => res.end(webpage(content)), + (error) => res.end(webpage(`
${error.message}
`)) + ); + return; + } + + res.writeHead(404); + res.end('Not found: ' + req.url); + } + const server = http.createServer(requestListener); + await new Promise((resolve) => server.listen(9901, resolve)); + + return { + notify: () => events.emit('change'), + }; +} + +const webpage = (content) => ` + +Hot Chain SVG +${content} + + +`; + +module.exports = serve; diff --git a/utils/hot-chain-svg/src/sync-nfts.js b/utils/hot-chain-svg/src/sync-nfts.js new file mode 100644 index 00000000..52c4aff4 --- /dev/null +++ b/utils/hot-chain-svg/src/sync-nfts.js @@ -0,0 +1,66 @@ +const { formatEther } = require('@ethersproject/units'); +const ethers = require('ethers'); +const fs = require('fs'); +const path = require('path'); + +const address = '0xa7988c8abb7706e024a8f2a1328e376227aaad18'; +const url = process.env.PROVIDER_URL; + +async function main() { + const provider = new ethers.providers.JsonRpcProvider({ url }); + const abi = [ + 'event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 amount)', + 'event CollectionNameUpdated(address indexed collection, string name)', + ]; + const contract = new ethers.Contract(address, abi, provider); + + const [mints, names] = await Promise.all([ + contract.queryFilter( + contract.filters.TransferSingle(null, ethers.constants.AddressZero) + ), + contract.queryFilter(contract.filters.CollectionNameUpdated()), + ]); + + const collectionNames = Object.fromEntries( + names.map((e) => [e.args.collection.toLowerCase(), e.args.name]) + ); + + const owners = [...new Set(mints.map((e) => e.args.to.toLowerCase()))]; + const ensNames = await Promise.all( + owners.map((address) => provider.lookupAddress(address)) + ); + + const ownerNames = Object.fromEntries( + owners.map((address, index) => [address, ensNames[index] || address]) + ); + + const log = mints.map((e) => { + const { id, to } = e.args; + const collection = ethers.utils.hexZeroPad( + id.and( + ethers.BigNumber.from('0xffffffffffffffffffffffffffffffffffffffff') + ), + 20 + ); + + const name = collectionNames[collection] || collection; + const owner = ownerNames[to.toLowerCase()]; + + return `- [${name}](https://etherscan.io/address/${collection}) by ${owner}`; + }); + + console.log(log); + + const readme = path.resolve(__dirname, '..', 'README.md'); + const content = fs.readFileSync(readme, 'utf8'); + const updated = content.replaceAll( + /[\s\S]+/gim, + ['', ...log, ''].join('\n') + ); + fs.writeFileSync(readme, updated); +} + +main().catch((error) => { + console.error(error); + process.exit(1); +}); diff --git a/utils/hot-chain-svg/yarn.lock b/utils/hot-chain-svg/yarn.lock new file mode 100644 index 00000000..0fe67215 --- /dev/null +++ b/utils/hot-chain-svg/yarn.lock @@ -0,0 +1,1167 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@ethereumjs/block@^3.5.0", "@ethereumjs/block@^3.6.2", "@ethereumjs/block@^3.6.3": + version "3.6.3" + resolved "https://registry.yarnpkg.com/@ethereumjs/block/-/block-3.6.3.tgz#d96cbd7af38b92ebb3424223dbf773f5ccd27f84" + integrity sha512-CegDeryc2DVKnDkg5COQrE0bJfw/p0v3GBk2W5/Dj5dOVfEmb50Ux0GLnSPypooLnfqjwFaorGuT9FokWB3GRg== + dependencies: + "@ethereumjs/common" "^2.6.5" + "@ethereumjs/tx" "^3.5.2" + ethereumjs-util "^7.1.5" + merkle-patricia-tree "^4.2.4" + +"@ethereumjs/blockchain@^5.5.3": + version "5.5.3" + resolved "https://registry.yarnpkg.com/@ethereumjs/blockchain/-/blockchain-5.5.3.tgz#aa49a6a04789da6b66b5bcbb0d0b98efc369f640" + integrity sha512-bi0wuNJ1gw4ByNCV56H0Z4Q7D+SxUbwyG12Wxzbvqc89PXLRNR20LBcSUZRKpN0+YCPo6m0XZL/JLio3B52LTw== + dependencies: + "@ethereumjs/block" "^3.6.2" + "@ethereumjs/common" "^2.6.4" + "@ethereumjs/ethash" "^1.1.0" + debug "^4.3.3" + ethereumjs-util "^7.1.5" + level-mem "^5.0.1" + lru-cache "^5.1.1" + semaphore-async-await "^1.5.1" + +"@ethereumjs/common@^2.6.4", "@ethereumjs/common@^2.6.5": + version "2.6.5" + resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.5.tgz#0a75a22a046272579d91919cb12d84f2756e8d30" + integrity sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA== + dependencies: + crc-32 "^1.2.0" + ethereumjs-util "^7.1.5" + +"@ethereumjs/ethash@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/ethash/-/ethash-1.1.0.tgz#7c5918ffcaa9cb9c1dc7d12f77ef038c11fb83fb" + integrity sha512-/U7UOKW6BzpA+Vt+kISAoeDie1vAvY4Zy2KF5JJb+So7+1yKmJeJEHOGSnQIj330e9Zyl3L5Nae6VZyh2TJnAA== + dependencies: + "@ethereumjs/block" "^3.5.0" + "@types/levelup" "^4.3.0" + buffer-xor "^2.0.1" + ethereumjs-util "^7.1.1" + miller-rabin "^4.0.0" + +"@ethereumjs/tx@^3.5.2": + version "3.5.2" + resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.5.2.tgz#197b9b6299582ad84f9527ca961466fce2296c1c" + integrity sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw== + dependencies: + "@ethereumjs/common" "^2.6.4" + ethereumjs-util "^7.1.5" + +"@ethereumjs/vm@^5.8.0": + version "5.9.3" + resolved "https://registry.yarnpkg.com/@ethereumjs/vm/-/vm-5.9.3.tgz#6d69202e4c132a4a1e1628ac246e92062e230823" + integrity sha512-Ha04TeF8goEglr8eL7hkkYyjhzdZS0PsoRURzYlTF6I0VVId5KjKb0N7MrA8GMgheN+UeTncfTgYx52D/WhEmg== + dependencies: + "@ethereumjs/block" "^3.6.3" + "@ethereumjs/blockchain" "^5.5.3" + "@ethereumjs/common" "^2.6.5" + "@ethereumjs/tx" "^3.5.2" + async-eventemitter "^0.2.4" + core-js-pure "^3.0.1" + debug "^4.3.3" + ethereumjs-util "^7.1.5" + functional-red-black-tree "^1.0.1" + mcl-wasm "^0.7.1" + merkle-patricia-tree "^4.2.4" + rustbn.js "~0.2.0" + +"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.6.0", "@ethersproject/abi@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" + integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" + integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + +"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" + integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/address@5.7.0", "@ethersproject/address@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + +"@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" + integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + +"@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.7.0.tgz#97034dc7e8938a8ca943ab20f8a5e492ece4020b" + integrity sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + bn.js "^5.2.1" + +"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" + integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + +"@ethersproject/contracts@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" + integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg== + dependencies: + "@ethersproject/abi" "^5.7.0" + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + +"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" + integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" + integrity sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wordlists" "^5.7.0" + +"@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz#5e3355287b548c32b368d91014919ebebddd5360" + integrity sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hdnode" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + aes-js "3.0.0" + scrypt-js "3.0.1" + +"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== + +"@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" + integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz#d2267d0a1f6e123f3771007338c47cccd83d3102" + integrity sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + +"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" + integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/providers@5.7.2": + version "5.7.2" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" + integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + bech32 "1.1.4" + ws "7.4.6" + +"@ethersproject/random@5.7.0", "@ethersproject/random@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.7.0.tgz#af19dcbc2484aae078bb03656ec05df66253280c" + integrity sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" + integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + hash.js "1.1.7" + +"@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" + integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + bn.js "^5.2.1" + elliptic "6.5.4" + hash.js "1.1.7" + +"@ethersproject/solidity@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8" + integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" + integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" + integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + +"@ethersproject/units@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.7.0.tgz#637b563d7e14f42deeee39245275d477aae1d8b1" + integrity sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/wallet@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" + integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/hdnode" "^5.7.0" + "@ethersproject/json-wallets" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wordlists" "^5.7.0" + +"@ethersproject/web@5.7.1", "@ethersproject/web@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" + integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== + dependencies: + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/wordlists@5.7.0", "@ethersproject/wordlists@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.7.0.tgz#8fb2c07185d68c3e09eb3bfd6e779ba2774627f5" + integrity sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@types/abstract-leveldown@*": + version "7.2.5" + resolved "https://registry.yarnpkg.com/@types/abstract-leveldown/-/abstract-leveldown-7.2.5.tgz#db2cf364c159fb1f12be6cd3549f56387eaf8d73" + integrity sha512-/2B0nQF4UdupuxeKTJA2+Rj1D+uDemo6P4kMwKCpbfpnzeVaWSELTsAw4Lxn3VJD6APtRrZOCuYo+4nHUQfTfg== + +"@types/bn.js@^5.1.0": + version "5.1.5" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.5.tgz#2e0dacdcce2c0f16b905d20ff87aedbc6f7b4bf0" + integrity sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A== + dependencies: + "@types/node" "*" + +"@types/level-errors@*": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/level-errors/-/level-errors-3.0.2.tgz#f33ec813c50780b547463da9ad8acac89ee457d9" + integrity sha512-gyZHbcQ2X5hNXf/9KS2qGEmgDe9EN2WDM3rJ5Ele467C0nA1sLhtmv1bZiPMDYfAYCfPWft0uQIaTvXbASSTRA== + +"@types/levelup@^4.3.0": + version "4.3.3" + resolved "https://registry.yarnpkg.com/@types/levelup/-/levelup-4.3.3.tgz#4dc2b77db079b1cf855562ad52321aa4241b8ef4" + integrity sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA== + dependencies: + "@types/abstract-leveldown" "*" + "@types/level-errors" "*" + "@types/node" "*" + +"@types/node@*": + version "20.14.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.2.tgz#a5f4d2bcb4b6a87bffcaa717718c5a0f208f4a18" + integrity sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q== + dependencies: + undici-types "~5.26.4" + +"@types/pbkdf2@^3.0.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.2.tgz#2dc43808e9985a2c69ff02e2d2027bd4fe33e8dc" + integrity sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew== + dependencies: + "@types/node" "*" + +"@types/secp256k1@^4.0.1": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.6.tgz#d60ba2349a51c2cbc5e816dcd831a42029d376bf" + integrity sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ== + dependencies: + "@types/node" "*" + +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@~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" + +aes-js@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" + integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== + +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@^2.4.0: + version "2.6.4" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" + integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== + dependencies: + lodash "^4.17.14" + +base-x@^3.0.2: + 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== + +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== + +blakejs@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" + integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== + +bn.js@^4.0.0, bn.js@^4.11.9: + 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.1.2, bn.js@^5.2.0, bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +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 sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + +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" + +bs58@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== + 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-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== + +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.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" + +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" + +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@^8.1.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== + +core-js-pure@^3.0.1: + version "3.37.1" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.37.1.tgz#2b4b34281f54db06c9a9a5bd60105046900553bd" + integrity sha512-J/r5JTHSmzTxbiYYrzXg9w1VpqrYt+gexenBE9pugeyhwPZTAEJddyiReJWsLO6uNQ8xJZFbod6XC7KKwatCiA== + +crc-32@^1.2.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" + integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ== + +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.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" + +debug@^4.3.3: + version "4.3.5" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" + integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== + dependencies: + ms "2.1.2" + +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" + +elliptic@6.5.4: + 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" + +elliptic@^6.5.4: + version "6.5.5" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.5.tgz#c715e09f78b6923977610d4c2346d6ce22e6dded" + integrity sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw== + 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" + +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" + +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" + +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" + +ethereumjs-util@^7.1.1, ethereumjs-util@^7.1.4, ethereumjs-util@^7.1.5: + version "7.1.5" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" + integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== + 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" + +ethers@^5.6.8: + version "5.7.2" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" + integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== + dependencies: + "@ethersproject/abi" "5.7.0" + "@ethersproject/abstract-provider" "5.7.0" + "@ethersproject/abstract-signer" "5.7.0" + "@ethersproject/address" "5.7.0" + "@ethersproject/base64" "5.7.0" + "@ethersproject/basex" "5.7.0" + "@ethersproject/bignumber" "5.7.0" + "@ethersproject/bytes" "5.7.0" + "@ethersproject/constants" "5.7.0" + "@ethersproject/contracts" "5.7.0" + "@ethersproject/hash" "5.7.0" + "@ethersproject/hdnode" "5.7.0" + "@ethersproject/json-wallets" "5.7.0" + "@ethersproject/keccak256" "5.7.0" + "@ethersproject/logger" "5.7.0" + "@ethersproject/networks" "5.7.1" + "@ethersproject/pbkdf2" "5.7.0" + "@ethersproject/properties" "5.7.0" + "@ethersproject/providers" "5.7.2" + "@ethersproject/random" "5.7.0" + "@ethersproject/rlp" "5.7.0" + "@ethersproject/sha2" "5.7.0" + "@ethersproject/signing-key" "5.7.0" + "@ethersproject/solidity" "5.7.0" + "@ethersproject/strings" "5.7.0" + "@ethersproject/transactions" "5.7.0" + "@ethersproject/units" "5.7.0" + "@ethersproject/wallet" "5.7.0" + "@ethersproject/web" "5.7.1" + "@ethersproject/wordlists" "5.7.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" + +follow-redirects@^1.12.1: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + +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 sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== + +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.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" + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +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 sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg== + +inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +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== + +keccak@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.4.tgz#edc09b89e633c0549da444432ecf062ffadee86d" + integrity sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + readable-stream "^3.6.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-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@^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-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@^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-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@^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@^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" + +lodash@^4.17.14: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +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" + +ltgt@~2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" + integrity sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA== + +mcl-wasm@^0.7.1: + version "0.7.9" + resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.9.tgz#c1588ce90042a8700c3b60e40efb339fc07ab87f" + integrity sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ== + +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" + +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" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== + +merkle-patricia-tree@^4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-4.2.4.tgz#ff988d045e2bf3dfa2239f7fabe2d59618d57413" + integrity sha512-eHbf/BG6eGNsqqfbLED9rIqbsF4+sykEaBn6OLNs71tjclbMcMOk1tEPmJKcNcNCLkvbpY/lwyOlizWsqPNo8w== + dependencies: + "@types/levelup" "^4.3.0" + ethereumjs-util "^7.1.4" + level-mem "^5.0.1" + level-ws "^2.0.0" + readable-stream "^3.6.0" + semaphore-async-await "^1.5.1" + +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" + +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 sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + +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== + +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-gyp-build@^4.2.0: + version "4.8.1" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.1.tgz#976d3ad905e71b76086f4f0b0d3637fe79b6cda5" + integrity sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw== + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + +pbkdf2@^3.0.17: + 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" + +prettier@^2.6.2: + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== + +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw== + +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" + +readable-stream@^3.1.0, readable-stream@^3.4.0, readable-stream@^3.6.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +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.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.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== + +scrypt-js@3.0.1, scrypt-js@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== + +secp256k1@^4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" + integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== + dependencies: + elliptic "^6.5.4" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +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 sha512-b/ptP11hETwYWpeilHXXQiV5UJNJl7ZWWooKRE5eBIYWoom6dZ0SluCIdCtKycsMtZgKWE01/qAw6jblw1YVhg== + +semver@^5.5.0: + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== + +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" + +solc@0.8.19: + version "0.8.19" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.19.tgz#cac6541106ae3cff101c740042c7742aa56a2ed3" + integrity sha512-yqurS3wzC4LdEvmMobODXqprV4MYJcVtinuxgrp61ac8K2zz40vXA0eSAskSHPgv8dQo7Nux39i3QBsHx4pqyA== + dependencies: + command-exists "^1.2.8" + commander "^8.1.0" + follow-redirects "^1.12.1" + js-sha3 "0.8.0" + memorystream "^0.3.1" + semver "^5.5.0" + tmp "0.0.33" + +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" + +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" + +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + +util-deprecate@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +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== + +xmldom@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.6.0.tgz#43a96ecb8beece991cef382c08397d82d4d0c46f" + integrity sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg== + +xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== From 6c2e76851a75ec2325dc70b548b65a7abc3b62d4 Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 17 Jun 2024 23:40:14 -0500 Subject: [PATCH 14/82] wip: more svg variants and updates --- .../derivatives/DerivativeCardDark.sol | 435 ++++++++++++++++++ .../derivatives/DerivativeCardGradient.sol | 371 +++++++++++++++ ...vativeCard.sol => DerivativeCardLight.sol} | 43 +- utils/hot-chain-svg/src/index.js | 2 +- 4 files changed, 828 insertions(+), 23 deletions(-) create mode 100644 src/modules/derivatives/DerivativeCardDark.sol create mode 100644 src/modules/derivatives/DerivativeCardGradient.sol rename src/modules/derivatives/{DerivativeCard.sol => DerivativeCardLight.sol} (92%) diff --git a/src/modules/derivatives/DerivativeCardDark.sol b/src/modules/derivatives/DerivativeCardDark.sol new file mode 100644 index 00000000..60a20a6e --- /dev/null +++ b/src/modules/derivatives/DerivativeCardDark.sol @@ -0,0 +1,435 @@ +/// SPDX-License-Identifier: BSL-1.1 +pragma solidity 0.8.19; + +import {svg, utils} from "src/lib/SVG.sol"; + +contract DerivativeCardDark { + + struct Info { + string derivativeType; + string baseAssetSymbol; + string quoteAssetSymbol; + string tokenId; + string tokenAddress; + string erc20Address; + Property[] properties; + } + + struct Property { + string key; + string stringValue; + uint256 value; + } + + struct Colors { + string blue; + string lightBlue; + string green; + string yellowGreen; + string yellow; + string orange; + string red; + } + + string internal constant STROKE = 'stroke="#000" stroke-miterlimit="10" stroke-width="4px" '; + string internal constant TEXT_STYLE= 'font-family="\'Menlo\', monospace" fill="white"'; + + Colors internal colors; + + constructor() { + colors = Colors({ + blue: 'rgb(110, 148, 240)', + lightBlue: 'rgb(118, 189, 242)', + green: 'rgb(206, 244, 117)', + yellowGreen: 'rgb(243, 244, 189)', + yellow: 'rgb(243, 244, 189)', + orange: 'rgb(246, 172, 84)', + red: 'rgb(242, 103, 64)' + }); + } + + function render(Info memory tokenInfo) internal view returns (string memory) { + return string.concat( + '', + svg.el('defs', utils.NULL, string.concat(fullGradient(), fullRadialGradient(), blueGreenGradient(), orangeRedGradient())), + svg.rect( + string.concat( + svg.prop('x', '5'), + svg.prop('y', '5'), + svg.prop('width', '280'), + svg.prop('height', '490'), + svg.prop('fill', 'rgb(30, 30, 30)'), + svg.prop('rx', '10'), + svg.prop('ry', '10') + ), + utils.NULL + ), + svg.text( + string.concat( + svg.prop('x', '145'), + svg.prop('y', '40'), + svg.prop('font-size', '20'), + svg.prop('text-anchor', 'middle'), + TEXT_STYLE + ), + tokenInfo.derivativeType + ), + svg.text( + string.concat( + svg.prop('x', '145'), + svg.prop('y', '100'), + svg.prop('font-size', '56'), + svg.prop('text-anchor', 'middle'), + // svg.prop('font-family', 'Menlo, monospace'), + // svg.prop('fill', "url('#orangeRedGradient')") + TEXT_STYLE + ), + tokenInfo.baseAssetSymbol + ), + progressBar(tokenInfo.properties[0].value, tokenInfo.properties[1].value), + svg.text( + string.concat( + svg.prop('x', '60'), + svg.prop('y', '200'), + svg.prop('font-size', '12'), + svg.prop('text-anchor', 'middle'), + TEXT_STYLE + ), + tokenInfo.properties[0].stringValue + ), + svg.text( + string.concat( + svg.prop('x', '230'), + svg.prop('y', '200'), + svg.prop('font-size', '12'), + svg.prop('text-anchor', 'middle'), + TEXT_STYLE + ), + tokenInfo.properties[1].stringValue + ), + svg.g( + string.concat( + svg.prop('transform', 'translate(72, 240) scale(0.15)') + ), + logo() + ), + // svg.text( + // string.concat( + // svg.prop('x', '20'), + // svg.prop('y', '360'), + // svg.prop('font-size', '16'), + // svg.prop('text-anchor', 'left'), + // TEXT_STYLE + // ), + // string.concat( + // tokenInfo.properties[0].key, + // ': ', + // tokenInfo.properties[0].stringValue + // ) + // ), + // svg.text( + // string.concat( + // svg.prop('x', '20'), + // svg.prop('y', '390'), + // svg.prop('font-size', '16'), + // svg.prop('text-anchor', 'left'), + // TEXT_STYLE + // ), + // string.concat( + // tokenInfo.properties[1].key, + // ': ', + // tokenInfo.properties[1].stringValue + // ) + // ), + // svg.g( + // string.concat( + // svg.prop('transform', 'translate(80, 430) scale(0.05)') + // ), + // wordmark() + // ), + svg.text( + string.concat( + svg.prop('x', '145'), + svg.prop('y', '460'), + svg.prop('font-size', '10'), + svg.prop('text-anchor', 'middle'), + TEXT_STYLE + ), + tokenInfo.tokenAddress + ), + svg.text( + string.concat( + svg.prop('x', '145'), + svg.prop('y', '480'), + svg.prop('font-size', '10'), + svg.prop('text-anchor', 'middle'), + TEXT_STYLE + ), + string.concat('ID: ', tokenInfo.tokenId) + ), + '' + ); + } + + function logo() internal pure returns (string memory) { + return svg.path( + string.concat( + svg.prop('fill' , "url('#fullRadialGradient')"), + STROKE, + svg.prop('d', 'M0.34668 818.666L20.3467 852.666L474.347 590.666V838.666H513.347V590.666L966.347 852.666L986.347 818.666L532.347 556.666L746.347 433.666L726.347 399.666L513.347 522.666L514.347 0.665527H474.347V522.666L260.347 399.666L240.347 433.666L454.347 556.666L0.34668 818.666Z') + ), + utils.NULL + ); + } + + function wordmark() internal pure returns (string memory) { + return svg.path( + string.concat( + svg.prop('fill' , "url('#fullGradient')"), + STROKE, + svg.prop('d', 'M2078.65 610.666H2118.65C2118.65 720.666 2205.65 799.666 2327.65 799.666C2439.65 799.666 2528.65 738.666 2528.65 629.666C2528.65 526.666 2460.65 465.666 2318.65 428.666C2167.65 397.666 2090.65 318.666 2090.65 201.666C2090.65 84.6656 2204.65 -2.33439 2323.65 0.665612C2450.65 -2.33439 2559.65 90.6656 2559.65 223.666H2521.65C2521.65 112.666 2432.65 40.6656 2323.65 40.6656C2223.65 40.6656 2130.65 110.666 2130.65 201.666C2130.65 300.666 2200.65 360.666 2331.65 394.666C2492.65 431.666 2569.65 505.666 2569.65 624.666C2569.65 743.666 2461.65 839.666 2323.65 839.666C2185.65 839.666 2078.65 742.666 2078.65 610.666ZM1926.65 820.666V20.6656H1966.65V820.666H1926.65ZM1005.65 801.666L1035.65 831.666L1416.65 450.666L1797.65 830.666L1826.65 800.666L1445.65 419.666L1826.65 40.6656L1796.65 10.6656L1415.65 391.666L1034.65 11.6656L1005.65 41.6656L1386.65 419.666L1005.65 801.666ZM45.6533 419.666C45.6533 627.666 212.653 794.666 419.653 794.666C611.653 794.666 793.653 648.666 793.653 419.666C793.653 190.666 611.653 45.6656 419.653 45.6656C212.653 45.6656 45.6533 213.666 45.6533 419.666ZM0.65332 419.666C0.65332 188.666 188.653 0.665612 419.653 0.665612C582.653 0.665612 761.653 103.666 817.653 299.666L869.653 20.6656H910.653L833.653 419.666L910.653 820.666H869.653L817.653 540.666C761.653 736.666 582.653 839.666 419.653 839.666C188.653 839.666 0.65332 651.666 0.65332 419.666Z') + ), + utils.NULL + ); + } + + function fullGradient() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop('id', 'fullGradient') + ), + string.concat( + svg.gradientStop( + 2, + colors.blue, + utils.NULL + ), + svg.gradientStop( + 10, + colors.lightBlue, + utils.NULL + ), + svg.gradientStop( + 32, + colors.green, + utils.NULL + ), + svg.gradientStop( + 49, + colors.yellowGreen, + utils.NULL + ), + svg.gradientStop( + 52, + colors.yellow, + utils.NULL + ), + svg.gradientStop( + 79, + colors.orange, + utils.NULL + ), + svg.gradientStop( + 100, + colors.red, + utils.NULL + ) + ) + ); + } + + function fullRadialGradient() internal view returns (string memory) { + return svg.radialGradient( + string.concat( + svg.prop('id', 'fullRadialGradient'), + svg.prop('gradientTransform', 'translate(0,0.15)') + ), + string.concat( + svg.gradientStop( + 2, + colors.blue, + utils.NULL + ), + svg.gradientStop( + 10, + colors.lightBlue, + utils.NULL + ), + svg.gradientStop( + 32, + colors.green, + utils.NULL + ), + svg.gradientStop( + 49, + colors.yellowGreen, + utils.NULL + ), + svg.gradientStop( + 52, + colors.yellow, + utils.NULL + ), + svg.gradientStop( + 79, + colors.orange, + utils.NULL + ), + svg.gradientStop( + 100, + colors.red, + utils.NULL + ) + ) + ); + } + + function blueGreenGradient() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop('id', 'blueGreenGradient'), + svg.prop('gradientUnits', 'userSpaceOnUse') + ), + string.concat( + svg.gradientStop( + 20, + colors.blue, + utils.NULL + ), + svg.gradientStop( + 40, + colors.lightBlue, + utils.NULL + ), + svg.gradientStop( + 60, + colors.green, + utils.NULL + ) + ) + ); + } + + function orangeRedGradient() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop('id', 'orangeRedGradient'), + svg.prop('gradientTransform', 'rotate(90)') + ), + string.concat( + svg.gradientStop( + 30, + colors.orange, + utils.NULL + ), + svg.gradientStop( + 90, + colors.red, + utils.NULL + ) + ) + ); + } + + function progressBar(uint256 start, uint256 end) internal view returns (string memory) { + uint256 currentTime = 1717200000 + 60 * 86400; // block.timestamp; + + bool started = start <= currentTime; + + uint256 progress = started ? (currentTime - start) * 100 / (end - start) : 0; + // progress can be at most 100 + progress = progress > 100 ? 100 : progress; + + uint256 len = (168 * progress) / 100; + + string memory startBar = svg.line( + string.concat( + svg.prop('x1', '60'), + svg.prop('y1', '155'), + svg.prop('x2', '60'), + svg.prop('y2', '175'), + svg.prop('stroke', started ? colors.blue : 'grey'), + svg.prop('stroke-width', '6') + ), + utils.NULL + ); + + string memory endBar = svg.line( + string.concat( + svg.prop('x1', '230'), + svg.prop('y1', '155'), + svg.prop('x2', '230'), + svg.prop('y2', '175'), + svg.prop('stroke', progress == 100 ? colors.green : 'grey'), + svg.prop('stroke-width', '6') + ), + utils.NULL + ); + + + string memory progressLine = svg.line( + string.concat( + svg.prop('x1', '62'), + svg.prop('y1', '165'), + svg.prop('x2', utils.uint2str(62 + len)), + svg.prop('y2', '165'), + svg.prop('stroke', "url('#blueGreenGradient')"), + svg.prop('stroke-width', '6') + ), + utils.NULL + ); + + string memory shadowLine = svg.line( + string.concat( + svg.prop('x1', '63'), + svg.prop('y1', '165'), + svg.prop('x2', '230'), + svg.prop('y2', '165'), + svg.prop('stroke', 'grey'), + svg.prop('stroke-width', '4') + ), + utils.NULL + ); + + string memory progressCircle = svg.circle( + string.concat( + svg.prop('cx', utils.uint2str(62 + len)), + svg.prop('cy', '165'), + svg.prop('r', '6'), + svg.prop('fill', "url('#blueGreenGradient')") + ), + utils.NULL + ); + + return svg.g( + utils.NULL, + string.concat( + startBar, + shadowLine, + progressLine, + endBar, + progress < 5 || progress > 95 ? '' : progressCircle + ) + ); + } + + function example() external view returns (string memory) { + Property[] memory properties = new Property[](2); + properties[0] = Property({key: "Vesting Start", stringValue: "2024-06-01", value: 1717200000}); + properties[1] = Property({key: "Vesting End", stringValue: "2024-09-01", value: 1725148800}); + + + Info memory info = Info({ + derivativeType: "Linear Vesting", + baseAssetSymbol: "XYZ", + quoteAssetSymbol: "", + tokenId: "123456", + tokenAddress: "0x1234567890123456789012345678901234567890", + erc20Address: "0xfedcba0987654321fedcba0987654321fedcba09", + properties: properties + }); + + return render(info); + } + +} \ No newline at end of file diff --git a/src/modules/derivatives/DerivativeCardGradient.sol b/src/modules/derivatives/DerivativeCardGradient.sol new file mode 100644 index 00000000..92bbea49 --- /dev/null +++ b/src/modules/derivatives/DerivativeCardGradient.sol @@ -0,0 +1,371 @@ +/// SPDX-License-Identifier: BSL-1.1 +pragma solidity 0.8.19; + +import {svg, utils} from "src/lib/SVG.sol"; + +contract DerivativeCardDark { + + struct Info { + string derivativeType; + string baseAssetSymbol; + string quoteAssetSymbol; + Property[] properties; + } + + struct Property { + string key; + string value; + } + + struct Colors { + string blue; + string lightBlue; + string green; + string yellowGreen; + string yellow; + string orange; + string red; + } + + string internal constant STROKE = 'stroke="#000" stroke-miterlimit="10" stroke-width="4px" '; + string internal constant TEXT_STYLE= 'font-family="\'Menlo\', monospace" fill="black"'; + + Colors internal colors; + + constructor() { + colors = Colors({ + blue: 'rgb(110, 148, 240)', + lightBlue: 'rgb(118, 189, 242)', + green: 'rgb(206, 244, 117)', + yellowGreen: 'rgb(243, 244, 189)', + yellow: 'rgb(243, 244, 189)', + orange: 'rgb(246, 172, 84)', + red: 'rgb(242, 103, 64)' + }); + } + + function render(Info memory tokenInfo) internal view returns (string memory) { + return string.concat( + '', + svg.el('defs', utils.NULL, string.concat(fullGradient(), fullVertGradient(), blueGreenGradient(), orangeRedGradient())), + svg.rect( + string.concat( + svg.prop('x', '5'), + svg.prop('y', '5'), + svg.prop('width', '280'), + svg.prop('height', '490'), + svg.prop('fill', "url('#orangeRedGradient')"), + svg.prop('stroke', 'black'), + svg.prop('rx', '10'), + svg.prop('ry', '10') + ), + utils.NULL + ), + svg.text( + string.concat( + svg.prop('x', '145'), + svg.prop('y', '40'), + svg.prop('font-size', '20'), + svg.prop('text-anchor', 'middle'), + TEXT_STYLE + ), + tokenInfo.derivativeType + ), + svg.text( + string.concat( + svg.prop('x', '145'), + svg.prop('y', '100'), + svg.prop('font-size', '56'), + svg.prop('text-anchor', 'middle'), + TEXT_STYLE + ), + tokenInfo.baseAssetSymbol + ), + progressBar(80), + svg.g( + string.concat( + svg.prop('transform', 'translate(96, 200) scale(0.1)') + ), + logo() + ), + svg.text( + string.concat( + svg.prop('x', '20'), + svg.prop('y', '350'), + svg.prop('font-size', '16'), + svg.prop('text-anchor', 'left'), + TEXT_STYLE + ), + string.concat( + tokenInfo.properties[0].key, + ': ', + tokenInfo.properties[0].value + ) + ), + svg.text( + string.concat( + svg.prop('x', '20'), + svg.prop('y', '380'), + svg.prop('font-size', '16'), + svg.prop('text-anchor', 'left'), + TEXT_STYLE + ), + string.concat( + tokenInfo.properties[1].key, + ': ', + tokenInfo.properties[1].value + ) + ), + // svg.g( + // string.concat( + // svg.prop('transform', 'translate(80, 430) scale(0.05)') + // ), + // wordmark() + // ), + '' + ); + } + + function logo() internal pure returns (string memory) { + return svg.path( + string.concat( + svg.prop('fill' , 'white'), + STROKE, + svg.prop('d', 'M0.34668 818.666L20.3467 852.666L474.347 590.666V838.666H513.347V590.666L966.347 852.666L986.347 818.666L532.347 556.666L746.347 433.666L726.347 399.666L513.347 522.666L514.347 0.665527H474.347V522.666L260.347 399.666L240.347 433.666L454.347 556.666L0.34668 818.666Z') + ), + utils.NULL + ); + } + + function wordmark() internal pure returns (string memory) { + return svg.path( + string.concat( + svg.prop('fill' , "url('#fullGradient')"), + STROKE, + svg.prop('d', 'M2078.65 610.666H2118.65C2118.65 720.666 2205.65 799.666 2327.65 799.666C2439.65 799.666 2528.65 738.666 2528.65 629.666C2528.65 526.666 2460.65 465.666 2318.65 428.666C2167.65 397.666 2090.65 318.666 2090.65 201.666C2090.65 84.6656 2204.65 -2.33439 2323.65 0.665612C2450.65 -2.33439 2559.65 90.6656 2559.65 223.666H2521.65C2521.65 112.666 2432.65 40.6656 2323.65 40.6656C2223.65 40.6656 2130.65 110.666 2130.65 201.666C2130.65 300.666 2200.65 360.666 2331.65 394.666C2492.65 431.666 2569.65 505.666 2569.65 624.666C2569.65 743.666 2461.65 839.666 2323.65 839.666C2185.65 839.666 2078.65 742.666 2078.65 610.666ZM1926.65 820.666V20.6656H1966.65V820.666H1926.65ZM1005.65 801.666L1035.65 831.666L1416.65 450.666L1797.65 830.666L1826.65 800.666L1445.65 419.666L1826.65 40.6656L1796.65 10.6656L1415.65 391.666L1034.65 11.6656L1005.65 41.6656L1386.65 419.666L1005.65 801.666ZM45.6533 419.666C45.6533 627.666 212.653 794.666 419.653 794.666C611.653 794.666 793.653 648.666 793.653 419.666C793.653 190.666 611.653 45.6656 419.653 45.6656C212.653 45.6656 45.6533 213.666 45.6533 419.666ZM0.65332 419.666C0.65332 188.666 188.653 0.665612 419.653 0.665612C582.653 0.665612 761.653 103.666 817.653 299.666L869.653 20.6656H910.653L833.653 419.666L910.653 820.666H869.653L817.653 540.666C761.653 736.666 582.653 839.666 419.653 839.666C188.653 839.666 0.65332 651.666 0.65332 419.666Z') + ), + utils.NULL + ); + } + + function fullGradient() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop('id', 'fullGradient') + ), + string.concat( + svg.gradientStop( + 2, + colors.blue, + utils.NULL + ), + svg.gradientStop( + 10, + colors.lightBlue, + utils.NULL + ), + svg.gradientStop( + 32, + colors.green, + utils.NULL + ), + svg.gradientStop( + 49, + colors.yellowGreen, + utils.NULL + ), + svg.gradientStop( + 52, + colors.yellow, + utils.NULL + ), + svg.gradientStop( + 79, + colors.orange, + utils.NULL + ), + svg.gradientStop( + 100, + colors.red, + utils.NULL + ) + ) + ); + } + + function fullVertGradient() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop('id', 'fullVertGradient'), + svg.prop('gradientTransform', 'rotate(90)') + ), + string.concat( + svg.gradientStop( + 8, + colors.blue, + utils.NULL + ), + svg.gradientStop( + 20, + colors.lightBlue, + utils.NULL + ), + svg.gradientStop( + 42, + colors.green, + utils.NULL + ), + svg.gradientStop( + 59, + colors.yellowGreen, + utils.NULL + ), + svg.gradientStop( + 65, + colors.yellow, + utils.NULL + ), + svg.gradientStop( + 79, + colors.orange, + utils.NULL + ), + svg.gradientStop( + 100, + colors.red, + utils.NULL + ) + ) + ); + } + + function blueGreenGradient() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop('id', 'blueGreenGradient'), + svg.prop('gradientUnits', 'userSpaceOnUse') + ), + string.concat( + svg.gradientStop( + 20, + colors.blue, + utils.NULL + ), + svg.gradientStop( + 40, + colors.lightBlue, + utils.NULL + ), + svg.gradientStop( + 60, + colors.green, + utils.NULL + ) + ) + ); + } + + function orangeRedGradient() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop('id', 'orangeRedGradient'), + svg.prop('gradientTransform', 'rotate(60)') + ), + string.concat( + svg.gradientStop( + 30, + colors.orange, + utils.NULL + ), + svg.gradientStop( + 90, + colors.red, + utils.NULL + ) + ) + ); + } + + function progressBar(uint256 _progress) internal view returns (string memory) { + + uint256 len = 168 * _progress / 100; + + string memory startBar = svg.line( + string.concat( + svg.prop('x1', '60'), + svg.prop('y1', '135'), + svg.prop('x2', '60'), + svg.prop('y2', '155'), + svg.prop('stroke', colors.blue), + svg.prop('stroke-width', '6') + ), + utils.NULL + ); + + string memory endBarColor = _progress == 100 ? colors.green : 'grey'; + + string memory endBar = svg.line( + string.concat( + svg.prop('x1', '230'), + svg.prop('y1', '135'), + svg.prop('x2', '230'), + svg.prop('y2', '155'), + svg.prop('stroke', endBarColor), + svg.prop('stroke-width', '6') + ), + utils.NULL + ); + + + string memory progressLine = svg.line( + string.concat( + svg.prop('x1', '63'), + svg.prop('y1', '145'), + svg.prop('x2', utils.uint2str(62 + len)), + svg.prop('y2', '145'), + svg.prop('stroke', "url('#blueGreenGradient')"), + svg.prop('stroke-width', '6') + ), + utils.NULL + ); + + string memory shadowLine = svg.line( + string.concat( + svg.prop('x1', '63'), + svg.prop('y1', '145'), + svg.prop('x2', '230'), + svg.prop('y2', '145'), + svg.prop('stroke', 'grey'), + svg.prop('stroke-width', '4') + ), + utils.NULL + ); + + return svg.g( + utils.NULL, + string.concat( + startBar, + shadowLine, + progressLine, + endBar + ) + ); + } + + function example() external view returns (string memory) { + Property[] memory properties = new Property[](2); + properties[0] = Property({key: "Vesting Start", value: "2024-07-01"}); + properties[1] = Property({key: "Vesting End", value: "2024-09-01"}); + + + Info memory info = Info({ + derivativeType: "Linear Vesting", + baseAssetSymbol: "XYZ", + quoteAssetSymbol: "", + properties: properties + }); + + return render(info); + } + +} \ No newline at end of file diff --git a/src/modules/derivatives/DerivativeCard.sol b/src/modules/derivatives/DerivativeCardLight.sol similarity index 92% rename from src/modules/derivatives/DerivativeCard.sol rename to src/modules/derivatives/DerivativeCardLight.sol index 828a398e..b4c116d1 100644 --- a/src/modules/derivatives/DerivativeCard.sol +++ b/src/modules/derivatives/DerivativeCardLight.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.19; import {svg, utils} from "src/lib/SVG.sol"; -contract DerivativeCard { +contract DerivativeCardDark { struct Info { string derivativeType; @@ -28,6 +28,8 @@ contract DerivativeCard { } string internal constant STROKE = 'stroke="#000" stroke-miterlimit="10" stroke-width="4px" '; + string internal constant TEXT_STYLE= 'font-family="\'Menlo\', monospace" fill="#000"'; + Colors internal colors; constructor() { @@ -52,7 +54,8 @@ contract DerivativeCard { svg.prop('y', '5'), svg.prop('width', '280'), svg.prop('height', '490'), - svg.prop('fill', 'black'), + svg.prop('fill', 'rgb(200, 200, 200)'), + svg.prop('stroke', 'black'), svg.prop('rx', '10'), svg.prop('ry', '10') ), @@ -62,10 +65,9 @@ contract DerivativeCard { string.concat( svg.prop('x', '145'), svg.prop('y', '30'), - svg.prop('fill', 'white'), svg.prop('font-size', '20'), - svg.prop('font-family', "\'Courier New\', monospace"), - svg.prop('text-anchor', 'middle') + svg.prop('text-anchor', 'middle'), + TEXT_STYLE ), tokenInfo.derivativeType ), @@ -73,14 +75,13 @@ contract DerivativeCard { string.concat( svg.prop('x', '145'), svg.prop('y', '90'), - svg.prop('fill', 'white'), svg.prop('font-size', '56'), - svg.prop('font-family', "\'Courier New\', monospace"), - svg.prop('text-anchor', 'middle') + svg.prop('text-anchor', 'middle'), + TEXT_STYLE ), tokenInfo.baseAssetSymbol ), - progressBar(100), + progressBar(60), svg.g( string.concat( svg.prop('transform', 'translate(96, 200) scale(0.1)') @@ -91,10 +92,9 @@ contract DerivativeCard { string.concat( svg.prop('x', '20'), svg.prop('y', '350'), - svg.prop('fill', 'white'), svg.prop('font-size', '16'), - svg.prop('font-family', "\'Courier New\', monospace"), - svg.prop('text-anchor', 'left') + svg.prop('text-anchor', 'left'), + TEXT_STYLE ), string.concat( tokenInfo.properties[0].key, @@ -106,10 +106,9 @@ contract DerivativeCard { string.concat( svg.prop('x', '20'), svg.prop('y', '380'), - svg.prop('fill', 'white'), svg.prop('font-size', '16'), - svg.prop('font-family', "\'Courier New\', monospace"), - svg.prop('text-anchor', 'left') + svg.prop('text-anchor', 'left'), + TEXT_STYLE ), string.concat( tokenInfo.properties[1].key, @@ -117,12 +116,12 @@ contract DerivativeCard { tokenInfo.properties[1].value ) ), - svg.g( - string.concat( - svg.prop('transform', 'translate(80, 430) scale(0.05)') - ), - wordmark() - ), + // svg.g( + // string.concat( + // svg.prop('transform', 'translate(80, 430) scale(0.05)') + // ), + // wordmark() + // ), '' ); } @@ -131,7 +130,7 @@ contract DerivativeCard { return svg.path( string.concat( svg.prop('fill' , "url('#fullVertGradient')"), - STROKE, + // STROKE, svg.prop('d', 'M0.34668 818.666L20.3467 852.666L474.347 590.666V838.666H513.347V590.666L966.347 852.666L986.347 818.666L532.347 556.666L746.347 433.666L726.347 399.666L513.347 522.666L514.347 0.665527H474.347V522.666L260.347 399.666L240.347 433.666L454.347 556.666L0.34668 818.666Z') ), utils.NULL diff --git a/utils/hot-chain-svg/src/index.js b/utils/hot-chain-svg/src/index.js index 4f71faea..b069547c 100644 --- a/utils/hot-chain-svg/src/index.js +++ b/utils/hot-chain-svg/src/index.js @@ -6,7 +6,7 @@ const call = require('./call'); const compile = require('./compile'); const deploy = require('./deploy'); -const SOURCE = path.join(__dirname, '..', '..', '..', 'src', 'modules', 'derivatives', 'DerivativeCard.sol'); +const SOURCE = path.join(__dirname, '..', '..', '..', 'src', 'modules', 'derivatives', 'DerivativeCardDark.sol'); const PROJECT_DIR = path.join(__dirname, '..', '..', '..'); async function main() { From 9c4e56fc175fe11a50e0425688c6cb06e2fde432 Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 18 Jun 2024 12:14:50 -0500 Subject: [PATCH 15/82] wip: more liv image updates (including animation) --- .../derivatives/DerivativeCardDark.sol | 306 ++++++++++-------- .../derivatives/DerivativeCardGradient.sol | 19 +- 2 files changed, 184 insertions(+), 141 deletions(-) diff --git a/src/modules/derivatives/DerivativeCardDark.sol b/src/modules/derivatives/DerivativeCardDark.sol index 60a20a6e..7941ce0f 100644 --- a/src/modules/derivatives/DerivativeCardDark.sol +++ b/src/modules/derivatives/DerivativeCardDark.sol @@ -51,16 +51,30 @@ contract DerivativeCardDark { function render(Info memory tokenInfo) internal view returns (string memory) { return string.concat( '', - svg.el('defs', utils.NULL, string.concat(fullGradient(), fullRadialGradient(), blueGreenGradient(), orangeRedGradient())), + svg.el('defs', utils.NULL, string.concat(fullGradient(), fullGradient90(), fullGradientReverse90(), blueGreenGradient(), orangeRedGradient())), svg.rect( string.concat( - svg.prop('x', '5'), - svg.prop('y', '5'), - svg.prop('width', '280'), - svg.prop('height', '490'), + svg.prop('x', '0'), + svg.prop('y', '0'), + svg.prop('width', '290'), + svg.prop('height', '500'), svg.prop('fill', 'rgb(30, 30, 30)'), - svg.prop('rx', '10'), - svg.prop('ry', '10') + svg.prop('rx', '25'), + svg.prop('ry', '25') + ), + utils.NULL + ), + svg.rect( + string.concat( + svg.prop('x', '8'), + svg.prop('y', '8'), + svg.prop('width', '274'), + svg.prop('height', '484'), + svg.prop('fill', 'none'), + svg.prop('stroke', "url('#fullGradientReverse90')"), + svg.prop('stroke-width', '2'), + svg.prop('rx', '20'), + svg.prop('ry', '20') ), utils.NULL ), @@ -107,46 +121,7 @@ contract DerivativeCardDark { ), tokenInfo.properties[1].stringValue ), - svg.g( - string.concat( - svg.prop('transform', 'translate(72, 240) scale(0.15)') - ), - logo() - ), - // svg.text( - // string.concat( - // svg.prop('x', '20'), - // svg.prop('y', '360'), - // svg.prop('font-size', '16'), - // svg.prop('text-anchor', 'left'), - // TEXT_STYLE - // ), - // string.concat( - // tokenInfo.properties[0].key, - // ': ', - // tokenInfo.properties[0].stringValue - // ) - // ), - // svg.text( - // string.concat( - // svg.prop('x', '20'), - // svg.prop('y', '390'), - // svg.prop('font-size', '16'), - // svg.prop('text-anchor', 'left'), - // TEXT_STYLE - // ), - // string.concat( - // tokenInfo.properties[1].key, - // ': ', - // tokenInfo.properties[1].stringValue - // ) - // ), - // svg.g( - // string.concat( - // svg.prop('transform', 'translate(80, 430) scale(0.05)') - // ), - // wordmark() - // ), + logo(), svg.text( string.concat( svg.prop('x', '145'), @@ -172,24 +147,119 @@ contract DerivativeCardDark { } function logo() internal pure returns (string memory) { - return svg.path( - string.concat( - svg.prop('fill' , "url('#fullRadialGradient')"), - STROKE, - svg.prop('d', 'M0.34668 818.666L20.3467 852.666L474.347 590.666V838.666H513.347V590.666L966.347 852.666L986.347 818.666L532.347 556.666L746.347 433.666L726.347 399.666L513.347 522.666L514.347 0.665527H474.347V522.666L260.347 399.666L240.347 433.666L454.347 556.666L0.34668 818.666Z') + return string.concat( + svg.rect( + string.concat( + svg.prop('x', '143'), + svg.prop('y', '240'), + svg.prop('width', '6'), + svg.prop('height', '125'), + svg.prop('fill', "url('#fullGradientReverse90')") + ), + utils.NULL ), - utils.NULL + svg.rect( + string.concat( + svg.prop('x', '79'), + svg.prop('y', '246'), + svg.prop('width', '6'), + svg.prop('height', '125'), + svg.prop('fill', "url('#fullGradient90')"), + svg.prop('transform', 'rotate(-60 145 250)') + ), + utils.NULL + ), + svg.rect( + string.concat( + svg.prop('x', '206'), + svg.prop('y', '244'), + svg.prop('width', '6'), + svg.prop('height', '125'), + svg.prop('fill', "url('#fullGradient90')"), + svg.prop('transform', 'rotate(60 145 250)') + ), + utils.NULL + ) ); } - function wordmark() internal pure returns (string memory) { - return svg.path( - string.concat( - svg.prop('fill' , "url('#fullGradient')"), - STROKE, - svg.prop('d', 'M2078.65 610.666H2118.65C2118.65 720.666 2205.65 799.666 2327.65 799.666C2439.65 799.666 2528.65 738.666 2528.65 629.666C2528.65 526.666 2460.65 465.666 2318.65 428.666C2167.65 397.666 2090.65 318.666 2090.65 201.666C2090.65 84.6656 2204.65 -2.33439 2323.65 0.665612C2450.65 -2.33439 2559.65 90.6656 2559.65 223.666H2521.65C2521.65 112.666 2432.65 40.6656 2323.65 40.6656C2223.65 40.6656 2130.65 110.666 2130.65 201.666C2130.65 300.666 2200.65 360.666 2331.65 394.666C2492.65 431.666 2569.65 505.666 2569.65 624.666C2569.65 743.666 2461.65 839.666 2323.65 839.666C2185.65 839.666 2078.65 742.666 2078.65 610.666ZM1926.65 820.666V20.6656H1966.65V820.666H1926.65ZM1005.65 801.666L1035.65 831.666L1416.65 450.666L1797.65 830.666L1826.65 800.666L1445.65 419.666L1826.65 40.6656L1796.65 10.6656L1415.65 391.666L1034.65 11.6656L1005.65 41.6656L1386.65 419.666L1005.65 801.666ZM45.6533 419.666C45.6533 627.666 212.653 794.666 419.653 794.666C611.653 794.666 793.653 648.666 793.653 419.666C793.653 190.666 611.653 45.6656 419.653 45.6656C212.653 45.6656 45.6533 213.666 45.6533 419.666ZM0.65332 419.666C0.65332 188.666 188.653 0.665612 419.653 0.665612C582.653 0.665612 761.653 103.666 817.653 299.666L869.653 20.6656H910.653L833.653 419.666L910.653 820.666H869.653L817.653 540.666C761.653 736.666 582.653 839.666 419.653 839.666C188.653 839.666 0.65332 651.666 0.65332 419.666Z') + function fullGradientStops() internal view returns (string memory) { + return string.concat( + svg.gradientStop( + 2, + colors.blue, + utils.NULL ), - utils.NULL + svg.gradientStop( + 10, + colors.lightBlue, + utils.NULL + ), + svg.gradientStop( + 32, + colors.green, + utils.NULL + ), + svg.gradientStop( + 49, + colors.yellowGreen, + utils.NULL + ), + svg.gradientStop( + 52, + colors.yellow, + utils.NULL + ), + svg.gradientStop( + 79, + colors.orange, + utils.NULL + ), + svg.gradientStop( + 100, + colors.red, + utils.NULL + ) + ); + } + + function fullGradientReverseStops() internal view returns (string memory) { + return string.concat( + svg.gradientStop( + 2, + colors.red, + utils.NULL + ), + svg.gradientStop( + 21, + colors.orange, + utils.NULL + ), + svg.gradientStop( + 48, + colors.yellow, + utils.NULL + ), + svg.gradientStop( + 51, + colors.yellowGreen, + utils.NULL + ), + svg.gradientStop( + 68, + colors.green, + utils.NULL + ), + svg.gradientStop( + 90, + colors.lightBlue, + utils.NULL + ), + svg.gradientStop( + 100, + colors.blue, + utils.NULL + ) ); } @@ -198,89 +268,27 @@ contract DerivativeCardDark { string.concat( svg.prop('id', 'fullGradient') ), - string.concat( - svg.gradientStop( - 2, - colors.blue, - utils.NULL - ), - svg.gradientStop( - 10, - colors.lightBlue, - utils.NULL - ), - svg.gradientStop( - 32, - colors.green, - utils.NULL - ), - svg.gradientStop( - 49, - colors.yellowGreen, - utils.NULL - ), - svg.gradientStop( - 52, - colors.yellow, - utils.NULL - ), - svg.gradientStop( - 79, - colors.orange, - utils.NULL - ), - svg.gradientStop( - 100, - colors.red, - utils.NULL - ) - ) + fullGradientStops() ); } - function fullRadialGradient() internal view returns (string memory) { - return svg.radialGradient( + function fullGradient90() internal view returns (string memory) { + return svg.linearGradient( string.concat( - svg.prop('id', 'fullRadialGradient'), - svg.prop('gradientTransform', 'translate(0,0.15)') + svg.prop('id', 'fullGradient90'), + svg.prop('gradientTransform', 'rotate(90)') ), + fullGradientStops() + ); + } + + function fullGradientReverse90() internal view returns (string memory) { + return svg.linearGradient( string.concat( - svg.gradientStop( - 2, - colors.blue, - utils.NULL - ), - svg.gradientStop( - 10, - colors.lightBlue, - utils.NULL - ), - svg.gradientStop( - 32, - colors.green, - utils.NULL - ), - svg.gradientStop( - 49, - colors.yellowGreen, - utils.NULL - ), - svg.gradientStop( - 52, - colors.yellow, - utils.NULL - ), - svg.gradientStop( - 79, - colors.orange, - utils.NULL - ), - svg.gradientStop( - 100, - colors.red, - utils.NULL - ) - ) + svg.prop('id', 'fullGradientReverse90'), + svg.prop('gradientTransform', 'rotate(90)') + ), + fullGradientReverseStops() ); } @@ -332,7 +340,7 @@ contract DerivativeCardDark { } function progressBar(uint256 start, uint256 end) internal view returns (string memory) { - uint256 currentTime = 1717200000 + 60 * 86400; // block.timestamp; + uint256 currentTime = 1717200000 + 70 * 86400; // block.timestamp; bool started = start <= currentTime; @@ -379,6 +387,27 @@ contract DerivativeCardDark { utils.NULL ); + string memory animateLine = svg.rect( + string.concat( + svg.prop('x', '62'), + svg.prop('y', '161'), + svg.prop('width', '16'), + svg.prop('height', '8'), + svg.prop('fill', "url('#blueGreenGradient')"), + svg.prop('rx', '4'), + svg.prop('ry', '4') + ), + svg.el('animate', + string.concat( + svg.prop('attributeName', 'x'), + svg.prop('values', string.concat('62;', utils.uint2str(62 + len - 16), ';')), + svg.prop('dur', '3s'), + svg.prop('repeatCount', 'indefinite') + ), + utils.NULL + ) + ); + string memory shadowLine = svg.line( string.concat( svg.prop('x1', '63'), @@ -407,6 +436,7 @@ contract DerivativeCardDark { startBar, shadowLine, progressLine, + progress < 5 ? '' : animateLine, endBar, progress < 5 || progress > 95 ? '' : progressCircle ) diff --git a/src/modules/derivatives/DerivativeCardGradient.sol b/src/modules/derivatives/DerivativeCardGradient.sol index 92bbea49..bdd5bcc9 100644 --- a/src/modules/derivatives/DerivativeCardGradient.sol +++ b/src/modules/derivatives/DerivativeCardGradient.sol @@ -55,16 +55,29 @@ contract DerivativeCardDark { svg.prop('width', '280'), svg.prop('height', '490'), svg.prop('fill', "url('#orangeRedGradient')"), + svg.prop('stroke', 'none'), + svg.prop('rx', '20'), + svg.prop('ry', '20') + ), + utils.NULL + ), + svg.rect( + string.concat( + svg.prop('x', '15'), + svg.prop('y', '15'), + svg.prop('width', '260'), + svg.prop('height', '470'), + svg.prop('fill', 'none'), svg.prop('stroke', 'black'), - svg.prop('rx', '10'), - svg.prop('ry', '10') + svg.prop('rx', '20'), + svg.prop('ry', '20') ), utils.NULL ), svg.text( string.concat( svg.prop('x', '145'), - svg.prop('y', '40'), + svg.prop('y', '45'), svg.prop('font-size', '20'), svg.prop('text-anchor', 'middle'), TEXT_STYLE From b8616283369d19befef61604e44de77600d170c9 Mon Sep 17 00:00:00 2001 From: Oighty Date: Wed, 19 Jun 2024 10:45:58 -0500 Subject: [PATCH 16/82] feat: compiles and integrated into LIV --- src/lib/ERC6909Metadata.sol | 6 + src/lib/SVG.sol | 312 ++++------ .../derivatives/DerivativeCardDark.sol | 465 --------------- .../derivatives/DerivativeCardGradient.sol | 384 ------------ .../derivatives/DerivativeCardLight.sol | 371 ------------ src/modules/derivatives/LinearVesting.sol | 42 +- src/modules/derivatives/LinearVestingCard.sol | 553 ++++++++++++++++++ .../mocks/MockDerivativeModule.sol | 2 + utils/hot-chain-svg/src/compile.js | 6 +- utils/hot-chain-svg/src/index.js | 2 +- 10 files changed, 724 insertions(+), 1419 deletions(-) delete mode 100644 src/modules/derivatives/DerivativeCardDark.sol delete mode 100644 src/modules/derivatives/DerivativeCardGradient.sol delete mode 100644 src/modules/derivatives/DerivativeCardLight.sol create mode 100644 src/modules/derivatives/LinearVestingCard.sol diff --git a/src/lib/ERC6909Metadata.sol b/src/lib/ERC6909Metadata.sol index eea62145..5229e49e 100644 --- a/src/lib/ERC6909Metadata.sol +++ b/src/lib/ERC6909Metadata.sol @@ -19,4 +19,10 @@ abstract contract ERC6909Metadata { /// @param tokenId_ The ID of the token /// @return uint8 The number of decimals used by the token function decimals(uint256 tokenId_) public view virtual returns (uint8); + + /// @notice Returns the URI of the token + /// + /// @param tokenId_ The ID of the token + /// @return string The URI of the token + function tokenURI(uint256 tokenId_) public view virtual returns (string memory); } diff --git a/src/lib/SVG.sol b/src/lib/SVG.sol index 98054ba3..9b693cca 100644 --- a/src/lib/SVG.sol +++ b/src/lib/SVG.sol @@ -6,33 +6,24 @@ pragma solidity ^0.8.12; // Core utils used extensively to format CSS and numbers. library utils { // used to simulate empty strings - string internal constant NULL = ''; + string internal constant NULL = ""; // formats a CSS variable line. includes a semicolon for formatting. - function setCssVar(string memory _key, string memory _val) - internal - pure - returns (string memory) - { - return string.concat('--', _key, ':', _val, ';'); + function setCssVar( + string memory _key, + string memory _val + ) internal pure returns (string memory) { + return string.concat("--", _key, ":", _val, ";"); } // formats getting a css variable - function getCssVar(string memory _key) - internal - pure - returns (string memory) - { - return string.concat('var(--', _key, ')'); + function getCssVar(string memory _key) internal pure returns (string memory) { + return string.concat("var(--", _key, ")"); } // formats getting a def URL - function getDefURL(string memory _id) - internal - pure - returns (string memory) - { - return string.concat('url(#', _id, ')'); + function getDefURL(string memory _id) internal pure returns (string memory) { + return string.concat("url(#", _id, ")"); } // formats rgba white with a specified opacity / alpha @@ -52,63 +43,53 @@ library utils { uint256 _b, uint256 _a ) internal pure returns (string memory) { - string memory formattedA = _a < 100 - ? string.concat('0.', utils.uint2str(_a)) - : '1'; - return - string.concat( - 'rgba(', - utils.uint2str(_r), - ',', - utils.uint2str(_g), - ',', - utils.uint2str(_b), - ',', - formattedA, - ')' - ); + string memory formattedA = _a < 100 ? string.concat("0.", utils.uint2str(_a)) : "1"; + return string.concat( + "rgba(", + utils.uint2str(_r), + ",", + utils.uint2str(_g), + ",", + utils.uint2str(_b), + ",", + formattedA, + ")" + ); } // checks if two strings are equal - function stringsEqual(string memory _a, string memory _b) - internal - pure - returns (bool) - { - return - keccak256(abi.encodePacked(_a)) == keccak256(abi.encodePacked(_b)); + function stringsEqual(string memory _a, string memory _b) internal pure returns (bool) { + return keccak256(abi.encodePacked(_a)) == keccak256(abi.encodePacked(_b)); } // returns the length of a string in characters - function utfStringLength(string memory _str) - internal - pure - returns (uint256 length) - { + function utfStringLength(string memory _str) internal pure returns (uint256 length) { uint256 i = 0; bytes memory string_rep = bytes(_str); while (i < string_rep.length) { - if (string_rep[i] >> 7 == 0) i += 1; - else if (string_rep[i] >> 5 == bytes1(uint8(0x6))) i += 2; - else if (string_rep[i] >> 4 == bytes1(uint8(0xE))) i += 3; - else if (string_rep[i] >> 3 == bytes1(uint8(0x1E))) + if (string_rep[i] >> 7 == 0) { + i += 1; + } else if (string_rep[i] >> 5 == bytes1(uint8(0x6))) { + i += 2; + } else if (string_rep[i] >> 4 == bytes1(uint8(0xE))) { + i += 3; + } else if (string_rep[i] >> 3 == bytes1(uint8(0x1E))) { i += 4; - //For safety - else i += 1; + } + //For safety + else { + i += 1; + } length++; } } // converts an unsigned integer to a string - function uint2str(uint256 _i) - internal - pure - returns (string memory _uintAsString) - { + function uint2str(uint256 _i) internal pure returns (string memory _uintAsString) { if (_i == 0) { - return '0'; + return "0"; } uint256 j = _i; uint256 len; @@ -133,113 +114,91 @@ library utils { // onchain SVG's with a simple, web-like API. library svg { /* MAIN ELEMENTS */ - function g(string memory _props, string memory _children) - internal - pure - returns (string memory) - { - return el('g', _props, _children); + function g( + string memory _props, + string memory _children + ) internal pure returns (string memory) { + return el("g", _props, _children); } - function path(string memory _props, string memory _children) - internal - pure - returns (string memory) - { - return el('path', _props, _children); + function path( + string memory _props, + string memory _children + ) internal pure returns (string memory) { + return el("path", _props, _children); } - function text(string memory _props, string memory _children) - internal - pure - returns (string memory) - { - return el('text', _props, _children); + function text( + string memory _props, + string memory _children + ) internal pure returns (string memory) { + return el("text", _props, _children); } - function line(string memory _props, string memory _children) - internal - pure - returns (string memory) - { - return el('line', _props, _children); + function line( + string memory _props, + string memory _children + ) internal pure returns (string memory) { + return el("line", _props, _children); } - function circle(string memory _props, string memory _children) - internal - pure - returns (string memory) - { - return el('circle', _props, _children); + function circle( + string memory _props, + string memory _children + ) internal pure returns (string memory) { + return el("circle", _props, _children); } - function circle(string memory _props) - internal - pure - returns (string memory) - { - return el('circle', _props); + function circle(string memory _props) internal pure returns (string memory) { + return el("circle", _props); } - function ellipse(string memory _props, string memory _children) - internal - pure - returns (string memory) - { - return el('ellipse', _props, _children); + function ellipse( + string memory _props, + string memory _children + ) internal pure returns (string memory) { + return el("ellipse", _props, _children); } function ellipse(string memory _props) internal pure returns (string memory) { - return el('ellipse', _props); + return el("ellipse", _props); } - function rect(string memory _props, string memory _children) - internal - pure - returns (string memory) - { - return el('rect', _props, _children); + function rect( + string memory _props, + string memory _children + ) internal pure returns (string memory) { + return el("rect", _props, _children); } - function rect(string memory _props) - internal - pure - returns (string memory) - { - return el('rect', _props); + function rect(string memory _props) internal pure returns (string memory) { + return el("rect", _props); } - function filter(string memory _props, string memory _children) - internal - pure - returns (string memory) - { - return el('filter', _props, _children); + function filter( + string memory _props, + string memory _children + ) internal pure returns (string memory) { + return el("filter", _props, _children); } - function cdata(string memory _content) - internal - pure - returns (string memory) - { - return string.concat('', _content, ''); + function cdata(string memory _content) internal pure returns (string memory) { + return string.concat("", _content, ""); } /* GRADIENTS */ - function radialGradient(string memory _props, string memory _children) - internal - pure - returns (string memory) - { - return el('radialGradient', _props, _children); + function radialGradient( + string memory _props, + string memory _children + ) internal pure returns (string memory) { + return el("radialGradient", _props, _children); } - function linearGradient(string memory _props, string memory _children) - internal - pure - returns (string memory) - { - return el('linearGradient', _props, _children); + function linearGradient( + string memory _props, + string memory _children + ) internal pure returns (string memory) { + return el("linearGradient", _props, _children); } function gradientStop( @@ -247,37 +206,27 @@ library svg { string memory stopColor, string memory _props ) internal pure returns (string memory) { - return - el( - 'stop', - string.concat( - prop('stop-color', stopColor), - ' ', - prop('offset', string.concat(utils.uint2str(offset), '%')), - ' ', - _props - ) - ); + return el( + "stop", + string.concat( + prop("stop-color", stopColor), + " ", + prop("offset", string.concat(utils.uint2str(offset), "%")), + " ", + _props + ) + ); } - function animateTransform(string memory _props) - internal - pure - returns (string memory) - { - return el('animateTransform', _props); + function animateTransform(string memory _props) internal pure returns (string memory) { + return el("animateTransform", _props); } - function image(string memory _href, string memory _props) - internal - pure - returns (string memory) - { - return - el( - 'image', - string.concat(prop('href', _href), ' ', _props) - ); + function image( + string memory _href, + string memory _props + ) internal pure returns (string memory) { + return el("image", string.concat(prop("href", _href), " ", _props)); } /* COMMON */ @@ -287,41 +236,16 @@ library svg { string memory _props, string memory _children ) internal pure returns (string memory) { - return - string.concat( - '<', - _tag, - ' ', - _props, - '>', - _children, - '' - ); + return string.concat("<", _tag, " ", _props, ">", _children, ""); } // A generic element, can be used to construct any SVG (or HTML) element without children - function el( - string memory _tag, - string memory _props - ) internal pure returns (string memory) { - return - string.concat( - '<', - _tag, - ' ', - _props, - '/>' - ); + function el(string memory _tag, string memory _props) internal pure returns (string memory) { + return string.concat("<", _tag, " ", _props, "/>"); } // an SVG attribute - function prop(string memory _key, string memory _val) - internal - pure - returns (string memory) - { - return string.concat(_key, '=', '"', _val, '" '); + function prop(string memory _key, string memory _val) internal pure returns (string memory) { + return string.concat(_key, "=", '"', _val, '" '); } } diff --git a/src/modules/derivatives/DerivativeCardDark.sol b/src/modules/derivatives/DerivativeCardDark.sol deleted file mode 100644 index 7941ce0f..00000000 --- a/src/modules/derivatives/DerivativeCardDark.sol +++ /dev/null @@ -1,465 +0,0 @@ -/// SPDX-License-Identifier: BSL-1.1 -pragma solidity 0.8.19; - -import {svg, utils} from "src/lib/SVG.sol"; - -contract DerivativeCardDark { - - struct Info { - string derivativeType; - string baseAssetSymbol; - string quoteAssetSymbol; - string tokenId; - string tokenAddress; - string erc20Address; - Property[] properties; - } - - struct Property { - string key; - string stringValue; - uint256 value; - } - - struct Colors { - string blue; - string lightBlue; - string green; - string yellowGreen; - string yellow; - string orange; - string red; - } - - string internal constant STROKE = 'stroke="#000" stroke-miterlimit="10" stroke-width="4px" '; - string internal constant TEXT_STYLE= 'font-family="\'Menlo\', monospace" fill="white"'; - - Colors internal colors; - - constructor() { - colors = Colors({ - blue: 'rgb(110, 148, 240)', - lightBlue: 'rgb(118, 189, 242)', - green: 'rgb(206, 244, 117)', - yellowGreen: 'rgb(243, 244, 189)', - yellow: 'rgb(243, 244, 189)', - orange: 'rgb(246, 172, 84)', - red: 'rgb(242, 103, 64)' - }); - } - - function render(Info memory tokenInfo) internal view returns (string memory) { - return string.concat( - '', - svg.el('defs', utils.NULL, string.concat(fullGradient(), fullGradient90(), fullGradientReverse90(), blueGreenGradient(), orangeRedGradient())), - svg.rect( - string.concat( - svg.prop('x', '0'), - svg.prop('y', '0'), - svg.prop('width', '290'), - svg.prop('height', '500'), - svg.prop('fill', 'rgb(30, 30, 30)'), - svg.prop('rx', '25'), - svg.prop('ry', '25') - ), - utils.NULL - ), - svg.rect( - string.concat( - svg.prop('x', '8'), - svg.prop('y', '8'), - svg.prop('width', '274'), - svg.prop('height', '484'), - svg.prop('fill', 'none'), - svg.prop('stroke', "url('#fullGradientReverse90')"), - svg.prop('stroke-width', '2'), - svg.prop('rx', '20'), - svg.prop('ry', '20') - ), - utils.NULL - ), - svg.text( - string.concat( - svg.prop('x', '145'), - svg.prop('y', '40'), - svg.prop('font-size', '20'), - svg.prop('text-anchor', 'middle'), - TEXT_STYLE - ), - tokenInfo.derivativeType - ), - svg.text( - string.concat( - svg.prop('x', '145'), - svg.prop('y', '100'), - svg.prop('font-size', '56'), - svg.prop('text-anchor', 'middle'), - // svg.prop('font-family', 'Menlo, monospace'), - // svg.prop('fill', "url('#orangeRedGradient')") - TEXT_STYLE - ), - tokenInfo.baseAssetSymbol - ), - progressBar(tokenInfo.properties[0].value, tokenInfo.properties[1].value), - svg.text( - string.concat( - svg.prop('x', '60'), - svg.prop('y', '200'), - svg.prop('font-size', '12'), - svg.prop('text-anchor', 'middle'), - TEXT_STYLE - ), - tokenInfo.properties[0].stringValue - ), - svg.text( - string.concat( - svg.prop('x', '230'), - svg.prop('y', '200'), - svg.prop('font-size', '12'), - svg.prop('text-anchor', 'middle'), - TEXT_STYLE - ), - tokenInfo.properties[1].stringValue - ), - logo(), - svg.text( - string.concat( - svg.prop('x', '145'), - svg.prop('y', '460'), - svg.prop('font-size', '10'), - svg.prop('text-anchor', 'middle'), - TEXT_STYLE - ), - tokenInfo.tokenAddress - ), - svg.text( - string.concat( - svg.prop('x', '145'), - svg.prop('y', '480'), - svg.prop('font-size', '10'), - svg.prop('text-anchor', 'middle'), - TEXT_STYLE - ), - string.concat('ID: ', tokenInfo.tokenId) - ), - '' - ); - } - - function logo() internal pure returns (string memory) { - return string.concat( - svg.rect( - string.concat( - svg.prop('x', '143'), - svg.prop('y', '240'), - svg.prop('width', '6'), - svg.prop('height', '125'), - svg.prop('fill', "url('#fullGradientReverse90')") - ), - utils.NULL - ), - svg.rect( - string.concat( - svg.prop('x', '79'), - svg.prop('y', '246'), - svg.prop('width', '6'), - svg.prop('height', '125'), - svg.prop('fill', "url('#fullGradient90')"), - svg.prop('transform', 'rotate(-60 145 250)') - ), - utils.NULL - ), - svg.rect( - string.concat( - svg.prop('x', '206'), - svg.prop('y', '244'), - svg.prop('width', '6'), - svg.prop('height', '125'), - svg.prop('fill', "url('#fullGradient90')"), - svg.prop('transform', 'rotate(60 145 250)') - ), - utils.NULL - ) - ); - } - - function fullGradientStops() internal view returns (string memory) { - return string.concat( - svg.gradientStop( - 2, - colors.blue, - utils.NULL - ), - svg.gradientStop( - 10, - colors.lightBlue, - utils.NULL - ), - svg.gradientStop( - 32, - colors.green, - utils.NULL - ), - svg.gradientStop( - 49, - colors.yellowGreen, - utils.NULL - ), - svg.gradientStop( - 52, - colors.yellow, - utils.NULL - ), - svg.gradientStop( - 79, - colors.orange, - utils.NULL - ), - svg.gradientStop( - 100, - colors.red, - utils.NULL - ) - ); - } - - function fullGradientReverseStops() internal view returns (string memory) { - return string.concat( - svg.gradientStop( - 2, - colors.red, - utils.NULL - ), - svg.gradientStop( - 21, - colors.orange, - utils.NULL - ), - svg.gradientStop( - 48, - colors.yellow, - utils.NULL - ), - svg.gradientStop( - 51, - colors.yellowGreen, - utils.NULL - ), - svg.gradientStop( - 68, - colors.green, - utils.NULL - ), - svg.gradientStop( - 90, - colors.lightBlue, - utils.NULL - ), - svg.gradientStop( - 100, - colors.blue, - utils.NULL - ) - ); - } - - function fullGradient() internal view returns (string memory) { - return svg.linearGradient( - string.concat( - svg.prop('id', 'fullGradient') - ), - fullGradientStops() - ); - } - - function fullGradient90() internal view returns (string memory) { - return svg.linearGradient( - string.concat( - svg.prop('id', 'fullGradient90'), - svg.prop('gradientTransform', 'rotate(90)') - ), - fullGradientStops() - ); - } - - function fullGradientReverse90() internal view returns (string memory) { - return svg.linearGradient( - string.concat( - svg.prop('id', 'fullGradientReverse90'), - svg.prop('gradientTransform', 'rotate(90)') - ), - fullGradientReverseStops() - ); - } - - function blueGreenGradient() internal view returns (string memory) { - return svg.linearGradient( - string.concat( - svg.prop('id', 'blueGreenGradient'), - svg.prop('gradientUnits', 'userSpaceOnUse') - ), - string.concat( - svg.gradientStop( - 20, - colors.blue, - utils.NULL - ), - svg.gradientStop( - 40, - colors.lightBlue, - utils.NULL - ), - svg.gradientStop( - 60, - colors.green, - utils.NULL - ) - ) - ); - } - - function orangeRedGradient() internal view returns (string memory) { - return svg.linearGradient( - string.concat( - svg.prop('id', 'orangeRedGradient'), - svg.prop('gradientTransform', 'rotate(90)') - ), - string.concat( - svg.gradientStop( - 30, - colors.orange, - utils.NULL - ), - svg.gradientStop( - 90, - colors.red, - utils.NULL - ) - ) - ); - } - - function progressBar(uint256 start, uint256 end) internal view returns (string memory) { - uint256 currentTime = 1717200000 + 70 * 86400; // block.timestamp; - - bool started = start <= currentTime; - - uint256 progress = started ? (currentTime - start) * 100 / (end - start) : 0; - // progress can be at most 100 - progress = progress > 100 ? 100 : progress; - - uint256 len = (168 * progress) / 100; - - string memory startBar = svg.line( - string.concat( - svg.prop('x1', '60'), - svg.prop('y1', '155'), - svg.prop('x2', '60'), - svg.prop('y2', '175'), - svg.prop('stroke', started ? colors.blue : 'grey'), - svg.prop('stroke-width', '6') - ), - utils.NULL - ); - - string memory endBar = svg.line( - string.concat( - svg.prop('x1', '230'), - svg.prop('y1', '155'), - svg.prop('x2', '230'), - svg.prop('y2', '175'), - svg.prop('stroke', progress == 100 ? colors.green : 'grey'), - svg.prop('stroke-width', '6') - ), - utils.NULL - ); - - - string memory progressLine = svg.line( - string.concat( - svg.prop('x1', '62'), - svg.prop('y1', '165'), - svg.prop('x2', utils.uint2str(62 + len)), - svg.prop('y2', '165'), - svg.prop('stroke', "url('#blueGreenGradient')"), - svg.prop('stroke-width', '6') - ), - utils.NULL - ); - - string memory animateLine = svg.rect( - string.concat( - svg.prop('x', '62'), - svg.prop('y', '161'), - svg.prop('width', '16'), - svg.prop('height', '8'), - svg.prop('fill', "url('#blueGreenGradient')"), - svg.prop('rx', '4'), - svg.prop('ry', '4') - ), - svg.el('animate', - string.concat( - svg.prop('attributeName', 'x'), - svg.prop('values', string.concat('62;', utils.uint2str(62 + len - 16), ';')), - svg.prop('dur', '3s'), - svg.prop('repeatCount', 'indefinite') - ), - utils.NULL - ) - ); - - string memory shadowLine = svg.line( - string.concat( - svg.prop('x1', '63'), - svg.prop('y1', '165'), - svg.prop('x2', '230'), - svg.prop('y2', '165'), - svg.prop('stroke', 'grey'), - svg.prop('stroke-width', '4') - ), - utils.NULL - ); - - string memory progressCircle = svg.circle( - string.concat( - svg.prop('cx', utils.uint2str(62 + len)), - svg.prop('cy', '165'), - svg.prop('r', '6'), - svg.prop('fill', "url('#blueGreenGradient')") - ), - utils.NULL - ); - - return svg.g( - utils.NULL, - string.concat( - startBar, - shadowLine, - progressLine, - progress < 5 ? '' : animateLine, - endBar, - progress < 5 || progress > 95 ? '' : progressCircle - ) - ); - } - - function example() external view returns (string memory) { - Property[] memory properties = new Property[](2); - properties[0] = Property({key: "Vesting Start", stringValue: "2024-06-01", value: 1717200000}); - properties[1] = Property({key: "Vesting End", stringValue: "2024-09-01", value: 1725148800}); - - - Info memory info = Info({ - derivativeType: "Linear Vesting", - baseAssetSymbol: "XYZ", - quoteAssetSymbol: "", - tokenId: "123456", - tokenAddress: "0x1234567890123456789012345678901234567890", - erc20Address: "0xfedcba0987654321fedcba0987654321fedcba09", - properties: properties - }); - - return render(info); - } - -} \ No newline at end of file diff --git a/src/modules/derivatives/DerivativeCardGradient.sol b/src/modules/derivatives/DerivativeCardGradient.sol deleted file mode 100644 index bdd5bcc9..00000000 --- a/src/modules/derivatives/DerivativeCardGradient.sol +++ /dev/null @@ -1,384 +0,0 @@ -/// SPDX-License-Identifier: BSL-1.1 -pragma solidity 0.8.19; - -import {svg, utils} from "src/lib/SVG.sol"; - -contract DerivativeCardDark { - - struct Info { - string derivativeType; - string baseAssetSymbol; - string quoteAssetSymbol; - Property[] properties; - } - - struct Property { - string key; - string value; - } - - struct Colors { - string blue; - string lightBlue; - string green; - string yellowGreen; - string yellow; - string orange; - string red; - } - - string internal constant STROKE = 'stroke="#000" stroke-miterlimit="10" stroke-width="4px" '; - string internal constant TEXT_STYLE= 'font-family="\'Menlo\', monospace" fill="black"'; - - Colors internal colors; - - constructor() { - colors = Colors({ - blue: 'rgb(110, 148, 240)', - lightBlue: 'rgb(118, 189, 242)', - green: 'rgb(206, 244, 117)', - yellowGreen: 'rgb(243, 244, 189)', - yellow: 'rgb(243, 244, 189)', - orange: 'rgb(246, 172, 84)', - red: 'rgb(242, 103, 64)' - }); - } - - function render(Info memory tokenInfo) internal view returns (string memory) { - return string.concat( - '', - svg.el('defs', utils.NULL, string.concat(fullGradient(), fullVertGradient(), blueGreenGradient(), orangeRedGradient())), - svg.rect( - string.concat( - svg.prop('x', '5'), - svg.prop('y', '5'), - svg.prop('width', '280'), - svg.prop('height', '490'), - svg.prop('fill', "url('#orangeRedGradient')"), - svg.prop('stroke', 'none'), - svg.prop('rx', '20'), - svg.prop('ry', '20') - ), - utils.NULL - ), - svg.rect( - string.concat( - svg.prop('x', '15'), - svg.prop('y', '15'), - svg.prop('width', '260'), - svg.prop('height', '470'), - svg.prop('fill', 'none'), - svg.prop('stroke', 'black'), - svg.prop('rx', '20'), - svg.prop('ry', '20') - ), - utils.NULL - ), - svg.text( - string.concat( - svg.prop('x', '145'), - svg.prop('y', '45'), - svg.prop('font-size', '20'), - svg.prop('text-anchor', 'middle'), - TEXT_STYLE - ), - tokenInfo.derivativeType - ), - svg.text( - string.concat( - svg.prop('x', '145'), - svg.prop('y', '100'), - svg.prop('font-size', '56'), - svg.prop('text-anchor', 'middle'), - TEXT_STYLE - ), - tokenInfo.baseAssetSymbol - ), - progressBar(80), - svg.g( - string.concat( - svg.prop('transform', 'translate(96, 200) scale(0.1)') - ), - logo() - ), - svg.text( - string.concat( - svg.prop('x', '20'), - svg.prop('y', '350'), - svg.prop('font-size', '16'), - svg.prop('text-anchor', 'left'), - TEXT_STYLE - ), - string.concat( - tokenInfo.properties[0].key, - ': ', - tokenInfo.properties[0].value - ) - ), - svg.text( - string.concat( - svg.prop('x', '20'), - svg.prop('y', '380'), - svg.prop('font-size', '16'), - svg.prop('text-anchor', 'left'), - TEXT_STYLE - ), - string.concat( - tokenInfo.properties[1].key, - ': ', - tokenInfo.properties[1].value - ) - ), - // svg.g( - // string.concat( - // svg.prop('transform', 'translate(80, 430) scale(0.05)') - // ), - // wordmark() - // ), - '' - ); - } - - function logo() internal pure returns (string memory) { - return svg.path( - string.concat( - svg.prop('fill' , 'white'), - STROKE, - svg.prop('d', 'M0.34668 818.666L20.3467 852.666L474.347 590.666V838.666H513.347V590.666L966.347 852.666L986.347 818.666L532.347 556.666L746.347 433.666L726.347 399.666L513.347 522.666L514.347 0.665527H474.347V522.666L260.347 399.666L240.347 433.666L454.347 556.666L0.34668 818.666Z') - ), - utils.NULL - ); - } - - function wordmark() internal pure returns (string memory) { - return svg.path( - string.concat( - svg.prop('fill' , "url('#fullGradient')"), - STROKE, - svg.prop('d', 'M2078.65 610.666H2118.65C2118.65 720.666 2205.65 799.666 2327.65 799.666C2439.65 799.666 2528.65 738.666 2528.65 629.666C2528.65 526.666 2460.65 465.666 2318.65 428.666C2167.65 397.666 2090.65 318.666 2090.65 201.666C2090.65 84.6656 2204.65 -2.33439 2323.65 0.665612C2450.65 -2.33439 2559.65 90.6656 2559.65 223.666H2521.65C2521.65 112.666 2432.65 40.6656 2323.65 40.6656C2223.65 40.6656 2130.65 110.666 2130.65 201.666C2130.65 300.666 2200.65 360.666 2331.65 394.666C2492.65 431.666 2569.65 505.666 2569.65 624.666C2569.65 743.666 2461.65 839.666 2323.65 839.666C2185.65 839.666 2078.65 742.666 2078.65 610.666ZM1926.65 820.666V20.6656H1966.65V820.666H1926.65ZM1005.65 801.666L1035.65 831.666L1416.65 450.666L1797.65 830.666L1826.65 800.666L1445.65 419.666L1826.65 40.6656L1796.65 10.6656L1415.65 391.666L1034.65 11.6656L1005.65 41.6656L1386.65 419.666L1005.65 801.666ZM45.6533 419.666C45.6533 627.666 212.653 794.666 419.653 794.666C611.653 794.666 793.653 648.666 793.653 419.666C793.653 190.666 611.653 45.6656 419.653 45.6656C212.653 45.6656 45.6533 213.666 45.6533 419.666ZM0.65332 419.666C0.65332 188.666 188.653 0.665612 419.653 0.665612C582.653 0.665612 761.653 103.666 817.653 299.666L869.653 20.6656H910.653L833.653 419.666L910.653 820.666H869.653L817.653 540.666C761.653 736.666 582.653 839.666 419.653 839.666C188.653 839.666 0.65332 651.666 0.65332 419.666Z') - ), - utils.NULL - ); - } - - function fullGradient() internal view returns (string memory) { - return svg.linearGradient( - string.concat( - svg.prop('id', 'fullGradient') - ), - string.concat( - svg.gradientStop( - 2, - colors.blue, - utils.NULL - ), - svg.gradientStop( - 10, - colors.lightBlue, - utils.NULL - ), - svg.gradientStop( - 32, - colors.green, - utils.NULL - ), - svg.gradientStop( - 49, - colors.yellowGreen, - utils.NULL - ), - svg.gradientStop( - 52, - colors.yellow, - utils.NULL - ), - svg.gradientStop( - 79, - colors.orange, - utils.NULL - ), - svg.gradientStop( - 100, - colors.red, - utils.NULL - ) - ) - ); - } - - function fullVertGradient() internal view returns (string memory) { - return svg.linearGradient( - string.concat( - svg.prop('id', 'fullVertGradient'), - svg.prop('gradientTransform', 'rotate(90)') - ), - string.concat( - svg.gradientStop( - 8, - colors.blue, - utils.NULL - ), - svg.gradientStop( - 20, - colors.lightBlue, - utils.NULL - ), - svg.gradientStop( - 42, - colors.green, - utils.NULL - ), - svg.gradientStop( - 59, - colors.yellowGreen, - utils.NULL - ), - svg.gradientStop( - 65, - colors.yellow, - utils.NULL - ), - svg.gradientStop( - 79, - colors.orange, - utils.NULL - ), - svg.gradientStop( - 100, - colors.red, - utils.NULL - ) - ) - ); - } - - function blueGreenGradient() internal view returns (string memory) { - return svg.linearGradient( - string.concat( - svg.prop('id', 'blueGreenGradient'), - svg.prop('gradientUnits', 'userSpaceOnUse') - ), - string.concat( - svg.gradientStop( - 20, - colors.blue, - utils.NULL - ), - svg.gradientStop( - 40, - colors.lightBlue, - utils.NULL - ), - svg.gradientStop( - 60, - colors.green, - utils.NULL - ) - ) - ); - } - - function orangeRedGradient() internal view returns (string memory) { - return svg.linearGradient( - string.concat( - svg.prop('id', 'orangeRedGradient'), - svg.prop('gradientTransform', 'rotate(60)') - ), - string.concat( - svg.gradientStop( - 30, - colors.orange, - utils.NULL - ), - svg.gradientStop( - 90, - colors.red, - utils.NULL - ) - ) - ); - } - - function progressBar(uint256 _progress) internal view returns (string memory) { - - uint256 len = 168 * _progress / 100; - - string memory startBar = svg.line( - string.concat( - svg.prop('x1', '60'), - svg.prop('y1', '135'), - svg.prop('x2', '60'), - svg.prop('y2', '155'), - svg.prop('stroke', colors.blue), - svg.prop('stroke-width', '6') - ), - utils.NULL - ); - - string memory endBarColor = _progress == 100 ? colors.green : 'grey'; - - string memory endBar = svg.line( - string.concat( - svg.prop('x1', '230'), - svg.prop('y1', '135'), - svg.prop('x2', '230'), - svg.prop('y2', '155'), - svg.prop('stroke', endBarColor), - svg.prop('stroke-width', '6') - ), - utils.NULL - ); - - - string memory progressLine = svg.line( - string.concat( - svg.prop('x1', '63'), - svg.prop('y1', '145'), - svg.prop('x2', utils.uint2str(62 + len)), - svg.prop('y2', '145'), - svg.prop('stroke', "url('#blueGreenGradient')"), - svg.prop('stroke-width', '6') - ), - utils.NULL - ); - - string memory shadowLine = svg.line( - string.concat( - svg.prop('x1', '63'), - svg.prop('y1', '145'), - svg.prop('x2', '230'), - svg.prop('y2', '145'), - svg.prop('stroke', 'grey'), - svg.prop('stroke-width', '4') - ), - utils.NULL - ); - - return svg.g( - utils.NULL, - string.concat( - startBar, - shadowLine, - progressLine, - endBar - ) - ); - } - - function example() external view returns (string memory) { - Property[] memory properties = new Property[](2); - properties[0] = Property({key: "Vesting Start", value: "2024-07-01"}); - properties[1] = Property({key: "Vesting End", value: "2024-09-01"}); - - - Info memory info = Info({ - derivativeType: "Linear Vesting", - baseAssetSymbol: "XYZ", - quoteAssetSymbol: "", - properties: properties - }); - - return render(info); - } - -} \ No newline at end of file diff --git a/src/modules/derivatives/DerivativeCardLight.sol b/src/modules/derivatives/DerivativeCardLight.sol deleted file mode 100644 index b4c116d1..00000000 --- a/src/modules/derivatives/DerivativeCardLight.sol +++ /dev/null @@ -1,371 +0,0 @@ -/// SPDX-License-Identifier: BSL-1.1 -pragma solidity 0.8.19; - -import {svg, utils} from "src/lib/SVG.sol"; - -contract DerivativeCardDark { - - struct Info { - string derivativeType; - string baseAssetSymbol; - string quoteAssetSymbol; - Property[] properties; - } - - struct Property { - string key; - string value; - } - - struct Colors { - string blue; - string lightBlue; - string green; - string yellowGreen; - string yellow; - string orange; - string red; - } - - string internal constant STROKE = 'stroke="#000" stroke-miterlimit="10" stroke-width="4px" '; - string internal constant TEXT_STYLE= 'font-family="\'Menlo\', monospace" fill="#000"'; - - Colors internal colors; - - constructor() { - colors = Colors({ - blue: 'rgb(110, 148, 240)', - lightBlue: 'rgb(118, 189, 242)', - green: 'rgb(206, 244, 117)', - yellowGreen: 'rgb(243, 244, 189)', - yellow: 'rgb(243, 244, 189)', - orange: 'rgb(246, 172, 84)', - red: 'rgb(242, 103, 64)' - }); - } - - function render(Info memory tokenInfo) internal view returns (string memory) { - return string.concat( - '', - svg.el('defs', utils.NULL, string.concat(fullGradient(), fullVertGradient(), blueGreenGradient(), orangeRedGradient())), - svg.rect( - string.concat( - svg.prop('x', '5'), - svg.prop('y', '5'), - svg.prop('width', '280'), - svg.prop('height', '490'), - svg.prop('fill', 'rgb(200, 200, 200)'), - svg.prop('stroke', 'black'), - svg.prop('rx', '10'), - svg.prop('ry', '10') - ), - utils.NULL - ), - svg.text( - string.concat( - svg.prop('x', '145'), - svg.prop('y', '30'), - svg.prop('font-size', '20'), - svg.prop('text-anchor', 'middle'), - TEXT_STYLE - ), - tokenInfo.derivativeType - ), - svg.text( - string.concat( - svg.prop('x', '145'), - svg.prop('y', '90'), - svg.prop('font-size', '56'), - svg.prop('text-anchor', 'middle'), - TEXT_STYLE - ), - tokenInfo.baseAssetSymbol - ), - progressBar(60), - svg.g( - string.concat( - svg.prop('transform', 'translate(96, 200) scale(0.1)') - ), - logo() - ), - svg.text( - string.concat( - svg.prop('x', '20'), - svg.prop('y', '350'), - svg.prop('font-size', '16'), - svg.prop('text-anchor', 'left'), - TEXT_STYLE - ), - string.concat( - tokenInfo.properties[0].key, - ': ', - tokenInfo.properties[0].value - ) - ), - svg.text( - string.concat( - svg.prop('x', '20'), - svg.prop('y', '380'), - svg.prop('font-size', '16'), - svg.prop('text-anchor', 'left'), - TEXT_STYLE - ), - string.concat( - tokenInfo.properties[1].key, - ': ', - tokenInfo.properties[1].value - ) - ), - // svg.g( - // string.concat( - // svg.prop('transform', 'translate(80, 430) scale(0.05)') - // ), - // wordmark() - // ), - '' - ); - } - - function logo() internal pure returns (string memory) { - return svg.path( - string.concat( - svg.prop('fill' , "url('#fullVertGradient')"), - // STROKE, - svg.prop('d', 'M0.34668 818.666L20.3467 852.666L474.347 590.666V838.666H513.347V590.666L966.347 852.666L986.347 818.666L532.347 556.666L746.347 433.666L726.347 399.666L513.347 522.666L514.347 0.665527H474.347V522.666L260.347 399.666L240.347 433.666L454.347 556.666L0.34668 818.666Z') - ), - utils.NULL - ); - } - - function wordmark() internal pure returns (string memory) { - return svg.path( - string.concat( - svg.prop('fill' , "url('#fullGradient')"), - STROKE, - svg.prop('d', 'M2078.65 610.666H2118.65C2118.65 720.666 2205.65 799.666 2327.65 799.666C2439.65 799.666 2528.65 738.666 2528.65 629.666C2528.65 526.666 2460.65 465.666 2318.65 428.666C2167.65 397.666 2090.65 318.666 2090.65 201.666C2090.65 84.6656 2204.65 -2.33439 2323.65 0.665612C2450.65 -2.33439 2559.65 90.6656 2559.65 223.666H2521.65C2521.65 112.666 2432.65 40.6656 2323.65 40.6656C2223.65 40.6656 2130.65 110.666 2130.65 201.666C2130.65 300.666 2200.65 360.666 2331.65 394.666C2492.65 431.666 2569.65 505.666 2569.65 624.666C2569.65 743.666 2461.65 839.666 2323.65 839.666C2185.65 839.666 2078.65 742.666 2078.65 610.666ZM1926.65 820.666V20.6656H1966.65V820.666H1926.65ZM1005.65 801.666L1035.65 831.666L1416.65 450.666L1797.65 830.666L1826.65 800.666L1445.65 419.666L1826.65 40.6656L1796.65 10.6656L1415.65 391.666L1034.65 11.6656L1005.65 41.6656L1386.65 419.666L1005.65 801.666ZM45.6533 419.666C45.6533 627.666 212.653 794.666 419.653 794.666C611.653 794.666 793.653 648.666 793.653 419.666C793.653 190.666 611.653 45.6656 419.653 45.6656C212.653 45.6656 45.6533 213.666 45.6533 419.666ZM0.65332 419.666C0.65332 188.666 188.653 0.665612 419.653 0.665612C582.653 0.665612 761.653 103.666 817.653 299.666L869.653 20.6656H910.653L833.653 419.666L910.653 820.666H869.653L817.653 540.666C761.653 736.666 582.653 839.666 419.653 839.666C188.653 839.666 0.65332 651.666 0.65332 419.666Z') - ), - utils.NULL - ); - } - - function fullGradient() internal view returns (string memory) { - return svg.linearGradient( - string.concat( - svg.prop('id', 'fullGradient') - ), - string.concat( - svg.gradientStop( - 2, - colors.blue, - utils.NULL - ), - svg.gradientStop( - 10, - colors.lightBlue, - utils.NULL - ), - svg.gradientStop( - 32, - colors.green, - utils.NULL - ), - svg.gradientStop( - 49, - colors.yellowGreen, - utils.NULL - ), - svg.gradientStop( - 52, - colors.yellow, - utils.NULL - ), - svg.gradientStop( - 79, - colors.orange, - utils.NULL - ), - svg.gradientStop( - 100, - colors.red, - utils.NULL - ) - ) - ); - } - - function fullVertGradient() internal view returns (string memory) { - return svg.linearGradient( - string.concat( - svg.prop('id', 'fullVertGradient'), - svg.prop('gradientTransform', 'rotate(90)') - ), - string.concat( - svg.gradientStop( - 8, - colors.blue, - utils.NULL - ), - svg.gradientStop( - 20, - colors.lightBlue, - utils.NULL - ), - svg.gradientStop( - 42, - colors.green, - utils.NULL - ), - svg.gradientStop( - 59, - colors.yellowGreen, - utils.NULL - ), - svg.gradientStop( - 65, - colors.yellow, - utils.NULL - ), - svg.gradientStop( - 79, - colors.orange, - utils.NULL - ), - svg.gradientStop( - 100, - colors.red, - utils.NULL - ) - ) - ); - } - - function blueGreenGradient() internal view returns (string memory) { - return svg.linearGradient( - string.concat( - svg.prop('id', 'blueGreenGradient'), - svg.prop('gradientUnits', 'userSpaceOnUse') - ), - string.concat( - svg.gradientStop( - 20, - colors.blue, - utils.NULL - ), - svg.gradientStop( - 40, - colors.lightBlue, - utils.NULL - ), - svg.gradientStop( - 60, - colors.green, - utils.NULL - ) - ) - ); - } - - function orangeRedGradient() internal view returns (string memory) { - return svg.linearGradient( - string.concat( - svg.prop('id', 'orangeRedGradient'), - svg.prop('gradientTransform', 'rotate(90)') - ), - string.concat( - svg.gradientStop( - 30, - colors.orange, - utils.NULL - ), - svg.gradientStop( - 90, - colors.red, - utils.NULL - ) - ) - ); - } - - function progressBar(uint256 _progress) internal view returns (string memory) { - - uint256 len = 168 * _progress / 100; - - string memory startBar = svg.line( - string.concat( - svg.prop('x1', '60'), - svg.prop('y1', '135'), - svg.prop('x2', '60'), - svg.prop('y2', '155'), - svg.prop('stroke', colors.blue), - svg.prop('stroke-width', '6') - ), - utils.NULL - ); - - string memory endBarColor = _progress == 100 ? colors.green : 'grey'; - - string memory endBar = svg.line( - string.concat( - svg.prop('x1', '230'), - svg.prop('y1', '135'), - svg.prop('x2', '230'), - svg.prop('y2', '155'), - svg.prop('stroke', endBarColor), - svg.prop('stroke-width', '6') - ), - utils.NULL - ); - - - string memory progressLine = svg.line( - string.concat( - svg.prop('x1', '63'), - svg.prop('y1', '145'), - svg.prop('x2', utils.uint2str(62 + len)), - svg.prop('y2', '145'), - svg.prop('stroke', "url('#blueGreenGradient')"), - svg.prop('stroke-width', '6') - ), - utils.NULL - ); - - string memory shadowLine = svg.line( - string.concat( - svg.prop('x1', '63'), - svg.prop('y1', '145'), - svg.prop('x2', '230'), - svg.prop('y2', '145'), - svg.prop('stroke', 'grey'), - svg.prop('stroke-width', '4') - ), - utils.NULL - ); - - return svg.g( - utils.NULL, - string.concat( - startBar, - shadowLine, - progressLine, - endBar - ) - ); - } - - function example() external view returns (string memory) { - Property[] memory properties = new Property[](2); - properties[0] = Property({key: "Vesting Start", value: "2024-07-01"}); - properties[1] = Property({key: "Vesting End", value: "2024-09-01"}); - - - Info memory info = Info({ - derivativeType: "Linear Vesting Token", - baseAssetSymbol: "XYZ", - quoteAssetSymbol: "", - properties: properties - }); - - return render(info); - } - -} \ No newline at end of file diff --git a/src/modules/derivatives/LinearVesting.sol b/src/modules/derivatives/LinearVesting.sol index a8747b77..9056b00e 100644 --- a/src/modules/derivatives/LinearVesting.sol +++ b/src/modules/derivatives/LinearVesting.sol @@ -14,6 +14,7 @@ import {ILinearVesting} from "src/interfaces/modules/derivatives/ILinearVesting. 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"; /// @title LinearVesting /// @notice A derivative module that allows for the creation of linearly vesting tokens @@ -23,7 +24,7 @@ import {SoulboundCloneERC20} from "src/modules/derivatives/SoulboundCloneERC20.s /// /// The start timestamp enables vesting tokens to have a cliff, after which vesting commences. /// @author Axis Finance -contract LinearVesting is DerivativeModule, ILinearVesting { +contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { using SafeTransferLib for ERC20; using ClonesWithImmutableArgs for address; using Timestamp for uint48; @@ -42,6 +43,7 @@ contract LinearVesting is DerivativeModule, ILinearVesting { // ========== MODULE SETUP ========== // constructor(address parent_) Module(parent_) { + // LinearVestingCard() // Deploy the clone implementation _IMPLEMENTATION = address(new SoulboundCloneERC20()); } @@ -682,4 +684,42 @@ contract LinearVesting is DerivativeModule, ILinearVesting { return ERC20(token.underlyingToken).decimals(); } + + // ========== ERC6909 CONTENT EXTENSION ========== // + + /// @inheritdoc ERC6909Metadata + /// @dev This function reverts if: + /// - The token ID does not exist + function tokenURI(uint256 tokenId_) + public + view + override + onlyValidTokenId(tokenId_) + returns (string memory) + { + Token storage token = tokenMetadata[tokenId_]; + VestingParams memory data = abi.decode(token.data, (VestingParams)); + + // Get the underlying token symbol + string memory _symbol = ERC20(token.underlyingToken).symbol(); + + // Create token info for rendering token card + Info memory info = Info({ + tokenId: tokenId_, + baseAssetSymbol: _symbol, + start: data.start, + expiry: data.expiry + }); + + // Return the token URI + return string.concat( + '{"name": "', + name(tokenId_), + '", "description": "Linear Vesting ', + _symbol, + '", "image": "data:image/svg+xml;utf8,', + render(info), + '"}' + ); + } } diff --git a/src/modules/derivatives/LinearVestingCard.sol b/src/modules/derivatives/LinearVestingCard.sol new file mode 100644 index 00000000..b2f10c2d --- /dev/null +++ b/src/modules/derivatives/LinearVestingCard.sol @@ -0,0 +1,553 @@ +/// 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 {LibString} from "lib/solady/src/utils/LibString.sol"; +import {Strings as LibString} from "lib/openzeppelin-contracts/contracts/utils/Strings.sol"; + +contract LinearVestingCard { + // ========== DATA STRUCTURES ========== // + + struct Info { + uint256 tokenId; + string baseAssetSymbol; + uint48 start; + uint48 expiry; + } + + struct Colors { + string blue; + string lightBlue; + string green; + string yellowGreen; + string yellow; + string orange; + string red; + } + + // ========== STATE VARIABLES ========== // + + string internal constant TEXT_STYLE = + 'font-family="\'Menlo\', monospace" fill="white" text-anchor="middle"'; + string internal constant NULL = ""; + string internal ADDR_STRING; + + Colors internal colors; + + // ========== CONSTRUCTOR ========== // + + constructor() { + colors = Colors({ + blue: "rgb(110, 148, 240)", + lightBlue: "rgb(118, 189, 242)", + green: "rgb(206, 244, 117)", + yellowGreen: "rgb(243, 244, 189)", + yellow: "rgb(243, 244, 189)", + orange: "rgb(246, 172, 84)", + red: "rgb(242, 103, 64)" + }); + + ADDR_STRING = LibString.toHexString(address(this)); + } + + // ========== RENDERER ========== // + function render(Info memory tokenInfo) internal view returns (string memory) { + return string.concat( + '', + svg.el( + "defs", + NULL, + string.concat( + fullGradient(), fullGradient90(), fullGradientReverse90(), blueGreenGradient() + ) + ), + svg.rect( + // string.concat( + // svg.prop('x', '0'), + // svg.prop('y', '0'), + // svg.prop('width', '290'), + // svg.prop('height', '500'), + // svg.prop('fill', 'rgb(30, 30, 30)'), + // svg.prop('rx', '25'), + // svg.prop('ry', '25') + // ), + 'x="0" y="0" width="290" height="500" fill="rgb(30, 30, 30)" rx="25" ry="25"', + NULL + ), + svg.rect( + // string.concat( + // svg.prop('x', '8'), + // svg.prop('y', '8'), + // svg.prop('width', '274'), + // svg.prop('height', '484'), + // svg.prop('fill', 'none'), + // svg.prop('stroke', "url('#fullGradient')"), + // svg.prop('stroke-width', '2'), + // svg.prop('rx', '20'), + // svg.prop('ry', '20') + // ), + 'x="8" y="8" width="274" height="484" fill="none" stroke="url(#fullGradient)" stroke-width="2" rx="20" ry="20"', + NULL + ), + title(tokenInfo.baseAssetSymbol), + progressBar(uint256(tokenInfo.start), uint256(tokenInfo.expiry)), + progressLabels(tokenInfo.start, tokenInfo.expiry), + logo(), + identifier(tokenInfo.tokenId), + "" + ); + } + + // ========== COMPONENTS ========== // + + function title(string memory symbol) internal pure returns (string memory) { + return string.concat( + svg.text( + // string.concat( + // svg.prop('x', '145'), + // svg.prop('y', '40'), + // svg.prop('font-size', '20'), + // TEXT_STYLE + // ), + string.concat('x="145" y="40" font-size="20" ', TEXT_STYLE), + "Linear Vesting" + ), + svg.text( + // string.concat( + // svg.prop('x', '145'), + // svg.prop('y', '100'), + // svg.prop('font-size', '56'), + // TEXT_STYLE + // ), + string.concat('x="145" y="100" font-size="56" ', TEXT_STYLE), + symbol + ) + ); + } + + function logo() internal pure returns (string memory) { + return string.concat( + svg.rect( + // string.concat( + // svg.prop('x', '143'), + // svg.prop('y', '240'), + // svg.prop('width', '6'), + // svg.prop('height', '125'), + // svg.prop('fill', "url('#fullGradientReverse90')") + // ), + 'x="143" y="240" width="6" height="125" fill="url(#fullGradientReverse90)"', + NULL + ), + svg.rect( + // string.concat( + // svg.prop('x', '79'), + // svg.prop('y', '246'), + // svg.prop('width', '6'), + // svg.prop('height', '125'), + // svg.prop('fill', "url('#fullGradient90')"), + // svg.prop('transform', 'rotate(-60 145 250)') + // ), + 'x="79" y="246" width="6" height="125" fill="url(#fullGradient90)" transform="rotate(-60 145 250)"', + NULL + ), + svg.rect( + // string.concat( + // svg.prop('x', '206'), + // svg.prop('y', '244'), + // svg.prop('width', '6'), + // svg.prop('height', '125'), + // svg.prop('fill', "url('#fullGradient90')"), + // svg.prop('transform', 'rotate(60 145 250)') + // ), + 'x="206" y="244" width="6" height="125" fill="url(#fullGradient90)" transform="rotate(60 145 250)"', + NULL + ) + ); + } + + function identifier(uint256 tokenId) internal view returns (string memory) { + return string.concat( + svg.text( + // string.concat( + // svg.prop('x', '145'), + // svg.prop('y', '460'), + // svg.prop('font-size', '10'), + // TEXT_STYLE + // ), + string.concat('x="145" y="460" font-size="10" ', TEXT_STYLE), + ADDR_STRING + ), + svg.text( + // string.concat( + // svg.prop('x', '145'), + // svg.prop('y', '480'), + // svg.prop('font-size', '10'), + // TEXT_STYLE + // ), + string.concat('x="145" y="480" font-size="10" ', TEXT_STYLE), + string.concat("ID: ", LibString.toString(tokenId)) + ) + ); + } + + function progressBar(uint256 start, uint256 end) internal view returns (string memory) { + uint256 currentTime = block.timestamp; // 1717200000 + 70 * 86400; + + string memory startBar; + string memory endBar; + uint256 progress; + { + bool started = start <= currentTime; + + progress = started ? (currentTime - start) * 100 / (end - start) : 0; + // progress can be at most 100 + progress = progress > 100 ? 100 : progress; + + startBar = svg.line( + // string.concat( + // svg.prop('x1', '60'), + // svg.prop('y1', '155'), + // svg.prop('x2', '60'), + // svg.prop('y2', '175'), + // svg.prop('stroke', started ? colors.blue : 'grey'), + // svg.prop('stroke-width', '6') + // ), + string.concat( + 'x1="60" y1="155" x2="60" y2="175" stroke="', + started ? colors.blue : "grey", + '" stroke-width="6"' + ), + NULL + ); + + endBar = svg.line( + // string.concat( + // svg.prop('x1', '230'), + // svg.prop('y1', '155'), + // svg.prop('x2', '230'), + // svg.prop('y2', '175'), + // svg.prop('stroke', progress == 100 ? colors.green : 'grey'), + // svg.prop('stroke-width', '6') + // ), + string.concat( + 'x1="230" y1="155" x2="230" y2="175" stroke="', + progress == 100 ? colors.green : "grey", + '" stroke-width="6"' + ), + NULL + ); + } + + uint256 len = (168 * progress) / 100; + string memory current = LibString.toString(62 + len); + + string memory progressLine = svg.line( + // string.concat( + // svg.prop('x1', '62'), + // svg.prop('y1', '165'), + // svg.prop('x2', current), + // svg.prop('y2', '165'), + // svg.prop('stroke', "url('#blueGreenGradient')"), + // svg.prop('stroke-width', '6') + // ), + string.concat( + 'x1="62" y1="165" x2="', + current, + '" y2="165" stroke="url(#blueGreenGradient)" stroke-width="6"' + ), + NULL + ); + + string memory progressCircle = svg.circle( + // string.concat( + // svg.prop('cx', current), + // svg.prop('cy', '165'), + // svg.prop('r', '6'), + // svg.prop('fill', "url('#blueGreenGradient')") + // ), + string.concat('cx="', current, '" cy="165" r="6" fill="url(#blueGreenGradient)"'), + NULL + ); + + string memory shadowLine = svg.line( + // string.concat( + // svg.prop('x1', '63'), + // svg.prop('y1', '165'), + // svg.prop('x2', '230'), + // svg.prop('y2', '165'), + // svg.prop('stroke', 'grey'), + // svg.prop('stroke-width', '4') + // ), + string.concat('x1="63" y1="165" x2="230" y2="165" stroke="grey" stroke-width="4"'), + NULL + ); + + return svg.g( + NULL, + string.concat( + startBar, + shadowLine, + progressLine, + progress < 15 ? "" : animateLine(len), + endBar, + progress < 5 || progress > 95 ? "" : progressCircle + ) + ); + } + + function animateLine(uint256 len) internal pure returns (string memory) { + return svg.rect( + // string.concat( + // svg.prop('x', '62'), + // svg.prop('y', '161'), + // svg.prop('width', '12'), + // svg.prop('height', '8'), + // svg.prop('fill', "url('#blueGreenGradient')"), + // svg.prop('rx', '4'), + // svg.prop('ry', '4') + // ), + string.concat( + 'x="62" y="161" width="12" height="8" fill="url(#blueGreenGradient)" rx="4" ry="4"' + ), + svg.el( + "animate", + // string.concat( + // svg.prop('attributeName', 'x'), + // svg.prop('values', string.concat('62;', LibString.toString(62 + len - 16), ';')), + // svg.prop('dur', string.concat(LibString.toString(((5 * len) / 168) + 1), 's')), + // svg.prop('repeatCount', 'indefinite') + // ), + string.concat( + 'attributeName="x" values="62;', + LibString.toString(62 + len - 16), + ';" dur="', + LibString.toString(((5 * len) / 168) + 1), + 's" repeatCount="indefinite"' + ), + NULL + ) + ); + } + + function progressLabels(uint48 start_, uint48 expiry_) internal pure returns (string memory) { + (string memory start, string memory expiry) = getTimeStrings(start_, expiry_); + + return string.concat( + svg.text( + // string.concat( + // svg.prop('x', '60'), + // svg.prop('y', '200'), + // svg.prop('font-size', '12'), + // TEXT_STYLE + // ), + string.concat('x="60" y="200" font-size="12" ', TEXT_STYLE), + start + ), + svg.text( + // string.concat( + // svg.prop('x', '230'), + // svg.prop('y', '200'), + // svg.prop('font-size', '12'), + // TEXT_STYLE + // ), + string.concat('x="230" y="200" font-size="12"', TEXT_STYLE), + expiry + ) + ); + } + + // ========== COLOR GRADIENTS ========== // + + function fullGradientStops() internal view returns (string memory) { + // return string.concat( + // svg.gradientStop( + // 2, + // colors.blue, + // NULL + // ), + // svg.gradientStop( + // 10, + // colors.lightBlue, + // NULL + // ), + // svg.gradientStop( + // 32, + // colors.green, + // NULL + // ), + // svg.gradientStop( + // 49, + // colors.yellowGreen, + // NULL + // ), + // svg.gradientStop( + // 52, + // colors.yellow, + // NULL + // ), + // svg.gradientStop( + // 79, + // colors.orange, + // NULL + // ), + // svg.gradientStop( + // 100, + // colors.red, + // NULL + // ) + // ); + return string.concat( + '', + '', + '', + '', + '', + '', + '' + ); + } + + function fullGradientReverseStops() internal view returns (string memory) { + return string.concat( + svg.gradientStop(2, colors.red, NULL), + svg.gradientStop(21, colors.orange, NULL), + svg.gradientStop(48, colors.yellow, NULL), + svg.gradientStop(51, colors.yellowGreen, NULL), + svg.gradientStop(68, colors.green, NULL), + svg.gradientStop(90, colors.lightBlue, NULL), + svg.gradientStop(100, colors.blue, NULL) + ); + return string.concat( + '', + '', + '', + '', + '', + '', + '' + ); + } + + function fullGradient() internal view returns (string memory) { + return + svg.linearGradient(string.concat(svg.prop("id", "fullGradient")), fullGradientStops()); + } + + function fullGradient90() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop("id", "fullGradient90"), svg.prop("gradientTransform", "rotate(90)") + ), + fullGradientStops() + ); + } + + function fullGradientReverse90() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop("id", "fullGradientReverse90"), svg.prop("gradientTransform", "rotate(90)") + ), + fullGradientReverseStops() + ); + } + + function blueGreenGradient() internal view returns (string memory) { + return svg.linearGradient( + string.concat( + svg.prop("id", "blueGreenGradient"), svg.prop("gradientUnits", "userSpaceOnUse") + ), + string.concat( + '', + '', + '' + ) + ); + } + + // function orangeRedGradient() internal view returns (string memory) { + // return svg.linearGradient( + // string.concat( + // svg.prop('id', 'orangeRedGradient'), + // svg.prop('gradientTransform', 'rotate(90)') + // ), + // string.concat( + // svg.gradientStop( + // 30, + // colors.orange, + // NULL + // ), + // svg.gradientStop( + // 90, + // colors.red, + // NULL + // ) + // ) + // ); + // } + + // ========== UTILITIES ========== // + + function getTimeStrings( + uint48 start, + uint48 end + ) internal pure returns (string memory, string memory) { + (string memory startYear, string memory startMonth, string memory startDay) = + Timestamp.toPaddedString(start); + (string memory endYear, string memory endMonth, string memory endDay) = + Timestamp.toPaddedString(end); + + return ( + string.concat(startYear, "-", startMonth, "-", startDay), + string.concat(endYear, "-", endMonth, "-", endDay) + ); + } + + // ========== EXAMPLE ========== // + // Used by hot-chain-svg during development. TODO: Remove for prod. + + function example() external view returns (string memory) { + Info memory info = Info({ + baseAssetSymbol: "XYZ", + tokenId: 123_456, + start: 1_717_200_000, // 2024-06-01 + expiry: 1_725_148_800 // 2024-09-01 + }); + + return render(info); + } +} diff --git a/test/modules/derivatives/mocks/MockDerivativeModule.sol b/test/modules/derivatives/mocks/MockDerivativeModule.sol index 5bc36d96..8f248112 100644 --- a/test/modules/derivatives/mocks/MockDerivativeModule.sol +++ b/test/modules/derivatives/mocks/MockDerivativeModule.sol @@ -209,4 +209,6 @@ contract MockDerivativeModule is DerivativeModule { function symbol(uint256 tokenId_) public view virtual override returns (string memory) {} function decimals(uint256 tokenId_) public view virtual override returns (uint8) {} + + function tokenURI(uint256 tokenId_) public view virtual override returns (string memory) {} } diff --git a/utils/hot-chain-svg/src/compile.js b/utils/hot-chain-svg/src/compile.js index 5077a8ad..93665495 100644 --- a/utils/hot-chain-svg/src/compile.js +++ b/utils/hot-chain-svg/src/compile.js @@ -12,10 +12,10 @@ function getSolcInput(source) { }, settings: { optimizer: { - enabled: false, - runs: 1, + enabled: true, + runs: 200, }, - evmVersion: 'london', + evmVersion: 'paris', outputSelection: { '*': { '*': ['abi', 'evm.bytecode'], diff --git a/utils/hot-chain-svg/src/index.js b/utils/hot-chain-svg/src/index.js index b069547c..bba813c7 100644 --- a/utils/hot-chain-svg/src/index.js +++ b/utils/hot-chain-svg/src/index.js @@ -6,7 +6,7 @@ const call = require('./call'); const compile = require('./compile'); const deploy = require('./deploy'); -const SOURCE = path.join(__dirname, '..', '..', '..', 'src', 'modules', 'derivatives', 'DerivativeCardDark.sol'); +const SOURCE = path.join(__dirname, '..', '..', '..', 'src', 'modules', 'derivatives', 'LinearVestingCard.sol'); const PROJECT_DIR = path.join(__dirname, '..', '..', '..'); async function main() { From b579f2566c2bfc579280acc4944fe8da9324c78b Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 21 Jun 2024 15:47:36 +0400 Subject: [PATCH 17/82] Add check for length of callback data # Conflicts: # script/salts/salts.json --- script/salts/salts.json | 4 ++-- .../allowlists/CappedMerkleAllowlist.sol | 5 +++++ .../AllocatedMerkleAllowlistAtomic.t.sol | 3 ++- .../AllocatedMerkleAllowlistBatch.t.sol | 3 ++- .../CappedMerkleAllowlistAtomic.t.sol | 19 +++++++++++++++++++ .../CappedMerkleAllowlistBatch.t.sol | 19 +++++++++++++++++++ 6 files changed, 49 insertions(+), 4 deletions(-) diff --git a/script/salts/salts.json b/script/salts/salts.json index b1327403..1c573d6e 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -42,8 +42,8 @@ "0x7cca57da19a5847b2b87641c1b721a32d4778e3e58641d6771cd14ed112b3bc3": "0xe0631d27a3d241774729d8c3ee1d9efae407f1073f89fa0956b2d308bd3adec4" }, "Test_CappedMerkleAllowlist": { - "0x240bdd876f7c0070009c234b8cde981c3865d49db15097f59cd4ffb15d818d1e": "0xe68b5bbeed8a53eb7e97b7bc84ec08e1e6a5b360cae16f0653c60eff312dec3f", - "0xb8a17b3ee693ebdcfc6913bb2f65d0fadbe8812d9ef4d927595a7dc75db68727": "0x956b71c3545015d12e8bbefbad72019b673860f32a5b4313eeb866425d97be17" + "0x2e55fe4d6c3005f7bf152a42653bd234155cdac7f621582ba16b664c115ba76b": "0xcebb750afb8a132bc3cb37d32494b7ff18eddfb4b5359d69324660cb723e32e3", + "0xbd19b648b51fb3fe1bd9e42ad4018b839966abea0f4e25a9149dffdc7cc86a4e": "0x40034a34b97aef1a7635ee0f34b06951512b57d37bc0baa1be879a5144895d08" }, "Test_GUniFactory": { "0x3bf0e882023640f31bf861e1f13d306fd4fbb7afb7860e21a489062cbefcf885": "0x397acf3db4cc9c81f8c1975a5505e392e6b5f8eb3b22efcc094b3e0f39f6739b" diff --git a/src/callbacks/allowlists/CappedMerkleAllowlist.sol b/src/callbacks/allowlists/CappedMerkleAllowlist.sol index ffaaf9e3..9565de77 100644 --- a/src/callbacks/allowlists/CappedMerkleAllowlist.sol +++ b/src/callbacks/allowlists/CappedMerkleAllowlist.sol @@ -54,6 +54,11 @@ contract CappedMerkleAllowlist is MerkleAllowlist { 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)); diff --git a/test/callbacks/AllocatedMerkleAllowlistAtomic.t.sol b/test/callbacks/AllocatedMerkleAllowlistAtomic.t.sol index ad81828c..ac41980f 100644 --- a/test/callbacks/AllocatedMerkleAllowlistAtomic.t.sol +++ b/test/callbacks/AllocatedMerkleAllowlistAtomic.t.sol @@ -135,7 +135,8 @@ contract AllocatedMerkleAllowlistAtomicTest is Test, Permit2User, WithSalts { function test_onCreate_allowlistParametersIncorrectFormat_reverts() public { // Expect revert - vm.expectRevert(); + bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); + vm.expectRevert(err); vm.prank(address(_auctionHouse)); _allowlist.onCreate( diff --git a/test/callbacks/AllocatedMerkleAllowlistBatch.t.sol b/test/callbacks/AllocatedMerkleAllowlistBatch.t.sol index 6c483e1e..ab5720a6 100644 --- a/test/callbacks/AllocatedMerkleAllowlistBatch.t.sol +++ b/test/callbacks/AllocatedMerkleAllowlistBatch.t.sol @@ -133,7 +133,8 @@ contract AllocatedMerkleAllowlistBatchTest is Test, Permit2User, WithSalts { function test_onCreate_allowlistParametersIncorrectFormat_reverts() public { // Expect revert - vm.expectRevert(); + bytes memory err = abi.encodeWithSelector(BaseCallback.Callback_InvalidParams.selector); + vm.expectRevert(err); vm.prank(address(_auctionHouse)); _allowlist.onCreate( diff --git a/test/callbacks/CappedMerkleAllowlistAtomic.t.sol b/test/callbacks/CappedMerkleAllowlistAtomic.t.sol index 72370543..402a31bc 100644 --- a/test/callbacks/CappedMerkleAllowlistAtomic.t.sol +++ b/test/callbacks/CappedMerkleAllowlistAtomic.t.sol @@ -91,6 +91,8 @@ contract CappedMerkleAllowlistAtomicTest is Test, Permit2User, WithSalts { } // 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 @@ -99,6 +101,23 @@ contract CappedMerkleAllowlistAtomicTest is Test, Permit2User, WithSalts { // [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); diff --git a/test/callbacks/CappedMerkleAllowlistBatch.t.sol b/test/callbacks/CappedMerkleAllowlistBatch.t.sol index 57cbc111..1a5622b8 100644 --- a/test/callbacks/CappedMerkleAllowlistBatch.t.sol +++ b/test/callbacks/CappedMerkleAllowlistBatch.t.sol @@ -91,6 +91,8 @@ contract CappedMerkleAllowlistBatchTest is Test, Permit2User, WithSalts { } // 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 @@ -99,6 +101,23 @@ contract CappedMerkleAllowlistBatchTest is Test, Permit2User, WithSalts { // [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); From 3ec117186c11b8ec25145b0c95ff32ef54721b82 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 21 Jun 2024 17:10:57 +0400 Subject: [PATCH 18/82] Tests for TokenAllowlist onBid --- script/salts/salts.json | 4 + script/salts/test/TestSalts.s.sol | 40 +++ src/callbacks/allowlists/TokenAllowlist.sol | 25 ++ test/callbacks/TokenAllowlistBatch.t.sol | 272 ++++++++++++++++++++ 4 files changed, 341 insertions(+) create mode 100644 test/callbacks/TokenAllowlistBatch.t.sol diff --git a/script/salts/salts.json b/script/salts/salts.json index 1c573d6e..fb0f4363 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -68,6 +68,10 @@ "0xd75e639b43b1d29e1703abcd2616b6b67f3ae232d53915d472f3a5b6aae6083c": "0xa45904df2431729c77de44b4b88e032130e12dcbc735f0f72a29af686e15f3ed", "0xf2644573f57aea10dffac6e7215b409fa19236ae57b735b20b9fac9834391850": "0x3a824c912eb7f08b82a8d936c2e29cb2b6fdde7e33ea9af18d9ccbde9c454161" }, + "Test_TokenAllowlist": { + "0x11e024c2f0ada4ce2ce048af08354dfa64f38ad959564c55e6bbf48d2ed3822e": "0x36081349bdb172b741f01d750be52416888c2083ea791863109f709f33f3eebd", + "0x78a7c23f669f5df656575693f45f928b7af2ed4bc981cf6dec77bef2c03bb081": "0x2f45234bfc47c4383d3d83a27019a523b0e94986d6f7ed632b7041de70b8ba63" + }, "Test_UniswapV2DirectToLiquidity": { "0xbce774b5c75ce6af2b000bd157d0966753042aba6fde38f5ea2eca76b585791f": "0x4a96efe15db180328cfc5296e72ceed9e7e3a10213a9c34d69b500733afc2d21" }, diff --git a/script/salts/test/TestSalts.s.sol b/script/salts/test/TestSalts.s.sol index d0486e1a..55318e11 100644 --- a/script/salts/test/TestSalts.s.sol +++ b/script/salts/test/TestSalts.s.sol @@ -13,6 +13,7 @@ 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"; @@ -28,6 +29,7 @@ contract TestSalts is Script, WithEnvironment, Permit2User, WithSalts, TestConst 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_); @@ -452,6 +454,44 @@ contract TestSalts is Script, WithEnvironment, Permit2User, WithSalts, TestConst _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; diff --git a/src/callbacks/allowlists/TokenAllowlist.sol b/src/callbacks/allowlists/TokenAllowlist.sol index 367c32ae..d3fcd51e 100644 --- a/src/callbacks/allowlists/TokenAllowlist.sol +++ b/src/callbacks/allowlists/TokenAllowlist.sol @@ -24,6 +24,7 @@ contract TokenAllowlist is BaseCallback { uint256 threshold; } + /// @notice Stores the token and balance threshold for each lot mapping(uint96 lotId => TokenCheck) public lotChecks; // ========== CONSTRUCTOR ========== // @@ -46,6 +47,13 @@ contract TokenAllowlist is BaseCallback { // ========== 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, @@ -55,6 +63,11 @@ contract TokenAllowlist is BaseCallback { 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)); @@ -71,16 +84,23 @@ contract TokenAllowlist is BaseCallback { 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_, @@ -92,6 +112,9 @@ contract TokenAllowlist is BaseCallback { _canParticipate(lotId_, buyer_); } + /// @inheritdoc BaseCallback + /// @dev This function reverts if: + /// - The buyer's balance is below the threshold function _onBid( uint96 lotId_, uint64, @@ -102,6 +125,8 @@ contract TokenAllowlist is BaseCallback { _canParticipate(lotId_, buyer_); } + /// @inheritdoc BaseCallback + /// @dev Not implemented function _onSettle(uint96, uint256, uint256, bytes calldata) internal pure override { // Not implemented revert Callback_NotImplemented(); diff --git a/test/callbacks/TokenAllowlistBatch.t.sol b/test/callbacks/TokenAllowlistBatch.t.sol new file mode 100644 index 00000000..29359460 --- /dev/null +++ b/test/callbacks/TokenAllowlistBatch.t.sol @@ -0,0 +1,272 @@ +// 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); + } +} From e95b60960081fdab0ee4c85822c74a3f4294abf9 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 21 Jun 2024 17:16:13 +0400 Subject: [PATCH 19/82] Add tests for TokenAllowlist with AtomicAuctionHouse --- test/callbacks/TokenAllowlistAtomic.t.sol | 277 ++++++++++++++++++++++ 1 file changed, 277 insertions(+) create mode 100644 test/callbacks/TokenAllowlistAtomic.t.sol diff --git a/test/callbacks/TokenAllowlistAtomic.t.sol b/test/callbacks/TokenAllowlistAtomic.t.sol new file mode 100644 index 00000000..13943a10 --- /dev/null +++ b/test/callbacks/TokenAllowlistAtomic.t.sol @@ -0,0 +1,277 @@ +// 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); + } +} From ae6d73b141d5bae43b84220ab5ae9416878cfd65 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 24 Jun 2024 15:48:32 +0400 Subject: [PATCH 20/82] Validate configuration addresses --- lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts | 12 ++++++++++++ lib/g-uni-v1-core/deploy/GUniPool.deploy.ts | 9 +++++++++ lib/g-uni-v1-core/deploy/address.ts | 2 ++ 3 files changed, 23 insertions(+) create mode 100644 lib/g-uni-v1-core/deploy/address.ts diff --git a/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts b/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts index 8388d924..978d5f65 100644 --- a/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts +++ b/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts @@ -2,6 +2,7 @@ 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 ( @@ -19,6 +20,17 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { 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"); + } + await deploy("GUniFactory", { from: deployer, proxy: { diff --git a/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts b/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts index 86329c39..8319ea21 100644 --- a/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts +++ b/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts @@ -2,6 +2,7 @@ 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 ( @@ -19,6 +20,14 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { 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"); + } + await deploy("GUniPool", { from: deployer, args: [addresses.Gelato], diff --git a/lib/g-uni-v1-core/deploy/address.ts b/lib/g-uni-v1-core/deploy/address.ts new file mode 100644 index 00000000..a9020e5e --- /dev/null +++ b/lib/g-uni-v1-core/deploy/address.ts @@ -0,0 +1,2 @@ + +export const isZeroAddress = (address: string): boolean => !address || address === "" || address === "0x0000000000000000000000000000000000000000"; From c9c49d3f991b11dfc3bfbec152e0bad148b2a630 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 24 Jun 2024 16:03:12 +0400 Subject: [PATCH 21/82] Compile error --- lib/g-uni-v1-core/contracts/abstract/GUniFactoryStorage.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/g-uni-v1-core/contracts/abstract/GUniFactoryStorage.sol b/lib/g-uni-v1-core/contracts/abstract/GUniFactoryStorage.sol index 6b8aab5c..567eb7e4 100644 --- a/lib/g-uni-v1-core/contracts/abstract/GUniFactoryStorage.sol +++ b/lib/g-uni-v1-core/contracts/abstract/GUniFactoryStorage.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.19; import {OwnableUninitialized} from "./OwnableUninitialized.sol"; import { Initializable -} from "@openzeppelin/contracts-upgradeable/utils/Initializable.sol"; +} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; From c8b0435ee03d1a4c7e2abff1e2d63d8820b5f7b7 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 24 Jun 2024 16:03:28 +0400 Subject: [PATCH 22/82] Add script for pool deployment --- lib/g-uni-v1-core/deploy/{ => factory}/GUniFactory.deploy.ts | 4 ++-- lib/g-uni-v1-core/deploy/{ => pool}/GUniPool.deploy.ts | 4 ++-- lib/g-uni-v1-core/package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename lib/g-uni-v1-core/deploy/{ => factory}/GUniFactory.deploy.ts (94%) rename lib/g-uni-v1-core/deploy/{ => pool}/GUniPool.deploy.ts (92%) diff --git a/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts b/lib/g-uni-v1-core/deploy/factory/GUniFactory.deploy.ts similarity index 94% rename from lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts rename to lib/g-uni-v1-core/deploy/factory/GUniFactory.deploy.ts index 978d5f65..ecacacbc 100644 --- a/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts +++ b/lib/g-uni-v1-core/deploy/factory/GUniFactory.deploy.ts @@ -1,8 +1,8 @@ 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"; +import { getAddresses } from "../../src/addresses"; +import { isZeroAddress } from "../address"; const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { if ( diff --git a/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts b/lib/g-uni-v1-core/deploy/pool/GUniPool.deploy.ts similarity index 92% rename from lib/g-uni-v1-core/deploy/GUniPool.deploy.ts rename to lib/g-uni-v1-core/deploy/pool/GUniPool.deploy.ts index 8319ea21..9ba79f21 100644 --- a/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts +++ b/lib/g-uni-v1-core/deploy/pool/GUniPool.deploy.ts @@ -1,8 +1,8 @@ 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"; +import { getAddresses } from "../../src/addresses"; +import { isZeroAddress } from "../address"; const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { if ( diff --git a/lib/g-uni-v1-core/package.json b/lib/g-uni-v1-core/package.json index 07129b73..08b5a8c0 100644 --- a/lib/g-uni-v1-core/package.json +++ b/lib/g-uni-v1-core/package.json @@ -4,7 +4,7 @@ "build": "yarn compile && npx tsc", "compile": "npx hardhat compile", "clean": "rm -rf dist && npx hardhat clean", - "deploy": "npx hardhat deploy ", + "deploy:pool": "npx hardhat deploy --deploy-scripts deploy/pool/ --write true", "format": "prettier --write .", "format:check": "prettier --check '*/**/*.{js,sol,json,md,ts}'", "lint": "eslint --cache . && yarn lint:sol", From 4989e57fb06f8b51e6c189e4e5dca0a943711938 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 24 Jun 2024 16:03:36 +0400 Subject: [PATCH 23/82] Default RPC urls --- lib/g-uni-v1-core/hardhat.config.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/g-uni-v1-core/hardhat.config.ts b/lib/g-uni-v1-core/hardhat.config.ts index 8f0f80f6..68dba3eb 100644 --- a/lib/g-uni-v1-core/hardhat.config.ts +++ b/lib/g-uni-v1-core/hardhat.config.ts @@ -34,22 +34,22 @@ const config: HardhatUserConfig = { }, blastSepolia: { chainId: 168587773, - url: process.env.BLAST_SEPOLIA_RPC, + 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, + 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, + 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, + url: process.env.BASE_SEPOLIA_RPC || "https://sepolia.base.org", accounts: [process.env.DEPLOYER_PRIVATE_KEY ?? ""] }, }, From a19acce536bcfe336a189c7b0b1e6de71687c6f5 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 24 Jun 2024 16:03:40 +0400 Subject: [PATCH 24/82] README --- lib/g-uni-v1-core/README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lib/g-uni-v1-core/README.md b/lib/g-uni-v1-core/README.md index cd2ce97a..7f841ff2 100644 --- a/lib/g-uni-v1-core/README.md +++ b/lib/g-uni-v1-core/README.md @@ -128,3 +128,30 @@ Arguments: yarn yarn test + +## Setup + +```shell +yarn install +``` + +Set up environment variables: + +- Copy `.env.example` to `.env` +- Fill out environment variables + +## Deployment + +First, deploy the GUniPool, as that will serve as input to the GUniFactory: + +```shell +HARDHAT_NETWORK="" yarn run deploy:pool +``` + +TODO: need to copy/paste pool address? + +Then, deploy the GUniFactory: + +```shell +yarn run deploy:factory +``` From 1b87606a3037e1ae5f7c29b03d74db7b56a78f6a Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 24 Jun 2024 16:28:50 +0400 Subject: [PATCH 25/82] Deployment script uses tags instead of directory --- lib/g-uni-v1-core/deploy/{factory => }/GUniFactory.deploy.ts | 4 ++-- lib/g-uni-v1-core/deploy/{pool => }/GUniPool.deploy.ts | 4 ++-- lib/g-uni-v1-core/package.json | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) rename lib/g-uni-v1-core/deploy/{factory => }/GUniFactory.deploy.ts (94%) rename lib/g-uni-v1-core/deploy/{pool => }/GUniPool.deploy.ts (92%) diff --git a/lib/g-uni-v1-core/deploy/factory/GUniFactory.deploy.ts b/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts similarity index 94% rename from lib/g-uni-v1-core/deploy/factory/GUniFactory.deploy.ts rename to lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts index ecacacbc..978d5f65 100644 --- a/lib/g-uni-v1-core/deploy/factory/GUniFactory.deploy.ts +++ b/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts @@ -1,8 +1,8 @@ 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"; +import { getAddresses } from "../src/addresses"; +import { isZeroAddress } from "./address"; const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { if ( diff --git a/lib/g-uni-v1-core/deploy/pool/GUniPool.deploy.ts b/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts similarity index 92% rename from lib/g-uni-v1-core/deploy/pool/GUniPool.deploy.ts rename to lib/g-uni-v1-core/deploy/GUniPool.deploy.ts index 9ba79f21..8319ea21 100644 --- a/lib/g-uni-v1-core/deploy/pool/GUniPool.deploy.ts +++ b/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts @@ -1,8 +1,8 @@ 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"; +import { getAddresses } from "../src/addresses"; +import { isZeroAddress } from "./address"; const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { if ( diff --git a/lib/g-uni-v1-core/package.json b/lib/g-uni-v1-core/package.json index 08b5a8c0..9dfa6019 100644 --- a/lib/g-uni-v1-core/package.json +++ b/lib/g-uni-v1-core/package.json @@ -4,7 +4,8 @@ "build": "yarn compile && npx tsc", "compile": "npx hardhat compile", "clean": "rm -rf dist && npx hardhat clean", - "deploy:pool": "npx hardhat deploy --deploy-scripts deploy/pool/ --write true", + "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", From 6d789de5a4c17bb3d7a884c4617d49558163cdee Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 24 Jun 2024 16:31:21 +0400 Subject: [PATCH 26/82] Logs and notes --- lib/g-uni-v1-core/README.md | 2 ++ lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts | 2 ++ lib/g-uni-v1-core/deploy/GUniPool.deploy.ts | 2 ++ 3 files changed, 6 insertions(+) diff --git a/lib/g-uni-v1-core/README.md b/lib/g-uni-v1-core/README.md index 7f841ff2..4ed57c31 100644 --- a/lib/g-uni-v1-core/README.md +++ b/lib/g-uni-v1-core/README.md @@ -155,3 +155,5 @@ Then, deploy the GUniFactory: ```shell 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. diff --git a/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts b/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts index 978d5f65..0d180967 100644 --- a/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts +++ b/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts @@ -49,6 +49,8 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { }, args: [addresses.UniswapV3Factory], }); + + console.log("Deployment of GUniFactory complete"); }; func.skip = async (hre: HardhatRuntimeEnvironment) => { diff --git a/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts b/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts index 8319ea21..459b0c5c 100644 --- a/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts +++ b/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts @@ -32,6 +32,8 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { from: deployer, args: [addresses.Gelato], }); + + console.log("Deployment of GUniPool complete"); }; func.skip = async (hre: HardhatRuntimeEnvironment) => { From e7b85c588f66d4aae332d10b816087ff69832745 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 24 Jun 2024 16:38:28 +0400 Subject: [PATCH 27/82] Log deployment address. Update docs. --- lib/g-uni-v1-core/README.md | 20 +++++++++---------- .../deploy/GUniFactory.deploy.ts | 4 ++-- lib/g-uni-v1-core/deploy/GUniPool.deploy.ts | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/g-uni-v1-core/README.md b/lib/g-uni-v1-core/README.md index 4ed57c31..409d9009 100644 --- a/lib/g-uni-v1-core/README.md +++ b/lib/g-uni-v1-core/README.md @@ -142,18 +142,18 @@ Set up environment variables: ## Deployment -First, deploy the GUniPool, as that will serve as input to the GUniFactory: +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 -``` - -TODO: need to copy/paste pool address? + ```shell + HARDHAT_NETWORK="" yarn run deploy:pool + ``` -Then, deploy the GUniFactory: +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 -yarn run deploy:factory -``` + ```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. diff --git a/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts b/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts index 0d180967..127be871 100644 --- a/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts +++ b/lib/g-uni-v1-core/deploy/GUniFactory.deploy.ts @@ -31,7 +31,7 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { throw new Error("GUniImplementation (pool implementation) address not set"); } - await deploy("GUniFactory", { + const result = await deploy("GUniFactory", { from: deployer, proxy: { proxyContract: "EIP173Proxy", @@ -50,7 +50,7 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { args: [addresses.UniswapV3Factory], }); - console.log("Deployment of GUniFactory complete"); + console.log("GUniFactory deployed to:", result.address); }; func.skip = async (hre: HardhatRuntimeEnvironment) => { diff --git a/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts b/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts index 459b0c5c..8026aee5 100644 --- a/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts +++ b/lib/g-uni-v1-core/deploy/GUniPool.deploy.ts @@ -28,12 +28,12 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { throw new Error("Deployer address not set"); } - await deploy("GUniPool", { + const result = await deploy("GUniPool", { from: deployer, args: [addresses.Gelato], }); - console.log("Deployment of GUniPool complete"); + console.log("GUniPool deployed to:", result.address); }; func.skip = async (hre: HardhatRuntimeEnvironment) => { From d649d62169e7d99f25b27f47e75600584f5f8565 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 24 Jun 2024 17:34:44 +0400 Subject: [PATCH 28/82] Verification works --- lib/g-uni-v1-core/README.md | 12 ++++++++++++ lib/g-uni-v1-core/hardhat.config.ts | 13 ++++++++----- lib/g-uni-v1-core/package.json | 2 +- lib/g-uni-v1-core/yarn.lock | 8 ++++---- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/lib/g-uni-v1-core/README.md b/lib/g-uni-v1-core/README.md index 409d9009..9f9eec8c 100644 --- a/lib/g-uni-v1-core/README.md +++ b/lib/g-uni-v1-core/README.md @@ -157,3 +157,15 @@ Set up environment variables: ``` 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/hardhat.config.ts b/lib/g-uni-v1-core/hardhat.config.ts index 68dba3eb..3c189122 100644 --- a/lib/g-uni-v1-core/hardhat.config.ts +++ b/lib/g-uni-v1-core/hardhat.config.ts @@ -30,27 +30,27 @@ const config: HardhatUserConfig = { anvil: { chainId: 31337, url: "http://localhost:8545", - accounts: [process.env.ANVIL_PRIVATE_KEY ?? ""] + 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 ?? ""] + 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 ?? ""] + 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 ?? ""] + 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 ?? ""] + accounts: [process.env.DEPLOYER_PRIVATE_KEY ?? ""], }, }, @@ -75,6 +75,9 @@ const config: HardhatUserConfig = { 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/package.json b/lib/g-uni-v1-core/package.json index 9dfa6019..e76c9192 100644 --- a/lib/g-uni-v1-core/package.json +++ b/lib/g-uni-v1-core/package.json @@ -37,7 +37,7 @@ "ethereum-waffle": "3.3.0", "ethers": "5.1.4", "hardhat": "2.3.0", - "hardhat-deploy": "0.9.14", + "hardhat-deploy": "0.10.0", "husky": "6.0.0", "lint-staged": "11.0.0", "node-fetch": "2.6.1", diff --git a/lib/g-uni-v1-core/yarn.lock b/lib/g-uni-v1-core/yarn.lock index f1190a51..c684243a 100644 --- a/lib/g-uni-v1-core/yarn.lock +++ b/lib/g-uni-v1-core/yarn.lock @@ -5120,10 +5120,10 @@ har-validator@~5.1.3: ajv "^6.12.3" har-schema "^2.0.0" -hardhat-deploy@0.9.14: - version "0.9.14" - resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.9.14.tgz#88c07497efd14cfca6f9fed1574f0bad65f0a8a0" - integrity sha512-mCwXeXdqtrQN8dL1gOnoGUh0z9Jylfsh56UNVZJC0c8AhjlwjLPgGE3pzNmMuyy88pj9OX4qo53X57bW2W7NJQ== +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" From e3519f24b346606d0c395685db800aaf3482db38 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Mon, 24 Jun 2024 17:35:31 +0400 Subject: [PATCH 29/82] Updated deployment on arbitrum sepolia --- .../arbitrumSepolia/GUniFactory.json | 57 ++++++++++--------- .../GUniFactory_Implementation.json | 23 ++++---- .../arbitrumSepolia/GUniFactory_Proxy.json | 53 ++++++++--------- .../deployments/arbitrumSepolia/GUniPool.json | 19 ++++--- lib/g-uni-v1-core/src/addresses.ts | 16 +++--- 5 files changed, 86 insertions(+), 82 deletions(-) diff --git a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory.json b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory.json index 3602a4af..2ee9e426 100644 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory.json +++ b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory.json @@ -1,5 +1,5 @@ { - "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", + "address": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", "abi": [ { "anonymous": false, @@ -640,56 +640,57 @@ "type": "constructor" } ], - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", + "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", "receipt": { "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x39AC4439e6CB9427C073259e5742529cE46DD663", - "transactionIndex": 4, - "gasUsed": "1375415", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000020000000400000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000400000200000000000000020010000000000000000800000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000200000000000000080000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000080400000000000000000000000000000000000000000000", - "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b", - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", + "from": "0x5fCfdc65044bf008A6b473512D34102282Ee43a6", + "contractAddress": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", + "transactionIndex": 3, + "gasUsed": "6114773", + "logsBloom": "0x00101000000020000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000400000000000000000000000000000000000000000000000008008000000000000000000000000000200000000000000020000000001000000000800000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000100000200000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000000400000000000000000000000000000000000000000000", + "blockHash": "0xf177e051cdb89f5b045dfa101135f95bd01e47ac4dc9fb9096403347f9c6c7e0", + "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", "logs": [ { - "transactionIndex": 4, - "blockNumber": 53304410, - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", - "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", + "transactionIndex": 3, + "blockNumber": 57912178, + "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", + "address": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", "topics": [ "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000090608f57161ac771b28fb0adcd2434cfa1463201" + "0x0000000000000000000000009ff468bd1de89f0229193f1f8f0ba0e265ba026a" ], "data": "0x", - "logIndex": 4, - "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b" + "logIndex": 6, + "blockHash": "0xf177e051cdb89f5b045dfa101135f95bd01e47ac4dc9fb9096403347f9c6c7e0" }, { - "transactionIndex": 4, - "blockNumber": 53304410, - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", - "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", + "transactionIndex": 3, + "blockNumber": 57912178, + "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", + "address": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", "topics": [ "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" ], "data": "0x", - "logIndex": 5, - "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b" + "logIndex": 7, + "blockHash": "0xf177e051cdb89f5b045dfa101135f95bd01e47ac4dc9fb9096403347f9c6c7e0" } ], - "blockNumber": 53304410, - "cumulativeGasUsed": "2551868", + "blockNumber": 57912178, + "cumulativeGasUsed": "9556108", "status": 1, "byzantium": true }, "args": [ - "0x90608F57161aC771b28fb0adCd2434cfa1463201", + "0x9ff468bd1De89F0229193F1F8f0bA0e265bA026a", "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b00000000000000000000000090608f57161ac771b28fb0adcd2434cfa1463201000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" + "0xc0c53b8b000000000000000000000000ce7427a94bc9b8a90e2c8d91cb0247d779819437000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" ], + "numDeployments": 1, "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", @@ -697,12 +698,12 @@ "execute": { "methodName": "initialize", "args": [ - "0x90608F57161aC771b28fb0adCd2434cfa1463201", + "0xCE7427a94bc9B8A90E2C8d91cB0247D779819437", "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" ] }, - "implementation": "0x90608F57161aC771b28fb0adCd2434cfa1463201", + "implementation": "0x9ff468bd1De89F0229193F1F8f0bA0e265bA026a", "devdoc": { "kind": "dev", "methods": {}, diff --git a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Implementation.json b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Implementation.json index f6e4f9ae..4e70e831 100644 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Implementation.json +++ b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Implementation.json @@ -1,5 +1,5 @@ { - "address": "0x90608F57161aC771b28fb0adCd2434cfa1463201", + "address": "0x9ff468bd1De89F0229193F1F8f0bA0e265bA026a", "abi": [ { "inputs": [ @@ -508,25 +508,26 @@ "type": "function" } ], - "transactionHash": "0x0ddae94495bea4ad45f3cf0bd0c7f3df1517ed5e13c1ed7135738305f91e92dc", + "transactionHash": "0xa08927fd8eb46642fd2ac115535f998f40a36ecb273a4e2662802b6a4c9130f2", "receipt": { "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x90608F57161aC771b28fb0adCd2434cfa1463201", - "transactionIndex": 3, - "gasUsed": "4839221", + "from": "0x5fCfdc65044bf008A6b473512D34102282Ee43a6", + "contractAddress": "0x9ff468bd1De89F0229193F1F8f0bA0e265bA026a", + "transactionIndex": 1, + "gasUsed": "19792719", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8bf57b4c77eff10abe629c05e512a69be9f81ce267bdda90c3cd31220ea59624", - "transactionHash": "0x0ddae94495bea4ad45f3cf0bd0c7f3df1517ed5e13c1ed7135738305f91e92dc", + "blockHash": "0x17695cd8d27ba4b0d7bbdbdaa2a05d55db91f1914cb61ebbfb1eaec48730a3e4", + "transactionHash": "0xa08927fd8eb46642fd2ac115535f998f40a36ecb273a4e2662802b6a4c9130f2", "logs": [], - "blockNumber": 53304307, - "cumulativeGasUsed": "5320219", + "blockNumber": 57912155, + "cumulativeGasUsed": "19792719", "status": 1, "byzantium": true }, "args": [ - "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" + "0x248AB79Bbb9bC29bB72f7Cd42F17e054Fc40188e" ], + "numDeployments": 1, "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", diff --git a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Proxy.json b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Proxy.json index 7ac4f102..a99a904e 100644 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Proxy.json +++ b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Proxy.json @@ -1,5 +1,5 @@ { - "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", + "address": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", "abi": [ { "inputs": [ @@ -145,56 +145,57 @@ "type": "receive" } ], - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", + "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", "receipt": { "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0x39AC4439e6CB9427C073259e5742529cE46DD663", - "transactionIndex": 4, - "gasUsed": "1375415", - "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000020000000400000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000400000200000000000000020010000000000000000800000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000200000000000000080000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000080400000000000000000000000000000000000000000000", - "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b", - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", + "from": "0x5fCfdc65044bf008A6b473512D34102282Ee43a6", + "contractAddress": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", + "transactionIndex": 3, + "gasUsed": "6114773", + "logsBloom": "0x00101000000020000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000400000000000000000000000000000000000000000000000008008000000000000000000000000000200000000000000020000000001000000000800000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000100000200000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000000400000000000000000000000000000000000000000000", + "blockHash": "0xf177e051cdb89f5b045dfa101135f95bd01e47ac4dc9fb9096403347f9c6c7e0", + "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", "logs": [ { - "transactionIndex": 4, - "blockNumber": 53304410, - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", - "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", + "transactionIndex": 3, + "blockNumber": 57912178, + "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", + "address": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", "topics": [ "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000090608f57161ac771b28fb0adcd2434cfa1463201" + "0x0000000000000000000000009ff468bd1de89f0229193f1f8f0ba0e265ba026a" ], "data": "0x", - "logIndex": 4, - "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b" + "logIndex": 6, + "blockHash": "0xf177e051cdb89f5b045dfa101135f95bd01e47ac4dc9fb9096403347f9c6c7e0" }, { - "transactionIndex": 4, - "blockNumber": 53304410, - "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", - "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", + "transactionIndex": 3, + "blockNumber": 57912178, + "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", + "address": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", "topics": [ "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" ], "data": "0x", - "logIndex": 5, - "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b" + "logIndex": 7, + "blockHash": "0xf177e051cdb89f5b045dfa101135f95bd01e47ac4dc9fb9096403347f9c6c7e0" } ], - "blockNumber": 53304410, - "cumulativeGasUsed": "2551868", + "blockNumber": 57912178, + "cumulativeGasUsed": "9556108", "status": 1, "byzantium": true }, "args": [ - "0x90608F57161aC771b28fb0adCd2434cfa1463201", + "0x9ff468bd1De89F0229193F1F8f0bA0e265bA026a", "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b00000000000000000000000090608f57161ac771b28fb0adcd2434cfa1463201000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" + "0xc0c53b8b000000000000000000000000ce7427a94bc9b8a90e2c8d91cb0247d779819437000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" ], + "numDeployments": 1, "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", diff --git a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniPool.json b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniPool.json index be35676c..afd2eb70 100644 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniPool.json +++ b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniPool.json @@ -1,5 +1,5 @@ { - "address": "0xF3e2578C66071a637F06cc02b1c11DeC0784C1A6", + "address": "0xCE7427a94bc9B8A90E2C8d91cB0247D779819437", "abi": [ { "inputs": [ @@ -1150,25 +1150,26 @@ "type": "function" } ], - "transactionHash": "0x8ca1d397f287c7ac87d7677c74656480c141f7242e78f3b9ad4612cf77a39fbe", + "transactionHash": "0x8556c6e13c6c9182f77b188412ef62e184732d732ac66d5bd24f69a7a9f43a94", "receipt": { "to": null, - "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "contractAddress": "0xF3e2578C66071a637F06cc02b1c11DeC0784C1A6", + "from": "0x5fCfdc65044bf008A6b473512D34102282Ee43a6", + "contractAddress": "0xCE7427a94bc9B8A90E2C8d91cB0247D779819437", "transactionIndex": 4, - "gasUsed": "5709523", + "gasUsed": "40852250", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xde2678056ddc18fe88264d249865e9cc47de73569a4988671c34dc0cf897d472", - "transactionHash": "0x8ca1d397f287c7ac87d7677c74656480c141f7242e78f3b9ad4612cf77a39fbe", + "blockHash": "0x8819a719eb6a9cbd16f6db1117ab4f4a0fb6aa7a2dc26cb4d5553ccda2071636", + "transactionHash": "0x8556c6e13c6c9182f77b188412ef62e184732d732ac66d5bd24f69a7a9f43a94", "logs": [], - "blockNumber": 54644356, - "cumulativeGasUsed": "6328188", + "blockNumber": 57910853, + "cumulativeGasUsed": "48848339", "status": 1, "byzantium": true }, "args": [ "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" ], + "numDeployments": 1, "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", diff --git a/lib/g-uni-v1-core/src/addresses.ts b/lib/g-uni-v1-core/src/addresses.ts index f0e89f9e..09362d28 100644 --- a/lib/g-uni-v1-core/src/addresses.ts +++ b/lib/g-uni-v1-core/src/addresses.ts @@ -62,7 +62,7 @@ export const getAddresses = (network: string): Addresses => { GUniImplementation: "", }; case "anvil": - return { + return { Gelato: "0x0000000000000000000000000000000000000000", Swapper: "", GelatoDevMultiSig: "0x0000000000000000000000000000000000000000", @@ -74,7 +74,7 @@ export const getAddresses = (network: string): Addresses => { GUniImplementation: "", }; case "blastSepolia": - return { + return { Gelato: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", Swapper: "", GelatoDevMultiSig: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", @@ -86,19 +86,19 @@ export const getAddresses = (network: string): Addresses => { GUniImplementation: "0xdde18C0c3B637F4BA02f5567a671F5e28b7404e7", }; case "arbitrumSepolia": - return { + return { Gelato: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", Swapper: "", GelatoDevMultiSig: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", WETH: "", DAI: "", USDC: "", - UniswapV3Factory: "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F", - GUniFactory: "0x39AC4439e6CB9427C073259e5742529cE46DD663", - GUniImplementation: "0xF3e2578C66071a637F06cc02b1c11DeC0784C1A6", + UniswapV3Factory: "0x248AB79Bbb9bC29bB72f7Cd42F17e054Fc40188e", + GUniFactory: "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", + GUniImplementation: "0xCE7427a94bc9B8A90E2C8d91cB0247D779819437", }; case "modeSepolia": - return { + return { Gelato: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", Swapper: "", GelatoDevMultiSig: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", @@ -110,7 +110,7 @@ export const getAddresses = (network: string): Addresses => { GUniImplementation: "0xe1B83edA3399A2c9B8265215EA21042C9b918dc5", }; case "baseSepolia": - return { + return { Gelato: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", Swapper: "", GelatoDevMultiSig: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", From 6e7644cc7c78899ef27c15f4f33347ea6da234cb Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 25 Jun 2024 13:07:08 +0400 Subject: [PATCH 30/82] Add example .env file for g-uni --- .gitignore | 1 + lib/g-uni-v1-core/.env.example | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 lib/g-uni-v1-core/.env.example diff --git a/.gitignore b/.gitignore index c79b712c..7b16da94 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ docs/ # Dotenv file .env .env.* +!.env.example node_modules/ diff --git a/lib/g-uni-v1-core/.env.example b/lib/g-uni-v1-core/.env.example new file mode 100644 index 00000000..73e94490 --- /dev/null +++ b/lib/g-uni-v1-core/.env.example @@ -0,0 +1,3 @@ +# Wallets +ANVIL_PRIVATE_KEY= +DEPLOYER_PRIVATE_KEY= From 15e37200aae7d662300a199b2ef3a3d3ab7fe51c Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 25 Jun 2024 13:08:00 +0400 Subject: [PATCH 31/82] Address conflicting dependency versions by adding Initializable into the g-uni repo --- .../contracts/abstract/GUniFactoryStorage.sol | 2 +- .../contracts/lib/Initializable.sol | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 lib/g-uni-v1-core/contracts/lib/Initializable.sol diff --git a/lib/g-uni-v1-core/contracts/abstract/GUniFactoryStorage.sol b/lib/g-uni-v1-core/contracts/abstract/GUniFactoryStorage.sol index 567eb7e4..f3c9b265 100644 --- a/lib/g-uni-v1-core/contracts/abstract/GUniFactoryStorage.sol +++ b/lib/g-uni-v1-core/contracts/abstract/GUniFactoryStorage.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.19; import {OwnableUninitialized} from "./OwnableUninitialized.sol"; import { Initializable -} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +} from "contracts/lib/Initializable.sol"; import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; diff --git a/lib/g-uni-v1-core/contracts/lib/Initializable.sol b/lib/g-uni-v1-core/contracts/lib/Initializable.sol new file mode 100644 index 00000000..a6a57c3c --- /dev/null +++ b/lib/g-uni-v1-core/contracts/lib/Initializable.sol @@ -0,0 +1,50 @@ +// 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; + } + } +} From e5baeb39e5f4afa83eaf20ff24790f1fc73fd855 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 25 Jun 2024 13:30:09 +0400 Subject: [PATCH 32/82] Update salts --- script/salts/salts.json | 4 ++-- test/Constants.sol | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/salts/salts.json b/script/salts/salts.json index b415c0cc..b6aabd5f 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -54,7 +54,7 @@ "0xb8a17b3ee693ebdcfc6913bb2f65d0fadbe8812d9ef4d927595a7dc75db68727": "0x956b71c3545015d12e8bbefbad72019b673860f32a5b4313eeb866425d97be17" }, "Test_GUniFactory": { - "0x3bf0e882023640f31bf861e1f13d306fd4fbb7afb7860e21a489062cbefcf885": "0x397acf3db4cc9c81f8c1975a5505e392e6b5f8eb3b22efcc094b3e0f39f6739b" + "0x7e47ffe07f5a38974d644bf78ff55e828227cdb7443c62eab211e53641973cc9": "0x8f8ca5383a10d7183d8e5ab6d19509307d674794ec2010e6e7acd764d815f6cf" }, "Test_MockCallback": { "0x0825d99059fe0dc95e0b5cd7b853a5f3f50b58f25c5812fc7fd01d69ff4ec679": "0x222b47fd0259b3eacfbc04b9dddf5bb5ba060245c2c3c3673672ad4d815d01df", @@ -83,7 +83,7 @@ "0xe6204aa211921628df345ff0b909c863298684cd8ca65de5479af6b70662e622": "0xf508fd71ff40f5d0640b01b9384f98d35db43c7ddb0d4abe274d61fdf1ea967f" }, "Test_UniswapV3DirectToLiquidity": { - "0x58b7674df101688da4f68d9cfad65390f1f35abe1c999bd0a251069b8883f528": "0xee9c953ecdad99f7aab8e6812d8b023c11ca7978a5324739a9e8987c44ac2e96" + "0x799ac11038ac9e9253b501db246287f36fac19f84cac3075938e3f52895cb138": "0xa7ea84dd1b36183230d2b956e8485c2690df42840d37487e8d34e9edc1304025" }, "Test_UniswapV3Factory": { "0xbcd657c3390ecd2e1782b6473400c51fa124922eb98b69f1b5192eb0f8e3d3df": "0x3448ebb18cb03fae2e9153c621d46f1b9b8941cc66e7063b587fe4a284490b01" diff --git a/test/Constants.sol b/test/Constants.sol index 04b9f4fe..e8e9be86 100644 --- a/test/Constants.sol +++ b/test/Constants.sol @@ -10,7 +10,7 @@ abstract contract TestConstants { address(0xAA9E6CDA232112EBc0FC2Ca14B3178567a410224); address internal constant _UNISWAP_V3_FACTORY = address(0xAA6E2347940f38546B6a1b804070899Ccb75c558); - address internal constant _GUNI_FACTORY = address(0xAA426C06A7D084E79bFa5B8cd0A15aeebA7693f1); + address internal constant _GUNI_FACTORY = address(0xAA1788e4c22129e5316273749F99E32049a8BBdA); address internal constant _BASELINE_KERNEL = address(0xBB); address internal constant _BASELINE_QUOTE_TOKEN = address(0xAA58516d932C482469914260268EEA7611BF0eb4); From f5ee3dd7bf05758e97384ebdba8e70e23d6baf7c Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 25 Jun 2024 13:41:56 +0400 Subject: [PATCH 33/82] Add note on salts/address mismatch --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 787594ae..71649e9f 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,17 @@ Then, the test suite can be run with: pnpm run test ``` +#### Address Mismatch + +Many of the contracts (e.g. callbacks) require a specific address prefix or have a deterministic address. If tests are failing for this reason, the cause is usually one of: + +- 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. + - 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 Combines `forge fmt` and `solhint` From daa6f8263b3d0a90a6c873392f6d127f81c81609 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 25 Jun 2024 14:16:45 +0400 Subject: [PATCH 34/82] Revert "Updated deployment on arbitrum sepolia" This reverts commit e3519f24b346606d0c395685db800aaf3482db38. --- .../arbitrumSepolia/GUniFactory.json | 57 +++++++++---------- .../GUniFactory_Implementation.json | 23 ++++---- .../arbitrumSepolia/GUniFactory_Proxy.json | 53 +++++++++-------- .../deployments/arbitrumSepolia/GUniPool.json | 19 +++---- lib/g-uni-v1-core/src/addresses.ts | 16 +++--- 5 files changed, 82 insertions(+), 86 deletions(-) diff --git a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory.json b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory.json index 2ee9e426..3602a4af 100644 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory.json +++ b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory.json @@ -1,5 +1,5 @@ { - "address": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", + "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", "abi": [ { "anonymous": false, @@ -640,57 +640,56 @@ "type": "constructor" } ], - "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", + "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", "receipt": { "to": null, - "from": "0x5fCfdc65044bf008A6b473512D34102282Ee43a6", - "contractAddress": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", - "transactionIndex": 3, - "gasUsed": "6114773", - "logsBloom": "0x00101000000020000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000400000000000000000000000000000000000000000000000008008000000000000000000000000000200000000000000020000000001000000000800000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000100000200000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000000400000000000000000000000000000000000000000000", - "blockHash": "0xf177e051cdb89f5b045dfa101135f95bd01e47ac4dc9fb9096403347f9c6c7e0", - "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", + "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "contractAddress": "0x39AC4439e6CB9427C073259e5742529cE46DD663", + "transactionIndex": 4, + "gasUsed": "1375415", + "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000020000000400000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000400000200000000000000020010000000000000000800000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000200000000000000080000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000080400000000000000000000000000000000000000000000", + "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b", + "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", "logs": [ { - "transactionIndex": 3, - "blockNumber": 57912178, - "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", - "address": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", + "transactionIndex": 4, + "blockNumber": 53304410, + "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", + "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", "topics": [ "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000009ff468bd1de89f0229193f1f8f0ba0e265ba026a" + "0x00000000000000000000000090608f57161ac771b28fb0adcd2434cfa1463201" ], "data": "0x", - "logIndex": 6, - "blockHash": "0xf177e051cdb89f5b045dfa101135f95bd01e47ac4dc9fb9096403347f9c6c7e0" + "logIndex": 4, + "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b" }, { - "transactionIndex": 3, - "blockNumber": 57912178, - "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", - "address": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", + "transactionIndex": 4, + "blockNumber": 53304410, + "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", + "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", "topics": [ "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" ], "data": "0x", - "logIndex": 7, - "blockHash": "0xf177e051cdb89f5b045dfa101135f95bd01e47ac4dc9fb9096403347f9c6c7e0" + "logIndex": 5, + "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b" } ], - "blockNumber": 57912178, - "cumulativeGasUsed": "9556108", + "blockNumber": 53304410, + "cumulativeGasUsed": "2551868", "status": 1, "byzantium": true }, "args": [ - "0x9ff468bd1De89F0229193F1F8f0bA0e265bA026a", + "0x90608F57161aC771b28fb0adCd2434cfa1463201", "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b000000000000000000000000ce7427a94bc9b8a90e2c8d91cb0247d779819437000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" + "0xc0c53b8b00000000000000000000000090608f57161ac771b28fb0adcd2434cfa1463201000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" ], - "numDeployments": 1, "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", @@ -698,12 +697,12 @@ "execute": { "methodName": "initialize", "args": [ - "0xCE7427a94bc9B8A90E2C8d91cB0247D779819437", + "0x90608F57161aC771b28fb0adCd2434cfa1463201", "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" ] }, - "implementation": "0x9ff468bd1De89F0229193F1F8f0bA0e265bA026a", + "implementation": "0x90608F57161aC771b28fb0adCd2434cfa1463201", "devdoc": { "kind": "dev", "methods": {}, diff --git a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Implementation.json b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Implementation.json index 4e70e831..f6e4f9ae 100644 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Implementation.json +++ b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Implementation.json @@ -1,5 +1,5 @@ { - "address": "0x9ff468bd1De89F0229193F1F8f0bA0e265bA026a", + "address": "0x90608F57161aC771b28fb0adCd2434cfa1463201", "abi": [ { "inputs": [ @@ -508,26 +508,25 @@ "type": "function" } ], - "transactionHash": "0xa08927fd8eb46642fd2ac115535f998f40a36ecb273a4e2662802b6a4c9130f2", + "transactionHash": "0x0ddae94495bea4ad45f3cf0bd0c7f3df1517ed5e13c1ed7135738305f91e92dc", "receipt": { "to": null, - "from": "0x5fCfdc65044bf008A6b473512D34102282Ee43a6", - "contractAddress": "0x9ff468bd1De89F0229193F1F8f0bA0e265bA026a", - "transactionIndex": 1, - "gasUsed": "19792719", + "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "contractAddress": "0x90608F57161aC771b28fb0adCd2434cfa1463201", + "transactionIndex": 3, + "gasUsed": "4839221", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x17695cd8d27ba4b0d7bbdbdaa2a05d55db91f1914cb61ebbfb1eaec48730a3e4", - "transactionHash": "0xa08927fd8eb46642fd2ac115535f998f40a36ecb273a4e2662802b6a4c9130f2", + "blockHash": "0x8bf57b4c77eff10abe629c05e512a69be9f81ce267bdda90c3cd31220ea59624", + "transactionHash": "0x0ddae94495bea4ad45f3cf0bd0c7f3df1517ed5e13c1ed7135738305f91e92dc", "logs": [], - "blockNumber": 57912155, - "cumulativeGasUsed": "19792719", + "blockNumber": 53304307, + "cumulativeGasUsed": "5320219", "status": 1, "byzantium": true }, "args": [ - "0x248AB79Bbb9bC29bB72f7Cd42F17e054Fc40188e" + "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" ], - "numDeployments": 1, "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", diff --git a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Proxy.json b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Proxy.json index a99a904e..7ac4f102 100644 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Proxy.json +++ b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniFactory_Proxy.json @@ -1,5 +1,5 @@ { - "address": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", + "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", "abi": [ { "inputs": [ @@ -145,57 +145,56 @@ "type": "receive" } ], - "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", + "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", "receipt": { "to": null, - "from": "0x5fCfdc65044bf008A6b473512D34102282Ee43a6", - "contractAddress": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", - "transactionIndex": 3, - "gasUsed": "6114773", - "logsBloom": "0x00101000000020000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000400000000000000000000000000000000000000000000000008008000000000000000000000000000200000000000000020000000001000000000800000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000100000200000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000000400000000000000000000000000000000000000000000", - "blockHash": "0xf177e051cdb89f5b045dfa101135f95bd01e47ac4dc9fb9096403347f9c6c7e0", - "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", + "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "contractAddress": "0x39AC4439e6CB9427C073259e5742529cE46DD663", + "transactionIndex": 4, + "gasUsed": "1375415", + "logsBloom": "0x00100000000020000000000000000000000000000000000000000000000000000000000000020000000400000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000400000200000000000000020010000000000000000800000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000200000000000000080000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000080400000000000000000000000000000000000000000000", + "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b", + "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", "logs": [ { - "transactionIndex": 3, - "blockNumber": 57912178, - "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", - "address": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", + "transactionIndex": 4, + "blockNumber": 53304410, + "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", + "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", "topics": [ "0x5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b7379068296", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000009ff468bd1de89f0229193f1f8f0ba0e265ba026a" + "0x00000000000000000000000090608f57161ac771b28fb0adcd2434cfa1463201" ], "data": "0x", - "logIndex": 6, - "blockHash": "0xf177e051cdb89f5b045dfa101135f95bd01e47ac4dc9fb9096403347f9c6c7e0" + "logIndex": 4, + "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b" }, { - "transactionIndex": 3, - "blockNumber": 57912178, - "transactionHash": "0x9b83e7b0549ce4adfcc2ffbdfb847572df815ca36cb5951ffecf2136042ff281", - "address": "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", + "transactionIndex": 4, + "blockNumber": 53304410, + "transactionHash": "0xa994440a2ad7747eb9c88bea6b326358d7d24f1d345f0ed3b425561b05cf824f", + "address": "0x39AC4439e6CB9427C073259e5742529cE46DD663", "topics": [ "0xdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec29", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" ], "data": "0x", - "logIndex": 7, - "blockHash": "0xf177e051cdb89f5b045dfa101135f95bd01e47ac4dc9fb9096403347f9c6c7e0" + "logIndex": 5, + "blockHash": "0xf5b7b2abe69c5722bd1b5142d00597648f1d6aeb9e41fe577400c4451de3259b" } ], - "blockNumber": 57912178, - "cumulativeGasUsed": "9556108", + "blockNumber": 53304410, + "cumulativeGasUsed": "2551868", "status": 1, "byzantium": true }, "args": [ - "0x9ff468bd1De89F0229193F1F8f0bA0e265bA026a", + "0x90608F57161aC771b28fb0adCd2434cfa1463201", "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "0xc0c53b8b000000000000000000000000ce7427a94bc9b8a90e2c8d91cb0247d779819437000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" + "0xc0c53b8b00000000000000000000000090608f57161ac771b28fb0adcd2434cfa1463201000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e000000000000000000000000b47c8e4beb28af80ede5e5bf474927b110ef2c0e" ], - "numDeployments": 1, "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", diff --git a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniPool.json b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniPool.json index afd2eb70..be35676c 100644 --- a/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniPool.json +++ b/lib/g-uni-v1-core/deployments/arbitrumSepolia/GUniPool.json @@ -1,5 +1,5 @@ { - "address": "0xCE7427a94bc9B8A90E2C8d91cB0247D779819437", + "address": "0xF3e2578C66071a637F06cc02b1c11DeC0784C1A6", "abi": [ { "inputs": [ @@ -1150,26 +1150,25 @@ "type": "function" } ], - "transactionHash": "0x8556c6e13c6c9182f77b188412ef62e184732d732ac66d5bd24f69a7a9f43a94", + "transactionHash": "0x8ca1d397f287c7ac87d7677c74656480c141f7242e78f3b9ad4612cf77a39fbe", "receipt": { "to": null, - "from": "0x5fCfdc65044bf008A6b473512D34102282Ee43a6", - "contractAddress": "0xCE7427a94bc9B8A90E2C8d91cB0247D779819437", + "from": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "contractAddress": "0xF3e2578C66071a637F06cc02b1c11DeC0784C1A6", "transactionIndex": 4, - "gasUsed": "40852250", + "gasUsed": "5709523", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8819a719eb6a9cbd16f6db1117ab4f4a0fb6aa7a2dc26cb4d5553ccda2071636", - "transactionHash": "0x8556c6e13c6c9182f77b188412ef62e184732d732ac66d5bd24f69a7a9f43a94", + "blockHash": "0xde2678056ddc18fe88264d249865e9cc47de73569a4988671c34dc0cf897d472", + "transactionHash": "0x8ca1d397f287c7ac87d7677c74656480c141f7242e78f3b9ad4612cf77a39fbe", "logs": [], - "blockNumber": 57910853, - "cumulativeGasUsed": "48848339", + "blockNumber": 54644356, + "cumulativeGasUsed": "6328188", "status": 1, "byzantium": true }, "args": [ "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" ], - "numDeployments": 1, "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", diff --git a/lib/g-uni-v1-core/src/addresses.ts b/lib/g-uni-v1-core/src/addresses.ts index 09362d28..f0e89f9e 100644 --- a/lib/g-uni-v1-core/src/addresses.ts +++ b/lib/g-uni-v1-core/src/addresses.ts @@ -62,7 +62,7 @@ export const getAddresses = (network: string): Addresses => { GUniImplementation: "", }; case "anvil": - return { + return { Gelato: "0x0000000000000000000000000000000000000000", Swapper: "", GelatoDevMultiSig: "0x0000000000000000000000000000000000000000", @@ -74,7 +74,7 @@ export const getAddresses = (network: string): Addresses => { GUniImplementation: "", }; case "blastSepolia": - return { + return { Gelato: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", Swapper: "", GelatoDevMultiSig: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", @@ -86,19 +86,19 @@ export const getAddresses = (network: string): Addresses => { GUniImplementation: "0xdde18C0c3B637F4BA02f5567a671F5e28b7404e7", }; case "arbitrumSepolia": - return { + return { Gelato: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", Swapper: "", GelatoDevMultiSig: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", WETH: "", DAI: "", USDC: "", - UniswapV3Factory: "0x248AB79Bbb9bC29bB72f7Cd42F17e054Fc40188e", - GUniFactory: "0x7f502e91182338F19CB6F4B02B33B33feD1c5000", - GUniImplementation: "0xCE7427a94bc9B8A90E2C8d91cB0247D779819437", + UniswapV3Factory: "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F", + GUniFactory: "0x39AC4439e6CB9427C073259e5742529cE46DD663", + GUniImplementation: "0xF3e2578C66071a637F06cc02b1c11DeC0784C1A6", }; case "modeSepolia": - return { + return { Gelato: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", Swapper: "", GelatoDevMultiSig: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", @@ -110,7 +110,7 @@ export const getAddresses = (network: string): Addresses => { GUniImplementation: "0xe1B83edA3399A2c9B8265215EA21042C9b918dc5", }; case "baseSepolia": - return { + return { Gelato: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", Swapper: "", GelatoDevMultiSig: "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", From be152b64fb374a8d8551b9247070ef92231bf21e Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 25 Jun 2024 14:24:47 +0400 Subject: [PATCH 35/82] Add G-UNI factory addresses from testnet deployments --- script/env.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/env.json b/script/env.json index 029777ea..f0b93772 100644 --- a/script/env.json +++ b/script/env.json @@ -53,14 +53,14 @@ "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" }, "gUni": { - "factory": "0x0000000000000000000000000000000000000000" + "factory": "0x39AC4439e6CB9427C073259e5742529cE46DD663" }, "uniswapV2": { "factory": "0x6c4f747ba42136f3F12E70c975AbBc194CBD39E4", "router": "0x909F26919989167d051312fBB0a1Df4CD93Bf70b" }, "uniswapV3": { - "factory": "0x248AB79Bbb9bC29bB72f7Cd42F17e054Fc40188e" + "factory": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" } }, "base-sepolia": { @@ -87,7 +87,7 @@ "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" }, "gUni": { - "factory": "0x0000000000000000000000000000000000000000" + "factory": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b" }, "uniswapV2": { "factory": "0x5D7ddDFee9fB5709Ccdea49Acd51db3d73BC75Fa", @@ -160,7 +160,7 @@ "weth": "0x4200000000000000000000000000000000000023" }, "gUni": { - "factory": "0x0000000000000000000000000000000000000000" + "factory": "0xED28E5230E934cf9C843C08818D0639176040297" }, "uniswapV2": { "factory": "0x9371C6e657681923708CA6F621DE5e93E5d46F7e", @@ -223,7 +223,7 @@ "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" }, "gUni": { - "factory": "0x0000000000000000000000000000000000000000" + "factory": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" }, "uniswapV2": { "factory": "0x85c0A59A492C084d84eDcD7a8b785eaF620a9B0d", From 5703b4f9f5a0b38b85cd30b53c2f8c17cb92ee8c Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 25 Jun 2024 15:12:48 +0400 Subject: [PATCH 36/82] chore: linting --- script/salts/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/salts/README.md b/script/salts/README.md index 1f8825ec..f08b51bc 100644 --- a/script/salts/README.md +++ b/script/salts/README.md @@ -81,4 +81,4 @@ The following steps need to be followed to generate the salt: ./scripts/salts/write_salt.sh ./bytecode/MockCallback98.bin 98 MockCallback 0x5080f4a157b896da527e936ac326bc3742c5d0239c63823b4d5c9939cc19ccb1 ``` -Provided the contract bytecode (contract code and constructor arguments) is the same, the saved salt will be used during deployment. \ No newline at end of file +Provided the contract bytecode (contract code and constructor arguments) is the same, the saved salt will be used during deployment. From e6283498d594ef45aa6bc8e409d166ab191a468a Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Tue, 25 Jun 2024 18:56:12 +0400 Subject: [PATCH 37/82] Verification of deployed tokens --- script/ops/test/deployTokens.sh | 37 +++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/script/ops/test/deployTokens.sh b/script/ops/test/deployTokens.sh index 7c89a378..f9c7c8d3 100755 --- a/script/ops/test/deployTokens.sh +++ b/script/ops/test/deployTokens.sh @@ -1,7 +1,7 @@ #!/bin/bash # Usage: -# ./deployTokens.sh --seller --buyer --envFile <.env> --broadcast +# ./deployTokens.sh --seller --buyer --envFile <.env> --broadcast --verify # Iterate through named arguments # Source: https://unix.stackexchange.com/a/388038 @@ -25,6 +25,7 @@ set +a # Disable automatic export # Apply defaults to command-line arguments BROADCAST=${broadcast:-false} +VERIFY=${verify:-false} # Check that the seller is defined and is an address if [[ ! "$seller" =~ ^0x[a-fA-F0-9]{40}$ ]] @@ -42,6 +43,9 @@ fi echo "Using chain: $CHAIN" echo "Using RPC at URL: $RPC_URL" +if [ -n "$VERIFIER_URL" ]; then + echo "Using verifier at URL: $VERIFIER_URL" +fi echo "Seller: $seller" echo "Buyer: $buyer" echo "Deployer: $DEPLOYER_ADDRESS" @@ -55,7 +59,36 @@ else echo "Broadcast: disabled" fi +# Set VERIFY_FLAG based on VERIFY +VERIFY_FLAG="" +if [ "$VERIFY" = "true" ] || [ "$VERIFY" = "TRUE" ]; then + + if [ -z "$VERIFIER" ] || [ "$VERIFIER" = "etherscan" ]; then + # Check if ETHERSCAN_API_KEY is set + if [ -z "$ETHERSCAN_API_KEY" ]; then + echo "No Etherscan API key found. Provide the key in .env or disable verification." + exit 1 + fi + + if [ -n "$VERIFIER_URL" ]; then + VERIFY_FLAG="--verify --verifier-url $VERIFIER_URL --etherscan-api-key $ETHERSCAN_API_KEY" + else + VERIFY_FLAG="--verify --etherscan-api-key $ETHERSCAN_API_KEY" + fi + else + if [ -n "$VERIFIER_URL" ]; then + VERIFY_FLAG="--verify --verifier $VERIFIER --verifier-url $VERIFIER_URL" + else + VERIFY_FLAG="--verify --verifier $VERIFIER" + fi + fi + echo "Verification: enabled" +else + echo "Verification: disabled" +fi + # Create auction forge script ./script/ops/test/TestData.s.sol:TestData --sig "deployTestTokens(address,address)()" $seller $buyer \ --rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvv \ -$BROADCAST_FLAG +$BROADCAST_FLAG \ +$VERIFY_FLAG From be656cfb871acc6333c503c72aa070aff57a912e Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 25 Jun 2024 11:03:36 -0400 Subject: [PATCH 38/82] feat: set referrer fee by auction with a max referrer fee configured by auction type --- src/AtomicAuctionHouse.sol | 9 +++------ src/AtomicCatalogue.sol | 2 +- src/bases/AuctionHouse.sol | 17 ++++++++++++----- src/bases/FeeManager.sol | 4 ++-- src/interfaces/IAuctionHouse.sol | 2 ++ src/interfaces/IFeeManager.sol | 16 ++++++++-------- 6 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/AtomicAuctionHouse.sol b/src/AtomicAuctionHouse.sol index c22a70d6..334bdb13 100644 --- a/src/AtomicAuctionHouse.sol +++ b/src/AtomicAuctionHouse.sol @@ -18,8 +18,6 @@ import {AuctionHouse} from "src/bases/AuctionHouse.sol"; import {AuctionModule} from "src/modules/Auction.sol"; import {AtomicAuctionModule} from "src/modules/auctions/AtomicAuctionModule.sol"; -import {Keycode, keycodeFromVeecode} from "src/modules/Keycode.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. contract AtomicAuctionHouse is IAtomicAuctionHouse, AuctionHouse { @@ -112,13 +110,12 @@ contract AtomicAuctionHouse is IAtomicAuctionHouse, AuctionHouse { Routing storage routing = lotRouting[params_.lotId]; // Calculate quote fees for purchase - // Note: this enables protocol and referrer fees to be changed between purchases + // Fees were cached on auction creation, so they are consistent for an auction uint256 amountLessFees; { - Keycode auctionKeycode = keycodeFromVeecode(routing.auctionReference); uint256 totalFees = _allocateQuoteFees( - fees[auctionKeycode].protocol, - fees[auctionKeycode].referrer, + lotFees[params_.lotId].protocolFee, + lotFees[params_.lotId].referrerFee, params_.referrer, routing.seller, ERC20(routing.quoteToken), diff --git a/src/AtomicCatalogue.sol b/src/AtomicCatalogue.sol index 95e65337..ac326760 100644 --- a/src/AtomicCatalogue.sol +++ b/src/AtomicCatalogue.sol @@ -31,7 +31,7 @@ contract AtomicCatalogue is IAtomicCatalogue, Catalogue { IFeeManager(auctionHouse).calculateQuoteFees(protocolFee, referrerFee, true, amount_); // Get payout from module - return module.payoutFor(lotId_, amount_ - uint96(toProtocol) - uint96(toReferrer)); + return module.payoutFor(lotId_, amount_ - toProtocol - toReferrer); } /// @inheritdoc IAtomicCatalogue diff --git a/src/bases/AuctionHouse.sol b/src/bases/AuctionHouse.sol index dc0c2f93..fbf71381 100644 --- a/src/bases/AuctionHouse.sol +++ b/src/bases/AuctionHouse.sol @@ -144,9 +144,14 @@ abstract contract AuctionHouse is IAuctionHouse, WithModules, ReentrancyGuard, F uint48 curatorFee = auctionFees.curator[routing_.curator]; lotFee.curatorFee = curatorFee > maxCuratorFee ? maxCuratorFee : curatorFee; - // Snapshot the protocol and referrer fees + // Check that the referrer fee does not exceed the max. + // If it does, set the fee to the max. + lotFee.referrerFee = routing_.referrerFee > auctionFees.maxReferrerFee + ? auctionFees.maxReferrerFee + : routing_.referrerFee; + + // Snapshot the protocol fee lotFee.protocolFee = auctionFees.protocol; - lotFee.referrerFee = auctionFees.referrer; } // Derivative @@ -435,11 +440,13 @@ abstract contract AuctionHouse is IAuctionHouse, WithModules, ReentrancyGuard, F if (fee_ > _FEE_DECIMALS) revert InvalidFee(); // Set fee based on type - // Or a combination of protocol and referrer fee since they are both in the quoteToken? + // Protocol and max referrer fee cannot exceed 100% if (type_ == FeeType.Protocol) { + if (fee_ + fees[auctionType_].maxReferrerFee > _FEE_DECIMALS) revert InvalidFee(); fees[auctionType_].protocol = fee_; - } else if (type_ == FeeType.Referrer) { - fees[auctionType_].referrer = fee_; + } else if (type_ == FeeType.MaxReferrer) { + if (fee_ + fees[auctionType_].protocol > _FEE_DECIMALS) revert InvalidFee(); + fees[auctionType_].maxReferrerFee = fee_; } else if (type_ == FeeType.MaxCurator) { fees[auctionType_].maxCuratorFee = fee_; } diff --git a/src/bases/FeeManager.sol b/src/bases/FeeManager.sol index a25b41d7..ab30b028 100644 --- a/src/bases/FeeManager.sol +++ b/src/bases/FeeManager.sol @@ -90,10 +90,10 @@ abstract contract FeeManager is IFeeManager, ReentrancyGuard { external view override - returns (uint48 protocol, uint48 referrer, uint48 maxCuratorFee) + returns (uint48 protocol, uint48 maxReferrerFee, uint48 maxCuratorFee) { Fees storage fee = fees[auctionType_]; - return (fee.protocol, fee.referrer, fee.maxCuratorFee); + return (fee.protocol, fee.maxReferrerFee, fee.maxCuratorFee); } /// @inheritdoc IFeeManager diff --git a/src/interfaces/IAuctionHouse.sol b/src/interfaces/IAuctionHouse.sol index 8c76b0ac..9fb967e7 100644 --- a/src/interfaces/IAuctionHouse.sol +++ b/src/interfaces/IAuctionHouse.sol @@ -51,6 +51,7 @@ interface IAuctionHouse { /// @param baseToken Token provided by seller. Declared as an address to avoid dependency hell. /// @param quoteToken Token to accept as payment. Declared as an address to avoid dependency hell. /// @param curator (optional) Address of the proposed curator + /// @param referrerFee (optional) Percent of bid/purchase amount received paid to a referrer, as a percent with 3 decimals, i.e. 1% = 1000. /// @param callbacks (optional) Callbacks implementation for extended functionality /// @param callbackData (optional) abi-encoded data to be sent to the onCreate callback function /// @param derivativeType (optional) Derivative type, represented by the Keycode for the derivative submodule @@ -61,6 +62,7 @@ interface IAuctionHouse { address baseToken; address quoteToken; address curator; + uint48 referrerFee; ICallback callbacks; bytes callbackData; Keycode derivativeType; diff --git a/src/interfaces/IFeeManager.sol b/src/interfaces/IFeeManager.sol index 471cfc29..4a4c7fdb 100644 --- a/src/interfaces/IFeeManager.sol +++ b/src/interfaces/IFeeManager.sol @@ -20,12 +20,12 @@ interface IFeeManager { /// a theoretical edge case, as the amount would not be practical. /// /// @param protocol Fee charged by the protocol - /// @param referrer Fee charged by the referrer + /// @param maxReferrerFee Maximum fee that can be paid to a referrer /// @param maxCuratorFee Maximum fee that a curator can charge /// @param curator Fee charged by a specific curator struct Fees { uint48 protocol; - uint48 referrer; + uint48 maxReferrerFee; uint48 maxCuratorFee; mapping(address => uint48) curator; } @@ -33,7 +33,7 @@ interface IFeeManager { /// @notice Defines the type of fee to set enum FeeType { Protocol, - Referrer, + MaxReferrer, MaxCurator } @@ -64,14 +64,14 @@ interface IFeeManager { /// @notice Gets the fees for a specific auction type /// - /// @param auctionType_ Auction type to get fees for - /// @return protocol Fee charged by the protocol - /// @return referrer Fee charged by the referrer - /// @return maxCuratorFee Maximum fee that a curator can charge + /// @param auctionType_ Auction type to get fees for + /// @return protocol Fee charged by the protocol + /// @return maxReferrerFee Maximum fee that can be paid to a referrer + /// @return maxCuratorFee Maximum fee that a curator can charge function getFees(Keycode auctionType_) external view - returns (uint48 protocol, uint48 referrer, uint48 maxCuratorFee); + returns (uint48 protocol, uint48 maxReferrerFee, uint48 maxCuratorFee); /// @notice Gets the fee for a specific auction type and curator /// From 3fc2363c78580e73b885461e9c9c82d9c56aa0f1 Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 25 Jun 2024 15:24:09 -0400 Subject: [PATCH 39/82] chore: linting and cleanup --- src/modules/derivatives/LinearVesting.sol | 7 +- src/modules/derivatives/LinearVestingCard.sol | 412 +++++------------- 2 files changed, 101 insertions(+), 318 deletions(-) diff --git a/src/modules/derivatives/LinearVesting.sol b/src/modules/derivatives/LinearVesting.sol index 9056b00e..95ecf244 100644 --- a/src/modules/derivatives/LinearVesting.sol +++ b/src/modules/derivatives/LinearVesting.sol @@ -42,8 +42,7 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { // ========== MODULE SETUP ========== // - constructor(address parent_) Module(parent_) { - // LinearVestingCard() + constructor(address parent_) Module(parent_) LinearVestingCard() { // Deploy the clone implementation _IMPLEMENTATION = address(new SoulboundCloneERC20()); } @@ -712,14 +711,16 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { }); // Return the token URI + // solhint-disable quotes return string.concat( '{"name": "', name(tokenId_), '", "description": "Linear Vesting ', _symbol, '", "image": "data:image/svg+xml;utf8,', - render(info), + _render(info), '"}' ); + // solhint-enable quotes } } diff --git a/src/modules/derivatives/LinearVestingCard.sol b/src/modules/derivatives/LinearVestingCard.sol index b2f10c2d..bc619e0f 100644 --- a/src/modules/derivatives/LinearVestingCard.sol +++ b/src/modules/derivatives/LinearVestingCard.sol @@ -7,6 +7,8 @@ import {Timestamp} from "src/lib/Timestamp.sol"; import {Strings as LibString} from "lib/openzeppelin-contracts/contracts/utils/Strings.sol"; contract LinearVestingCard { + // solhint-disable quotes + // ========== DATA STRUCTURES ========== // struct Info { @@ -16,182 +18,93 @@ contract LinearVestingCard { uint48 expiry; } - struct Colors { - string blue; - string lightBlue; - string green; - string yellowGreen; - string yellow; - string orange; - string red; - } - // ========== STATE VARIABLES ========== // - string internal constant TEXT_STYLE = + string internal constant _TEXT_STYLE = 'font-family="\'Menlo\', monospace" fill="white" text-anchor="middle"'; - string internal constant NULL = ""; - string internal ADDR_STRING; + string internal constant _NULL = ""; + string internal _addrString; - Colors internal colors; + string internal constant _COLOR_BLUE = "rgb(110, 148, 240)"; + string internal constant _COLOR_LIGHT_BLUE = "rgb(118, 189, 242)"; + string internal constant _COLOR_GREEN = "rgb(206, 244, 117)"; + string internal constant _COLOR_YELLOW_GREEN = "rgb(243, 244, 189)"; + string internal constant _COLOR_YELLOW = "rgb(243, 244, 189)"; + string internal constant _COLOR_ORANGE = "rgb(246, 172, 84)"; + string internal constant _COLOR_RED = "rgb(242, 103, 64)"; // ========== CONSTRUCTOR ========== // constructor() { - colors = Colors({ - blue: "rgb(110, 148, 240)", - lightBlue: "rgb(118, 189, 242)", - green: "rgb(206, 244, 117)", - yellowGreen: "rgb(243, 244, 189)", - yellow: "rgb(243, 244, 189)", - orange: "rgb(246, 172, 84)", - red: "rgb(242, 103, 64)" - }); - - ADDR_STRING = LibString.toHexString(address(this)); + _addrString = LibString.toHexString(address(this)); } // ========== RENDERER ========== // - function render(Info memory tokenInfo) internal view returns (string memory) { + function _render(Info memory tokenInfo) internal view returns (string memory) { return string.concat( '', svg.el( "defs", - NULL, + _NULL, string.concat( - fullGradient(), fullGradient90(), fullGradientReverse90(), blueGreenGradient() + _fullGradient(), + _fullGradient90(), + _fullGradientReverse90(), + _blueGreenGradient() ) ), svg.rect( - // string.concat( - // svg.prop('x', '0'), - // svg.prop('y', '0'), - // svg.prop('width', '290'), - // svg.prop('height', '500'), - // svg.prop('fill', 'rgb(30, 30, 30)'), - // svg.prop('rx', '25'), - // svg.prop('ry', '25') - // ), - 'x="0" y="0" width="290" height="500" fill="rgb(30, 30, 30)" rx="25" ry="25"', - NULL + 'x="0" y="0" width="290" height="500" fill="rgb(30, 30, 30)" rx="25" ry="25"', _NULL ), svg.rect( - // string.concat( - // svg.prop('x', '8'), - // svg.prop('y', '8'), - // svg.prop('width', '274'), - // svg.prop('height', '484'), - // svg.prop('fill', 'none'), - // svg.prop('stroke', "url('#fullGradient')"), - // svg.prop('stroke-width', '2'), - // svg.prop('rx', '20'), - // svg.prop('ry', '20') - // ), 'x="8" y="8" width="274" height="484" fill="none" stroke="url(#fullGradient)" stroke-width="2" rx="20" ry="20"', - NULL + _NULL ), - title(tokenInfo.baseAssetSymbol), - progressBar(uint256(tokenInfo.start), uint256(tokenInfo.expiry)), - progressLabels(tokenInfo.start, tokenInfo.expiry), - logo(), - identifier(tokenInfo.tokenId), + _title(tokenInfo.baseAssetSymbol), + _progressBar(uint256(tokenInfo.start), uint256(tokenInfo.expiry)), + _progressLabels(tokenInfo.start, tokenInfo.expiry), + _logo(), + _identifier(tokenInfo.tokenId), "" ); } // ========== COMPONENTS ========== // - function title(string memory symbol) internal pure returns (string memory) { + function _title(string memory symbol) internal pure returns (string memory) { return string.concat( - svg.text( - // string.concat( - // svg.prop('x', '145'), - // svg.prop('y', '40'), - // svg.prop('font-size', '20'), - // TEXT_STYLE - // ), - string.concat('x="145" y="40" font-size="20" ', TEXT_STYLE), - "Linear Vesting" - ), - svg.text( - // string.concat( - // svg.prop('x', '145'), - // svg.prop('y', '100'), - // svg.prop('font-size', '56'), - // TEXT_STYLE - // ), - string.concat('x="145" y="100" font-size="56" ', TEXT_STYLE), - symbol - ) + svg.text(string.concat('x="145" y="40" font-size="20" ', _TEXT_STYLE), "Linear Vesting"), + svg.text(string.concat('x="145" y="100" font-size="56" ', _TEXT_STYLE), symbol) ); } - function logo() internal pure returns (string memory) { + function _logo() internal pure returns (string memory) { return string.concat( svg.rect( - // string.concat( - // svg.prop('x', '143'), - // svg.prop('y', '240'), - // svg.prop('width', '6'), - // svg.prop('height', '125'), - // svg.prop('fill', "url('#fullGradientReverse90')") - // ), - 'x="143" y="240" width="6" height="125" fill="url(#fullGradientReverse90)"', - NULL + 'x="143" y="240" width="6" height="125" fill="url(#fullGradientReverse90)"', _NULL ), svg.rect( - // string.concat( - // svg.prop('x', '79'), - // svg.prop('y', '246'), - // svg.prop('width', '6'), - // svg.prop('height', '125'), - // svg.prop('fill', "url('#fullGradient90')"), - // svg.prop('transform', 'rotate(-60 145 250)') - // ), 'x="79" y="246" width="6" height="125" fill="url(#fullGradient90)" transform="rotate(-60 145 250)"', - NULL + _NULL ), svg.rect( - // string.concat( - // svg.prop('x', '206'), - // svg.prop('y', '244'), - // svg.prop('width', '6'), - // svg.prop('height', '125'), - // svg.prop('fill', "url('#fullGradient90')"), - // svg.prop('transform', 'rotate(60 145 250)') - // ), 'x="206" y="244" width="6" height="125" fill="url(#fullGradient90)" transform="rotate(60 145 250)"', - NULL + _NULL ) ); } - function identifier(uint256 tokenId) internal view returns (string memory) { + function _identifier(uint256 tokenId) internal view returns (string memory) { return string.concat( + svg.text(string.concat('x="145" y="460" font-size="10" ', _TEXT_STYLE), _addrString), svg.text( - // string.concat( - // svg.prop('x', '145'), - // svg.prop('y', '460'), - // svg.prop('font-size', '10'), - // TEXT_STYLE - // ), - string.concat('x="145" y="460" font-size="10" ', TEXT_STYLE), - ADDR_STRING - ), - svg.text( - // string.concat( - // svg.prop('x', '145'), - // svg.prop('y', '480'), - // svg.prop('font-size', '10'), - // TEXT_STYLE - // ), - string.concat('x="145" y="480" font-size="10" ', TEXT_STYLE), + string.concat('x="145" y="480" font-size="10" ', _TEXT_STYLE), string.concat("ID: ", LibString.toString(tokenId)) ) ); } - function progressBar(uint256 start, uint256 end) internal view returns (string memory) { + function _progressBar(uint256 start, uint256 end) internal view returns (string memory) { uint256 currentTime = block.timestamp; // 1717200000 + 70 * 86400; string memory startBar; @@ -205,37 +118,21 @@ contract LinearVestingCard { progress = progress > 100 ? 100 : progress; startBar = svg.line( - // string.concat( - // svg.prop('x1', '60'), - // svg.prop('y1', '155'), - // svg.prop('x2', '60'), - // svg.prop('y2', '175'), - // svg.prop('stroke', started ? colors.blue : 'grey'), - // svg.prop('stroke-width', '6') - // ), string.concat( 'x1="60" y1="155" x2="60" y2="175" stroke="', - started ? colors.blue : "grey", + started ? _COLOR_BLUE : "grey", '" stroke-width="6"' ), - NULL + _NULL ); endBar = svg.line( - // string.concat( - // svg.prop('x1', '230'), - // svg.prop('y1', '155'), - // svg.prop('x2', '230'), - // svg.prop('y2', '175'), - // svg.prop('stroke', progress == 100 ? colors.green : 'grey'), - // svg.prop('stroke-width', '6') - // ), string.concat( 'x1="230" y1="155" x2="230" y2="175" stroke="', - progress == 100 ? colors.green : "grey", + progress == 100 ? _COLOR_GREEN : "grey", '" stroke-width="6"' ), - NULL + _NULL ); } @@ -243,81 +140,43 @@ contract LinearVestingCard { string memory current = LibString.toString(62 + len); string memory progressLine = svg.line( - // string.concat( - // svg.prop('x1', '62'), - // svg.prop('y1', '165'), - // svg.prop('x2', current), - // svg.prop('y2', '165'), - // svg.prop('stroke', "url('#blueGreenGradient')"), - // svg.prop('stroke-width', '6') - // ), string.concat( 'x1="62" y1="165" x2="', current, '" y2="165" stroke="url(#blueGreenGradient)" stroke-width="6"' ), - NULL + _NULL ); string memory progressCircle = svg.circle( - // string.concat( - // svg.prop('cx', current), - // svg.prop('cy', '165'), - // svg.prop('r', '6'), - // svg.prop('fill', "url('#blueGreenGradient')") - // ), - string.concat('cx="', current, '" cy="165" r="6" fill="url(#blueGreenGradient)"'), - NULL + string.concat('cx="', current, '" cy="165" r="6" fill="url(#blueGreenGradient)"'), _NULL ); string memory shadowLine = svg.line( - // string.concat( - // svg.prop('x1', '63'), - // svg.prop('y1', '165'), - // svg.prop('x2', '230'), - // svg.prop('y2', '165'), - // svg.prop('stroke', 'grey'), - // svg.prop('stroke-width', '4') - // ), string.concat('x1="63" y1="165" x2="230" y2="165" stroke="grey" stroke-width="4"'), - NULL + _NULL ); return svg.g( - NULL, + _NULL, string.concat( startBar, shadowLine, progressLine, - progress < 15 ? "" : animateLine(len), + progress < 15 ? "" : _animateLine(len), endBar, progress < 5 || progress > 95 ? "" : progressCircle ) ); } - function animateLine(uint256 len) internal pure returns (string memory) { + function _animateLine(uint256 len) internal pure returns (string memory) { return svg.rect( - // string.concat( - // svg.prop('x', '62'), - // svg.prop('y', '161'), - // svg.prop('width', '12'), - // svg.prop('height', '8'), - // svg.prop('fill', "url('#blueGreenGradient')"), - // svg.prop('rx', '4'), - // svg.prop('ry', '4') - // ), string.concat( 'x="62" y="161" width="12" height="8" fill="url(#blueGreenGradient)" rx="4" ry="4"' ), svg.el( "animate", - // string.concat( - // svg.prop('attributeName', 'x'), - // svg.prop('values', string.concat('62;', LibString.toString(62 + len - 16), ';')), - // svg.prop('dur', string.concat(LibString.toString(((5 * len) / 168) + 1), 's')), - // svg.prop('repeatCount', 'indefinite') - // ), string.concat( 'attributeName="x" values="62;', LibString.toString(62 + len - 16), @@ -325,204 +184,128 @@ contract LinearVestingCard { LibString.toString(((5 * len) / 168) + 1), 's" repeatCount="indefinite"' ), - NULL + _NULL ) ); } - function progressLabels(uint48 start_, uint48 expiry_) internal pure returns (string memory) { - (string memory start, string memory expiry) = getTimeStrings(start_, expiry_); + function _progressLabels(uint48 start_, uint48 expiry_) internal pure returns (string memory) { + (string memory start, string memory expiry) = _getTimeStrings(start_, expiry_); return string.concat( - svg.text( - // string.concat( - // svg.prop('x', '60'), - // svg.prop('y', '200'), - // svg.prop('font-size', '12'), - // TEXT_STYLE - // ), - string.concat('x="60" y="200" font-size="12" ', TEXT_STYLE), - start - ), - svg.text( - // string.concat( - // svg.prop('x', '230'), - // svg.prop('y', '200'), - // svg.prop('font-size', '12'), - // TEXT_STYLE - // ), - string.concat('x="230" y="200" font-size="12"', TEXT_STYLE), - expiry - ) + svg.text(string.concat('x="60" y="200" font-size="12" ', _TEXT_STYLE), start), + svg.text(string.concat('x="230" y="200" font-size="12"', _TEXT_STYLE), expiry) ); } // ========== COLOR GRADIENTS ========== // - function fullGradientStops() internal view returns (string memory) { - // return string.concat( - // svg.gradientStop( - // 2, - // colors.blue, - // NULL - // ), - // svg.gradientStop( - // 10, - // colors.lightBlue, - // NULL - // ), - // svg.gradientStop( - // 32, - // colors.green, - // NULL - // ), - // svg.gradientStop( - // 49, - // colors.yellowGreen, - // NULL - // ), - // svg.gradientStop( - // 52, - // colors.yellow, - // NULL - // ), - // svg.gradientStop( - // 79, - // colors.orange, - // NULL - // ), - // svg.gradientStop( - // 100, - // colors.red, - // NULL - // ) - // ); + function _fullGradientStops() internal view returns (string memory) { return string.concat( '', '', '', '', '', '', '' ); } - function fullGradientReverseStops() internal view returns (string memory) { + function _fullGradientReverseStops() internal view returns (string memory) { return string.concat( - svg.gradientStop(2, colors.red, NULL), - svg.gradientStop(21, colors.orange, NULL), - svg.gradientStop(48, colors.yellow, NULL), - svg.gradientStop(51, colors.yellowGreen, NULL), - svg.gradientStop(68, colors.green, NULL), - svg.gradientStop(90, colors.lightBlue, NULL), - svg.gradientStop(100, colors.blue, NULL) + svg.gradientStop(2, _COLOR_RED, _NULL), + svg.gradientStop(21, _COLOR_ORANGE, _NULL), + svg.gradientStop(48, _COLOR_YELLOW, _NULL), + svg.gradientStop(51, _COLOR_YELLOW_GREEN, _NULL), + svg.gradientStop(68, _COLOR_GREEN, _NULL), + svg.gradientStop(90, _COLOR_LIGHT_BLUE, _NULL), + svg.gradientStop(100, _COLOR_BLUE, _NULL) ); return string.concat( '', '', '', '', '', '', '' ); } - function fullGradient() internal view returns (string memory) { + function _fullGradient() internal view returns (string memory) { return - svg.linearGradient(string.concat(svg.prop("id", "fullGradient")), fullGradientStops()); + svg.linearGradient(string.concat(svg.prop("id", "fullGradient")), _fullGradientStops()); } - function fullGradient90() internal view returns (string memory) { + function _fullGradient90() internal view returns (string memory) { return svg.linearGradient( string.concat( svg.prop("id", "fullGradient90"), svg.prop("gradientTransform", "rotate(90)") ), - fullGradientStops() + _fullGradientStops() ); } - function fullGradientReverse90() internal view returns (string memory) { + function _fullGradientReverse90() internal view returns (string memory) { return svg.linearGradient( string.concat( svg.prop("id", "fullGradientReverse90"), svg.prop("gradientTransform", "rotate(90)") ), - fullGradientReverseStops() + _fullGradientReverseStops() ); } - function blueGreenGradient() internal view returns (string memory) { + function _blueGreenGradient() internal view returns (string memory) { return svg.linearGradient( string.concat( svg.prop("id", "blueGreenGradient"), svg.prop("gradientUnits", "userSpaceOnUse") ), string.concat( '', '', '' ) ); } - // function orangeRedGradient() internal view returns (string memory) { - // return svg.linearGradient( - // string.concat( - // svg.prop('id', 'orangeRedGradient'), - // svg.prop('gradientTransform', 'rotate(90)') - // ), - // string.concat( - // svg.gradientStop( - // 30, - // colors.orange, - // NULL - // ), - // svg.gradientStop( - // 90, - // colors.red, - // NULL - // ) - // ) - // ); - // } - // ========== UTILITIES ========== // - function getTimeStrings( + function _getTimeStrings( uint48 start, uint48 end ) internal pure returns (string memory, string memory) { @@ -538,16 +321,15 @@ contract LinearVestingCard { } // ========== EXAMPLE ========== // - // Used by hot-chain-svg during development. TODO: Remove for prod. - - function example() external view returns (string memory) { - Info memory info = Info({ - baseAssetSymbol: "XYZ", - tokenId: 123_456, - start: 1_717_200_000, // 2024-06-01 - expiry: 1_725_148_800 // 2024-09-01 - }); - - return render(info); - } + // Used by hot-chain-svg during development. + // + // function example() external view returns (string memory) { + // Info memory info = Info({ + // baseAssetSymbol: "XYZ", + // tokenId: 123_456, + // start: 1_717_200_000, // 2024-06-01 + // expiry: 1_725_148_800 // 2024-09-01 + // }); + // return _render(info); + // } } From a657c48994911dffc9f7b03dad6e7438362fc854 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 26 Jun 2024 11:14:42 +0400 Subject: [PATCH 40/82] Update Uniswap V2 addresses for arbitrum sepolia --- script/env.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/env.json b/script/env.json index f0b93772..c7c8b15c 100644 --- a/script/env.json +++ b/script/env.json @@ -56,8 +56,8 @@ "factory": "0x39AC4439e6CB9427C073259e5742529cE46DD663" }, "uniswapV2": { - "factory": "0x6c4f747ba42136f3F12E70c975AbBc194CBD39E4", - "router": "0x909F26919989167d051312fBB0a1Df4CD93Bf70b" + "factory": "0xeA68f4B82D43979c42E1Fc8E80BDA27BF54C9651", + "router": "0x706f328cdE340522149821FC249c2ad321070212" }, "uniswapV3": { "factory": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" From 127cc24ba1020c445d6f74a29bcbe86f72520d60 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 26 Jun 2024 11:14:53 +0400 Subject: [PATCH 41/82] Add resume flag to deployTokens script --- script/ops/test/deployTokens.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/script/ops/test/deployTokens.sh b/script/ops/test/deployTokens.sh index f9c7c8d3..886679af 100755 --- a/script/ops/test/deployTokens.sh +++ b/script/ops/test/deployTokens.sh @@ -1,7 +1,7 @@ #!/bin/bash # Usage: -# ./deployTokens.sh --seller --buyer --envFile <.env> --broadcast --verify +# ./deployTokens.sh --seller --buyer --envFile <.env> --broadcast --verify --resume # Iterate through named arguments # Source: https://unix.stackexchange.com/a/388038 @@ -26,6 +26,7 @@ set +a # Disable automatic export # Apply defaults to command-line arguments BROADCAST=${broadcast:-false} VERIFY=${verify:-false} +RESUME=${resume:-false} # Check that the seller is defined and is an address if [[ ! "$seller" =~ ^0x[a-fA-F0-9]{40}$ ]] @@ -87,8 +88,18 @@ else echo "Verification: disabled" fi +# Set RESUME_FLAG based on RESUME +RESUME_FLAG="" +if [ "$RESUME" = "true" ] || [ "$RESUME" = "TRUE" ]; then + RESUME_FLAG="--resume" + echo "Resume: enabled" +else + echo "Resume: disabled" +fi + # Create auction forge script ./script/ops/test/TestData.s.sol:TestData --sig "deployTestTokens(address,address)()" $seller $buyer \ --rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvv \ $BROADCAST_FLAG \ -$VERIFY_FLAG +$VERIFY_FLAG \ +$RESUME_FLAG From d65b906eb4091f056316e6c6745c70b9096d4f5c Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 26 Jun 2024 11:52:35 +0400 Subject: [PATCH 42/82] Update Uniswap V2 deployments on blast/base/mode sepolia testnets --- script/env.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/script/env.json b/script/env.json index c7c8b15c..eab6ecad 100644 --- a/script/env.json +++ b/script/env.json @@ -90,8 +90,8 @@ "factory": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b" }, "uniswapV2": { - "factory": "0x5D7ddDFee9fB5709Ccdea49Acd51db3d73BC75Fa", - "router": "0x3c068BF506925A8349CC14438ce91d2C43793D4e" + "factory": "0xFFa262a1FaDaEd0CE863792CE7A57cC329d7492e", + "router": "0xFA41988c6D1B095826Bea02dbcD124661305dAE7" }, "uniswapV3": { "factory": "0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24" @@ -163,8 +163,8 @@ "factory": "0xED28E5230E934cf9C843C08818D0639176040297" }, "uniswapV2": { - "factory": "0x9371C6e657681923708CA6F621DE5e93E5d46F7e", - "router": "0x82D4e19FeC908EEE6009e6E099794EA050eb8a96" + "factory": "0x8823062F9406f31cc52cc24A70a8415d982E245b", + "router": "0xF3711CaF818d6932da1e31aACF27167c989cD886" }, "uniswapV3": { "factory": "0x84fF29e6321c9dd328B8B383b08dd2815b121243" @@ -226,8 +226,8 @@ "factory": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" }, "uniswapV2": { - "factory": "0x85c0A59A492C084d84eDcD7a8b785eaF620a9B0d", - "router": "0xaBBD0dBeF1f5A61b89CDAaefB6c25ADf3Be05B58" + "factory": "0xFFa262a1FaDaEd0CE863792CE7A57cC329d7492e", + "router": "0xFA41988c6D1B095826Bea02dbcD124661305dAE7" }, "uniswapV3": { "factory": "0x0f88f3f5108eB3BD1A2D411E9a1fD41997811D88" From c1922fcefcbf6b43488c604048f080fdc1eedaf0 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 27 Jun 2024 12:26:20 +0400 Subject: [PATCH 43/82] Remove redundant env addresses --- script/env.json | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/script/env.json b/script/env.json index eab6ecad..6a855b8a 100644 --- a/script/env.json +++ b/script/env.json @@ -261,35 +261,6 @@ "uniswapV3": { "factory": "0x0227628f3F023bb0B980b67D528571c95c6DaC1c" } - }, - "tests": { - "axis": { - "AtomicAuctionHouse": "0x0000000000000000000000000000000000000000", - "AtomicCatalogue": "0x0000000000000000000000000000000000000000", - "AtomicLinearVesting": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "BatchAuctionHouse": "0x0000000000000000000000000000000000000000", - "BatchCatalogue": "0x0000000000000000000000000000000000000000", - "BatchLinearVesting": "0x0000000000000000000000000000000000000000", - "BatchUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "BatchUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "EncryptedMarginalPrice": "0x0000000000000000000000000000000000000000", - "FixedPriceSale": "0x0000000000000000000000000000000000000000", - "OWNER": "0x0000000000000000000000000000000000000001", - "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", - "PROTOCOL": "0x0000000000000000000000000000000000000003" - }, - "gUni": { - "factory": "0x0000000000000000000000000000000000000000" - }, - "uniswapV2": { - "factory": "0x0000000000000000000000000000000000000000", - "router": "0x0000000000000000000000000000000000000000" - }, - "uniswapV3": { - "factory": "0x0000000000000000000000000000000000000000" - } } } } From 706689ddd1d429dc0af39ec4a527ef123065c206 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 27 Jun 2024 12:35:37 +0400 Subject: [PATCH 44/82] Add addresses for dependencies on Base --- script/env.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/script/env.json b/script/env.json index 6a855b8a..bb34b1d5 100644 --- a/script/env.json +++ b/script/env.json @@ -63,6 +63,19 @@ "factory": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" } }, + "base": { + "axis": {}, + "gUni": { + "factory": "0x0000000000000000000000000000000000000000" + }, + "uniswapV2": { + "factory": "0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6", + "router": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" + }, + "uniswapV3": { + "factory": "0x33128a8fC17869897dcE68Ed026d694621f6FDfD" + } + }, "base-sepolia": { "axis": { "AtomicAuctionHouse": "0x0000000000000000000000000000000000000000", From de4491fd58a8471f82b739c6d0ed8ce39fa46c3f Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 27 Jun 2024 12:35:46 +0400 Subject: [PATCH 45/82] Document sources for external addresses --- script/deploy/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/script/deploy/README.md b/script/deploy/README.md index 10e35d62..4b7f0633 100644 --- a/script/deploy/README.md +++ b/script/deploy/README.md @@ -98,3 +98,18 @@ 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. From 3e3752222fcc8c25a64038274016f483d4c2dca4 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 28 Jun 2024 11:06:15 +0400 Subject: [PATCH 46/82] Re-deployment of UniswapV2DTL to Arbitrum Sepolia --- deployments/.arbitrum-sepolia-1719558304.json | 3 +++ script/env.json | 2 +- script/salts/salts.json | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 deployments/.arbitrum-sepolia-1719558304.json diff --git a/deployments/.arbitrum-sepolia-1719558304.json b/deployments/.arbitrum-sepolia-1719558304.json new file mode 100644 index 00000000..6ae6449c --- /dev/null +++ b/deployments/.arbitrum-sepolia-1719558304.json @@ -0,0 +1,3 @@ +{ +"axis.BatchUniswapV2DirectToLiquidity": "0xE676907Fa9a09dC1E3b67De11816665A1313524f" +} diff --git a/script/env.json b/script/env.json index bb34b1d5..009e74d1 100644 --- a/script/env.json +++ b/script/env.json @@ -43,7 +43,7 @@ "BatchLinearVesting": "0xFB1113E170CA6d95f3a91121BDD2370a822598E9", "BatchMerkleAllowlist": "0x9837cA34C444cEbd07C699036D1D174C6392D9fa", "BatchTokenAllowlist": "0x988c61b36F7898e464a0Bf477d2dc06aC4E95F95", - "BatchUniswapV2DirectToLiquidity": "0xE64E0807E5a0d789dB2fABB3345aB763f879521C", + "BatchUniswapV2DirectToLiquidity": "0xE676907Fa9a09dC1E3b67De11816665A1313524f", "BatchUniswapV3DirectToLiquidity": "0xE6ECF0f655E642834c79F30323e7ae941883ac00", "EncryptedMarginalPrice": "0x2Ca8954B468E2FbfE55240B69db937861c12F0d0", "FixedPriceBatch": "0x8b47F82a58d8AFBE5167feBf0D3F3Bb509aaf2bd", diff --git a/script/salts/salts.json b/script/salts/salts.json index b6aabd5f..5c5659ae 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -102,6 +102,7 @@ "0x49a44765f82e21a2455ecafadfd36f1dd7066ae8733dab3bf13fa33f271faabe": "0x036007589a41359e5858eddc394a9e4c2fe917360175a38d6139d77c8d8b0a89", "0x5e493cf7f7157b59101a569467e19f4a2618cb03f6414d4a8b4f1d2b4ac2912e": "0x43996039523bd2f955e18733dafabd2ab45c0e40865e93cca76dd2773c453d97", "0x60bc649627ebd535e11e848bd93dbbb4dc819e0279d20e1d3088983f65562dbf": "0xc4534d72b992c13813b52daa775c9dbe230eaf0b139a76fdc78baf72487148d0", + "0x72c2f4c8abb52265f37b52eb8732d93bdf72ff14512a77bb62d85f44283f81c1": "0x193e02d9a140f48949d8e6d06639c2b6f07aa2ac3aede83f1c2806fb603fde06", "0x8b4463835dc772630989c2d09011d747347fc03f6cdf5b4e820ed1ef05f26942": "0xc3a15bdea9242368d2db15a46055a9bf88b551562eda6217f0a02f1d6a93f73b", "0xd1807b8e8fef23d2bd5acb7fe74e7dab661f1ef2f7aaaa66e286398a6d9e8011": "0xec56a79198c3d690cad3e6e39521bd7dd90dc8692cf50a7ab027408d139bd189", "0xe8242d2e1eae0d89d0ca278cea284cd4056496fb12fd0405237827e252efdfea": "0x65a71869dd1c30cc12ac786991b9492a5286c8cd942161d738ca34b3e0e29053", From 99cbe361ace45349070ee0e5060f2f3f7b329bfd Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 28 Jun 2024 11:11:24 +0400 Subject: [PATCH 47/82] Re-deployment of UniswapV2DTL to Base Sepolia --- deployments/.base-sepolia-1719558588.json | 3 +++ script/env.json | 2 +- script/salts/salts.json | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 deployments/.base-sepolia-1719558588.json diff --git a/deployments/.base-sepolia-1719558588.json b/deployments/.base-sepolia-1719558588.json new file mode 100644 index 00000000..2bf7186d --- /dev/null +++ b/deployments/.base-sepolia-1719558588.json @@ -0,0 +1,3 @@ +{ +"axis.BatchUniswapV2DirectToLiquidity": "0xE66538D4EEbf830b1Dc791894af4709Af257764d" +} diff --git a/script/env.json b/script/env.json index 009e74d1..82b631ec 100644 --- a/script/env.json +++ b/script/env.json @@ -90,7 +90,7 @@ "BatchLinearVesting": "0x392C629741a0c7350c7181addD5870dE178eeD94", "BatchMerkleAllowlist": "0x9837cA34C444cEbd07C699036D1D174C6392D9fa", "BatchTokenAllowlist": "0x988c61b36F7898e464a0Bf477d2dc06aC4E95F95", - "BatchUniswapV2DirectToLiquidity": "0xE650A43485b89F26FB98ad16811BF45BD52ad014", + "BatchUniswapV2DirectToLiquidity": "0xE66538D4EEbf830b1Dc791894af4709Af257764d", "BatchUniswapV3DirectToLiquidity": "0xE661c46d94c53584095A8240958695bAD6d6fC2F", "EncryptedMarginalPrice": "0x02c63F8aE0a8e9D0F7267AA4d0Af0567858188C2", "FixedPriceBatch": "0x188Ad428c60eADFB0749B2E3A4836D63489304E3", diff --git a/script/salts/salts.json b/script/salts/salts.json index 5c5659ae..81310698 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -99,6 +99,7 @@ "UniswapV2DirectToLiquidity": { "0x2952f587868594ee4aed1e483cdbb653d4ef61c9c662a737fc6ae8f271225fe1": "0x000174bce07575898f52c13859450718eea202638a7089ff3d358a023b48bbfb", "0x32dcc0983af67a522f275494ce3a9a2aa88e6402989414825c965c9ca5fba907": "0xf588d14ef594a9c7c4fa378cfdebcbec0356153259bfe8a58d168f4866f7f2fb", + "0x3da878eaa4aa411d061618a12b80bd1a2896d0c89cdfc57bf95f335ec4c95544": "0xa368baf207ddf8d6a2d6bff03af56f0b527211d2c717d8e0768080227a6f4ca8", "0x49a44765f82e21a2455ecafadfd36f1dd7066ae8733dab3bf13fa33f271faabe": "0x036007589a41359e5858eddc394a9e4c2fe917360175a38d6139d77c8d8b0a89", "0x5e493cf7f7157b59101a569467e19f4a2618cb03f6414d4a8b4f1d2b4ac2912e": "0x43996039523bd2f955e18733dafabd2ab45c0e40865e93cca76dd2773c453d97", "0x60bc649627ebd535e11e848bd93dbbb4dc819e0279d20e1d3088983f65562dbf": "0xc4534d72b992c13813b52daa775c9dbe230eaf0b139a76fdc78baf72487148d0", From 60024dcf6a026bdfc618444feba7dd64c6234892 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 28 Jun 2024 11:12:35 +0400 Subject: [PATCH 48/82] Re-deployment of UniswapV2DTL to Blast Sepolia --- deployments/.blast-sepolia-1719558704.json | 3 +++ script/env.json | 2 +- script/salts/salts.json | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 deployments/.blast-sepolia-1719558704.json diff --git a/deployments/.blast-sepolia-1719558704.json b/deployments/.blast-sepolia-1719558704.json new file mode 100644 index 00000000..f822c2be --- /dev/null +++ b/deployments/.blast-sepolia-1719558704.json @@ -0,0 +1,3 @@ +{ +"axis.BatchUniswapV2DirectToLiquidity": "0xE60007A0721A92f0eb538c360317d4808238700D" +} diff --git a/script/env.json b/script/env.json index 82b631ec..fb734c23 100644 --- a/script/env.json +++ b/script/env.json @@ -158,7 +158,7 @@ "BatchLinearVesting": "0xBD0474b8e7b65f3dF35d2817BA09aC864a199e31", "BatchMerkleAllowlist": "0x9859c6FA2594e93149bd76415cE3982f39888CCb", "BatchTokenAllowlist": "0x984B6165fC87c682441E81B4aa23A017cdbFba18", - "BatchUniswapV2DirectToLiquidity": "0xE6282DDB61f81F4d769FE511676dC21E570AF815", + "BatchUniswapV2DirectToLiquidity": "0xE60007A0721A92f0eb538c360317d4808238700D", "BatchUniswapV3DirectToLiquidity": "0xE6b1113d108f86Fb7eF662ecF235dB6dB8978Cc3", "EncryptedMarginalPrice": "0x8F34bBB3edd28017f826FE7a73eb9297384BF0d8", "FixedPriceBatch": "0x87ED152099949F870725bD9517A1697d428ddF74", diff --git a/script/salts/salts.json b/script/salts/salts.json index 81310698..ade6cedd 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -106,6 +106,7 @@ "0x72c2f4c8abb52265f37b52eb8732d93bdf72ff14512a77bb62d85f44283f81c1": "0x193e02d9a140f48949d8e6d06639c2b6f07aa2ac3aede83f1c2806fb603fde06", "0x8b4463835dc772630989c2d09011d747347fc03f6cdf5b4e820ed1ef05f26942": "0xc3a15bdea9242368d2db15a46055a9bf88b551562eda6217f0a02f1d6a93f73b", "0xd1807b8e8fef23d2bd5acb7fe74e7dab661f1ef2f7aaaa66e286398a6d9e8011": "0xec56a79198c3d690cad3e6e39521bd7dd90dc8692cf50a7ab027408d139bd189", + "0xd2933152e78d2d8b4bc2fd47ec67df6c92de359d55ada6804e2071bbe3597d29": "0x8a132dcd9dd6726916af25a65e707d2d6e654b73df598b3b3edd92360b16d4e7", "0xe8242d2e1eae0d89d0ca278cea284cd4056496fb12fd0405237827e252efdfea": "0x65a71869dd1c30cc12ac786991b9492a5286c8cd942161d738ca34b3e0e29053", "0xf40b0b3a6c36f510d58633db604bcd978fe1e804891ce9792ac9bbb064cbe97a": "0x4fdd82a331ef80cde3af5905bd2b39c5b1d2f1da38e059fc7e077a355f4caa92" }, From 6687984a316abffc33e5c9a1e4edafd2e084d5e0 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 28 Jun 2024 11:15:47 +0400 Subject: [PATCH 49/82] Re-deployment of UniswapV2DTL on Mode Sepolia --- deployments/.mode-sepolia-1719558822.json | 3 +++ script/env.json | 2 +- script/salts/salts.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 deployments/.mode-sepolia-1719558822.json diff --git a/deployments/.mode-sepolia-1719558822.json b/deployments/.mode-sepolia-1719558822.json new file mode 100644 index 00000000..a656a37d --- /dev/null +++ b/deployments/.mode-sepolia-1719558822.json @@ -0,0 +1,3 @@ +{ +"axis.BatchUniswapV2DirectToLiquidity": "0xE60FD6203AF5D5d43433952a033Cb70Ba21784E9" +} diff --git a/script/env.json b/script/env.json index fb734c23..1f09721b 100644 --- a/script/env.json +++ b/script/env.json @@ -226,7 +226,7 @@ "BatchLinearVesting": "0x90608F57161aC771b28fb0adCd2434cfa1463201", "BatchMerkleAllowlist": "0x9837cA34C444cEbd07C699036D1D174C6392D9fa", "BatchTokenAllowlist": "0x988c61b36F7898e464a0Bf477d2dc06aC4E95F95", - "BatchUniswapV2DirectToLiquidity": "0xE60f928d399782836540752Eb3fCfE46b0Cb4E24", + "BatchUniswapV2DirectToLiquidity": "0xE60FD6203AF5D5d43433952a033Cb70Ba21784E9", "BatchUniswapV3DirectToLiquidity": "0xE6ce65C413a5Fc10Fa77B26032B33DCD68F8474a", "EncryptedMarginalPrice": "0x1A6Ba70B8e5957bCd03C20f9CF42D9e6D3d9b514", "FixedPriceBatch": "0x75DA61536510BA0bCa0C9Af21311A1Fc035DCf4e", diff --git a/script/salts/salts.json b/script/salts/salts.json index ade6cedd..4c4f54ec 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -99,7 +99,7 @@ "UniswapV2DirectToLiquidity": { "0x2952f587868594ee4aed1e483cdbb653d4ef61c9c662a737fc6ae8f271225fe1": "0x000174bce07575898f52c13859450718eea202638a7089ff3d358a023b48bbfb", "0x32dcc0983af67a522f275494ce3a9a2aa88e6402989414825c965c9ca5fba907": "0xf588d14ef594a9c7c4fa378cfdebcbec0356153259bfe8a58d168f4866f7f2fb", - "0x3da878eaa4aa411d061618a12b80bd1a2896d0c89cdfc57bf95f335ec4c95544": "0xa368baf207ddf8d6a2d6bff03af56f0b527211d2c717d8e0768080227a6f4ca8", + "0x3da878eaa4aa411d061618a12b80bd1a2896d0c89cdfc57bf95f335ec4c95544": "0xc281eab2cbc2fa51cc5bf3dde7cf9bef394d9db473c797d48a7da85e2c4bfb95", "0x49a44765f82e21a2455ecafadfd36f1dd7066ae8733dab3bf13fa33f271faabe": "0x036007589a41359e5858eddc394a9e4c2fe917360175a38d6139d77c8d8b0a89", "0x5e493cf7f7157b59101a569467e19f4a2618cb03f6414d4a8b4f1d2b4ac2912e": "0x43996039523bd2f955e18733dafabd2ab45c0e40865e93cca76dd2773c453d97", "0x60bc649627ebd535e11e848bd93dbbb4dc819e0279d20e1d3088983f65562dbf": "0xc4534d72b992c13813b52daa775c9dbe230eaf0b139a76fdc78baf72487148d0", From eaae37ea8c73a196d92d1cf2870b8761009e138f Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 2 Jul 2024 11:37:20 -0400 Subject: [PATCH 50/82] feat: add totalSupply value to ERC6909 derivatives --- src/interfaces/modules/IDerivative.sol | 15 ++++++-- src/lib/ERC6909Metadata.sol | 6 ++++ src/modules/derivatives/LinearVesting.sol | 35 ++++++++++++++++--- .../mocks/MockDerivativeModule.sol | 2 ++ 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/src/interfaces/modules/IDerivative.sol b/src/interfaces/modules/IDerivative.sol index a4ea48b7..c9a1c487 100644 --- a/src/interfaces/modules/IDerivative.sol +++ b/src/interfaces/modules/IDerivative.sol @@ -14,13 +14,15 @@ interface IDerivative { /// @notice Metadata for a derivative token /// /// @param exists True if the token has been deployed - /// @param wrapped True if an ERC20-wrapped derivative has been deployed + /// @param wrapped Non-zero if an ERC20-wrapped derivative has been deployed /// @param underlyingToken The address of the underlying token + /// @param supply The total supply of the derivative token /// @param data Implementation-specific data struct Token { bool exists; address wrapped; address underlyingToken; + uint256 supply; bytes data; } @@ -30,13 +32,20 @@ interface IDerivative { /// /// @param tokenId The ID of the derivative token /// @return exists True if the token has been deployed - /// @return wrapped True if an ERC20-wrapped derivative has been deployed + /// @return wrapped Non-zero if an ERC20-wrapped derivative has been deployed /// @return underlyingToken The address of the underlying token + /// @return supply The total supply of the derivative token /// @return data Implementation-specific data function tokenMetadata(uint256 tokenId) external view - returns (bool exists, address wrapped, address underlyingToken, bytes memory data); + returns ( + bool exists, + address wrapped, + address underlyingToken, + uint256 supply, + bytes memory data + ); // ========== DERIVATIVE MANAGEMENT ========== // diff --git a/src/lib/ERC6909Metadata.sol b/src/lib/ERC6909Metadata.sol index 5229e49e..3d83cd01 100644 --- a/src/lib/ERC6909Metadata.sol +++ b/src/lib/ERC6909Metadata.sol @@ -25,4 +25,10 @@ abstract contract ERC6909Metadata { /// @param tokenId_ The ID of the token /// @return string The URI of the token function tokenURI(uint256 tokenId_) public view virtual returns (string memory); + + /// @notice Returns the total supply of the token + /// + /// @param tokenId_ The ID of the token + /// @return uint256 The total supply of the token + function totalSupply(uint256 tokenId_) public view virtual returns (uint256); } diff --git a/src/modules/derivatives/LinearVesting.sol b/src/modules/derivatives/LinearVesting.sol index 95ecf244..065fd843 100644 --- a/src/modules/derivatives/LinearVesting.sol +++ b/src/modules/derivatives/LinearVesting.sol @@ -145,6 +145,11 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { _deployWrapIfNeeded(tokenId_, token_); } + // Increment the supply + unchecked { + token_.supply += amount_; + } + // Transfer collateral token to this contract { ERC20 baseToken = ERC20(token_.underlyingToken); @@ -266,10 +271,16 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { // Burn the unwrapped tokens if (derivativeToBurn > 0) { + unchecked { + tokenData.supply -= derivativeToBurn; + } _burn(user_, tokenId_, derivativeToBurn); } // Burn the wrapped tokens - will be 0 if not wrapped if (wrappedToBurn > 0) { + unchecked { + tokenData.supply -= wrappedToBurn; + } SoulboundCloneERC20(tokenData.wrapped).burn(user_, wrappedToBurn); } @@ -395,6 +406,8 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { if (balanceOf[msg.sender][tokenId_] < amount_) revert InsufficientBalance(); + // Supply does not change + // Burn the derivative token _burn(msg.sender, tokenId_, amount_); @@ -424,6 +437,8 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { if (wrappedToken.balanceOf(msg.sender) < amount_) revert InsufficientBalance(); + // Supply does not change + // Burn the wrapped derivative token wrappedToken.burn(msg.sender, amount_); @@ -705,22 +720,34 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { // Create token info for rendering token card Info memory info = Info({ tokenId: tokenId_, - baseAssetSymbol: _symbol, + baseToken: token.underlyingToken, + baseTokenSymbol: _symbol, start: data.start, - expiry: data.expiry + expiry: data.expiry, + supply: totalSupply(tokenId_) }); // Return the token URI // solhint-disable quotes return string.concat( + "data:application/json;utf8,", '{"name": "', name(tokenId_), - '", "description": "Linear Vesting ', + '", "description": "', _symbol, - '", "image": "data:image/svg+xml;utf8,', + ' Soulbound Linear Vesting Derivative Token. Powered by Axis.", "attributes": ', + _attributes(info), + ', "image": "data:image/svg+xml;utf8,', _render(info), '"}' ); // solhint-enable quotes } + + // ========== ERC6909 TOKEN SUPPLY EXTENSION ========== // + + /// @inheritdoc ERC6909Metadata + function totalSupply(uint256 tokenId_) public view override returns (uint256) { + return tokenMetadata[tokenId_].supply; + } } diff --git a/test/modules/derivatives/mocks/MockDerivativeModule.sol b/test/modules/derivatives/mocks/MockDerivativeModule.sol index 8f248112..96610554 100644 --- a/test/modules/derivatives/mocks/MockDerivativeModule.sol +++ b/test/modules/derivatives/mocks/MockDerivativeModule.sol @@ -211,4 +211,6 @@ contract MockDerivativeModule is DerivativeModule { function decimals(uint256 tokenId_) public view virtual override returns (uint8) {} function tokenURI(uint256 tokenId_) public view virtual override returns (string memory) {} + + function totalSupply(uint256 tokenId_) public view virtual override returns (uint256) {} } From a5d9f3ce5032d859be1b32b31d32b588ea8d5262 Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 2 Jul 2024 11:37:46 -0400 Subject: [PATCH 51/82] feat: update Linear Vesting tokenURI and cleanup SVG card --- src/modules/derivatives/LinearVestingCard.sol | 122 ++++++++---------- 1 file changed, 53 insertions(+), 69 deletions(-) diff --git a/src/modules/derivatives/LinearVestingCard.sol b/src/modules/derivatives/LinearVestingCard.sol index bc619e0f..8c4ceab9 100644 --- a/src/modules/derivatives/LinearVestingCard.sol +++ b/src/modules/derivatives/LinearVestingCard.sol @@ -3,8 +3,7 @@ pragma solidity 0.8.19; import {svg} from "src/lib/SVG.sol"; import {Timestamp} from "src/lib/Timestamp.sol"; -// import {LibString} from "lib/solady/src/utils/LibString.sol"; -import {Strings as LibString} from "lib/openzeppelin-contracts/contracts/utils/Strings.sol"; +import {Strings} from "lib/openzeppelin-contracts/contracts/utils/Strings.sol"; contract LinearVestingCard { // solhint-disable quotes @@ -13,9 +12,11 @@ contract LinearVestingCard { struct Info { uint256 tokenId; - string baseAssetSymbol; + address baseToken; + string baseTokenSymbol; uint48 start; uint48 expiry; + uint256 supply; } // ========== STATE VARIABLES ========== // @@ -36,7 +37,32 @@ contract LinearVestingCard { // ========== CONSTRUCTOR ========== // constructor() { - _addrString = LibString.toHexString(address(this)); + _addrString = Strings.toHexString(address(this)); + } + + // ========== ATTRIBUTES ========== // + + function _attributes(Info memory tokenInfo) internal view returns (string memory) { + return string.concat( + '[{"trait_type":"Token ID","value":"', + Strings.toString(tokenInfo.tokenId), + '"},', + '{"trait_type":"Base Token","value":"', + Strings.toHexString(tokenInfo.baseToken), + '"},', + '{"trait_type":"Base Token Symbol", "value":"', + tokenInfo.baseTokenSymbol, + '"},', + '{"trait_type":"Vesting Start","display_type":"date","value":"', + Strings.toString(tokenInfo.start), + '"},', + '{"trait_type":"Vesting End","display_type":"date","value":"', + Strings.toString(tokenInfo.expiry), + '"},', + '{"trait_type":"Total Supply","value":"', + Strings.toString(tokenInfo.supply), + '"}]' + ); } // ========== RENDERER ========== // @@ -60,7 +86,7 @@ contract LinearVestingCard { 'x="8" y="8" width="274" height="484" fill="none" stroke="url(#fullGradient)" stroke-width="2" rx="20" ry="20"', _NULL ), - _title(tokenInfo.baseAssetSymbol), + _title(tokenInfo.baseTokenSymbol), _progressBar(uint256(tokenInfo.start), uint256(tokenInfo.expiry)), _progressLabels(tokenInfo.start, tokenInfo.expiry), _logo(), @@ -99,7 +125,7 @@ contract LinearVestingCard { svg.text(string.concat('x="145" y="460" font-size="10" ', _TEXT_STYLE), _addrString), svg.text( string.concat('x="145" y="480" font-size="10" ', _TEXT_STYLE), - string.concat("ID: ", LibString.toString(tokenId)) + string.concat("ID: ", Strings.toString(tokenId)) ) ); } @@ -137,7 +163,7 @@ contract LinearVestingCard { } uint256 len = (168 * progress) / 100; - string memory current = LibString.toString(62 + len); + string memory current = Strings.toString(62 + len); string memory progressLine = svg.line( string.concat( @@ -179,9 +205,9 @@ contract LinearVestingCard { "animate", string.concat( 'attributeName="x" values="62;', - LibString.toString(62 + len - 16), + Strings.toString(62 + len - 16), ';" dur="', - LibString.toString(((5 * len) / 168) + 1), + Strings.toString(((5 * len) / 168) + 1), 's" repeatCount="indefinite"' ), _NULL @@ -200,33 +226,19 @@ contract LinearVestingCard { // ========== COLOR GRADIENTS ========== // - function _fullGradientStops() internal view returns (string memory) { + function _fullGradientStops() internal pure returns (string memory) { return string.concat( - '', - '', - '', - '', - '', - '', - '' + svg.gradientStop(2, _COLOR_BLUE, _NULL), + svg.gradientStop(10, _COLOR_LIGHT_BLUE, _NULL), + svg.gradientStop(32, _COLOR_GREEN, _NULL), + svg.gradientStop(49, _COLOR_YELLOW_GREEN, _NULL), + svg.gradientStop(52, _COLOR_YELLOW, _NULL), + svg.gradientStop(79, _COLOR_ORANGE, _NULL), + svg.gradientStop(100, _COLOR_RED, _NULL) ); } - function _fullGradientReverseStops() internal view returns (string memory) { + function _fullGradientReverseStops() internal pure returns (string memory) { return string.concat( svg.gradientStop(2, _COLOR_RED, _NULL), svg.gradientStop(21, _COLOR_ORANGE, _NULL), @@ -236,37 +248,14 @@ contract LinearVestingCard { svg.gradientStop(90, _COLOR_LIGHT_BLUE, _NULL), svg.gradientStop(100, _COLOR_BLUE, _NULL) ); - return string.concat( - '', - '', - '', - '', - '', - '', - '' - ); } - function _fullGradient() internal view returns (string memory) { + function _fullGradient() internal pure returns (string memory) { return svg.linearGradient(string.concat(svg.prop("id", "fullGradient")), _fullGradientStops()); } - function _fullGradient90() internal view returns (string memory) { + function _fullGradient90() internal pure returns (string memory) { return svg.linearGradient( string.concat( svg.prop("id", "fullGradient90"), svg.prop("gradientTransform", "rotate(90)") @@ -275,7 +264,7 @@ contract LinearVestingCard { ); } - function _fullGradientReverse90() internal view returns (string memory) { + function _fullGradientReverse90() internal pure returns (string memory) { return svg.linearGradient( string.concat( svg.prop("id", "fullGradientReverse90"), svg.prop("gradientTransform", "rotate(90)") @@ -284,21 +273,15 @@ contract LinearVestingCard { ); } - function _blueGreenGradient() internal view returns (string memory) { + function _blueGreenGradient() internal pure returns (string memory) { return svg.linearGradient( string.concat( svg.prop("id", "blueGreenGradient"), svg.prop("gradientUnits", "userSpaceOnUse") ), string.concat( - '', - '', - '' + svg.gradientStop(20, _COLOR_BLUE, _NULL), + svg.gradientStop(40, _COLOR_LIGHT_BLUE, _NULL), + svg.gradientStop(60, _COLOR_GREEN, _NULL) ) ); } @@ -325,7 +308,8 @@ contract LinearVestingCard { // // function example() external view returns (string memory) { // Info memory info = Info({ - // baseAssetSymbol: "XYZ", + // baseToken: address(0x1234567890123456789012345678901234567890), + // baseTokenSymbol: "XYZ", // tokenId: 123_456, // start: 1_717_200_000, // 2024-06-01 // expiry: 1_725_148_800 // 2024-09-01 From 5530eea796c809ac995d3dd899c48114620d5719 Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 2 Jul 2024 12:48:47 -0400 Subject: [PATCH 52/82] test: update salts --- script/salts/salts.json | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/script/salts/salts.json b/script/salts/salts.json index 9bda0fb8..aad592b5 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -46,38 +46,38 @@ "0xed4ba02077e70f78db70ce191509333d2dcccfff136d30dcb011f567305e88ad": "0x2b8bc588174d409692f1bd993942e3806c9a11344dbe674f46aed32a030aacf1" }, "Test_AllocatedMerkleAllowlist": { - "0x1242d528fb3d9259e7192f83e1faf95370bfd8d7f2b1bae5d3ea350d3d9c563c": "0x0ec2c9d910490e897c952a3210e5915006080f59a14a022b941a8c8cef2886e3", - "0x7cca57da19a5847b2b87641c1b721a32d4778e3e58641d6771cd14ed112b3bc3": "0xe0631d27a3d241774729d8c3ee1d9efae407f1073f89fa0956b2d308bd3adec4" + "0x0a2d065ef3d2d6c130ea0c8f842eeea7beb95ef48b1920ab9be64d206b8757a8": "0x50f8e9eef931694bd5a50e9a0dbc557c356065ab9dfc8558286cf2b063a4e1e8", + "0x32b5e4fb41e10ecda1ccda8d203d8f92bbcb65cad3f7ea8b93e837db2f835054": "0x92175bc2333113ae45429d8caec2316254d0e2b5b7889fb503211515d0302e42" }, "Test_CappedMerkleAllowlist": { - "0x240bdd876f7c0070009c234b8cde981c3865d49db15097f59cd4ffb15d818d1e": "0xe68b5bbeed8a53eb7e97b7bc84ec08e1e6a5b360cae16f0653c60eff312dec3f", - "0xb8a17b3ee693ebdcfc6913bb2f65d0fadbe8812d9ef4d927595a7dc75db68727": "0x956b71c3545015d12e8bbefbad72019b673860f32a5b4313eeb866425d97be17" + "0x02736cfd6208962bd7a9eb511d4f48d434361d9eb5bc6df1207efa739621c0a2": "0xf3f0551fb48dad53afcfd6afb2298b8d7f25a9c6462139731d3f7e4ee1b8987f", + "0x55286ad58fe67b1a4910bf2553ef8ecf5fc7322b56369bad4421ab15e9bd34f3": "0x9f5e5aa6dc0e500eca4093ca7163a82e7e4e388ad60818531041389c801e186b" }, "Test_MockCallback": { - "0x0825d99059fe0dc95e0b5cd7b853a5f3f50b58f25c5812fc7fd01d69ff4ec679": "0x222b47fd0259b3eacfbc04b9dddf5bb5ba060245c2c3c3673672ad4d815d01df", - "0x51526251ca3003df174c65f2fb581f61820ce57c14720e0d67480ed8c8b77925": "0xd25a3174b866cae4f78f513123ffebf33114f3df0093e06159010b3d9fbadff3", - "0x6206c9845f35f3006fc507c15aaaf4a719380265cf472773a270ffe6d5eb5299": "0xe9943f7c46c50e34e5f91da14d0ca6c58b5504172e156e19108bf2844fdaec63", - "0x6b7fa77ae82f95cc8c5fe53dca64702ea0dc8e3dad74749dc8cd77de2884e704": "0x600196a40f70c0b91ab3ace5873750bc77d14dddf6b1093b03def43f31ddb4c3", - "0x7310243dabd76344326f3659aabda0b846a9c8e9e7d50b990261c14f2b44d560": "0x86d15e2125c36574017c86d4fcd04bb470225e835b76e3cbe63c5908da46ab8c", - "0x7602309c05771de8281f2f3f08e74ec9f19f1bfdaac8cd970d9f7a8d62173b6e": "0xd28f39fd2d2e1a378b0fe177abc5ac22a4642634847865a096a5e96bd04c6411", - "0x892e1120a976151ae5375dca978040abe705c8cbdd3c7b64b41ff1087ee01c22": "0x748af80730f660a2400a4d6f8f4f41d21cca1cc117fc2f1c51e131e16fa43ce3", - "0x8a69dcb863773a3bb971a969233286e75cba80abf6ec8d881cada7ea0ad674b0": "0xd7bacad37fd5e507c6bc424ed88ae37e8d4935b54d7e41cf1306d46c37eaebb4", - "0x8d8681a539f3b359e94a05239187dc55cb9cb2dcfe01726d3053573206efe25f": "0x6f209918e9619b620b306b2014e6aabe3688c4a4043117b6835ab17bd70bf004", - "0x918d87a20c837fa93ce3089d2cb6386b66f79bbfd0f09bd6784bc52108b69938": "0x64473a26214c7b928ff6c08104e3b18ae36918097eefb554aa17c2b9347fd7f2", - "0x9569f58e5e127ceb73049eea8119bb21f8c4328d3b4770da5a67075be3f77c12": "0x2123580432d5ece19c5e099d5156a9598f2c49fdcbcc1029f7d21276ccab2ba3", - "0x96f0481f00eeec717fa8c0d41efd04b6e3fdccbebbaa223ee2118449ebea2406": "0x6bc41d5bab2740be84e43b053ed3b46acb6f3ac1cb9031fb3203edd92a833a07", - "0x9c35a3189126603f4b187149f54e09082403dac10b3e899a503e28e897edd6f9": "0xa35f7a6870564c7a14d71310c87a6816c3ef4f80eb0a5ac43d56235e075ae162", - "0x9db4bc605469ede684fbaa475d320b3fbe6a707deaa953ee1ba29ecb3c1125fb": "0x67f66566dfb091aeeb776b692eba5f570f5a310cf25e94f0e06120cf64737a9d", - "0xb8e0b3cbd7273e83cfdbcb8269e5c3510a28892e815fe28bc0f515be0df2c8f9": "0x17f7fbab547a6a69119fee8820b0ff11a8da7a1f9902a19d8f3917a6c8aff2da", - "0xc38bb4813ebdb9978d2485ae5ad92e1152f8a955430a63210b69b2277eed9477": "0x9bf9b60e2afb2faf561385c61d5c3f5b6b910c97bdd3bb4af59d193140215a31", - "0xd75e639b43b1d29e1703abcd2616b6b67f3ae232d53915d472f3a5b6aae6083c": "0xa45904df2431729c77de44b4b88e032130e12dcbc735f0f72a29af686e15f3ed", - "0xf2644573f57aea10dffac6e7215b409fa19236ae57b735b20b9fac9834391850": "0x3a824c912eb7f08b82a8d936c2e29cb2b6fdde7e33ea9af18d9ccbde9c454161" + "0x0825d99059fe0dc95e0b5cd7b853a5f3f50b58f25c5812fc7fd01d69ff4ec679": "0x7115985c85966c2ae92532a236ed7a60433d064530db48acfaaffefac7d2ba80", + "0x51526251ca3003df174c65f2fb581f61820ce57c14720e0d67480ed8c8b77925": "0xc069eb6d2e6e633369b7ae57a983bfab95859aec80f035423bcc0d37adc6ba6a", + "0x6206c9845f35f3006fc507c15aaaf4a719380265cf472773a270ffe6d5eb5299": "0x9a9d1e9fed3ed0572252fde51fcbc1fd2f97c2dbfc929d18d19d11d10306592a", + "0x6b7fa77ae82f95cc8c5fe53dca64702ea0dc8e3dad74749dc8cd77de2884e704": "0x397784e4562938597f74b1bf92a4ce0bfe5e7d592831800acb128eff47c5f541", + "0x7310243dabd76344326f3659aabda0b846a9c8e9e7d50b990261c14f2b44d560": "0xfba43024a022f9f29d2d2cf5e9194fff93bb68bb51655e64adfee89b84478bea", + "0x7602309c05771de8281f2f3f08e74ec9f19f1bfdaac8cd970d9f7a8d62173b6e": "0x3512d8b5de4b4a0075aed4993bb8b05e3127d98b00ee39fc602a74cf46cbd24f", + "0x892e1120a976151ae5375dca978040abe705c8cbdd3c7b64b41ff1087ee01c22": "0x4bae71c56041d0a73ff376a4a0eea031b54e119e8bf27c36f0383ed2e06affdf", + "0x8a69dcb863773a3bb971a969233286e75cba80abf6ec8d881cada7ea0ad674b0": "0x2610c04393571051ca99aa7e2c62a250466afc6bae8cb3c38ba8a9ea510b6eda", + "0x8d8681a539f3b359e94a05239187dc55cb9cb2dcfe01726d3053573206efe25f": "0x4ec2b03e03ebb3a734ea2172c2c5290c7b569a608342b3b72c2ecdbc6d1bb988", + "0x918d87a20c837fa93ce3089d2cb6386b66f79bbfd0f09bd6784bc52108b69938": "0x4848299ce5b2013b7e0f4ef1835ba4c76fa0152a99128fb4646bf7c3c83b75b7", + "0x9569f58e5e127ceb73049eea8119bb21f8c4328d3b4770da5a67075be3f77c12": "0x42f97fa48dc74283718a0cccc71d31e0932774bfabf4df8d23ece009d7d8bec6", + "0x96f0481f00eeec717fa8c0d41efd04b6e3fdccbebbaa223ee2118449ebea2406": "0x99332fe68ecdf6f6f494eaf54809345648a4d5f9cc907c0e70afdc637432605b", + "0x9c35a3189126603f4b187149f54e09082403dac10b3e899a503e28e897edd6f9": "0x667f256c8ea16b1f4d72d0309a5ee0094e7ec70d68171a3e6105232912c81493", + "0x9db4bc605469ede684fbaa475d320b3fbe6a707deaa953ee1ba29ecb3c1125fb": "0x545d3b883f77604920ed2bbbb67eb6dc98b0ad5d071810eb29336e8fcdc00abc", + "0xb8e0b3cbd7273e83cfdbcb8269e5c3510a28892e815fe28bc0f515be0df2c8f9": "0xbc128fcdfd4757dec6b354cf4d575c3d601562ea7876d6d02adb3038aaef88ff", + "0xc38bb4813ebdb9978d2485ae5ad92e1152f8a955430a63210b69b2277eed9477": "0xdf66fb1b6890b40da5876bc75b0dfb8d5ae91874572df1e46426daed8a40994b", + "0xd75e639b43b1d29e1703abcd2616b6b67f3ae232d53915d472f3a5b6aae6083c": "0x8d0525de5eac7507bb8991adfcfb32efacd77c045266d279a897835e544c702d", + "0xf2644573f57aea10dffac6e7215b409fa19236ae57b735b20b9fac9834391850": "0x35782b6fe6a665598cdd56db1429e4308233b4e8bf375f9445051e18a2cc77e3" }, "Test_UniswapV2DirectToLiquidity": { - "0x174201fc5371e6b5c38ac3e8a150aac595a79929c11ade671773a4af96e796b2": "0xf79f6bfb74c7ea1422de906b5c897cbc4e8e282d391348930a7f75feaa4fc6ce" + "0x6ecef7dad12b92990582b5e7be05c63ac5dd43b74df7e3620cde236d8837442e": "0xc505cbfb2803d1270b897322573cb8b40eea99ed615a365b126e21abd58b3dfb" }, "Test_UniswapV3DirectToLiquidity": { - "0xbbc3774034dce84cb792ad50a090b7c2b736a85af6e59e595e55e4f369523495": "0x2cb699095381555944575ef169da11fe4a944e6c6c382910eefd1a06c32b2c33" + "0x2df6b36ca1e324c0e17ca294f028a7f93d25171e29df7c6cc0db7caeab04d747": "0xb2afbd203a98f50f6ea6d39ce67c89b835b36283b425c5ce45b5c389b0a851de" }, "TokenAllowlist": { "0x09db47d395a68db033a3b222b9d1a212cec8422b03aeafc313aa4d2813c6dd60": "0xe07a005213f35e1f050a4da040d6bc3cae2ad333647b51a6ffa2e7941980043a", From f0df1c4de81a639d93f26013a69e3ca8efc735b1 Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 2 Jul 2024 13:54:49 -0400 Subject: [PATCH 53/82] fix: only track ERC6909 supply on derivative contract --- src/modules/Derivative.sol | 7 ++++ src/modules/derivatives/LinearVesting.sol | 32 ++++++++----------- src/modules/derivatives/LinearVestingCard.sol | 2 +- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/modules/Derivative.sol b/src/modules/Derivative.sol index 6aa0bf7f..702185ba 100644 --- a/src/modules/Derivative.sol +++ b/src/modules/Derivative.sol @@ -21,4 +21,11 @@ abstract contract DerivativeModule is IDerivative, ERC6909, ERC6909Metadata, Mod function getTokenMetadata(uint256 tokenId) external view virtual returns (Token memory) { return tokenMetadata[tokenId]; } + + // ========== ERC6909 TOKEN SUPPLY EXTENSION ========== // + + /// @inheritdoc ERC6909Metadata + function totalSupply(uint256 tokenId) public view virtual override returns (uint256) { + return tokenMetadata[tokenId].supply; + } } diff --git a/src/modules/derivatives/LinearVesting.sol b/src/modules/derivatives/LinearVesting.sol index 065fd843..f0685eeb 100644 --- a/src/modules/derivatives/LinearVesting.sol +++ b/src/modules/derivatives/LinearVesting.sol @@ -145,11 +145,6 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { _deployWrapIfNeeded(tokenId_, token_); } - // Increment the supply - unchecked { - token_.supply += amount_; - } - // Transfer collateral token to this contract { ERC20 baseToken = ERC20(token_.underlyingToken); @@ -169,7 +164,12 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { SoulboundCloneERC20 wrappedToken = SoulboundCloneERC20(token_.wrapped); wrappedToken.mint(to_, amount_); } else { - // Otherwise mint the normal derivative token + // Increment the supply + unchecked { + token_.supply += amount_; + } + + // Mint the normal derivative token _mint(to_, tokenId_, amount_); } } @@ -278,9 +278,6 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { } // Burn the wrapped tokens - will be 0 if not wrapped if (wrappedToBurn > 0) { - unchecked { - tokenData.supply -= wrappedToBurn; - } SoulboundCloneERC20(tokenData.wrapped).burn(user_, wrappedToBurn); } @@ -406,7 +403,10 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { if (balanceOf[msg.sender][tokenId_] < amount_) revert InsufficientBalance(); - // Supply does not change + // Decrement supply on this contract, since it's tracked on the ERC20 + unchecked { + tokenMetadata[tokenId_].supply -= amount_; + } // Burn the derivative token _burn(msg.sender, tokenId_, amount_); @@ -437,7 +437,10 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { if (wrappedToken.balanceOf(msg.sender) < amount_) revert InsufficientBalance(); - // Supply does not change + // Increment supply on this contract + unchecked { + token.supply += amount_; + } // Burn the wrapped derivative token wrappedToken.burn(msg.sender, amount_); @@ -743,11 +746,4 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { ); // solhint-enable quotes } - - // ========== ERC6909 TOKEN SUPPLY EXTENSION ========== // - - /// @inheritdoc ERC6909Metadata - function totalSupply(uint256 tokenId_) public view override returns (uint256) { - return tokenMetadata[tokenId_].supply; - } } diff --git a/src/modules/derivatives/LinearVestingCard.sol b/src/modules/derivatives/LinearVestingCard.sol index 8c4ceab9..388fb61a 100644 --- a/src/modules/derivatives/LinearVestingCard.sol +++ b/src/modules/derivatives/LinearVestingCard.sol @@ -42,7 +42,7 @@ contract LinearVestingCard { // ========== ATTRIBUTES ========== // - function _attributes(Info memory tokenInfo) internal view returns (string memory) { + function _attributes(Info memory tokenInfo) internal pure returns (string memory) { return string.concat( '[{"trait_type":"Token ID","value":"', Strings.toString(tokenInfo.tokenId), From 6d0edfba37704bde5becdf27ad9bfc3f0b94379e Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 2 Jul 2024 13:55:02 -0400 Subject: [PATCH 54/82] test: linear vesting supply checks --- test/modules/derivatives/LinearVesting.t.sol | 50 +++++++++++++++++++ .../mocks/MockDerivativeModule.sol | 2 + 2 files changed, 52 insertions(+) diff --git a/test/modules/derivatives/LinearVesting.t.sol b/test/modules/derivatives/LinearVesting.t.sol index 7fcbbbc1..959e8d71 100644 --- a/test/modules/derivatives/LinearVesting.t.sol +++ b/test/modules/derivatives/LinearVesting.t.sol @@ -841,6 +841,7 @@ contract LinearVestingTest is Test, Permit2User { assertTrue(wrappedAddress == address(0), "wrappedAddress mismatch"); assertEq(amountCreated, _AMOUNT, "amountCreated mismatch"); assertEq(_linearVesting.balanceOf(_ALICE, tokenId), _AMOUNT, "balanceOf mismatch"); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT, "totalSupply mismatch"); } function test_mint_params_expiryTimestampIsBeforeCurrentTimestamp() @@ -859,6 +860,7 @@ contract LinearVestingTest is Test, Permit2User { assertTrue(wrappedAddress == address(0), "wrappedAddress mismatch"); assertEq(amountCreated, _AMOUNT, "amountCreated mismatch"); assertEq(_linearVesting.balanceOf(_ALICE, tokenId), _AMOUNT, "balanceOf mismatch"); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT, "totalSupply mismatch"); } function test_mint_params_afterExpiry() @@ -880,6 +882,7 @@ contract LinearVestingTest is Test, Permit2User { assertEq(_linearVesting.balanceOf(_ALICE, tokenId), _AMOUNT, "balanceOf mismatch"); assertEq(_underlyingToken.balanceOf(_ALICE), 0, "underlying: balanceOf mismatch"); assertEq(_linearVesting.redeemable(_ALICE, tokenId), _AMOUNT, "redeemable mismatch"); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT, "totalSupply mismatch"); } function test_mint_params_mintAmountIsZero_reverts() public { @@ -905,6 +908,7 @@ contract LinearVestingTest is Test, Permit2User { // Check values assertTrue(tokenId > 0, "tokenId mismatch"); assertEq(_linearVesting.balanceOf(address(0), tokenId), _AMOUNT, "balanceOf mismatch"); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT, "totalSupply mismatch"); } function test_mint_params_insufficentBalance_reverts() public { @@ -953,6 +957,7 @@ contract LinearVestingTest is Test, Permit2User { ); assertEq(_underlyingToken.balanceOf(_ALICE), 0, "underlying: balanceOf mismatch"); assertEq(_linearVesting.redeemable(_ALICE, tokenId), 0, "redeemable mismatch"); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT, "totalSupply mismatch"); } function test_mint_params_afterVestingStart(uint48 elapsed_) @@ -984,6 +989,7 @@ contract LinearVestingTest is Test, Permit2User { expectedRedeemableAmount, "redeemable mismatch" ); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT, "totalSupply mismatch"); } function test_mint_params_givenExistingDerivativeTokens_afterVestingStart(uint48 elapsed_) @@ -1028,6 +1034,7 @@ contract LinearVestingTest is Test, Permit2User { expectedRedeemableAmount, "redeemable mismatch" ); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT + _AMOUNT_TWO, "totalSupply mismatch"); } function test_mint_params_notWrapped_tokenNotDeployed() @@ -1045,6 +1052,7 @@ contract LinearVestingTest is Test, Permit2User { assertTrue(wrappedAddress == address(0), "wrappedAddress mismatch"); assertEq(amountCreated, _AMOUNT, "amountCreated mismatch"); assertEq(_linearVesting.balanceOf(_ALICE, tokenId), _AMOUNT, "balanceOf mismatch"); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT, "totalSupply mismatch"); } function test_mint_params_notWrapped_tokenDeployed() @@ -1063,6 +1071,7 @@ contract LinearVestingTest is Test, Permit2User { assertTrue(wrappedAddress == address(0), "wrappedAddress mismatch"); assertEq(amountCreated, _AMOUNT, "amountCreated mismatch"); assertEq(_linearVesting.balanceOf(_ALICE, tokenId), _AMOUNT, "balanceOf mismatch"); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT, "totalSupply mismatch"); } function test_mint_params_wrapped_wrappedTokenIsNotDeployed() @@ -1083,6 +1092,8 @@ contract LinearVestingTest is Test, Permit2User { assertEq( SoulboundCloneERC20(wrappedAddress).balanceOf(_ALICE), _AMOUNT, "balanceOf mismatch" ); + assertEq(_linearVesting.totalSupply(tokenId), 0, "totalSupply mismatch"); + assertEq(SoulboundCloneERC20(wrappedAddress).totalSupply(), _AMOUNT, "balanceOf mismatch"); } function test_mint_params_wrapped_wrappedTokenIsDeployed() @@ -1103,6 +1114,8 @@ contract LinearVestingTest is Test, Permit2User { assertEq( SoulboundCloneERC20(wrappedAddress).balanceOf(_ALICE), _AMOUNT, "balanceOf mismatch" ); + assertEq(_linearVesting.totalSupply(tokenId), 0, "totalSupply mismatch"); + assertEq(SoulboundCloneERC20(wrappedAddress).totalSupply(), _AMOUNT, "balanceOf mismatch"); } function test_mint_params_notParent() @@ -1123,6 +1136,8 @@ contract LinearVestingTest is Test, Permit2User { assertEq( SoulboundCloneERC20(wrappedAddress).balanceOf(_ALICE), _AMOUNT, "balanceOf mismatch" ); + assertEq(_linearVesting.totalSupply(tokenId), 0, "totalSupply mismatch"); + assertEq(SoulboundCloneERC20(wrappedAddress).totalSupply(), _AMOUNT, "balanceOf mismatch"); } function test_mint_params_notParent_insufficientBalance_reverts() @@ -1196,6 +1211,7 @@ contract LinearVestingTest is Test, Permit2User { // Check values assertEq(_linearVesting.balanceOf(address(0), tokenId), _AMOUNT); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT, "totalSupply mismatch"); } function test_mint_tokenId_insufficentBalance_reverts() public givenDerivativeIsDeployed { @@ -1244,6 +1260,7 @@ contract LinearVestingTest is Test, Permit2User { ); assertEq(_underlyingToken.balanceOf(_ALICE), 0, "underlying: balanceOf mismatch"); assertEq(_linearVesting.redeemable(_ALICE, tokenId), 0, "redeemable mismatch"); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT, "totalSupply mismatch"); } function test_mint_tokenId_afterVestingStart(uint48 elapsed_) @@ -1275,6 +1292,7 @@ contract LinearVestingTest is Test, Permit2User { expectedRedeemableAmount, "redeemable mismatch" ); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT, "totalSupply mismatch"); } function test_mint_tokenId_afterVestingExpiry() @@ -1297,6 +1315,7 @@ contract LinearVestingTest is Test, Permit2User { ); assertEq(_underlyingToken.balanceOf(_ALICE), 0, "underlying: balanceOf mismatch"); assertEq(_linearVesting.redeemable(_ALICE, tokenId), _AMOUNT, "redeemable mismatch"); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT, "totalSupply mismatch"); } function test_mint_tokenId_givenExistingDerivativeTokens_afterVestingStart(uint48 elapsed_) @@ -1340,6 +1359,7 @@ contract LinearVestingTest is Test, Permit2User { expectedRedeemableAmount, "redeemable mismatch" ); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT + _AMOUNT_TWO, "totalSupply mismatch"); } function test_mint_tokenId_givenExistingDerivativeTokens_afterVestingExpiry() @@ -1377,6 +1397,7 @@ contract LinearVestingTest is Test, Permit2User { assertEq( _linearVesting.redeemable(_ALICE, tokenId), _AMOUNT + _AMOUNT_TWO, "redeemable mismatch" ); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT + _AMOUNT_TWO, "totalSupply mismatch"); } function test_mint_tokenId_notWrapped() @@ -1394,6 +1415,7 @@ contract LinearVestingTest is Test, Permit2User { assertTrue(wrappedAddress == address(0)); assertEq(amountCreated, _AMOUNT); assertEq(_linearVesting.balanceOf(_ALICE, tokenId), _AMOUNT, "balanceOf mismatch"); + assertEq(_linearVesting.totalSupply(tokenId), _AMOUNT, "totalSupply mismatch"); } function test_mint_tokenId_wrapped_wrappedTokenIsNotDeployed() @@ -1414,6 +1436,8 @@ contract LinearVestingTest is Test, Permit2User { assertEq( SoulboundCloneERC20(wrappedAddress).balanceOf(_ALICE), _AMOUNT, "balanceOf mismatch" ); + assertEq(_linearVesting.totalSupply(tokenId), 0, "totalSupply mismatch"); + assertEq(SoulboundCloneERC20(wrappedAddress).totalSupply(), _AMOUNT, "balanceOf mismatch"); } function test_mint_tokenId_wrapped_wrappedTokenIsDeployed() @@ -1434,6 +1458,8 @@ contract LinearVestingTest is Test, Permit2User { assertEq( SoulboundCloneERC20(wrappedAddress).balanceOf(_ALICE), _AMOUNT, "balanceOf mismatch" ); + assertEq(_linearVesting.totalSupply(tokenId), 0, "totalSupply mismatch"); + assertEq(SoulboundCloneERC20(wrappedAddress).totalSupply(), _AMOUNT, "balanceOf mismatch"); } function test_mint_tokenId_notParent() @@ -1454,6 +1480,8 @@ contract LinearVestingTest is Test, Permit2User { assertEq( SoulboundCloneERC20(wrappedAddress).balanceOf(_ALICE), _AMOUNT, "balanceOf mismatch" ); + assertEq(_linearVesting.totalSupply(tokenId), 0, "totalSupply mismatch"); + assertEq(SoulboundCloneERC20(wrappedAddress).totalSupply(), _AMOUNT, "balanceOf mismatch"); } // redeem @@ -1538,6 +1566,7 @@ contract LinearVestingTest is Test, Permit2User { // Check values assertEq(_linearVesting.balanceOf(_ALICE, _derivativeTokenId), _AMOUNT - amount); assertEq(SoulboundCloneERC20(_underlyingTokenAddress).balanceOf(_ALICE), amount); + assertEq(_linearVesting.totalSupply(_derivativeTokenId), _AMOUNT - amount); } function test_redeem_givenWrappedBalance(uint256 amount_) @@ -1556,6 +1585,8 @@ contract LinearVestingTest is Test, Permit2User { assertEq(_linearVesting.balanceOf(_ALICE, _derivativeTokenId), 0); assertEq(SoulboundCloneERC20(_derivativeWrappedAddress).balanceOf(_ALICE), _AMOUNT - amount); assertEq(SoulboundCloneERC20(_underlyingTokenAddress).balanceOf(_ALICE), amount); + assertEq(_linearVesting.totalSupply(_derivativeTokenId), 0); + assertEq(SoulboundCloneERC20(_derivativeWrappedAddress).totalSupply(), _AMOUNT - amount); } function test_redeem_givenUnwrappedBalance(uint256 amount_) @@ -1574,6 +1605,8 @@ contract LinearVestingTest is Test, Permit2User { assertEq(_linearVesting.balanceOf(_ALICE, _derivativeTokenId), _AMOUNT - amount); assertEq(SoulboundCloneERC20(_derivativeWrappedAddress).balanceOf(_ALICE), 0); assertEq(SoulboundCloneERC20(_underlyingTokenAddress).balanceOf(_ALICE), amount); + assertEq(_linearVesting.totalSupply(_derivativeTokenId), _AMOUNT - amount); + assertEq(SoulboundCloneERC20(_derivativeWrappedAddress).totalSupply(), 0); } function test_redeem_givenMixedBalance() @@ -1593,6 +1626,8 @@ contract LinearVestingTest is Test, Permit2User { assertEq(_linearVesting.balanceOf(_ALICE, _derivativeTokenId), 0); // Redeems unwrapped first assertEq(SoulboundCloneERC20(_derivativeWrappedAddress).balanceOf(_ALICE), _AMOUNT - 1); assertEq(SoulboundCloneERC20(_underlyingTokenAddress).balanceOf(_ALICE), amountToRedeem); + assertEq(_linearVesting.totalSupply(_derivativeTokenId), 0); + assertEq(SoulboundCloneERC20(_derivativeWrappedAddress).totalSupply(), _AMOUNT - 1); } // redeem max @@ -1643,6 +1678,7 @@ contract LinearVestingTest is Test, Permit2User { // Check values assertEq(_linearVesting.balanceOf(_ALICE, _derivativeTokenId), 0); assertEq(SoulboundCloneERC20(_underlyingTokenAddress).balanceOf(_ALICE), _AMOUNT); + assertEq(_linearVesting.totalSupply(_derivativeTokenId), 0); } function test_redeemMax_givenWrappedBalance_givenVestingExpiry() @@ -1659,6 +1695,8 @@ contract LinearVestingTest is Test, Permit2User { assertEq(_linearVesting.balanceOf(_ALICE, _derivativeTokenId), 0); assertEq(SoulboundCloneERC20(_derivativeWrappedAddress).balanceOf(_ALICE), 0); assertEq(SoulboundCloneERC20(_underlyingTokenAddress).balanceOf(_ALICE), _AMOUNT); + assertEq(_linearVesting.totalSupply(_derivativeTokenId), 0); + assertEq(SoulboundCloneERC20(_derivativeWrappedAddress).totalSupply(), 0); } function test_redeemMax_givenUnwrappedBalance_givenVestingExpiry() @@ -1675,6 +1713,8 @@ contract LinearVestingTest is Test, Permit2User { assertEq(_linearVesting.balanceOf(_ALICE, _derivativeTokenId), 0); assertEq(SoulboundCloneERC20(_derivativeWrappedAddress).balanceOf(_ALICE), 0); assertEq(SoulboundCloneERC20(_underlyingTokenAddress).balanceOf(_ALICE), _AMOUNT); + assertEq(_linearVesting.totalSupply(_derivativeTokenId), 0); + assertEq(SoulboundCloneERC20(_derivativeWrappedAddress).totalSupply(), 0); } function test_redeemMax(uint48 elapsed_) public givenWrappedDerivativeIsDeployed { @@ -1717,6 +1757,16 @@ contract LinearVestingTest is Test, Permit2User { redeemable, "underlying token: balanceOf mismatch" ); + assertEq( + _linearVesting.totalSupply(_derivativeTokenId), + expectedBalanceUnwrapped, + "derivative token: totalSupply mismatch" + ); + assertEq( + SoulboundCloneERC20(_derivativeWrappedAddress).totalSupply(), + expectedBalanceWrapped, + "wrapped derivative token: totalSupply mismatch" + ); } // redeemable diff --git a/test/modules/derivatives/mocks/MockDerivativeModule.sol b/test/modules/derivatives/mocks/MockDerivativeModule.sol index 96610554..dfb1922f 100644 --- a/test/modules/derivatives/mocks/MockDerivativeModule.sol +++ b/test/modules/derivatives/mocks/MockDerivativeModule.sol @@ -93,6 +93,8 @@ contract MockDerivativeModule is DerivativeModule { } // Otherwise mint as normal else { + // Increment the supply + tokenMetadata[tokenId].supply += amount_; derivativeToken.mint(to_, tokenId, outputAmount); } From 906c436aebedb535902c2820dc2461e6fef0ef6f Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 2 Jul 2024 16:34:15 -0400 Subject: [PATCH 55/82] fix: revert when referrer fee greater than max --- src/bases/AuctionHouse.sol | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bases/AuctionHouse.sol b/src/bases/AuctionHouse.sol index fbf71381..54980e57 100644 --- a/src/bases/AuctionHouse.sol +++ b/src/bases/AuctionHouse.sol @@ -145,10 +145,11 @@ abstract contract AuctionHouse is IAuctionHouse, WithModules, ReentrancyGuard, F lotFee.curatorFee = curatorFee > maxCuratorFee ? maxCuratorFee : curatorFee; // Check that the referrer fee does not exceed the max. - // If it does, set the fee to the max. - lotFee.referrerFee = routing_.referrerFee > auctionFees.maxReferrerFee - ? auctionFees.maxReferrerFee - : routing_.referrerFee; + // If it does, revert. We revert here since the value is provided by the submitter + // and can be changed whereas the curator fee above is set by someone else. + // Otherwise, set the value. + if (routing_.referrerFee > auctionFees.maxReferrerFee) revert InvalidParams(); + lotFee.referrerFee = routing_.referrerFee; // Snapshot the protocol fee lotFee.protocolFee = auctionFees.protocol; From 8b17274354591c0906c04605265e0eac81aa0c0e Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 2 Jul 2024 16:36:57 -0400 Subject: [PATCH 56/82] fix: change all percentages to basis points (hundredths of a percent) --- .../FixedPriceBatch-BaseDTL/TestData.s.sol | 6 +++--- .../ops/test/FixedPriceBatch/TestData.s.sol | 2 +- script/ops/test/TestData.s.sol | 2 +- src/bases/Catalogue.sol | 4 ++-- src/bases/FeeManager.sol | 4 ++-- src/callbacks/liquidity/BaseDTL.sol | 20 +++++++++---------- src/callbacks/liquidity/UniswapV2DTL.sol | 2 +- src/callbacks/liquidity/UniswapV3DTL.sol | 2 +- src/interfaces/IAuctionHouse.sol | 2 +- src/interfaces/IFeeManager.sol | 2 +- .../auctions/IEncryptedMarginalPrice.sol | 2 +- .../modules/auctions/IFixedPriceBatch.sol | 2 +- .../modules/auctions/IFixedPriceSale.sol | 2 +- src/modules/Auction.sol | 6 +++--- src/modules/auctions/atomic/FPS.sol | 2 +- src/modules/auctions/batch/FPB.sol | 2 +- 16 files changed, 31 insertions(+), 31 deletions(-) diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol index 19aff81d..d1279a43 100644 --- a/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol +++ b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol @@ -61,7 +61,7 @@ contract TestData is Script, WithEnvironment { routingParams.callbackData = abi.encode( BaseDirectToLiquidity.OnCreateParams({ - proceedsUtilisationPercent: 50_000, // 50% + proceedsUtilisationPercent: 50_00, // 50% vestingStart: 0, vestingExpiry: 0, recipient: msg.sender, @@ -80,7 +80,7 @@ contract TestData is Script, WithEnvironment { IFixedPriceBatch.AuctionDataParams memory auctionDataParams; auctionDataParams.price = 2e18; // 2 quote tokens per base token - auctionDataParams.minFillPercent = uint24(10_000); // 10% + auctionDataParams.minFillPercent = uint24(10_00); // 10% bytes memory implParams = abi.encode(auctionDataParams); uint48 duration = 86_400; // 1 day @@ -152,7 +152,7 @@ contract TestData is Script, WithEnvironment { console2.log("Timestamp is", block.timestamp); bytes memory callbackData = - abi.encode(UniswapV2DirectToLiquidity.OnSettleParams({maxSlippage: 500})); // 0.5% + abi.encode(UniswapV2DirectToLiquidity.OnSettleParams({maxSlippage: 50})); // 0.5% 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 0aa3a5d8..abd57ddb 100644 --- a/script/ops/test/FixedPriceBatch/TestData.s.sol +++ b/script/ops/test/FixedPriceBatch/TestData.s.sol @@ -68,7 +68,7 @@ contract TestData is Script, WithEnvironment { IFixedPriceBatch.AuctionDataParams memory auctionDataParams; auctionDataParams.price = 1e18; // 1 quote tokens per base token - auctionDataParams.minFillPercent = uint24(10_000); // 10% + auctionDataParams.minFillPercent = uint24(10_00); // 10% bytes memory implParams = abi.encode(auctionDataParams); uint48 duration = 86_400; // 1 day diff --git a/script/ops/test/TestData.s.sol b/script/ops/test/TestData.s.sol index 72442c0c..7e3da732 100644 --- a/script/ops/test/TestData.s.sol +++ b/script/ops/test/TestData.s.sol @@ -68,7 +68,7 @@ contract TestData is Script { EncryptedMarginalPrice.AuctionDataParams memory auctionDataParams; auctionDataParams.minPrice = 2e18; // 2 quote tokens per base token - auctionDataParams.minFillPercent = uint24(10_000); // 10% + auctionDataParams.minFillPercent = uint24(10_00); // 10% auctionDataParams.minBidSize = 2e17; // 0.2 quote tokens auctionDataParams.publicKey = publicKey; bytes memory implParams = abi.encode(auctionDataParams); diff --git a/src/bases/Catalogue.sol b/src/bases/Catalogue.sol index 4fc4006f..1c9418de 100644 --- a/src/bases/Catalogue.sol +++ b/src/bases/Catalogue.sol @@ -19,8 +19,8 @@ abstract contract Catalogue is ICatalogue { /// @inheritdoc ICatalogue address public auctionHouse; - /// @notice Fees are in basis points (3 decimals). 1% equals 1000. - uint48 internal constant _FEE_DECIMALS = 1e5; + /// @notice Fees are in basis points (hundredths of a percent). 1% equals 100. + uint48 internal constant _FEE_DECIMALS = 100e2; // ========== CONSTRUCTOR ========== // diff --git a/src/bases/FeeManager.sol b/src/bases/FeeManager.sol index ab30b028..90fb8d5f 100644 --- a/src/bases/FeeManager.sol +++ b/src/bases/FeeManager.sol @@ -19,8 +19,8 @@ import {Keycode} from "src/modules/Keycode.sol"; abstract contract FeeManager is IFeeManager, ReentrancyGuard { // ========== STATE VARIABLES ========== // - /// @notice Fees are in basis points (3 decimals). 1% equals 1000. - uint48 internal constant _FEE_DECIMALS = 1e5; + /// @notice Fees are in basis points (hundredths of a percent). 1% equals 100. + uint48 internal constant _FEE_DECIMALS = 100e2; /// @notice Address the protocol receives fees at address internal _protocol; diff --git a/src/callbacks/liquidity/BaseDTL.sol b/src/callbacks/liquidity/BaseDTL.sol index bbdf769b..f7c3cd22 100644 --- a/src/callbacks/liquidity/BaseDTL.sol +++ b/src/callbacks/liquidity/BaseDTL.sol @@ -41,7 +41,7 @@ abstract contract BaseDirectToLiquidity is BaseCallback { /// @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 + /// @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) @@ -76,7 +76,7 @@ abstract contract BaseDirectToLiquidity is BaseCallback { // ========== STATE VARIABLES ========== // - uint24 public constant MAX_PERCENT = 1e5; + uint24 public constant ONE_HUNDRED_PERCENT = 100e2; bytes5 public constant LINEAR_VESTING_KEYCODE = 0x4c49560000; // "LIV" /// @notice Maps the lot id to the DTL configuration @@ -136,10 +136,10 @@ abstract contract BaseDirectToLiquidity is BaseCallback { // Proceeds utilisation if ( params.proceedsUtilisationPercent == 0 - || params.proceedsUtilisationPercent > MAX_PERCENT + || params.proceedsUtilisationPercent > ONE_HUNDRED_PERCENT ) { revert Callback_Params_PercentOutOfBounds( - params.proceedsUtilisationPercent, 1, MAX_PERCENT + params.proceedsUtilisationPercent, 1, ONE_HUNDRED_PERCENT ); } @@ -311,9 +311,9 @@ abstract contract BaseDirectToLiquidity is BaseCallback { // 11 refund // Utilisation = 1 - 11/110 = 90% uint256 utilisationPercent = - 1e5 - refund_ * 1e5 / (config.lotCapacity + config.lotCuratorPayout); + 100e2 - refund_ * 100e2 / (config.lotCapacity + config.lotCuratorPayout); - capacityUtilised = (config.lotCapacity * utilisationPercent) / MAX_PERCENT; + capacityUtilised = (config.lotCapacity * utilisationPercent) / ONE_HUNDRED_PERCENT; } // Calculate the base tokens required to create the pool @@ -409,18 +409,18 @@ abstract contract BaseDirectToLiquidity is BaseCallback { uint256 amount_, uint24 slippage_ ) internal pure returns (uint256) { - if (slippage_ > MAX_PERCENT) { - revert Callback_Params_PercentOutOfBounds(slippage_, 0, MAX_PERCENT); + if (slippage_ > ONE_HUNDRED_PERCENT) { + revert Callback_Params_PercentOutOfBounds(slippage_, 0, ONE_HUNDRED_PERCENT); } - return (amount_ * (MAX_PERCENT - slippage_)) / MAX_PERCENT; + return (amount_ * (ONE_HUNDRED_PERCENT - slippage_)) / ONE_HUNDRED_PERCENT; } function _tokensRequiredForPool( uint256 amount_, uint24 proceedsUtilisationPercent_ ) internal pure returns (uint256) { - return (amount_ * proceedsUtilisationPercent_) / MAX_PERCENT; + return (amount_ * proceedsUtilisationPercent_) / ONE_HUNDRED_PERCENT; } function _getLatestLinearVestingModule() internal view returns (address) { diff --git a/src/callbacks/liquidity/UniswapV2DTL.sol b/src/callbacks/liquidity/UniswapV2DTL.sol index 8c603636..105f2279 100644 --- a/src/callbacks/liquidity/UniswapV2DTL.sol +++ b/src/callbacks/liquidity/UniswapV2DTL.sol @@ -29,7 +29,7 @@ contract UniswapV2DirectToLiquidity is BaseDirectToLiquidity { /// @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 `MAX_PERCENT`) + /// @param maxSlippage The maximum slippage allowed when adding liquidity (in terms of `ONE_HUNDRED_PERCENT`) struct OnSettleParams { uint24 maxSlippage; } diff --git a/src/callbacks/liquidity/UniswapV3DTL.sol b/src/callbacks/liquidity/UniswapV3DTL.sol index 0b1d414a..b7f47250 100644 --- a/src/callbacks/liquidity/UniswapV3DTL.sol +++ b/src/callbacks/liquidity/UniswapV3DTL.sol @@ -43,7 +43,7 @@ contract UniswapV3DirectToLiquidity is BaseDirectToLiquidity { /// @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 `MAX_PERCENT`) + /// @param maxSlippage The maximum slippage allowed when adding liquidity (in terms of `ONE_HUNDRED_PERCENT`) struct OnSettleParams { uint24 maxSlippage; } diff --git a/src/interfaces/IAuctionHouse.sol b/src/interfaces/IAuctionHouse.sol index 9fb967e7..a929d684 100644 --- a/src/interfaces/IAuctionHouse.sol +++ b/src/interfaces/IAuctionHouse.sol @@ -51,7 +51,7 @@ interface IAuctionHouse { /// @param baseToken Token provided by seller. Declared as an address to avoid dependency hell. /// @param quoteToken Token to accept as payment. Declared as an address to avoid dependency hell. /// @param curator (optional) Address of the proposed curator - /// @param referrerFee (optional) Percent of bid/purchase amount received paid to a referrer, as a percent with 3 decimals, i.e. 1% = 1000. + /// @param referrerFee (optional) Percent of bid/purchase amount received paid to a referrer in basis points, i.e. 1% = 100. /// @param callbacks (optional) Callbacks implementation for extended functionality /// @param callbackData (optional) abi-encoded data to be sent to the onCreate callback function /// @param derivativeType (optional) Derivative type, represented by the Keycode for the derivative submodule diff --git a/src/interfaces/IFeeManager.sol b/src/interfaces/IFeeManager.sol index 4a4c7fdb..7da9ecd9 100644 --- a/src/interfaces/IFeeManager.sol +++ b/src/interfaces/IFeeManager.sol @@ -16,7 +16,7 @@ interface IFeeManager { /// @notice Protocol and referrer fees are taken in the quoteToken and accumulate in the contract. These are set by the protocol. /// @notice Curator fees are taken in the payoutToken and are sent when the auction is settled / purchase is made. Curators can set these up to the configured maximum. /// @dev There are some situations where the fees may round down to zero if quantity of baseToken - /// is < 1e5 wei (can happen with big price differences on small decimal tokens). This is purely + /// is < 100e2 wei (can happen with big price differences on small decimal tokens). This is purely /// a theoretical edge case, as the amount would not be practical. /// /// @param protocol Fee charged by the protocol diff --git a/src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol b/src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol index 39f21bbb..0d5cfff1 100644 --- a/src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol +++ b/src/interfaces/modules/auctions/IEncryptedMarginalPrice.sol @@ -36,7 +36,7 @@ interface IEncryptedMarginalPrice { /// @notice Parameters that are used to set auction-specific data /// /// @param minPrice The minimum price (in quote tokens) that a bid must fulfill - /// @param minFillPercent The minimum percentage of capacity that the lot must fill in order to settle. Maximum value = 100_000 = 1e5. + /// @param minFillPercent The minimum percentage of capacity that the lot must fill in order to settle. Maximum value = 10000 = 100e2. /// @param minBidSize The minimum size of a bid in quote tokens /// @param publicKey The public key used to encrypt bids struct AuctionDataParams { diff --git a/src/interfaces/modules/auctions/IFixedPriceBatch.sol b/src/interfaces/modules/auctions/IFixedPriceBatch.sol index e29995a6..73f41d7e 100644 --- a/src/interfaces/modules/auctions/IFixedPriceBatch.sol +++ b/src/interfaces/modules/auctions/IFixedPriceBatch.sol @@ -29,7 +29,7 @@ interface IFixedPriceBatch is IBatchAuction { /// @notice Parameters for a fixed price auction /// /// @param price The fixed price of the lot - /// @param minFillPercent The minimum percentage of the lot that must be filled in order to settle (100% = 1e5) + /// @param minFillPercent The minimum percentage of the lot that must be filled in order to settle (100% = 100e2 = 1e4) struct AuctionDataParams { uint256 price; uint24 minFillPercent; diff --git a/src/interfaces/modules/auctions/IFixedPriceSale.sol b/src/interfaces/modules/auctions/IFixedPriceSale.sol index a3cdc4f6..1679cf0e 100644 --- a/src/interfaces/modules/auctions/IFixedPriceSale.sol +++ b/src/interfaces/modules/auctions/IFixedPriceSale.sol @@ -14,7 +14,7 @@ interface IFixedPriceSale { /// @notice Parameters for a fixed price auction /// /// @param price The fixed price of the lot - /// @param maxPayoutPercent The maximum payout per purchase, as a percentage of the capacity (100% = 1e5) + /// @param maxPayoutPercent The maximum payout per purchase, as a percentage of the capacity (100% = 100e2 = 1e4) struct AuctionDataParams { uint256 price; uint24 maxPayoutPercent; diff --git a/src/modules/Auction.sol b/src/modules/Auction.sol index bc5076bc..e6f88f7f 100644 --- a/src/modules/Auction.sol +++ b/src/modules/Auction.sol @@ -7,9 +7,9 @@ import {Module} from "src/modules/Modules.sol"; abstract contract AuctionModule is IAuction, Module { // ========= STATE ========== // - /// @notice Constant for percentages - /// @dev 1% = 1_000 or 1e3. 100% = 100_000 or 1e5. - uint48 internal constant _ONE_HUNDRED_PERCENT = 100_000; + /// @notice Constant for percentages, in basis points + /// @dev 1% = 1_00 or 1e2. 100% = 100_00 or 100e2 or 1e4. + uint48 internal constant _ONE_HUNDRED_PERCENT = 100e2; /// @inheritdoc IAuction uint48 public minAuctionDuration; diff --git a/src/modules/auctions/atomic/FPS.sol b/src/modules/auctions/atomic/FPS.sol index 265e8676..4a3ef841 100644 --- a/src/modules/auctions/atomic/FPS.sol +++ b/src/modules/auctions/atomic/FPS.sol @@ -56,7 +56,7 @@ contract FixedPriceSale is AtomicAuctionModule, IFixedPriceSale { // Validate the max payout percent is between 1% and 100% if ( - auctionParams.maxPayoutPercent < 1e3 + auctionParams.maxPayoutPercent < 1e2 || auctionParams.maxPayoutPercent > _ONE_HUNDRED_PERCENT ) revert Auction_InvalidParams(); diff --git a/src/modules/auctions/batch/FPB.sol b/src/modules/auctions/batch/FPB.sol index bf2cfd62..8b3b9e0c 100644 --- a/src/modules/auctions/batch/FPB.sol +++ b/src/modules/auctions/batch/FPB.sol @@ -57,7 +57,7 @@ contract FixedPriceBatch is BatchAuctionModule, IFixedPriceBatch { /// This function reverts if: /// - The parameters cannot be decoded into the correct format /// - The price is zero - /// - The minimum fill percentage is greater than 100% + /// - The minimum fill percentage is greater than /// /// @param params_ ABI-encoded data of type `AuctionDataParams` function _auction(uint96 lotId_, Lot memory lot_, bytes memory params_) internal override { From c1c858e567cb32e075903fba8fd694a78b7ac558 Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 2 Jul 2024 17:15:14 -0400 Subject: [PATCH 57/82] test: update based on new percent decimals and referrer design --- script/salts/salts.json | 48 ++++----- test/AtomicAuctionHouse/AuctionHouseTest.sol | 51 +++++++--- test/AtomicAuctionHouse/cancelAuction.t.sol | 2 +- test/AtomicAuctionHouse/claimRewards.t.sol | 8 +- test/AtomicAuctionHouse/purchase.t.sol | 69 ++++++++++--- test/AtomicAuctionHouse/setFee.t.sol | 18 ++-- test/AtomicAuctionHouse/setProtocol.t.sol | 5 +- test/BatchAuctionHouse/AuctionHouseTest.sol | 57 +++++++---- test/BatchAuctionHouse/auction.t.sol | 21 ++++ test/BatchAuctionHouse/bid.t.sol | 14 ++- test/BatchAuctionHouse/claimBids.t.sol | 99 +++---------------- test/BatchAuctionHouse/settle.t.sol | 54 ++++++++++ test/callbacks/MockCallback.sol | 6 +- .../UniswapV2DTL/UniswapV2DTLTest.sol | 3 +- .../liquidity/UniswapV2DTL/onCreate.t.sol | 6 +- .../liquidity/UniswapV2DTL/onSettle.t.sol | 16 +-- .../UniswapV3DTL/UniswapV3DTLTest.sol | 3 +- .../liquidity/UniswapV3DTL/onCreate.t.sol | 6 +- .../liquidity/UniswapV3DTL/onSettle.t.sol | 20 ++-- .../Auction/MockAtomicAuctionModule.sol | 2 +- test/modules/Auction/auction.t.sol | 6 ++ test/modules/Auction/cancel.t.sol | 5 + test/modules/auctions/EMP/EMPTest.sol | 2 +- test/modules/auctions/EMP/auction.t.sol | 8 +- test/modules/auctions/EMP/claimBids.t.sol | 2 +- test/modules/auctions/FPB/FPBTest.sol | 2 +- test/modules/auctions/FPB/auction.t.sol | 6 +- test/modules/auctions/FPB/settle.t.sol | 2 +- test/modules/auctions/FPS/FPSTest.sol | 2 +- test/modules/auctions/FPS/auction.t.sol | 20 ++-- test/modules/auctions/FPS/purchase.t.sol | 4 +- .../LinearVestingEMPAIntegration.t.sol | 2 +- 32 files changed, 336 insertions(+), 233 deletions(-) diff --git a/script/salts/salts.json b/script/salts/salts.json index 602432e4..f432329d 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -46,48 +46,48 @@ "0xed4ba02077e70f78db70ce191509333d2dcccfff136d30dcb011f567305e88ad": "0x2b8bc588174d409692f1bd993942e3806c9a11344dbe674f46aed32a030aacf1" }, "Test_AllocatedMerkleAllowlist": { - "0x1242d528fb3d9259e7192f83e1faf95370bfd8d7f2b1bae5d3ea350d3d9c563c": "0x0ec2c9d910490e897c952a3210e5915006080f59a14a022b941a8c8cef2886e3", - "0x7cca57da19a5847b2b87641c1b721a32d4778e3e58641d6771cd14ed112b3bc3": "0xe0631d27a3d241774729d8c3ee1d9efae407f1073f89fa0956b2d308bd3adec4" + "0xb17794250569bcd64aae2ec1312399120db92167bf0a2602821e0ee953dd3d31": "0xa02d6206d785bdc9bbd57caa7aa2b429fbd68af9dbe938981c3f3419a13a5b07", + "0xecbee26b3d0e662be84e4cef678b23166957f507ca68f32eaa49e60ceb567981": "0xea67755fb850eb33ee6a98ac48fc23e3b350b139f37c1a47d1926e7a2499db92" }, "Test_CappedMerkleAllowlist": { - "0x2e55fe4d6c3005f7bf152a42653bd234155cdac7f621582ba16b664c115ba76b": "0xcebb750afb8a132bc3cb37d32494b7ff18eddfb4b5359d69324660cb723e32e3", - "0xbd19b648b51fb3fe1bd9e42ad4018b839966abea0f4e25a9149dffdc7cc86a4e": "0x40034a34b97aef1a7635ee0f34b06951512b57d37bc0baa1be879a5144895d08" + "0xa0ed568f98efa2efd4e93f21a5445970919a333349a8f5369a28ae93271d9cca": "0xc4351be38848fc345a2cd1a3310714a677cb6c758df2a5f568e7fd437465f086", + "0xfd2c28cb6c38931a1f784078c41d21d7bf8fc3653231edca225a5fbbc50529dc": "0x866fb81efae6aba7b5d8052e5fb11fb0f3b61dc2d268d8bd7a89c74876cd03e0" }, "Test_GUniFactory": { "0x3bf0e882023640f31bf861e1f13d306fd4fbb7afb7860e21a489062cbefcf885": "0x397acf3db4cc9c81f8c1975a5505e392e6b5f8eb3b22efcc094b3e0f39f6739b" }, "Test_MockCallback": { - "0x0825d99059fe0dc95e0b5cd7b853a5f3f50b58f25c5812fc7fd01d69ff4ec679": "0x222b47fd0259b3eacfbc04b9dddf5bb5ba060245c2c3c3673672ad4d815d01df", - "0x51526251ca3003df174c65f2fb581f61820ce57c14720e0d67480ed8c8b77925": "0xd25a3174b866cae4f78f513123ffebf33114f3df0093e06159010b3d9fbadff3", - "0x6206c9845f35f3006fc507c15aaaf4a719380265cf472773a270ffe6d5eb5299": "0xe9943f7c46c50e34e5f91da14d0ca6c58b5504172e156e19108bf2844fdaec63", - "0x6b7fa77ae82f95cc8c5fe53dca64702ea0dc8e3dad74749dc8cd77de2884e704": "0x600196a40f70c0b91ab3ace5873750bc77d14dddf6b1093b03def43f31ddb4c3", - "0x7310243dabd76344326f3659aabda0b846a9c8e9e7d50b990261c14f2b44d560": "0x86d15e2125c36574017c86d4fcd04bb470225e835b76e3cbe63c5908da46ab8c", - "0x7602309c05771de8281f2f3f08e74ec9f19f1bfdaac8cd970d9f7a8d62173b6e": "0xd28f39fd2d2e1a378b0fe177abc5ac22a4642634847865a096a5e96bd04c6411", - "0x892e1120a976151ae5375dca978040abe705c8cbdd3c7b64b41ff1087ee01c22": "0x748af80730f660a2400a4d6f8f4f41d21cca1cc117fc2f1c51e131e16fa43ce3", - "0x8a69dcb863773a3bb971a969233286e75cba80abf6ec8d881cada7ea0ad674b0": "0xd7bacad37fd5e507c6bc424ed88ae37e8d4935b54d7e41cf1306d46c37eaebb4", - "0x8d8681a539f3b359e94a05239187dc55cb9cb2dcfe01726d3053573206efe25f": "0x6f209918e9619b620b306b2014e6aabe3688c4a4043117b6835ab17bd70bf004", - "0x918d87a20c837fa93ce3089d2cb6386b66f79bbfd0f09bd6784bc52108b69938": "0x64473a26214c7b928ff6c08104e3b18ae36918097eefb554aa17c2b9347fd7f2", - "0x9569f58e5e127ceb73049eea8119bb21f8c4328d3b4770da5a67075be3f77c12": "0x2123580432d5ece19c5e099d5156a9598f2c49fdcbcc1029f7d21276ccab2ba3", - "0x96f0481f00eeec717fa8c0d41efd04b6e3fdccbebbaa223ee2118449ebea2406": "0x6bc41d5bab2740be84e43b053ed3b46acb6f3ac1cb9031fb3203edd92a833a07", - "0x9c35a3189126603f4b187149f54e09082403dac10b3e899a503e28e897edd6f9": "0xa35f7a6870564c7a14d71310c87a6816c3ef4f80eb0a5ac43d56235e075ae162", - "0x9db4bc605469ede684fbaa475d320b3fbe6a707deaa953ee1ba29ecb3c1125fb": "0x67f66566dfb091aeeb776b692eba5f570f5a310cf25e94f0e06120cf64737a9d", - "0xb8e0b3cbd7273e83cfdbcb8269e5c3510a28892e815fe28bc0f515be0df2c8f9": "0x17f7fbab547a6a69119fee8820b0ff11a8da7a1f9902a19d8f3917a6c8aff2da", - "0xc38bb4813ebdb9978d2485ae5ad92e1152f8a955430a63210b69b2277eed9477": "0x9bf9b60e2afb2faf561385c61d5c3f5b6b910c97bdd3bb4af59d193140215a31", - "0xd75e639b43b1d29e1703abcd2616b6b67f3ae232d53915d472f3a5b6aae6083c": "0xa45904df2431729c77de44b4b88e032130e12dcbc735f0f72a29af686e15f3ed", - "0xf2644573f57aea10dffac6e7215b409fa19236ae57b735b20b9fac9834391850": "0x3a824c912eb7f08b82a8d936c2e29cb2b6fdde7e33ea9af18d9ccbde9c454161" + "0x052a304d0a4a19a819c4e1501b45b4f1b49f73d1a7cac910386fe5fc509633a4": "0xc6065a07239f2cc5e6815da442bbf20235a73b478a6d54a79ac6821b5b7a7d28", + "0x211f0c56d141fbeca1844d250c6a356beb00eaecc7afef8cd01797aa6b730ba6": "0xaeda83a2eea09230a231bd9a2093f719daa9593150bab530dee4f47330e1842b", + "0x409bf08f08583ee56edee5cf91c507ce0ee7cd3a33d6b176505cde7e6fab5212": "0xbc0cb39903b09af940cd22dc5f6207da850b245d901c62ebf414758fea9264d5", + "0x42425e602c9c169d71be77da2f8ca1fc0718c859fc8a1a8940e010485b9b2db4": "0xb597983520eee34eafda0ae6bfa0a7c42e583b88622823df7bd25d9e8033805f", + "0x4eb19888c437940923b0c1e78a04f1afe2a75dae78812574ba219f022fc5395a": "0x157f746e00d6600ba3e3bc8b98cb16484284fd6c3426f6aa878e65acd7543d4e", + "0x65861ca173680f85c64b5ecb1041d69eba8addf2e4f3acde8ae4b0ec5f2625f5": "0x95e40ccfc1f2780e7e330d505120ad53a5e1b8afefc82ac0fda94ded13d54cf0", + "0x732ffa915e7dee8ddde1f40a62d2a275e439a4fc180fa652b48e733b460fdd52": "0x86fcfcc51aab2585740af207f84ee1ae17991659e8f6e2a26e79fb9bc43f9c7c", + "0x819496f5a9c8dd326fdaaafa185159c136315d5abee91896f192dbdf2212768d": "0x09888a22ba81aa1f63d141c9218847b04500dee5b8b05b4a3767b23a67f9b75c", + "0x9df1908fad57611d75eb1b9d9a581ddc43baeaa767a14f5ddd26fe371bbcf06b": "0x210df33b039e970b195f2ba4b002fc5cce1e5089f4b78fd0310893c77c412c33", + "0xb10e85dc047de055ec7bcc8d8933f859c8c220aa1540e8d61f36e6391d5975fd": "0x073f19736c18bba81ab00dd1400230e8dddf5001c99c808358d54b133d290b31", + "0xb262c3f41c3ffc3d264c72a40f60b02c497017ed75f73524e008f3ead803a998": "0xc3b61e79be00bdae71d3390cb7dcfff107f49890d7637e84f34e0019cf39fd20", + "0xb582fee2a3f0fd5f455d98b1278099ceadb1a7c9d46e93e5100c8cc86aa4a388": "0x4ff0921c566e6c8335243cca9493d936237c15432cd2b46cacedc924c6a74ab3", + "0xbcd87b9a1206b37ef12053cbcac10515fbf400962837441462e04daa9e2ddc98": "0xeae313d76511fda576544873c1f194d360835d89b3fa6ac8f0eaa3720e460d37", + "0xc9ae4a5f6e1baf9009493d9068d9f61f8461a99a23532a7f8ed98393106ef560": "0x2cf765c5239f65fd7a6320f9ced82f781250c95e63477b37a4fc1e505d36245e", + "0xd3e19abee55b3295d081f5777c0e642f7c7023552b5ae035ecc53f706fd90e63": "0x2642e226f3dcbd86a5529864ef200f96cb803ec643fa32a91734ad69b5ce41b4", + "0xf12ef8015ea1ab65c40a62ad74a87c7a97bbc2736afd3f81f1cec73bc2290b45": "0x123243bb40017d592cf768072714268a81fb8533b0379837981687b10e125828", + "0xf36332cb1efc8bc6ea44da0a8971f853fc081b8487c5d4d3e09c1de201a68bc5": "0x8d8fa796b3ed9d941ceead4834fc24113e199f13bf7af2328388b9bf01884177", + "0xf745ee60388fc42e05923e38f1c09237e8514387e3a4b328c576a52aaa29c9b3": "0x1ade095069cfbe0debff4e5cee60edaab45631d39b2215cd1ba359fcf8b68858" }, "Test_TokenAllowlist": { "0x11e024c2f0ada4ce2ce048af08354dfa64f38ad959564c55e6bbf48d2ed3822e": "0x36081349bdb172b741f01d750be52416888c2083ea791863109f709f33f3eebd", "0x78a7c23f669f5df656575693f45f928b7af2ed4bc981cf6dec77bef2c03bb081": "0x2f45234bfc47c4383d3d83a27019a523b0e94986d6f7ed632b7041de70b8ba63" }, "Test_UniswapV2DirectToLiquidity": { - "0xbce774b5c75ce6af2b000bd157d0966753042aba6fde38f5ea2eca76b585791f": "0x4a96efe15db180328cfc5296e72ceed9e7e3a10213a9c34d69b500733afc2d21" + "0xf77179ebee72718ef1a17438d512b323bf27d54fa684e08eb2c0e04db5e4b6e8": "0x5333b99e4591f981322477a49d3b7dfd74d9b40682587c45844dc8204742976b" }, "Test_UniswapV2Router": { "0xe6204aa211921628df345ff0b909c863298684cd8ca65de5479af6b70662e622": "0xf508fd71ff40f5d0640b01b9384f98d35db43c7ddb0d4abe274d61fdf1ea967f" }, "Test_UniswapV3DirectToLiquidity": { - "0x58b7674df101688da4f68d9cfad65390f1f35abe1c999bd0a251069b8883f528": "0xee9c953ecdad99f7aab8e6812d8b023c11ca7978a5324739a9e8987c44ac2e96" + "0x9fba41d9fa6e37d4d48a3e2740f19cab37f9e6cabd831d34d70987f6047d7cfa": "0xbf8d53d0e9ac87c66fc640508db3d175f7242666b9a014facf35776234c78246" }, "Test_UniswapV3Factory": { "0xbcd657c3390ecd2e1782b6473400c51fa124922eb98b69f1b5192eb0f8e3d3df": "0x3448ebb18cb03fae2e9153c621d46f1b9b8941cc66e7063b587fe4a284490b01" diff --git a/test/AtomicAuctionHouse/AuctionHouseTest.sol b/test/AtomicAuctionHouse/AuctionHouseTest.sol index a018dbaa..2a0fd7dc 100644 --- a/test/AtomicAuctionHouse/AuctionHouseTest.sol +++ b/test/AtomicAuctionHouse/AuctionHouseTest.sol @@ -61,15 +61,18 @@ abstract contract AtomicAuctionHouseTest is Test, Permit2User, WithSalts { address internal _bidder; uint256 internal _bidderKey; - uint24 internal constant _CURATOR_MAX_FEE_PERCENT = 100; + uint24 internal constant _CURATOR_MAX_FEE_PERCENT = 1_00; uint24 internal constant _CURATOR_FEE_PERCENT = 90; uint24 internal _curatorFeePercentActual; - uint24 internal constant _PROTOCOL_FEE_PERCENT = 100; - uint24 internal constant _REFERRER_FEE_PERCENT = 105; - uint24 internal _protocolFeePercentActual; + uint24 internal constant _PROTOCOL_FEE_PERCENT = 1_00; + uint24 internal constant _REFERRER_FEE_PERCENT = 1_05; + uint24 internal constant _REFERRER_MAX_FEE_PERCENT = 10_00; uint24 internal _referrerFeePercentActual; + uint24 internal _protocolFeePercentActual; + uint24 internal _maxReferrerFeePercentActual; + uint256 internal _curatorMaxPotentialFee; bool internal _curatorApproved; @@ -130,6 +133,7 @@ abstract contract AtomicAuctionHouseTest is Test, Permit2User, WithSalts { auctionType: toKeycode(""), baseToken: address(_baseToken), quoteToken: address(_quoteToken), + referrerFee: 0, // Default to 0 curator: _CURATOR, callbacks: ICallback(address(0)), callbackData: abi.encode(""), @@ -460,11 +464,37 @@ abstract contract AtomicAuctionHouseTest is Test, Permit2User, WithSalts { _; } + function _setMaxReferrerFee(uint24 fee_) internal { + vm.prank(_OWNER); + _auctionHouse.setFee(_auctionModuleKeycode, IFeeManager.FeeType.MaxReferrer, fee_); + _maxReferrerFeePercentActual = fee_; + } + + modifier givenMaxReferrerFeeIsSet() { + _setMaxReferrerFee(_REFERRER_MAX_FEE_PERCENT); + _; + } + + function _setReferrerFee(uint24 fee_) internal { + _referrerFeePercentActual = fee_; + _routingParams.referrerFee = fee_; + } + + modifier givenReferrerFee(uint24 fee_) { + _setReferrerFee(fee_); + _; + } + + modifier givenReferrerFeeIsSet() { + _setReferrerFee(_REFERRER_FEE_PERCENT); + _; + } + function _setCuratorFee(uint24 fee_) internal { vm.prank(_CURATOR); _auctionHouse.setCuratorFee(_auctionModuleKeycode, fee_); _curatorFeePercentActual = fee_; - _curatorMaxPotentialFee = _curatorFeePercentActual * _LOT_CAPACITY / 1e5; + _curatorMaxPotentialFee = _curatorFeePercentActual * _LOT_CAPACITY / 100e2; } modifier givenCuratorFeeIsSet() { @@ -490,17 +520,6 @@ abstract contract AtomicAuctionHouseTest is Test, Permit2User, WithSalts { _; } - function _setReferrerFee(uint24 fee_) internal { - vm.prank(_OWNER); - _auctionHouse.setFee(_auctionModuleKeycode, IFeeManager.FeeType.Referrer, fee_); - _referrerFeePercentActual = fee_; - } - - modifier givenReferrerFeeIsSet() { - _setReferrerFee(_REFERRER_FEE_PERCENT); - _; - } - // ===== Helpers ===== // function _getLotRouting(uint96 lotId_) internal view returns (IAuctionHouse.Routing memory) { diff --git a/test/AtomicAuctionHouse/cancelAuction.t.sol b/test/AtomicAuctionHouse/cancelAuction.t.sol index 59401122..f404ead6 100644 --- a/test/AtomicAuctionHouse/cancelAuction.t.sol +++ b/test/AtomicAuctionHouse/cancelAuction.t.sol @@ -10,7 +10,7 @@ import {AtomicAuctionHouseTest} from "test/AtomicAuctionHouse/AuctionHouseTest.s contract AtomicCancelAuctionTest is AtomicAuctionHouseTest { uint256 internal constant _PURCHASE_AMOUNT = 2e18; uint256 internal constant _PURCHASE_AMOUNT_OUT = 1e18; - uint32 internal constant _PAYOUT_MULTIPLIER = 50_000; // 50% + uint32 internal constant _PAYOUT_MULTIPLIER = 50_00; // 50% bytes internal _purchaseAuctionData = abi.encode(""); diff --git a/test/AtomicAuctionHouse/claimRewards.t.sol b/test/AtomicAuctionHouse/claimRewards.t.sol index bc9d7bbe..647a9b35 100644 --- a/test/AtomicAuctionHouse/claimRewards.t.sol +++ b/test/AtomicAuctionHouse/claimRewards.t.sol @@ -5,8 +5,8 @@ import {AtomicAuctionHouseTest} from "test/AtomicAuctionHouse/AuctionHouseTest.s contract AtomicClaimRewardsTest is AtomicAuctionHouseTest { uint256 internal constant _AMOUNT_IN = 1e18; - uint256 internal _amountInReferrerFee = (_AMOUNT_IN * _REFERRER_FEE_PERCENT) / 1e5; - uint256 internal _amountInProtocolFee = (_AMOUNT_IN * _PROTOCOL_FEE_PERCENT) / 1e5; + uint256 internal _amountInReferrerFee = (_AMOUNT_IN * _REFERRER_FEE_PERCENT) / 100e2; + uint256 internal _amountInProtocolFee = (_AMOUNT_IN * _PROTOCOL_FEE_PERCENT) / 100e2; uint256 internal _amountInLessFee = _AMOUNT_IN - _amountInReferrerFee - _amountInProtocolFee; // 1:1 exchange rate uint256 internal _amountOut = _amountInLessFee; @@ -28,6 +28,7 @@ contract AtomicClaimRewardsTest is AtomicAuctionHouseTest { whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -56,6 +57,7 @@ contract AtomicClaimRewardsTest is AtomicAuctionHouseTest { whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -84,6 +86,7 @@ contract AtomicClaimRewardsTest is AtomicAuctionHouseTest { whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -112,6 +115,7 @@ contract AtomicClaimRewardsTest is AtomicAuctionHouseTest { whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted diff --git a/test/AtomicAuctionHouse/purchase.t.sol b/test/AtomicAuctionHouse/purchase.t.sol index d23da6ab..dde26bb5 100644 --- a/test/AtomicAuctionHouse/purchase.t.sol +++ b/test/AtomicAuctionHouse/purchase.t.sol @@ -11,7 +11,7 @@ import {AtomicAuctionHouseTest} from "test/AtomicAuctionHouse/AuctionHouseTest.s contract AtomicPurchaseTest is AtomicAuctionHouseTest { uint256 internal constant _AMOUNT_IN = 2e18; - uint256 internal constant _PAYOUT_MULTIPLIER = 50_000; // 50% + uint256 internal constant _PAYOUT_MULTIPLIER = 50_00; // 50% address internal constant _SENDER = address(0x26); @@ -57,8 +57,8 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { amountInLessFees = amountInLessFees * _BASE_SCALE / (10 ** _quoteToken.decimals()); // Set the amount out - _amountOut = _scaleBaseTokenAmount((amountInLessFees * multiplier_) / 1e5); - _curatorFeeActual = (_amountOut * _curatorFeePercentActual) / 1e5; + _amountOut = _scaleBaseTokenAmount((amountInLessFees * multiplier_) / 100e2); + _curatorFeeActual = (_amountOut * _curatorFeePercentActual) / 100e2; _; } @@ -80,21 +80,21 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { } modifier givenFeesAreCalculated(uint256 amountIn_) { - _expectedReferrerFeesAllocated = (amountIn_ * _referrerFeePercentActual) / 1e5; - _expectedProtocolFeesAllocated = (amountIn_ * _protocolFeePercentActual) / 1e5; + _expectedReferrerFeesAllocated = (amountIn_ * _referrerFeePercentActual) / 100e2; + _expectedProtocolFeesAllocated = (amountIn_ * _protocolFeePercentActual) / 100e2; _; } modifier givenFeesAreCalculatedNoReferrer(uint256 amountIn_) { _expectedReferrerFeesAllocated = 0; _expectedProtocolFeesAllocated = - (amountIn_ * (_protocolFeePercentActual + _referrerFeePercentActual)) / 1e5; + (amountIn_ * (_protocolFeePercentActual + _referrerFeePercentActual)) / 100e2; _; } modifier givenBalancesAreCalculated(uint256 amountIn_, uint256 amountOut_) { // Determine curator fee - uint256 curatorFee = _curatorApproved ? (amountOut_ * _curatorFeePercentActual) / 1e5 : 0; + uint256 curatorFee = _curatorApproved ? (amountOut_ * _curatorFeePercentActual) / 100e2 : 0; bool hasDerivativeToken = _derivativeTokenId != type(uint256).max; bool hasCallback = address(_routingParams.callbacks) != address(0); uint256 scaledLotCapacity = _scaleBaseTokenAmount(_LOT_CAPACITY); @@ -308,12 +308,13 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { external whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled + givenProtocolFeeIsSet givenLotIsCreated givenLotHasStarted givenUserHasQuoteTokenBalance(_AMOUNT_IN) givenUserHasQuoteTokenAllowance(_AMOUNT_IN) givenFeesAreCalculated(_AMOUNT_IN) - whenPayoutMultiplierIsSet(90_000) + whenPayoutMultiplierIsSet(90_00) givenSellerHasBaseTokenBalance(_amountOut) givenSellerHasBaseTokenAllowance(_amountOut) { @@ -360,6 +361,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenLotHasAllowlist whenAllowlistProofIsCorrect givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -393,6 +395,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -422,6 +425,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenQuoteTokenHasDecimals(17) givenBaseTokenHasDecimals(13) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -451,6 +455,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenQuoteTokenHasDecimals(13) givenBaseTokenHasDecimals(17) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -478,6 +483,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -507,6 +513,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenQuoteTokenHasDecimals(17) givenBaseTokenHasDecimals(13) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -536,6 +543,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenQuoteTokenHasDecimals(13) givenBaseTokenHasDecimals(17) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -574,6 +582,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenCallbackHasSendBaseTokensFlag givenCallbackIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -607,6 +616,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenCallbackHasSendBaseTokensFlag givenCallbackIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -640,6 +650,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenCallbackHasSendBaseTokensFlag givenCallbackIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -671,6 +682,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenCallbackHasReceiveQuoteTokensFlag givenCallbackIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -701,6 +713,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAtomicAuctionModuleIsInstalled givenCallbackIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -730,6 +743,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -759,6 +773,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenQuoteTokenHasDecimals(17) givenBaseTokenHasDecimals(13) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -788,6 +803,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenQuoteTokenHasDecimals(13) givenBaseTokenHasDecimals(17) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -824,6 +840,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenDerivativeParamsAreSet givenDerivativeIsDeployed givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -857,6 +874,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenDerivativeParamsAreSet givenDerivativeIsDeployed givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -890,6 +908,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenDerivativeParamsAreSet givenDerivativeIsDeployed givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -920,6 +939,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { external whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -948,6 +968,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAtomicAuctionModuleIsInstalled givenQuoteTokenHasDecimals(17) givenBaseTokenHasDecimals(13) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -976,6 +997,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAtomicAuctionModuleIsInstalled givenQuoteTokenHasDecimals(13) givenBaseTokenHasDecimals(17) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -1003,6 +1025,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -1032,6 +1055,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenQuoteTokenHasDecimals(17) givenBaseTokenHasDecimals(13) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -1061,6 +1085,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenQuoteTokenHasDecimals(13) givenBaseTokenHasDecimals(17) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -1091,8 +1116,8 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { external whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled - givenLotIsCreated givenProtocolFeeIsSet + givenLotIsCreated givenLotHasStarted givenUserHasQuoteTokenBalance(_AMOUNT_IN) givenUserHasQuoteTokenAllowance(_AMOUNT_IN) @@ -1119,8 +1144,8 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAtomicAuctionModuleIsInstalled givenQuoteTokenHasDecimals(17) givenBaseTokenHasDecimals(13) - givenLotIsCreated givenProtocolFeeIsSet + givenLotIsCreated givenLotHasStarted givenUserHasQuoteTokenBalance(_scaleQuoteTokenAmount(_AMOUNT_IN)) givenUserHasQuoteTokenAllowance(_scaleQuoteTokenAmount(_AMOUNT_IN)) @@ -1147,8 +1172,8 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAtomicAuctionModuleIsInstalled givenQuoteTokenHasDecimals(13) givenBaseTokenHasDecimals(17) - givenLotIsCreated givenProtocolFeeIsSet + givenLotIsCreated givenLotHasStarted givenUserHasQuoteTokenBalance(_scaleQuoteTokenAmount(_AMOUNT_IN)) givenUserHasQuoteTokenAllowance(_scaleQuoteTokenAmount(_AMOUNT_IN)) @@ -1173,9 +1198,10 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { external whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled - givenLotIsCreated + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet + givenLotIsCreated givenLotHasStarted givenUserHasQuoteTokenBalance(_AMOUNT_IN) givenUserHasQuoteTokenAllowance(_AMOUNT_IN) @@ -1202,9 +1228,10 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAtomicAuctionModuleIsInstalled givenQuoteTokenHasDecimals(17) givenBaseTokenHasDecimals(13) - givenLotIsCreated + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet + givenLotIsCreated givenLotHasStarted givenUserHasQuoteTokenBalance(_scaleQuoteTokenAmount(_AMOUNT_IN)) givenUserHasQuoteTokenAllowance(_scaleQuoteTokenAmount(_AMOUNT_IN)) @@ -1231,9 +1258,10 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAtomicAuctionModuleIsInstalled givenQuoteTokenHasDecimals(13) givenBaseTokenHasDecimals(17) - givenLotIsCreated + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet + givenLotIsCreated givenLotHasStarted givenUserHasQuoteTokenBalance(_scaleQuoteTokenAmount(_AMOUNT_IN)) givenUserHasQuoteTokenAllowance(_scaleQuoteTokenAmount(_AMOUNT_IN)) @@ -1258,9 +1286,8 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { external whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled - givenLotIsCreated - givenReferrerFeeIsSet givenProtocolFeeIsSet + givenLotIsCreated givenLotHasStarted givenUserHasQuoteTokenBalance(_scaleQuoteTokenAmount(_AMOUNT_IN)) givenUserHasQuoteTokenAllowance(_scaleQuoteTokenAmount(_AMOUNT_IN)) @@ -1299,6 +1326,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -1327,6 +1355,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAtomicAuctionModuleIsInstalled givenCuratorIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -1357,6 +1386,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -1388,6 +1418,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenQuoteTokenHasDecimals(17) givenBaseTokenHasDecimals(13) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenCuratorMaxFeeIsSet givenCuratorFeeIsSet @@ -1421,6 +1452,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenQuoteTokenHasDecimals(13) givenBaseTokenHasDecimals(17) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenCuratorMaxFeeIsSet givenCuratorFeeIsSet @@ -1452,6 +1484,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAtomicAuctionModuleIsInstalled givenCuratorIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenCuratorMaxFeeIsSet givenLotIsCreated @@ -1482,6 +1515,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { whenAtomicAuctionModuleIsInstalled givenCuratorIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenCuratorMaxFeeIsSet givenCuratorFeeIsSet @@ -1521,6 +1555,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenDerivativeIsDeployed givenCuratorIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenCuratorMaxFeeIsSet givenCuratorFeeIsSet @@ -1558,6 +1593,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenDerivativeIsDeployed givenCuratorIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenCuratorMaxFeeIsSet givenCuratorFeeIsSet @@ -1595,6 +1631,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenDerivativeIsDeployed givenCuratorIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenCuratorMaxFeeIsSet givenCuratorFeeIsSet diff --git a/test/AtomicAuctionHouse/setFee.t.sol b/test/AtomicAuctionHouse/setFee.t.sol index a72a91e5..1441676e 100644 --- a/test/AtomicAuctionHouse/setFee.t.sol +++ b/test/AtomicAuctionHouse/setFee.t.sol @@ -29,7 +29,7 @@ contract AtomicSetFeeTest is Test, Permit2User { Keycode internal _auctionKeycode; - uint48 internal constant _MAX_FEE = 1e5; + uint48 internal constant _MAX_FEE = 100e2; function setUp() external { _auctionHouse = new AtomicAuctionHouse(_OWNER, _PROTOCOL, _permit2Address); @@ -75,24 +75,24 @@ contract AtomicSetFeeTest is Test, Permit2User { _auctionHouse.setFee(_auctionKeycode, IFeeManager.FeeType.Protocol, fee); // Validate - (uint48 protocolFee, uint48 referrerFee, uint48 maxCuratorFee) = + (uint48 protocolFee, uint48 maxReferrerFee, uint48 maxCuratorFee) = _auctionHouse.fees(_auctionKeycode); assertEq(protocolFee, fee); - assertEq(referrerFee, 0); + assertEq(maxReferrerFee, 0); assertEq(maxCuratorFee, 0); } - function test_referrerFee(uint48 fee_) public { + function test_maxReferrerFee(uint48 fee_) public { uint48 fee = uint48(bound(fee_, 0, _MAX_FEE)); vm.prank(_OWNER); - _auctionHouse.setFee(_auctionKeycode, IFeeManager.FeeType.Referrer, fee); + _auctionHouse.setFee(_auctionKeycode, IFeeManager.FeeType.MaxReferrer, fee); // Validate - (uint48 protocolFee, uint48 referrerFee, uint48 maxCuratorFee) = + (uint48 protocolFee, uint48 maxReferrerFee, uint48 maxCuratorFee) = _auctionHouse.fees(_auctionKeycode); assertEq(protocolFee, 0); - assertEq(referrerFee, fee); + assertEq(maxReferrerFee, fee); assertEq(maxCuratorFee, 0); } @@ -103,10 +103,10 @@ contract AtomicSetFeeTest is Test, Permit2User { _auctionHouse.setFee(_auctionKeycode, IFeeManager.FeeType.MaxCurator, fee); // Validate - (uint48 protocolFee, uint48 referrerFee, uint48 maxCuratorFee) = + (uint48 protocolFee, uint48 maxReferrerFee, uint48 maxCuratorFee) = _auctionHouse.fees(_auctionKeycode); assertEq(protocolFee, 0); - assertEq(referrerFee, 0); + assertEq(maxReferrerFee, 0); assertEq(maxCuratorFee, fee); } } diff --git a/test/AtomicAuctionHouse/setProtocol.t.sol b/test/AtomicAuctionHouse/setProtocol.t.sol index 872107b8..ad079414 100644 --- a/test/AtomicAuctionHouse/setProtocol.t.sol +++ b/test/AtomicAuctionHouse/setProtocol.t.sol @@ -7,8 +7,8 @@ contract AtomicSetProtocolTest is AtomicAuctionHouseTest { address internal immutable _NEW_PROTOCOL = address(0x7); uint96 internal constant _AMOUNT_IN = 1e18; - uint96 internal _amountInReferrerFee = _AMOUNT_IN * _REFERRER_FEE_PERCENT / 1e5; - uint96 internal _amountInProtocolFee = _AMOUNT_IN * _PROTOCOL_FEE_PERCENT / 1e5; + uint96 internal _amountInReferrerFee = _AMOUNT_IN * _REFERRER_FEE_PERCENT / 100e2; + uint96 internal _amountInProtocolFee = _AMOUNT_IN * _PROTOCOL_FEE_PERCENT / 100e2; uint96 internal _amountInLessFee = _AMOUNT_IN - _amountInReferrerFee - _amountInProtocolFee; // 1:1 exchange rate uint96 internal _amountOut = _amountInLessFee; @@ -42,6 +42,7 @@ contract AtomicSetProtocolTest is AtomicAuctionHouseTest { public whenAuctionTypeIsAtomic whenAtomicAuctionModuleIsInstalled + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet givenLotIsCreated diff --git a/test/BatchAuctionHouse/AuctionHouseTest.sol b/test/BatchAuctionHouse/AuctionHouseTest.sol index ebdb55f0..f9fa754a 100644 --- a/test/BatchAuctionHouse/AuctionHouseTest.sol +++ b/test/BatchAuctionHouse/AuctionHouseTest.sol @@ -60,15 +60,18 @@ abstract contract BatchAuctionHouseTest is Test, Permit2User, WithSalts { address internal _bidder; uint256 internal _bidderKey; - uint24 internal constant _CURATOR_MAX_FEE_PERCENT = 100; + uint24 internal constant _CURATOR_MAX_FEE_PERCENT = 1_00; uint24 internal constant _CURATOR_FEE_PERCENT = 90; uint24 internal _curatorFeePercentActual; - uint24 internal constant _PROTOCOL_FEE_PERCENT = 100; - uint24 internal constant _REFERRER_FEE_PERCENT = 105; - uint24 internal _protocolFeePercentActual; + uint24 internal constant _PROTOCOL_FEE_PERCENT = 1_00; + uint24 internal constant _REFERRER_FEE_PERCENT = 1_05; + uint24 internal constant _REFERRER_MAX_FEE_PERCENT = 10_00; uint24 internal _referrerFeePercentActual; + uint24 internal _protocolFeePercentActual; + uint24 internal _maxReferrerFeePercentActual; + uint256 internal _curatorMaxPotentialFee; bool internal _curatorApproved; @@ -131,6 +134,7 @@ abstract contract BatchAuctionHouseTest is Test, Permit2User, WithSalts { auctionType: toKeycode(""), baseToken: address(_baseToken), quoteToken: address(_quoteToken), + referrerFee: 0, // not set by default curator: _CURATOR, callbacks: ICallback(address(0)), callbackData: abi.encode(""), @@ -160,12 +164,12 @@ abstract contract BatchAuctionHouseTest is Test, Permit2User, WithSalts { ) internal view returns (uint256 toReferrer, uint256 toProtocol, uint256 totalFees) { bool hasReferrer = referrer_ != address(0); - uint256 referrerFee = uint256(amountIn_) * _referrerFeePercentActual / 1e5; + uint256 referrerFee = uint256(amountIn_) * _referrerFeePercentActual / 100e2; // If the referrer is not set, the referrer fee is allocated to the protocol toReferrer = hasReferrer ? referrerFee : 0; toProtocol = - uint256(amountIn_) * _protocolFeePercentActual / 1e5 + (hasReferrer ? 0 : referrerFee); + uint256(amountIn_) * _protocolFeePercentActual / 100e2 + (hasReferrer ? 0 : referrerFee); return (toReferrer, toProtocol, toReferrer + toProtocol); } @@ -179,7 +183,7 @@ abstract contract BatchAuctionHouseTest is Test, Permit2User, WithSalts { return 0; } - return amountOut_ * _curatorFeePercentActual / 1e5; + return amountOut_ * _curatorFeePercentActual / 100e2; } // ===== Modifiers ===== // @@ -515,11 +519,37 @@ abstract contract BatchAuctionHouseTest is Test, Permit2User, WithSalts { _; } + function _setMaxReferrerFee(uint24 fee_) internal { + vm.prank(_OWNER); + _auctionHouse.setFee(_auctionModuleKeycode, IFeeManager.FeeType.MaxReferrer, fee_); + _maxReferrerFeePercentActual = fee_; + } + + modifier givenMaxReferrerFeeIsSet() { + _setMaxReferrerFee(_REFERRER_MAX_FEE_PERCENT); + _; + } + + function _setReferrerFee(uint24 fee_) internal { + _referrerFeePercentActual = fee_; + _routingParams.referrerFee = fee_; + } + + modifier givenReferrerFee(uint24 fee_) { + _setReferrerFee(fee_); + _; + } + + modifier givenReferrerFeeIsSet() { + _setReferrerFee(_REFERRER_FEE_PERCENT); + _; + } + function _setCuratorFee(uint24 fee_) internal { vm.prank(_CURATOR); _auctionHouse.setCuratorFee(_auctionModuleKeycode, fee_); _curatorFeePercentActual = fee_; - _curatorMaxPotentialFee = _curatorFeePercentActual * _auctionParams.capacity / 1e5; + _curatorMaxPotentialFee = _curatorFeePercentActual * _auctionParams.capacity / 100e2; } modifier givenCuratorFeeIsSet() { @@ -545,17 +575,6 @@ abstract contract BatchAuctionHouseTest is Test, Permit2User, WithSalts { _; } - function _setReferrerFee(uint24 fee_) internal { - vm.prank(_OWNER); - _auctionHouse.setFee(_auctionModuleKeycode, IFeeManager.FeeType.Referrer, fee_); - _referrerFeePercentActual = fee_; - } - - modifier givenReferrerFeeIsSet() { - _setReferrerFee(_REFERRER_FEE_PERCENT); - _; - } - modifier givenBidIsClaimed(uint64 bidId_) { uint64[] memory bids = new uint64[](1); bids[0] = bidId_; diff --git a/test/BatchAuctionHouse/auction.t.sol b/test/BatchAuctionHouse/auction.t.sol index 8a2f530a..ca742219 100644 --- a/test/BatchAuctionHouse/auction.t.sol +++ b/test/BatchAuctionHouse/auction.t.sol @@ -58,6 +58,7 @@ contract BatchCreateAuctionTest is BatchAuctionHouseTest { // [X] reverts when base token is 0 // [X] reverts when quote token is 0 // [X] reverts when the auction type is not batch + // [ ] reverts when the referrer fee is greater than the max referrer fee for the auction type // [X] given the curator fee would cause an overflow // [X] it reverts // [X] creates the auction lot @@ -228,6 +229,24 @@ contract BatchCreateAuctionTest is BatchAuctionHouseTest { ); } + function test_whenReferrerFeeGreaterThanMax_reverts() + external + whenAuctionTypeIsBatch + whenBatchAuctionModuleIsInstalled + givenSellerHasBaseTokenBalance(_LOT_CAPACITY) + givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) + givenMaxReferrerFeeIsSet() + givenProtocolFeeIsSet + givenReferrerFee(_REFERRER_MAX_FEE_PERCENT + 1) + { + // Expect revert + bytes memory err = abi.encodeWithSelector(IAuctionHouse.InvalidParams.selector); + vm.expectRevert(err); + + vm.prank(_SELLER); + _auctionHouse.auction(_routingParams, _auctionParams, _INFO_HASH); + } + function test_success() external whenAuctionTypeIsBatch @@ -877,6 +896,7 @@ contract BatchCreateAuctionTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenCuratorIsSet givenCuratorMaxFeeIsSet @@ -916,6 +936,7 @@ contract BatchCreateAuctionTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenCuratorIsSet givenCuratorMaxFeeIsSet diff --git a/test/BatchAuctionHouse/bid.t.sol b/test/BatchAuctionHouse/bid.t.sol index 1f908cce..7d599525 100644 --- a/test/BatchAuctionHouse/bid.t.sol +++ b/test/BatchAuctionHouse/bid.t.sol @@ -359,17 +359,19 @@ contract BatchBidTest is BatchAuctionHouseTest { ); } - // [X] given there is no referrer fee set for the auction type + // [X] given the referrer fee for the auction is zero // [X] the referrer fee is not accrued - // [X] the referrer fee is not accrued + // [X] given the referrer fee for the auction is not zero + // [X] the referrer fee is not accrued (doesn't happen until the bid is claimed) - function test_givenReferrerFeeIsSet() + function test_givenReferrerFeeIsNonZero() external whenAuctionTypeIsBatch whenBatchAuctionModuleIsInstalled givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) - givenReferrerFeeIsSet + givenMaxReferrerFeeIsSet + givenReferrerFee(1_00) givenLotIsCreated givenLotHasStarted givenUserHasQuoteTokenBalance(_BID_AMOUNT) @@ -403,12 +405,14 @@ contract BatchBidTest is BatchAuctionHouseTest { ); } - function test_givenReferrerFeeIsNotSet() + function test_givenReferrerFeeIsZero() external whenAuctionTypeIsBatch whenBatchAuctionModuleIsInstalled givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) + givenMaxReferrerFeeIsSet + givenReferrerFee(0) givenLotIsCreated givenLotHasStarted givenUserHasQuoteTokenBalance(_BID_AMOUNT) diff --git a/test/BatchAuctionHouse/claimBids.t.sol b/test/BatchAuctionHouse/claimBids.t.sol index 2461a25a..da7658a9 100644 --- a/test/BatchAuctionHouse/claimBids.t.sol +++ b/test/BatchAuctionHouse/claimBids.t.sol @@ -310,6 +310,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenCuratorIsSet givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet givenLotIsCreated @@ -344,6 +345,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenBaseTokenHasDecimals(13) givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet givenLotIsCreated @@ -378,6 +380,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenBaseTokenHasDecimals(17) givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet givenLotIsCreated @@ -403,42 +406,6 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { _assertBaseTokenBalances(); } - function test_givenNoPayout_givenReferrerFeeIsChanged() - external - whenAuctionTypeIsBatch - whenBatchAuctionModuleIsInstalled - givenCuratorIsSet - givenSellerHasBaseTokenBalance(_LOT_CAPACITY) - givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) - givenReferrerFeeIsSet - givenProtocolFeeIsSet - givenLotIsCreated - givenLotHasStarted - givenUserHasQuoteTokenBalance(_scaleQuoteTokenAmount(_BID_AMOUNT)) - givenUserHasQuoteTokenAllowance(_scaleQuoteTokenAmount(_BID_AMOUNT)) - givenBidCreated(_bidder, _scaleQuoteTokenAmount(_BID_AMOUNT), "") - givenBidderTwoHasQuoteTokenBalance(_scaleQuoteTokenAmount(_BID_AMOUNT)) - givenBidderTwoHasQuoteTokenAllowance(_scaleQuoteTokenAmount(_BID_AMOUNT)) - givenBidCreated(_BIDDER_TWO, _scaleQuoteTokenAmount(_BID_AMOUNT), "") - givenPayoutIsNotSet(_bidIds[0], _bidder, _REFERRER, _scaleQuoteTokenAmount(_BID_AMOUNT)) - givenPayoutIsNotSet(_bidIds[1], _BIDDER_TWO, _REFERRER, _scaleQuoteTokenAmount(_BID_AMOUNT)) - givenLotIsConcluded - givenLotSettlementIsNotSuccessful - { - // Change the referrer fee - _setReferrerFee(90); - - // Call the function - vm.prank(address(this)); - _auctionHouse.claimBids(_lotId, _bidIds); - - // Check the accrued fees - // Assertions are not updated with the new fee, so the test will fail if the new fee is used by the AuctionHouse - _assertAccruedFees(); - _assertQuoteTokenBalances(); - _assertBaseTokenBalances(); - } - function test_givenNoPayout_givenProtocolFeeIsChanged() external whenAuctionTypeIsBatch @@ -446,6 +413,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenCuratorIsSet givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet givenLotIsCreated @@ -482,6 +450,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenCuratorIsSet givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet givenLotIsCreated @@ -528,6 +497,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenBaseTokenHasDecimals(13) givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet givenLotIsCreated @@ -574,6 +544,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenBaseTokenHasDecimals(17) givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet givenLotIsCreated @@ -611,54 +582,6 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { _assertBaseTokenBalances(); } - function test_givenPayout_givenReferrerFeeIsChanged() - external - whenAuctionTypeIsBatch - whenBatchAuctionModuleIsInstalled - givenCuratorIsSet - givenSellerHasBaseTokenBalance(_LOT_CAPACITY) - givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) - givenReferrerFeeIsSet - givenProtocolFeeIsSet - givenLotIsCreated - givenLotHasStarted - givenUserHasQuoteTokenBalance(_scaleQuoteTokenAmount(_BID_AMOUNT)) - givenUserHasQuoteTokenAllowance(_scaleQuoteTokenAmount(_BID_AMOUNT)) - givenBidCreated(_bidder, _scaleQuoteTokenAmount(_BID_AMOUNT), "") - givenBidderTwoHasQuoteTokenBalance(_scaleQuoteTokenAmount(_BID_AMOUNT)) - givenBidderTwoHasQuoteTokenAllowance(_scaleQuoteTokenAmount(_BID_AMOUNT)) - givenBidCreated(_BIDDER_TWO, _scaleQuoteTokenAmount(_BID_AMOUNT), "") - givenPayoutIsSet( - _bidIds[0], - _bidder, - _REFERRER, - _scaleQuoteTokenAmount(_BID_AMOUNT), - _scaleBaseTokenAmount(_BID_AMOUNT_OUT) - ) - givenPayoutIsSet( - _bidIds[1], - _BIDDER_TWO, - _REFERRER, - _scaleQuoteTokenAmount(_BID_AMOUNT), - _scaleBaseTokenAmount(_BID_AMOUNT_OUT) - ) - givenLotIsConcluded - givenLotSettlementIsSuccessful - { - // Change the referrer fee - _setReferrerFee(90); - - // Call the function - vm.prank(address(this)); - _auctionHouse.claimBids(_lotId, _bidIds); - - // Check the accrued fees - // Assertions are not updated with the new fee, so the test will fail if the new fee is used by the AuctionHouse - _assertAccruedFees(); - _assertQuoteTokenBalances(); - _assertBaseTokenBalances(); - } - function test_givenPayout_givenProtocolFeeIsChanged() external whenAuctionTypeIsBatch @@ -666,6 +589,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenCuratorIsSet givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet givenLotIsCreated @@ -714,6 +638,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenCuratorIsSet givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet givenLotIsCreated @@ -760,6 +685,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenBaseTokenHasDecimals(13) givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet givenLotIsCreated @@ -806,6 +732,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenBaseTokenHasDecimals(17) givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet givenLotIsCreated @@ -850,6 +777,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenCuratorIsSet givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -895,6 +823,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenBaseTokenHasDecimals(13) givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -940,6 +869,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenBaseTokenHasDecimals(17) givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -1282,6 +1212,7 @@ contract BatchClaimBidsTest is BatchAuctionHouseTest { givenCuratorIsSet givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenProtocolFeeIsSet givenLotIsCreated diff --git a/test/BatchAuctionHouse/settle.t.sol b/test/BatchAuctionHouse/settle.t.sol index 98cc5b19..93d7e55a 100644 --- a/test/BatchAuctionHouse/settle.t.sol +++ b/test/BatchAuctionHouse/settle.t.sol @@ -399,6 +399,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasStarted @@ -431,6 +432,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -463,6 +465,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -495,6 +498,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -524,6 +528,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenCuratorMaxFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenCuratorHasApproved @@ -552,6 +557,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotDoesNotSettle @@ -581,6 +587,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotDoesNotSettle @@ -610,6 +617,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotDoesNotSettle @@ -637,6 +645,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -669,6 +678,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -701,6 +711,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -730,6 +741,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenCuratorMaxFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenCuratorHasApproved @@ -758,6 +770,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -789,6 +802,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasPartialFill @@ -815,6 +829,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasPartialFill @@ -841,6 +856,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasPartialFill @@ -870,6 +886,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenCallbackHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -899,6 +916,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCallbackHasBaseTokenBalance(_LOT_CAPACITY) givenCallbackHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasPartialFill @@ -928,6 +946,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -957,6 +976,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasPartialFill @@ -987,6 +1007,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenCallbackHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1017,6 +1038,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCallbackHasBaseTokenBalance(_LOT_CAPACITY) givenCallbackHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasPartialFill @@ -1042,6 +1064,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotHasPartialFill @@ -1065,6 +1088,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1097,6 +1121,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1129,6 +1154,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1158,6 +1184,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenCuratorMaxFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenCuratorHasApproved @@ -1186,6 +1213,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotIsUnderCapacity @@ -1215,6 +1243,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotIsUnderCapacity @@ -1244,6 +1273,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotIsUnderCapacity @@ -1273,6 +1303,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenCallbackHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1302,6 +1333,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCallbackHasBaseTokenBalance(_LOT_CAPACITY) givenCallbackHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotIsUnderCapacity @@ -1331,6 +1363,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1360,6 +1393,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotIsUnderCapacity @@ -1390,6 +1424,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenCallbackHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1420,6 +1455,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCallbackHasBaseTokenBalance(_LOT_CAPACITY) givenCallbackHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotIsUnderCapacity @@ -1447,6 +1483,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1479,6 +1516,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1511,6 +1549,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1540,6 +1579,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenCuratorMaxFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenCuratorHasApproved @@ -1565,6 +1605,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotCapacityIsFilled @@ -1591,6 +1632,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotCapacityIsFilled @@ -1617,6 +1659,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotCapacityIsFilled @@ -1641,6 +1684,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotCapacityIsFilled @@ -1664,6 +1708,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenCuratorMaxFeeIsSet givenCuratorFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1695,6 +1740,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenCuratorMaxFeeIsSet givenCuratorFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1726,6 +1772,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenAllowance(_scaleBaseTokenAmount(_LOT_CAPACITY)) givenCuratorMaxFeeIsSet givenCuratorFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1937,6 +1984,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenCallbackHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -1966,6 +2014,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCallbackHasBaseTokenBalance(_LOT_CAPACITY) givenCallbackHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotCapacityIsFilled @@ -1995,6 +2044,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenSellerHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -2024,6 +2074,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotCapacityIsFilled @@ -2050,6 +2101,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotCapacityIsFilled @@ -2077,6 +2129,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCuratorMaxFeeIsSet givenCuratorFeeIsSet givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenCallbackHasBaseTokenBalance(_curatorMaxPotentialFee) @@ -2107,6 +2160,7 @@ contract BatchSettleTest is BatchAuctionHouseTest { givenCallbackHasBaseTokenBalance(_LOT_CAPACITY) givenCallbackHasBaseTokenAllowance(_LOT_CAPACITY) givenProtocolFeeIsSet + givenMaxReferrerFeeIsSet givenReferrerFeeIsSet givenLotIsCreated givenLotCapacityIsFilled diff --git a/test/callbacks/MockCallback.sol b/test/callbacks/MockCallback.sol index 0764585f..92fc8f05 100644 --- a/test/callbacks/MockCallback.sol +++ b/test/callbacks/MockCallback.sol @@ -60,7 +60,7 @@ contract MockCallback is BaseCallback { if (prefund_) { if (onCreateMultiplier > 0) { - capacity_ = uint96(uint256(capacity_) * onCreateMultiplier / 1e5); + capacity_ = uint96(uint256(capacity_) * onCreateMultiplier / 100e2); } // Transfer the base tokens to the auction house @@ -90,7 +90,7 @@ contract MockCallback is BaseCallback { if (prefund_) { if (onCurateMultiplier > 0) { - curatorFee_ = uint96(uint256(curatorFee_) * onCurateMultiplier / 1e5); + curatorFee_ = uint96(uint256(curatorFee_) * onCurateMultiplier / 100e2); } // Transfer the base tokens to the auction house @@ -122,7 +122,7 @@ contract MockCallback is BaseCallback { // Do nothing, as tokens have already been transferred } else { if (onPurchaseMultiplier > 0) { - payout_ = uint96(uint256(payout_) * onPurchaseMultiplier / 1e5); + payout_ = uint96(uint256(payout_) * onPurchaseMultiplier / 100e2); } // Transfer the base tokens to the auction house diff --git a/test/callbacks/liquidity/UniswapV2DTL/UniswapV2DTLTest.sol b/test/callbacks/liquidity/UniswapV2DTL/UniswapV2DTLTest.sol index e62d3a4c..ed5899a6 100644 --- a/test/callbacks/liquidity/UniswapV2DTL/UniswapV2DTLTest.sol +++ b/test/callbacks/liquidity/UniswapV2DTL/UniswapV2DTLTest.sol @@ -56,7 +56,7 @@ abstract contract UniswapV2DirectToLiquidityTest is Test, Permit2User, WithSalts // Inputs BaseDirectToLiquidity.OnCreateParams internal _dtlCreateParams = BaseDirectToLiquidity .OnCreateParams({ - proceedsUtilisationPercent: 1e5, + proceedsUtilisationPercent: 100e2, vestingStart: 0, vestingExpiry: 0, recipient: _SELLER, @@ -168,6 +168,7 @@ abstract contract UniswapV2DirectToLiquidityTest is Test, Permit2User, WithSalts auctionType: keycodeFromVeecode(_batchAuctionModule.VEECODE()), baseToken: address(_baseToken), quoteToken: address(_quoteToken), + referrerFee: 0, // No referrer fee curator: address(0), callbacks: _dtl, callbackData: abi.encode(_dtlCreateParams), diff --git a/test/callbacks/liquidity/UniswapV2DTL/onCreate.t.sol b/test/callbacks/liquidity/UniswapV2DTL/onCreate.t.sol index 1996ddea..86a0c370 100644 --- a/test/callbacks/liquidity/UniswapV2DTL/onCreate.t.sol +++ b/test/callbacks/liquidity/UniswapV2DTL/onCreate.t.sol @@ -127,7 +127,7 @@ contract UniswapV2DirectToLiquidityOnCreateTest is UniswapV2DirectToLiquidityTes { // Expect revert bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_PercentOutOfBounds.selector, 0, 1, 1e5 + BaseDirectToLiquidity.Callback_Params_PercentOutOfBounds.selector, 0, 1, 100e2 ); vm.expectRevert(err); @@ -137,11 +137,11 @@ contract UniswapV2DirectToLiquidityOnCreateTest is UniswapV2DirectToLiquidityTes function test_whenProceedsUtilisationIsGreaterThan100Percent_reverts() public givenCallbackIsCreated - givenProceedsUtilisationPercent(1e5 + 1) + givenProceedsUtilisationPercent(100e2 + 1) { // Expect revert bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_PercentOutOfBounds.selector, 1e5 + 1, 1, 1e5 + BaseDirectToLiquidity.Callback_Params_PercentOutOfBounds.selector, 100e2 + 1, 1, 100e2 ); vm.expectRevert(err); diff --git a/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol b/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol index bdb0d32d..17c46b04 100644 --- a/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol +++ b/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol @@ -29,7 +29,7 @@ contract UniswapV2DirectToLiquidityOnSettleTest is UniswapV2DirectToLiquidityTes uint96 internal _baseTokensToDeposit; uint96 internal _curatorPayout; - uint24 internal _maxSlippage = 10; // 0.01% + uint24 internal _maxSlippage = 1; // 0.01% // ========== Internal functions ========== // @@ -176,18 +176,18 @@ contract UniswapV2DirectToLiquidityOnSettleTest is UniswapV2DirectToLiquidityTes // However, curator payouts are linear to the capacity utilised // Calculate the percent utilisation uint96 capacityUtilisationPercent = - 1e5 - uint96(FixedPointMathLib.mulDivDown(_refund, 1e5, _LOT_CAPACITY + _curatorPayout)); - _capacityUtilised = _LOT_CAPACITY * capacityUtilisationPercent / 1e5; + 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 / 1e5; - _baseTokensToDeposit = _capacityUtilised * _dtlCreateParams.proceedsUtilisationPercent / 1e5; + _quoteTokensToDeposit = _proceeds * _dtlCreateParams.proceedsUtilisationPercent / 100e2; + _baseTokensToDeposit = _capacityUtilised * _dtlCreateParams.proceedsUtilisationPercent / 100e2; _; } modifier givenUnboundedProceedsUtilisationPercent(uint24 percent_) { // Bound the percent - uint24 percent = uint24(bound(percent_, 1, 1e5)); + uint24 percent = uint24(bound(percent_, 1, 100e2)); // Set the value on the DTL _dtlCreateParams.proceedsUtilisationPercent = percent; @@ -420,7 +420,7 @@ contract UniswapV2DirectToLiquidityOnSettleTest is UniswapV2DirectToLiquidityTes givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - givenMaxSlippage(5000) // 5% + givenMaxSlippage(500) // 5% { _performCallback(); @@ -458,7 +458,7 @@ contract UniswapV2DirectToLiquidityOnSettleTest is UniswapV2DirectToLiquidityTes givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) - givenMaxSlippage(5000) // 5% + givenMaxSlippage(500) // 5% { _performCallback(); diff --git a/test/callbacks/liquidity/UniswapV3DTL/UniswapV3DTLTest.sol b/test/callbacks/liquidity/UniswapV3DTL/UniswapV3DTLTest.sol index 7d7edd0f..c2c7d984 100644 --- a/test/callbacks/liquidity/UniswapV3DTL/UniswapV3DTLTest.sol +++ b/test/callbacks/liquidity/UniswapV3DTL/UniswapV3DTLTest.sol @@ -57,7 +57,7 @@ abstract contract UniswapV3DirectToLiquidityTest is Test, Permit2User, WithSalts uint24 internal _poolFee = 500; BaseDirectToLiquidity.OnCreateParams internal _dtlCreateParams = BaseDirectToLiquidity .OnCreateParams({ - proceedsUtilisationPercent: 1e5, + proceedsUtilisationPercent: 100e2, vestingStart: 0, vestingExpiry: 0, recipient: _SELLER, @@ -176,6 +176,7 @@ abstract contract UniswapV3DirectToLiquidityTest is Test, Permit2User, WithSalts auctionType: keycodeFromVeecode(_batchAuctionModule.VEECODE()), baseToken: address(_baseToken), quoteToken: address(_quoteToken), + referrerFee: 0, // No referrer fee curator: address(0), callbacks: _dtl, callbackData: abi.encode(_dtlCreateParams), diff --git a/test/callbacks/liquidity/UniswapV3DTL/onCreate.t.sol b/test/callbacks/liquidity/UniswapV3DTL/onCreate.t.sol index e32edc5f..966e2ab0 100644 --- a/test/callbacks/liquidity/UniswapV3DTL/onCreate.t.sol +++ b/test/callbacks/liquidity/UniswapV3DTL/onCreate.t.sol @@ -130,7 +130,7 @@ contract UniswapV3DirectToLiquidityOnCreateTest is UniswapV3DirectToLiquidityTes { // Expect revert bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_PercentOutOfBounds.selector, 0, 1, 1e5 + BaseDirectToLiquidity.Callback_Params_PercentOutOfBounds.selector, 0, 1, 100e2 ); vm.expectRevert(err); @@ -140,11 +140,11 @@ contract UniswapV3DirectToLiquidityOnCreateTest is UniswapV3DirectToLiquidityTes function test_whenProceedsUtilisationIsGreaterThan100Percent_reverts() public givenCallbackIsCreated - givenProceedsUtilisationPercent(1e5 + 1) + givenProceedsUtilisationPercent(100e2 + 1) { // Expect revert bytes memory err = abi.encodeWithSelector( - BaseDirectToLiquidity.Callback_Params_PercentOutOfBounds.selector, 1e5 + 1, 1, 1e5 + BaseDirectToLiquidity.Callback_Params_PercentOutOfBounds.selector, 100e2 + 1, 1, 100e2 ); vm.expectRevert(err); diff --git a/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol b/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol index 074c9936..d4eefd95 100644 --- a/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol +++ b/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol @@ -29,7 +29,7 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes uint96 internal _quoteTokensToDeposit; uint96 internal _baseTokensToDeposit; uint96 internal _curatorPayout; - uint24 internal _maxSlippage = 10; // 0.01% + 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 @@ -214,12 +214,12 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes // However, curator payouts are linear to the capacity utilised // Calculate the percent utilisation uint96 capacityUtilisationPercent = - 1e5 - uint96(FixedPointMathLib.mulDivDown(_refund, 1e5, _LOT_CAPACITY + _curatorPayout)); - _capacityUtilised = _LOT_CAPACITY * capacityUtilisationPercent / 1e5; + 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 / 1e5; - _baseTokensToDeposit = _capacityUtilised * _dtlCreateParams.proceedsUtilisationPercent / 1e5; + _quoteTokensToDeposit = _proceeds * _dtlCreateParams.proceedsUtilisationPercent / 100e2; + _baseTokensToDeposit = _capacityUtilised * _dtlCreateParams.proceedsUtilisationPercent / 100e2; _sqrtPriceX96 = _calculateSqrtPriceX96(_quoteTokensToDeposit, _baseTokensToDeposit); _; @@ -227,7 +227,7 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes modifier givenUnboundedProceedsUtilisationPercent(uint24 percent_) { // Bound the percent - uint24 percent = uint24(bound(percent_, 1, 1e5)); + uint24 percent = uint24(bound(percent_, 1, 100e2)); // Set the value on the DTL _dtlCreateParams.proceedsUtilisationPercent = percent; @@ -332,7 +332,7 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - givenMaxSlippage(81_000) // 81% + givenMaxSlippage(81_00) // 81% { _performCallback(); @@ -457,7 +457,7 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes setCallbackParameters(_PROCEEDS, _REFUND) givenPoolHasDepositLowerPrice givenPoolIsCreatedAndInitialized(_sqrtPriceX96) - givenMaxSlippage(51_000) // 51% + givenMaxSlippage(51_00) // 51% givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) @@ -479,7 +479,7 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes setCallbackParameters(_PROCEEDS, _REFUND) givenPoolHasDepositHigherPrice givenPoolIsCreatedAndInitialized(_sqrtPriceX96) - givenMaxSlippage(51_000) // 51% + givenMaxSlippage(51_00) // 51% givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) @@ -499,7 +499,7 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes givenCallbackIsCreated givenOnCreate setCallbackParameters(_PROCEEDS, _REFUND) - givenMaxSlippage(100) // 0.01% + givenMaxSlippage(1) // 0.01% givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) diff --git a/test/modules/Auction/MockAtomicAuctionModule.sol b/test/modules/Auction/MockAtomicAuctionModule.sol index 4563f8fe..a3ec9503 100644 --- a/test/modules/Auction/MockAtomicAuctionModule.sol +++ b/test/modules/Auction/MockAtomicAuctionModule.sol @@ -49,7 +49,7 @@ contract MockAtomicAuctionModule is AtomicAuctionModule { if (payoutData[lotId_] == 0) { payout = uint96(adjustedAmount); } else { - payout = uint96((payoutData[lotId_] * adjustedAmount) / 1e5); + payout = uint96((payoutData[lotId_] * adjustedAmount) / 100e2); } // Reduce capacity diff --git a/test/modules/Auction/auction.t.sol b/test/modules/Auction/auction.t.sol index 3d675dea..74cc2452 100644 --- a/test/modules/Auction/auction.t.sol +++ b/test/modules/Auction/auction.t.sol @@ -15,6 +15,7 @@ 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"; @@ -35,6 +36,8 @@ contract AuctionTest is Test, Permit2User { uint8 internal constant _QUOTE_TOKEN_DECIMALS = 18; uint8 internal constant _BASE_TOKEN_DECIMALS = 18; + uint48 internal constant _REFERRER_FEE = 1_00; + function setUp() external { // Ensure the block timestamp is a sane value vm.warp(1_000_000); @@ -48,6 +51,8 @@ contract AuctionTest is Test, Permit2User { _auctionHouse.installModule(_mockAuctionModule); + _auctionHouse.setFee(_mockAuctionModuleKeycode, IFeeManager.FeeType.MaxReferrer, 10_00); + _auctionParams = IAuction.AuctionParams({ start: uint48(block.timestamp), duration: uint48(1 days), @@ -60,6 +65,7 @@ contract AuctionTest is Test, Permit2User { auctionType: _mockAuctionModuleKeycode, baseToken: address(_baseToken), quoteToken: address(_quoteToken), + referrerFee: _REFERRER_FEE, curator: address(0), callbacks: ICallback(address(0)), callbackData: abi.encode(""), diff --git a/test/modules/Auction/cancel.t.sol b/test/modules/Auction/cancel.t.sol index ee469b3b..d57f4cfa 100644 --- a/test/modules/Auction/cancel.t.sol +++ b/test/modules/Auction/cancel.t.sol @@ -14,6 +14,7 @@ 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"; @@ -33,6 +34,7 @@ contract CancelTest is Test, Permit2User { address internal constant _SELLER = address(0x1); address internal constant _PROTOCOL = address(0x2); uint48 internal constant _DURATION = 1 days; + uint48 internal constant _REFERRER_FEE = 1_00; string internal _infoHash = ""; @@ -46,6 +48,8 @@ contract CancelTest is Test, Permit2User { _auctionHouse.installModule(_mockAuctionModule); + _auctionHouse.setFee(_mockAuctionModuleKeycode, IFeeManager.FeeType.MaxReferrer, 10_00); + _auctionParams = IAuction.AuctionParams({ start: uint48(block.timestamp), duration: _DURATION, @@ -58,6 +62,7 @@ contract CancelTest is Test, Permit2User { auctionType: _mockAuctionModuleKeycode, baseToken: address(_baseToken), quoteToken: address(_quoteToken), + referrerFee: _REFERRER_FEE, curator: address(0), callbacks: ICallback(address(0)), callbackData: abi.encode(""), diff --git a/test/modules/auctions/EMP/EMPTest.sol b/test/modules/auctions/EMP/EMPTest.sol index f6b2ddb6..0443e23a 100644 --- a/test/modules/auctions/EMP/EMPTest.sol +++ b/test/modules/auctions/EMP/EMPTest.sol @@ -26,7 +26,7 @@ abstract contract EmpTest is Test, Permit2User { uint256 internal constant _LOT_CAPACITY = 10e18; uint48 internal constant _DURATION = 1 days; uint256 internal constant _MIN_PRICE = 1e18; - uint24 internal constant _MIN_FILL_PERCENT = 25_000; // 25% + uint24 internal constant _MIN_FILL_PERCENT = 25e2; // 25% uint256 internal constant _MIN_BID_SIZE = 1e15; // 0.001 quote tokens uint256 internal constant _AUCTION_PRIVATE_KEY = 112_233_445_566; diff --git a/test/modules/auctions/EMP/auction.t.sol b/test/modules/auctions/EMP/auction.t.sol index 278c8899..51422324 100644 --- a/test/modules/auctions/EMP/auction.t.sol +++ b/test/modules/auctions/EMP/auction.t.sol @@ -72,7 +72,7 @@ contract EmpCreateAuctionTest is EmpTest { _createAuctionLot(); } - function test_minFillAboveMax_reverts() public givenMinimumFillPercentage(1e5 + 1) { + function test_minFillAboveMax_reverts() public givenMinimumFillPercentage(100e2 + 1) { // Expect revert bytes memory err = abi.encodeWithSelector(IAuction.Auction_InvalidParams.selector); vm.expectRevert(err); @@ -152,7 +152,7 @@ contract EmpCreateAuctionTest is EmpTest { assertEq(auctionData.minPrice, _scaleQuoteTokenAmount(_MIN_PRICE), "minPrice"); assertEq(auctionData.nextDecryptIndex, 0, "nextDecryptIndex"); assertEq( - auctionData.minFilled, _scaleBaseTokenAmount(_LOT_CAPACITY) * _MIN_FILL_PERCENT / 1e5 + auctionData.minFilled, _scaleBaseTokenAmount(_LOT_CAPACITY) * _MIN_FILL_PERCENT / 100e2 ); assertEq(auctionData.minBidSize, _scaleQuoteTokenAmount(_MIN_BID_SIZE), "minBidSize"); assertEq( @@ -188,7 +188,7 @@ contract EmpCreateAuctionTest is EmpTest { assertEq(auctionData.minPrice, _scaleQuoteTokenAmount(_MIN_PRICE), "minPrice"); assertEq(auctionData.nextDecryptIndex, 0, "nextDecryptIndex"); assertEq( - auctionData.minFilled, _scaleBaseTokenAmount(_LOT_CAPACITY) * _MIN_FILL_PERCENT / 1e5 + auctionData.minFilled, _scaleBaseTokenAmount(_LOT_CAPACITY) * _MIN_FILL_PERCENT / 100e2 ); assertEq(auctionData.minBidSize, _scaleQuoteTokenAmount(_MIN_BID_SIZE), "minBidSize"); assertEq( @@ -224,7 +224,7 @@ contract EmpCreateAuctionTest is EmpTest { assertEq(auctionData.minPrice, _scaleQuoteTokenAmount(_MIN_PRICE), "minPrice"); assertEq(auctionData.nextDecryptIndex, 0, "nextDecryptIndex"); assertEq( - auctionData.minFilled, _scaleBaseTokenAmount(_LOT_CAPACITY) * _MIN_FILL_PERCENT / 1e5 + auctionData.minFilled, _scaleBaseTokenAmount(_LOT_CAPACITY) * _MIN_FILL_PERCENT / 100e2 ); assertEq(auctionData.minBidSize, _scaleQuoteTokenAmount(_MIN_BID_SIZE), "minBidSize"); assertEq( diff --git a/test/modules/auctions/EMP/claimBids.t.sol b/test/modules/auctions/EMP/claimBids.t.sol index 04093cc4..78f8cddb 100644 --- a/test/modules/auctions/EMP/claimBids.t.sol +++ b/test/modules/auctions/EMP/claimBids.t.sol @@ -273,7 +273,7 @@ contract EmpClaimBidsTest is EmpTest { givenLotIsCreated givenLotHasStarted { - uint256 minFillAmount = _MIN_FILL_PERCENT * _LOT_CAPACITY / 1e5; + uint256 minFillAmount = _MIN_FILL_PERCENT * _LOT_CAPACITY / 100e2; // Bound the amounts uint256 bidAmountIn = bound(bidAmountIn_, 1e18, minFillAmount - 1); // Ensures that it cannot settle even at minimum price uint256 bidAmountOut = 1e18; // at minimum price diff --git a/test/modules/auctions/FPB/FPBTest.sol b/test/modules/auctions/FPB/FPBTest.sol index 519499ea..6252171b 100644 --- a/test/modules/auctions/FPB/FPBTest.sol +++ b/test/modules/auctions/FPB/FPBTest.sol @@ -24,7 +24,7 @@ abstract contract FpbTest is Test, Permit2User { uint256 internal constant _LOT_CAPACITY = 10e18; uint48 internal constant _DURATION = 1 days; - uint24 internal constant _MIN_FILL_PERCENT = 5e4; // 50% + uint24 internal constant _MIN_FILL_PERCENT = 50e2; // 50% uint256 internal constant _PRICE = 2e18; BatchAuctionHouse internal _auctionHouse; diff --git a/test/modules/auctions/FPB/auction.t.sol b/test/modules/auctions/FPB/auction.t.sol index 18c72a0a..56e6750a 100644 --- a/test/modules/auctions/FPB/auction.t.sol +++ b/test/modules/auctions/FPB/auction.t.sol @@ -66,7 +66,7 @@ contract FpbCreateAuctionTest is FpbTest { _createAuctionLot(); } - function test_minFillPercentageGreaterThan100_reverts() public givenMinFillPercent(1e5 + 1) { + function test_minFillPercentageGreaterThan100_reverts() public givenMinFillPercent(100e2 + 1) { // Expect revert bytes memory err = abi.encodeWithSelector(IAuction.Auction_InvalidParams.selector); vm.expectRevert(err); @@ -92,14 +92,14 @@ contract FpbCreateAuctionTest is FpbTest { _setCapacity(capacity); uint256 price = bound(price_, 1, type(uint256).max); _setPrice(price); - uint24 minFillPercent = uint24(bound(minFillPercent_, 0, 1e5)); + uint24 minFillPercent = uint24(bound(minFillPercent_, 0, 100e2)); _setMinFillPercent(minFillPercent); // Call the function _createAuctionLot(); // Round up to be conservative - uint256 minFilled = Math.fullMulDivUp(capacity, minFillPercent, 1e5); + uint256 minFilled = Math.fullMulDivUp(capacity, minFillPercent, 100e2); // Assert state IAuction.Lot memory lotData = _module.getLot(_lotId); diff --git a/test/modules/auctions/FPB/settle.t.sol b/test/modules/auctions/FPB/settle.t.sol index 592d78e7..c4473c56 100644 --- a/test/modules/auctions/FPB/settle.t.sol +++ b/test/modules/auctions/FPB/settle.t.sol @@ -187,7 +187,7 @@ contract FpbSettleTest is FpbTest { function test_settle_doesNotBrick() public givenPrice(2e18) - givenMinFillPercent(100e3) + givenMinFillPercent(100e2) givenLotCapacity(10e18) givenLotIsCreated givenLotHasStarted diff --git a/test/modules/auctions/FPS/FPSTest.sol b/test/modules/auctions/FPS/FPSTest.sol index 02acca73..e89513d1 100644 --- a/test/modules/auctions/FPS/FPSTest.sol +++ b/test/modules/auctions/FPS/FPSTest.sol @@ -23,7 +23,7 @@ abstract contract FpsTest is Test, Permit2User { uint256 internal constant _LOT_CAPACITY = 10e18; uint48 internal constant _DURATION = 1 days; - uint24 internal constant _MAX_PAYOUT_PERCENT = 5e4; // 50% + uint24 internal constant _MAX_PAYOUT_PERCENT = 50e2; // 50% uint256 internal constant _PRICE = 2e18; AtomicAuctionHouse internal _auctionHouse; diff --git a/test/modules/auctions/FPS/auction.t.sol b/test/modules/auctions/FPS/auction.t.sol index 1e56dc3e..daac3782 100644 --- a/test/modules/auctions/FPS/auction.t.sol +++ b/test/modules/auctions/FPS/auction.t.sol @@ -71,7 +71,7 @@ contract FpsCreateAuctionTest is FpsTest { } function test_maxPayoutPercentIsLessThanMinimum_reverts(uint24 maxPayout_) public { - uint24 maxPayout = uint24(bound(maxPayout_, 0, 1e3 - 1)); + uint24 maxPayout = uint24(bound(maxPayout_, 0, 1e2 - 1)); _setMaxPayout(maxPayout); // Expect revert @@ -83,7 +83,7 @@ contract FpsCreateAuctionTest is FpsTest { } function test_maxPayoutPercentIsGreaterThanMaximum_reverts(uint24 maxPayout_) public { - uint24 maxPayout = uint24(bound(maxPayout_, 1e5 + 1, type(uint24).max)); + uint24 maxPayout = uint24(bound(maxPayout_, 100e2 + 1, type(uint24).max)); _setMaxPayout(maxPayout); // Expect revert @@ -95,11 +95,11 @@ contract FpsCreateAuctionTest is FpsTest { } function test_maxPayoutPercent_fuzz(uint24 maxPayout_) public { - uint24 maxPayout = uint24(bound(maxPayout_, 1e3, 1e5)); + uint24 maxPayout = uint24(bound(maxPayout_, 1e2, 100e2)); _setMaxPayout(maxPayout); // Calculate the expected value - uint256 expectedMaxPayout = Math.mulDivDown(_LOT_CAPACITY, maxPayout, 1e5); + uint256 expectedMaxPayout = Math.mulDivDown(_LOT_CAPACITY, maxPayout, 100e2); // Call the function _createAuctionLot(); @@ -112,7 +112,7 @@ contract FpsCreateAuctionTest is FpsTest { function test_capacityInQuote() public givenCapacityInQuote { // Calculate the expected value uint256 expectedMaxPayoutInQuote = - Math.mulDivDown(_scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 1e5); + Math.mulDivDown(_scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2); uint256 expectedMaxPayout = Math.mulDivDown( expectedMaxPayoutInQuote, 10 ** _baseTokenDecimals, _scaleQuoteTokenAmount(_PRICE) ); @@ -140,7 +140,7 @@ contract FpsCreateAuctionTest is FpsTest { { // Calculate the expected value uint256 expectedMaxPayoutInQuote = - Math.mulDivDown(_scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 1e5); + Math.mulDivDown(_scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2); uint256 expectedMaxPayout = Math.mulDivDown( expectedMaxPayoutInQuote, 10 ** _baseTokenDecimals, _scaleQuoteTokenAmount(_PRICE) ); @@ -168,7 +168,7 @@ contract FpsCreateAuctionTest is FpsTest { { // Calculate the expected value uint256 expectedMaxPayoutInQuote = - Math.mulDivDown(_scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 1e5); + Math.mulDivDown(_scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2); uint256 expectedMaxPayout = Math.mulDivDown( expectedMaxPayoutInQuote, 10 ** _baseTokenDecimals, _scaleQuoteTokenAmount(_PRICE) ); @@ -208,7 +208,7 @@ contract FpsCreateAuctionTest is FpsTest { assertEq(auctionData.price, _scaleQuoteTokenAmount(_PRICE), "price"); assertEq( auctionData.maxPayout, - Math.mulDivDown(_scaleBaseTokenAmount(_LOT_CAPACITY), _MAX_PAYOUT_PERCENT, 1e5), + Math.mulDivDown(_scaleBaseTokenAmount(_LOT_CAPACITY), _MAX_PAYOUT_PERCENT, 100e2), "maxPayout" ); } @@ -237,7 +237,7 @@ contract FpsCreateAuctionTest is FpsTest { assertEq(auctionData.price, _scaleQuoteTokenAmount(_PRICE), "price"); assertEq( auctionData.maxPayout, - Math.mulDivDown(_scaleBaseTokenAmount(_LOT_CAPACITY), _MAX_PAYOUT_PERCENT, 1e5), + Math.mulDivDown(_scaleBaseTokenAmount(_LOT_CAPACITY), _MAX_PAYOUT_PERCENT, 100e2), "maxPayout" ); } @@ -266,7 +266,7 @@ contract FpsCreateAuctionTest is FpsTest { assertEq(auctionData.price, _scaleQuoteTokenAmount(_PRICE), "price"); assertEq( auctionData.maxPayout, - Math.mulDivDown(_scaleBaseTokenAmount(_LOT_CAPACITY), _MAX_PAYOUT_PERCENT, 1e5), + Math.mulDivDown(_scaleBaseTokenAmount(_LOT_CAPACITY), _MAX_PAYOUT_PERCENT, 100e2), "maxPayout" ); } diff --git a/test/modules/auctions/FPS/purchase.t.sol b/test/modules/auctions/FPS/purchase.t.sol index 7332ae03..1a2e468d 100644 --- a/test/modules/auctions/FPS/purchase.t.sol +++ b/test/modules/auctions/FPS/purchase.t.sol @@ -82,7 +82,7 @@ contract FpsPurchaseTest is FpsTest { function test_whenCapacityIsInsufficient_reverts() public givenLotCapacity(2e18) - givenMaxPayout(1e5) + givenMaxPayout(100e2) givenLotIsCreated givenLotHasStarted givenPurchase(_PURCHASE_AMOUNT, _PURCHASE_AMOUNT_OUT) // Payout 1, remaining capacity is 2 - 1 = 1 @@ -99,7 +99,7 @@ contract FpsPurchaseTest is FpsTest { public givenCapacityInQuote givenLotCapacity(3e18) - givenMaxPayout(1e5) + givenMaxPayout(100e2) givenLotIsCreated givenLotHasStarted givenPurchase(_PURCHASE_AMOUNT, _PURCHASE_AMOUNT_OUT) // Payout 1, remaining capacity is 3 - 2 = 1 diff --git a/test/modules/derivatives/LinearVestingEMPAIntegration.t.sol b/test/modules/derivatives/LinearVestingEMPAIntegration.t.sol index bbb906c3..718ca5fc 100644 --- a/test/modules/derivatives/LinearVestingEMPAIntegration.t.sol +++ b/test/modules/derivatives/LinearVestingEMPAIntegration.t.sol @@ -27,7 +27,7 @@ contract LinearVestingEMPAIntegrationTest is BatchAuctionHouseTest { EncryptedMarginalPrice.AuctionDataParams internal _auctionDataParams; uint256 internal constant _MIN_PRICE = 1e18; - uint24 internal constant _MIN_FILL_PERCENT = 25_000; // 25% + uint24 internal constant _MIN_FILL_PERCENT = 25e2; // 25% uint256 internal constant _MIN_BID_SIZE = 1e17; // 0.1 quote tokens ILinearVesting.VestingParams internal _linearVestingParams; From 4b3aa138bea721ae9c3cb89e7f4d6d25f9d04b38 Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 2 Jul 2024 17:15:37 -0400 Subject: [PATCH 58/82] chore: linter --- .../test/FixedPriceBatch-BaseDTL/TestData.s.sol | 4 ++-- script/ops/test/FixedPriceBatch/TestData.s.sol | 2 +- script/ops/test/TestData.s.sol | 2 +- src/modules/auctions/batch/FPB.sol | 2 +- test/AtomicAuctionHouse/AuctionHouseTest.sol | 8 ++++---- test/AtomicAuctionHouse/cancelAuction.t.sol | 2 +- test/AtomicAuctionHouse/purchase.t.sol | 4 ++-- test/BatchAuctionHouse/AuctionHouseTest.sol | 8 ++++---- test/BatchAuctionHouse/auction.t.sol | 2 +- test/BatchAuctionHouse/bid.t.sol | 2 +- .../liquidity/UniswapV2DTL/onSettle.t.sol | 7 ++++--- .../liquidity/UniswapV3DTL/onSettle.t.sol | 13 +++++++------ test/modules/Auction/auction.t.sol | 4 ++-- test/modules/Auction/cancel.t.sol | 4 ++-- test/modules/auctions/FPS/auction.t.sol | 15 +++++++++------ 15 files changed, 42 insertions(+), 37 deletions(-) diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol index d1279a43..80eddd9d 100644 --- a/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol +++ b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol @@ -61,7 +61,7 @@ contract TestData is Script, WithEnvironment { routingParams.callbackData = abi.encode( BaseDirectToLiquidity.OnCreateParams({ - proceedsUtilisationPercent: 50_00, // 50% + proceedsUtilisationPercent: 5000, // 50% vestingStart: 0, vestingExpiry: 0, recipient: msg.sender, @@ -80,7 +80,7 @@ contract TestData is Script, WithEnvironment { IFixedPriceBatch.AuctionDataParams memory auctionDataParams; auctionDataParams.price = 2e18; // 2 quote tokens per base token - auctionDataParams.minFillPercent = uint24(10_00); // 10% + auctionDataParams.minFillPercent = uint24(1000); // 10% bytes memory implParams = abi.encode(auctionDataParams); uint48 duration = 86_400; // 1 day diff --git a/script/ops/test/FixedPriceBatch/TestData.s.sol b/script/ops/test/FixedPriceBatch/TestData.s.sol index abd57ddb..70834a6c 100644 --- a/script/ops/test/FixedPriceBatch/TestData.s.sol +++ b/script/ops/test/FixedPriceBatch/TestData.s.sol @@ -68,7 +68,7 @@ contract TestData is Script, WithEnvironment { IFixedPriceBatch.AuctionDataParams memory auctionDataParams; auctionDataParams.price = 1e18; // 1 quote tokens per base token - auctionDataParams.minFillPercent = uint24(10_00); // 10% + auctionDataParams.minFillPercent = uint24(1000); // 10% bytes memory implParams = abi.encode(auctionDataParams); uint48 duration = 86_400; // 1 day diff --git a/script/ops/test/TestData.s.sol b/script/ops/test/TestData.s.sol index 7e3da732..c2a80bfc 100644 --- a/script/ops/test/TestData.s.sol +++ b/script/ops/test/TestData.s.sol @@ -68,7 +68,7 @@ contract TestData is Script { EncryptedMarginalPrice.AuctionDataParams memory auctionDataParams; auctionDataParams.minPrice = 2e18; // 2 quote tokens per base token - auctionDataParams.minFillPercent = uint24(10_00); // 10% + auctionDataParams.minFillPercent = uint24(1000); // 10% auctionDataParams.minBidSize = 2e17; // 0.2 quote tokens auctionDataParams.publicKey = publicKey; bytes memory implParams = abi.encode(auctionDataParams); diff --git a/src/modules/auctions/batch/FPB.sol b/src/modules/auctions/batch/FPB.sol index 8b3b9e0c..e65f1f2a 100644 --- a/src/modules/auctions/batch/FPB.sol +++ b/src/modules/auctions/batch/FPB.sol @@ -57,7 +57,7 @@ contract FixedPriceBatch is BatchAuctionModule, IFixedPriceBatch { /// This function reverts if: /// - The parameters cannot be decoded into the correct format /// - The price is zero - /// - The minimum fill percentage is greater than + /// - The minimum fill percentage is greater than /// /// @param params_ ABI-encoded data of type `AuctionDataParams` function _auction(uint96 lotId_, Lot memory lot_, bytes memory params_) internal override { diff --git a/test/AtomicAuctionHouse/AuctionHouseTest.sol b/test/AtomicAuctionHouse/AuctionHouseTest.sol index 2a0fd7dc..89d38fe4 100644 --- a/test/AtomicAuctionHouse/AuctionHouseTest.sol +++ b/test/AtomicAuctionHouse/AuctionHouseTest.sol @@ -61,13 +61,13 @@ abstract contract AtomicAuctionHouseTest is Test, Permit2User, WithSalts { address internal _bidder; uint256 internal _bidderKey; - uint24 internal constant _CURATOR_MAX_FEE_PERCENT = 1_00; + uint24 internal constant _CURATOR_MAX_FEE_PERCENT = 100; uint24 internal constant _CURATOR_FEE_PERCENT = 90; uint24 internal _curatorFeePercentActual; - uint24 internal constant _PROTOCOL_FEE_PERCENT = 1_00; - uint24 internal constant _REFERRER_FEE_PERCENT = 1_05; - uint24 internal constant _REFERRER_MAX_FEE_PERCENT = 10_00; + uint24 internal constant _PROTOCOL_FEE_PERCENT = 100; + uint24 internal constant _REFERRER_FEE_PERCENT = 105; + uint24 internal constant _REFERRER_MAX_FEE_PERCENT = 1000; uint24 internal _referrerFeePercentActual; uint24 internal _protocolFeePercentActual; diff --git a/test/AtomicAuctionHouse/cancelAuction.t.sol b/test/AtomicAuctionHouse/cancelAuction.t.sol index f404ead6..a14a3477 100644 --- a/test/AtomicAuctionHouse/cancelAuction.t.sol +++ b/test/AtomicAuctionHouse/cancelAuction.t.sol @@ -10,7 +10,7 @@ import {AtomicAuctionHouseTest} from "test/AtomicAuctionHouse/AuctionHouseTest.s contract AtomicCancelAuctionTest is AtomicAuctionHouseTest { uint256 internal constant _PURCHASE_AMOUNT = 2e18; uint256 internal constant _PURCHASE_AMOUNT_OUT = 1e18; - uint32 internal constant _PAYOUT_MULTIPLIER = 50_00; // 50% + uint32 internal constant _PAYOUT_MULTIPLIER = 5000; // 50% bytes internal _purchaseAuctionData = abi.encode(""); diff --git a/test/AtomicAuctionHouse/purchase.t.sol b/test/AtomicAuctionHouse/purchase.t.sol index dde26bb5..085aceaa 100644 --- a/test/AtomicAuctionHouse/purchase.t.sol +++ b/test/AtomicAuctionHouse/purchase.t.sol @@ -11,7 +11,7 @@ import {AtomicAuctionHouseTest} from "test/AtomicAuctionHouse/AuctionHouseTest.s contract AtomicPurchaseTest is AtomicAuctionHouseTest { uint256 internal constant _AMOUNT_IN = 2e18; - uint256 internal constant _PAYOUT_MULTIPLIER = 50_00; // 50% + uint256 internal constant _PAYOUT_MULTIPLIER = 5000; // 50% address internal constant _SENDER = address(0x26); @@ -314,7 +314,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenUserHasQuoteTokenBalance(_AMOUNT_IN) givenUserHasQuoteTokenAllowance(_AMOUNT_IN) givenFeesAreCalculated(_AMOUNT_IN) - whenPayoutMultiplierIsSet(90_00) + whenPayoutMultiplierIsSet(9000) givenSellerHasBaseTokenBalance(_amountOut) givenSellerHasBaseTokenAllowance(_amountOut) { diff --git a/test/BatchAuctionHouse/AuctionHouseTest.sol b/test/BatchAuctionHouse/AuctionHouseTest.sol index f9fa754a..f0eeee7a 100644 --- a/test/BatchAuctionHouse/AuctionHouseTest.sol +++ b/test/BatchAuctionHouse/AuctionHouseTest.sol @@ -60,13 +60,13 @@ abstract contract BatchAuctionHouseTest is Test, Permit2User, WithSalts { address internal _bidder; uint256 internal _bidderKey; - uint24 internal constant _CURATOR_MAX_FEE_PERCENT = 1_00; + uint24 internal constant _CURATOR_MAX_FEE_PERCENT = 100; uint24 internal constant _CURATOR_FEE_PERCENT = 90; uint24 internal _curatorFeePercentActual; - uint24 internal constant _PROTOCOL_FEE_PERCENT = 1_00; - uint24 internal constant _REFERRER_FEE_PERCENT = 1_05; - uint24 internal constant _REFERRER_MAX_FEE_PERCENT = 10_00; + uint24 internal constant _PROTOCOL_FEE_PERCENT = 100; + uint24 internal constant _REFERRER_FEE_PERCENT = 105; + uint24 internal constant _REFERRER_MAX_FEE_PERCENT = 1000; uint24 internal _referrerFeePercentActual; uint24 internal _protocolFeePercentActual; diff --git a/test/BatchAuctionHouse/auction.t.sol b/test/BatchAuctionHouse/auction.t.sol index ca742219..20b6a75d 100644 --- a/test/BatchAuctionHouse/auction.t.sol +++ b/test/BatchAuctionHouse/auction.t.sol @@ -235,7 +235,7 @@ contract BatchCreateAuctionTest is BatchAuctionHouseTest { whenBatchAuctionModuleIsInstalled givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) - givenMaxReferrerFeeIsSet() + givenMaxReferrerFeeIsSet givenProtocolFeeIsSet givenReferrerFee(_REFERRER_MAX_FEE_PERCENT + 1) { diff --git a/test/BatchAuctionHouse/bid.t.sol b/test/BatchAuctionHouse/bid.t.sol index 7d599525..5a077a19 100644 --- a/test/BatchAuctionHouse/bid.t.sol +++ b/test/BatchAuctionHouse/bid.t.sol @@ -371,7 +371,7 @@ contract BatchBidTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenMaxReferrerFeeIsSet - givenReferrerFee(1_00) + givenReferrerFee(100) givenLotIsCreated givenLotHasStarted givenUserHasQuoteTokenBalance(_BID_AMOUNT) diff --git a/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol b/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol index 17c46b04..60bef165 100644 --- a/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol +++ b/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol @@ -175,13 +175,14 @@ contract UniswapV2DirectToLiquidityOnSettleTest is UniswapV2DirectToLiquidityTes // 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)); + 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; + _baseTokensToDeposit = + _capacityUtilised * _dtlCreateParams.proceedsUtilisationPercent / 100e2; _; } diff --git a/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol b/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol index d4eefd95..ededd302 100644 --- a/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol +++ b/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol @@ -213,13 +213,14 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes // 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)); + 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; + _baseTokensToDeposit = + _capacityUtilised * _dtlCreateParams.proceedsUtilisationPercent / 100e2; _sqrtPriceX96 = _calculateSqrtPriceX96(_quoteTokensToDeposit, _baseTokensToDeposit); _; @@ -332,7 +333,7 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - givenMaxSlippage(81_00) // 81% + givenMaxSlippage(8100) // 81% { _performCallback(); @@ -457,7 +458,7 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes setCallbackParameters(_PROCEEDS, _REFUND) givenPoolHasDepositLowerPrice givenPoolIsCreatedAndInitialized(_sqrtPriceX96) - givenMaxSlippage(51_00) // 51% + givenMaxSlippage(5100) // 51% givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) @@ -479,7 +480,7 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes setCallbackParameters(_PROCEEDS, _REFUND) givenPoolHasDepositHigherPrice givenPoolIsCreatedAndInitialized(_sqrtPriceX96) - givenMaxSlippage(51_00) // 51% + givenMaxSlippage(5100) // 51% givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) diff --git a/test/modules/Auction/auction.t.sol b/test/modules/Auction/auction.t.sol index 74cc2452..6e03e6b3 100644 --- a/test/modules/Auction/auction.t.sol +++ b/test/modules/Auction/auction.t.sol @@ -36,7 +36,7 @@ contract AuctionTest is Test, Permit2User { uint8 internal constant _QUOTE_TOKEN_DECIMALS = 18; uint8 internal constant _BASE_TOKEN_DECIMALS = 18; - uint48 internal constant _REFERRER_FEE = 1_00; + uint48 internal constant _REFERRER_FEE = 100; function setUp() external { // Ensure the block timestamp is a sane value @@ -51,7 +51,7 @@ contract AuctionTest is Test, Permit2User { _auctionHouse.installModule(_mockAuctionModule); - _auctionHouse.setFee(_mockAuctionModuleKeycode, IFeeManager.FeeType.MaxReferrer, 10_00); + _auctionHouse.setFee(_mockAuctionModuleKeycode, IFeeManager.FeeType.MaxReferrer, 1000); _auctionParams = IAuction.AuctionParams({ start: uint48(block.timestamp), diff --git a/test/modules/Auction/cancel.t.sol b/test/modules/Auction/cancel.t.sol index d57f4cfa..6bb3acea 100644 --- a/test/modules/Auction/cancel.t.sol +++ b/test/modules/Auction/cancel.t.sol @@ -34,7 +34,7 @@ contract CancelTest is Test, Permit2User { address internal constant _SELLER = address(0x1); address internal constant _PROTOCOL = address(0x2); uint48 internal constant _DURATION = 1 days; - uint48 internal constant _REFERRER_FEE = 1_00; + uint48 internal constant _REFERRER_FEE = 100; string internal _infoHash = ""; @@ -48,7 +48,7 @@ contract CancelTest is Test, Permit2User { _auctionHouse.installModule(_mockAuctionModule); - _auctionHouse.setFee(_mockAuctionModuleKeycode, IFeeManager.FeeType.MaxReferrer, 10_00); + _auctionHouse.setFee(_mockAuctionModuleKeycode, IFeeManager.FeeType.MaxReferrer, 1000); _auctionParams = IAuction.AuctionParams({ start: uint48(block.timestamp), diff --git a/test/modules/auctions/FPS/auction.t.sol b/test/modules/auctions/FPS/auction.t.sol index daac3782..f9d2ba9e 100644 --- a/test/modules/auctions/FPS/auction.t.sol +++ b/test/modules/auctions/FPS/auction.t.sol @@ -111,8 +111,9 @@ contract FpsCreateAuctionTest is FpsTest { function test_capacityInQuote() public givenCapacityInQuote { // Calculate the expected value - uint256 expectedMaxPayoutInQuote = - Math.mulDivDown(_scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2); + uint256 expectedMaxPayoutInQuote = Math.mulDivDown( + _scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2 + ); uint256 expectedMaxPayout = Math.mulDivDown( expectedMaxPayoutInQuote, 10 ** _baseTokenDecimals, _scaleQuoteTokenAmount(_PRICE) ); @@ -139,8 +140,9 @@ contract FpsCreateAuctionTest is FpsTest { givenBaseTokenDecimals(13) { // Calculate the expected value - uint256 expectedMaxPayoutInQuote = - Math.mulDivDown(_scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2); + uint256 expectedMaxPayoutInQuote = Math.mulDivDown( + _scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2 + ); uint256 expectedMaxPayout = Math.mulDivDown( expectedMaxPayoutInQuote, 10 ** _baseTokenDecimals, _scaleQuoteTokenAmount(_PRICE) ); @@ -167,8 +169,9 @@ contract FpsCreateAuctionTest is FpsTest { givenBaseTokenDecimals(17) { // Calculate the expected value - uint256 expectedMaxPayoutInQuote = - Math.mulDivDown(_scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2); + uint256 expectedMaxPayoutInQuote = Math.mulDivDown( + _scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2 + ); uint256 expectedMaxPayout = Math.mulDivDown( expectedMaxPayoutInQuote, 10 ** _baseTokenDecimals, _scaleQuoteTokenAmount(_PRICE) ); From 47374c03d55bbd43467b2c0501a0a0396a9167c6 Mon Sep 17 00:00:00 2001 From: Oighty Date: Wed, 3 Jul 2024 11:42:56 -0400 Subject: [PATCH 59/82] fix: token URI encoding now in Base64 and other minor updates --- src/modules/derivatives/LinearVesting.sol | 27 ++++++++++++------- src/modules/derivatives/LinearVestingCard.sol | 8 +++--- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/modules/derivatives/LinearVesting.sol b/src/modules/derivatives/LinearVesting.sol index f0685eeb..1fe7961b 100644 --- a/src/modules/derivatives/LinearVesting.sol +++ b/src/modules/derivatives/LinearVesting.sol @@ -8,6 +8,7 @@ import {ClonesWithImmutableArgs} from "src/lib/clones/ClonesWithImmutableArgs.so 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"; @@ -733,16 +734,22 @@ contract LinearVesting is DerivativeModule, ILinearVesting, LinearVestingCard { // Return the token URI // solhint-disable quotes return string.concat( - "data:application/json;utf8,", - '{"name": "', - name(tokenId_), - '", "description": "', - _symbol, - ' Soulbound Linear Vesting Derivative Token. Powered by Axis.", "attributes": ', - _attributes(info), - ', "image": "data:image/svg+xml;utf8,', - _render(info), - '"}' + "data:application/json;base64,", + Base64.encode( + bytes( + string.concat( + '{"name": "', + name(tokenId_), + '", "description": "', + _symbol, + ' Soulbound Linear Vesting Derivative Token. Powered by Axis.", "attributes": ', + _attributes(info), + ', "image": "data:image/svg+xml;base64,', + Base64.encode(bytes(_render(info))), + '"}' + ) + ) + ) ); // solhint-enable quotes } diff --git a/src/modules/derivatives/LinearVestingCard.sol b/src/modules/derivatives/LinearVestingCard.sol index 388fb61a..02027805 100644 --- a/src/modules/derivatives/LinearVestingCard.sol +++ b/src/modules/derivatives/LinearVestingCard.sol @@ -124,8 +124,8 @@ contract LinearVestingCard { return string.concat( svg.text(string.concat('x="145" y="460" font-size="10" ', _TEXT_STYLE), _addrString), svg.text( - string.concat('x="145" y="480" font-size="10" ', _TEXT_STYLE), - string.concat("ID: ", Strings.toString(tokenId)) + string.concat('x="145" y="480" font-size="6" ', _TEXT_STYLE), + string.concat("ID: ", Strings.toHexString(tokenId)) ) ); } @@ -139,7 +139,7 @@ contract LinearVestingCard { { bool started = start <= currentTime; - progress = started ? (currentTime - start) * 100 / (end - start) : 0; + progress = started ? ((currentTime - start) * 100) / (end - start) : 0; // progress can be at most 100 progress = progress > 100 ? 100 : progress; @@ -220,7 +220,7 @@ contract LinearVestingCard { return string.concat( svg.text(string.concat('x="60" y="200" font-size="12" ', _TEXT_STYLE), start), - svg.text(string.concat('x="230" y="200" font-size="12"', _TEXT_STYLE), expiry) + svg.text(string.concat('x="230" y="200" font-size="12" ', _TEXT_STYLE), expiry) ); } From c0b0a6766f41307874edc12f5a9b075aad2fa8c5 Mon Sep 17 00:00:00 2001 From: Oighty Date: Wed, 3 Jul 2024 11:43:17 -0400 Subject: [PATCH 60/82] test: add tests to check live tokenURIs --- test/modules/derivatives/LinearVesting.t.sol | 78 +++++++++++++++++++- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/test/modules/derivatives/LinearVesting.t.sol b/test/modules/derivatives/LinearVesting.t.sol index 959e8d71..1935caec 100644 --- a/test/modules/derivatives/LinearVesting.t.sol +++ b/test/modules/derivatives/LinearVesting.t.sol @@ -3,6 +3,7 @@ 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"; @@ -53,7 +54,7 @@ contract LinearVestingTest is Test, Permit2User { vm.warp(_VESTING_START - 1); _underlyingToken = - new MockFeeOnTransferERC20("Underlying", "UNDERLYING", _underlyingTokenDecimals); + new MockFeeOnTransferERC20("Underlying", "UNDY", _underlyingTokenDecimals); _underlyingTokenAddress = address(_underlyingToken); _auctionHouse = new AtomicAuctionHouse(address(this), _PROTOCOL, _permit2Address); @@ -65,7 +66,7 @@ contract LinearVestingTest is Test, Permit2User { _vestingParamsBytes = abi.encode(_vestingParams); _wrappedDerivativeTokenName = "Underlying 2024-01-12"; - _wrappedDerivativeTokenSymbol = "UNDERLYING 2024-01-12"; + _wrappedDerivativeTokenSymbol = "UNDY 2024-01-12"; _wrappedDerivativeTokenNameLength = bytes(_wrappedDerivativeTokenName).length; _wrappedDerivativeTokenSymbolLength = bytes(_wrappedDerivativeTokenSymbol).length; } @@ -2543,4 +2544,77 @@ contract LinearVestingTest is Test, Permit2User { // Call _linearVesting.exercise(_derivativeTokenId, _AMOUNT); } + + // tokenURI + // [X] given the vesting period hasn't started + // [X] the progress bar is grey (verified externally) + // [X] given the vesting period has just started + // [X] the progress bar has blue green gradient at the left bar (verified externally) + // [X] given the vesting period is halfway through + // [X] the progress bar has blue green gradient in the middle and a circle showing current point (verified externally) + // [X] given the vesting period has ended + // [X] the progress bar is fully blue green gradient (verified externally) + + function test_tokenURI_beforeStart() + public + givenDerivativeIsDeployed + givenAliceHasDerivativeTokens(_AMOUNT) + { + // Call + string memory tokenURI = _linearVesting.tokenURI(_derivativeTokenId); + + console2.log("beforeStart: ", tokenURI); + } + + function test_tokenURI_atStart() + public + givenDerivativeIsDeployed + givenAliceHasDerivativeTokens(_AMOUNT) + { + vm.warp(_VESTING_START); + + // Call + string memory tokenURI = _linearVesting.tokenURI(_derivativeTokenId); + + console2.log("atStart: ", tokenURI); + } + + function test_tokenURI_halfway() + public + givenDerivativeIsDeployed + givenAliceHasDerivativeTokens(_AMOUNT) + { + vm.warp(_VESTING_START + _VESTING_DURATION / 2); + + // Call + string memory tokenURI = _linearVesting.tokenURI(_derivativeTokenId); + + console2.log("halfway: ", tokenURI); + } + + function test_tokenURI_atEnd() + public + givenDerivativeIsDeployed + givenAliceHasDerivativeTokens(_AMOUNT) + { + vm.warp(_VESTING_START + _VESTING_DURATION); + + // Call + string memory tokenURI = _linearVesting.tokenURI(_derivativeTokenId); + + console2.log("atEnd: ", tokenURI); + } + + function test_tokenURI_afterEnd() + public + givenDerivativeIsDeployed + givenAliceHasDerivativeTokens(_AMOUNT) + { + vm.warp(_VESTING_START + _VESTING_DURATION * 2); + + // Call + string memory tokenURI = _linearVesting.tokenURI(_derivativeTokenId); + + console2.log("afterEnd: ", tokenURI); + } } From bf5bc6ba1325457f6807c62f4cfe3e63d88315c8 Mon Sep 17 00:00:00 2001 From: Oighty Date: Wed, 3 Jul 2024 11:49:24 -0400 Subject: [PATCH 61/82] test: update salts and fix assertion that was broken --- script/salts/salts.json | 4 ++-- test/modules/derivatives/LinearVesting.t.sol | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/salts/salts.json b/script/salts/salts.json index aad592b5..136332ae 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -74,10 +74,10 @@ "0xf2644573f57aea10dffac6e7215b409fa19236ae57b735b20b9fac9834391850": "0x35782b6fe6a665598cdd56db1429e4308233b4e8bf375f9445051e18a2cc77e3" }, "Test_UniswapV2DirectToLiquidity": { - "0x6ecef7dad12b92990582b5e7be05c63ac5dd43b74df7e3620cde236d8837442e": "0xc505cbfb2803d1270b897322573cb8b40eea99ed615a365b126e21abd58b3dfb" + "0x2b19228bea571f0f8d492cc276ce2765f12958a42d00d40c0bb87f414c88410b": "0x4502811f276078d57f96c0af0179adb80a2b6c5ffeb2d539cc2c26b6cc850f87" }, "Test_UniswapV3DirectToLiquidity": { - "0x2df6b36ca1e324c0e17ca294f028a7f93d25171e29df7c6cc0db7caeab04d747": "0xb2afbd203a98f50f6ea6d39ce67c89b835b36283b425c5ce45b5c389b0a851de" + "0xebe2a2742c8a71eef5d3b2bb8cd69234c344f9e6baefbfa8aaa09d4656953301": "0x87c9dc3c09384859be11af9736f1cbe285b2c61ee8d18fb8ce300fe967a41830" }, "TokenAllowlist": { "0x09db47d395a68db033a3b222b9d1a212cec8422b03aeafc313aa4d2813c6dd60": "0xe07a005213f35e1f050a4da040d6bc3cae2ad333647b51a6ffa2e7941980043a", diff --git a/test/modules/derivatives/LinearVesting.t.sol b/test/modules/derivatives/LinearVesting.t.sol index 1935caec..ae8f2361 100644 --- a/test/modules/derivatives/LinearVesting.t.sol +++ b/test/modules/derivatives/LinearVesting.t.sol @@ -125,7 +125,7 @@ contract LinearVestingTest is Test, Permit2User { _vestingParamsBytes = abi.encode(_vestingParams); _wrappedDerivativeTokenName = "Underlying 2024-01-14"; - _wrappedDerivativeTokenSymbol = "UNDERLYING 2024-01-14"; + _wrappedDerivativeTokenSymbol = "UNDY 2024-01-14"; _wrappedDerivativeTokenNameLength = bytes(_wrappedDerivativeTokenName).length; _wrappedDerivativeTokenSymbolLength = bytes(_wrappedDerivativeTokenSymbol).length; _; From a7f310b26971f184ebcf3986a32d44b003445ac2 Mon Sep 17 00:00:00 2001 From: Oighty Date: Wed, 3 Jul 2024 17:21:36 -0400 Subject: [PATCH 62/82] chore: add mantle sepolia deployment --- deployments/.mantle-sepolia-v0.4.json | 13 + .../deployments/mantleSepolia/.chainId | 1 + .../mantleSepolia/GUniFactory.json | 721 +++++++ .../GUniFactory_Implementation.json | 802 ++++++++ .../mantleSepolia/GUniFactory_Proxy.json | 217 +++ .../deployments/mantleSepolia/GUniPool.json | 1649 +++++++++++++++++ .../f1f932b5297d788fce5c0abb03e1e395.json | 155 ++ lib/g-uni-v1-core/hardhat.config.ts | 5 + lib/g-uni-v1-core/src/addresses.ts | 12 + script/deploy/deploy.sh | 1 + script/env.json | 34 + script/salts/salts.json | 18 +- 12 files changed, 3623 insertions(+), 5 deletions(-) create mode 100644 deployments/.mantle-sepolia-v0.4.json create mode 100644 lib/g-uni-v1-core/deployments/mantleSepolia/.chainId create mode 100644 lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory.json create mode 100644 lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory_Implementation.json create mode 100644 lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory_Proxy.json create mode 100644 lib/g-uni-v1-core/deployments/mantleSepolia/GUniPool.json create mode 100644 lib/g-uni-v1-core/deployments/mantleSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json diff --git a/deployments/.mantle-sepolia-v0.4.json b/deployments/.mantle-sepolia-v0.4.json new file mode 100644 index 00000000..bd576ba9 --- /dev/null +++ b/deployments/.mantle-sepolia-v0.4.json @@ -0,0 +1,13 @@ +{ +"axis.BatchAuctionHouse": "0xBA00002999aBfa63cA25B3A7aD4c8F3a578aBe28", +"axis.BatchCatalogue": "0xb5a822eaA5803Ac5b8Ed2DC4De3D5916b3F46605", +"axis.EncryptedMarginalPrice": "0x30c356DFBAc808BC62c860A9B285f024b40dF1fc", +"axis.FixedPriceBatch": "0x13B299062c5E613C304145D78dA733bF9711DfC9", +"axis.BatchLinearVesting": "0xA9AEAe1d42bbfa591F4a06945a895d75011bE6e8", +"axis.BatchCappedMerkleAllowlist": "0x98A9b42b2eCF9B1A6de9d2D2fA6929a93A094957", +"axis.BatchMerkleAllowlist": "0x982b5C065CE01507aBfEda487FC19275aaF95EB1", +"axis.BatchTokenAllowlist": "0x98E0306bAf959791211f7324A99B5094548aba72", +"axis.BatchAllocatedMerkleAllowlist": "0x98fEC87d19AF5e7bda897a644c9A06C0044F2c21", +"axis.BatchUniswapV2DirectToLiquidity": "0xE6F33CdB98B3D249002F2FCd12805Fccf7d78351", +"axis.BatchUniswapV3DirectToLiquidity": "0xE6755a98C6a89331bee40EBbCA35750Daac55aC5" +} diff --git a/lib/g-uni-v1-core/deployments/mantleSepolia/.chainId b/lib/g-uni-v1-core/deployments/mantleSepolia/.chainId new file mode 100644 index 00000000..d119e5e7 --- /dev/null +++ b/lib/g-uni-v1-core/deployments/mantleSepolia/.chainId @@ -0,0 +1 @@ +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 new file mode 100644 index 00000000..24c00265 --- /dev/null +++ b/lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory.json @@ -0,0 +1,721 @@ +{ + "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 new file mode 100644 index 00000000..73658508 --- /dev/null +++ b/lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory_Implementation.json @@ -0,0 +1,802 @@ +{ + "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 new file mode 100644 index 00000000..457bcc9d --- /dev/null +++ b/lib/g-uni-v1-core/deployments/mantleSepolia/GUniFactory_Proxy.json @@ -0,0 +1,217 @@ +{ + "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 new file mode 100644 index 00000000..50c3ee82 --- /dev/null +++ b/lib/g-uni-v1-core/deployments/mantleSepolia/GUniPool.json @@ -0,0 +1,1649 @@ +{ + "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 new file mode 100644 index 00000000..371127af --- /dev/null +++ b/lib/g-uni-v1-core/deployments/mantleSepolia/solcInputs/f1f932b5297d788fce5c0abb03e1e395.json @@ -0,0 +1,155 @@ +{ + "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/hardhat.config.ts b/lib/g-uni-v1-core/hardhat.config.ts index 8f0f80f6..d41eeb05 100644 --- a/lib/g-uni-v1-core/hardhat.config.ts +++ b/lib/g-uni-v1-core/hardhat.config.ts @@ -52,6 +52,11 @@ const config: HardhatUserConfig = { url: process.env.BASE_SEPOLIA_RPC, accounts: [process.env.DEPLOYER_PRIVATE_KEY ?? ""] }, + mantleSepolia: { + chainId: 5003, + url: process.env.MANTLE_SEPOLIA_RPC, + accounts: [process.env.DEPLOYER_PRIVATE_KEY ?? ""] + } }, solidity: { diff --git a/lib/g-uni-v1-core/src/addresses.ts b/lib/g-uni-v1-core/src/addresses.ts index f0e89f9e..51f7d586 100644 --- a/lib/g-uni-v1-core/src/addresses.ts +++ b/lib/g-uni-v1-core/src/addresses.ts @@ -121,6 +121,18 @@ export const getAddresses = (network: string): Addresses => { 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/script/deploy/deploy.sh b/script/deploy/deploy.sh index 2a871994..3b422574 100755 --- a/script/deploy/deploy.sh +++ b/script/deploy/deploy.sh @@ -141,6 +141,7 @@ fi # Deploy using script forge script $DEPLOY_SCRIPT:$DEPLOY_CONTRACT --sig "deploy(string,string,bool)()" $CHAIN $DEPLOY_FILE $SAVE \ --rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvv \ +-g 4000000 --with-gas-price 20000000 --priority-gas-price 10000000 \ $BROADCAST_FLAG \ $VERIFY_FLAG \ $RESUME_FLAG diff --git a/script/env.json b/script/env.json index 029777ea..3496eda7 100644 --- a/script/env.json +++ b/script/env.json @@ -199,6 +199,40 @@ "factory": "0x1F98431c8aD98523631AE4a59f267346ea31F984" } }, + "mantle-sepolia": { + "axis": { + "AtomicAuctionHouse": "0x0000000000000000000000000000000000000000", + "AtomicCatalogue": "0x0000000000000000000000000000000000000000", + "AtomicLinearVesting": "0x0000000000000000000000000000000000000000", + "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", + "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", + "BatchAllocatedMerkleAllowlist": "0x98fEC87d19AF5e7bda897a644c9A06C0044F2c21", + "BatchAuctionHouse": "0xBA00002999aBfa63cA25B3A7aD4c8F3a578aBe28", + "BatchCappedMerkleAllowlist": "0x98A9b42b2eCF9B1A6de9d2D2fA6929a93A094957", + "BatchCatalogue": "0xb5a822eaA5803Ac5b8Ed2DC4De3D5916b3F46605", + "BatchLinearVesting": "0xA9AEAe1d42bbfa591F4a06945a895d75011bE6e8", + "BatchMerkleAllowlist": "0x982b5C065CE01507aBfEda487FC19275aaF95EB1", + "BatchTokenAllowlist": "0x98E0306bAf959791211f7324A99B5094548aba72", + "BatchUniswapV2DirectToLiquidity": "0xE6F33CdB98B3D249002F2FCd12805Fccf7d78351", + "BatchUniswapV3DirectToLiquidity": "0xE6755a98C6a89331bee40EBbCA35750Daac55aC5", + "EncryptedMarginalPrice": "0x30c356DFBAc808BC62c860A9B285f024b40dF1fc", + "FixedPriceBatch": "0x13B299062c5E613C304145D78dA733bF9711DfC9", + "FixedPriceSale": "0x0000000000000000000000000000000000000000", + "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", + "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" + }, + "gUni": { + "factory": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706" + }, + "uniswapV2": { + "factory": "0x63Fb97Dd80060cFd70c87Aa54F594F3988B6Fc66", + "router": "0x884E32d3c9D60962EF1A005f3d5365a41CDE38b8" + }, + "uniswapV3": { + "factory": "0xE292cF4e316191CbFEbD74909356DF3cd9455e96" + } + }, "mode-sepolia": { "axis": { "AtomicAuctionHouse": "0xAA0000A0F9FF55d5F00aB9cc8d05eF78DE4f9E8f", diff --git a/script/salts/salts.json b/script/salts/salts.json index 602432e4..f9e01de8 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -1,8 +1,9 @@ { "AllocatedMerkleAllowlist": { "0x109440c1c675388d17f52673a20abbe28dd179642c176d6142dd7f44821be594": "0x5d9938f8fccff4783842cc1c5968240c6d173a447ccf3e11c096c5bb0e7423ec", + "0x1330bbebf9210aa32cfa7221ca21157fee8f977c21e2e9bb9d396e02000726b2": "0x8cdbe3133136ece80f286b64a3dabf2a9d1bd5868e8a851a7747048f17e44717", "0x30b51492b0fefba6189938e77c04874f66af1ae415576b9a0870e3d831af3aeb": "0xb21446946154104802ca94a722f3d9c017dedcf52633e778343e049f558fc5e5", - "0x829a6a78304229812355cc3fd4ffbb383e35120e39942f1547bce97c9156f204": "0x17ee40dc561a4a9cfcb92fe1ddf4b2b90b51592d244fc8f0818efd797240e3f7", + "0x829a6a78304229812355cc3fd4ffbb383e35120e39942f1547bce97c9156f204": "0x12550234064c7913456e44b288c40022cf5b78c608f5e7f5ef0489157f49478f", "0x940f58c92177218354ef28efcd7056b131053fc33f27336c68af3eda9b7a537f": "0x9471763f5a9abcd58fee06a10aede685e570750ddc1de9f9e742130bb8f6369c", "0xaa5c1bd02f7b04980f0e4ef0778e9165f8404f41c1c2bc372f2902f80dc646b0": "0x3c781e03bd8272c21052708923b6b00b60d976b84bc792a25a8eeb527d166944", "0xc329d36cea27b1f8e044c99a5eda27503fd6087f50b6d27b7bb12ac4493507e1": "0xb724ad108002e85a8144c2b305013b4d302fb1ef4a39d477f6d18e96bc219a3d" @@ -26,23 +27,26 @@ "CappedMerkleAllowlist": { "0x0249dded8310d17581f166a526ea9ded65b81112ccac0ee8a144e9770d2b8432": "0xf5746fa34aeff9866dc5ec58712f7f47045aea15db39a0aabf4dadc9d35c8854", "0x0ae7777d88dd21a8b9ca3dd9212307295a83aed438fef9dad0b62d57fbaf1025": "0x1de5ae5b126bd2cee8eb4f083080f5c30baa692580cf823fa5f382a7bfc70ac5", + "0x1862ac863dc5f418c2e4637cbb69eeb9167c098cd66fc4c383431729bcc056eb": "0x848d8f46acb79432a25b5b3070de9ef468df82ff8080f509eace1a7cbef19308", "0x3b13d752dd521a5917210eff552f4d0ec3ff4ddb2d194f5d02b7e2247489ebdc": "0xf1ff9fa131a9733c7bdb0d3a3bd2f0ff01a4460e6886df4c7099947ebcfb1ee9", "0x3fc1cd506bf64c403917a5799b49e036dd3aae5428060a18d3c19d6e6065498e": "0xd24c83ddb154d7c984384db1f8da3ab3307028e5f1cc43031c4243a81e25edb6", "0x41e4959210f69f1bc43a7e525cd5c4d9552ded294727f411ff30fe70c69a4b76": "0x20e7f379ad74ce616829a0e336c3b9c48e0d2a74f219219e32e02fe2a982da7d", "0x7629e3374867d748eaab783ad2eedb4e39634e55428c39713fd82415d41043a3": "0x31246341c7c82c31414f184b807da273fdd6cdf591cb6f997fec41babc279fd9", "0x78ee3a1a70f7e9a784590ca00ef3290f3478105f6338266b9e5f0d10951b4aa9": "0xdb5af3b6d32454d69075509db94196460a19acb9849c5dc0d5ccef5a1b4ab032", "0xba7c6b1a20d51f9d58af92b2ad7ef3e41e1468b723bedeaa967ad18324a01396": "0x008360de5819a25fa0b4f08212b0b7745df530809622970e4dfefc77cb8c5066", - "0xbece95cede2c4b6f2712067328ed372606a7ec24649023996465365239ed5c23": "0x43af01d498eaa96528f948867f7b771b700b090e1b1077c95ecc1394265f1af9" + "0xbece95cede2c4b6f2712067328ed372606a7ec24649023996465365239ed5c23": "0x43af01d498eaa96528f948867f7b771b700b090e1b1077c95ecc1394265f1af9", + "0xec2a597ad93b51f9a58ce3a90dc777d51183931ff91f23ba7d685f36d08a5fb5": "0x09ef29485dadd335f15b530a213bf16fe826b712a6d9704d86d2980a775c6309" }, "MerkleAllowlist": { "0x00e31f39c32ce8511a5db04dec4a0a92b29eb2cb02a965f107dbeb9549517e6a": "0xcfcc4407dd569ab1e457b9d475420c8d10e7db6751646b5aa84cfacf500947ba", "0x13f8dde16815b53fad1d222ffd783f6ed99b01992a48aac29791352ac7578576": "0x605db39e79afd6a7e67bd3055afc358a69143d97544404d75b8091c2d2c82fa1", "0x2cc37ca69a4e1ef00579453aad3e7dd939350a9b53f3dfa1f20896f0cd1dbddb": "0x87a479d8c7b3a31f53b0ae53979510bcb06d09a2e202432ac40581c6bc37ff08", - "0x772e272fd6e30185ccd0d9d485a87d71b47d93ad31dcdb274bbde5002f12b12d": "0x087a6bed9bb620c899b2520ea860a6737de62d90aee55032be8e9086dcae819d", + "0x772e272fd6e30185ccd0d9d485a87d71b47d93ad31dcdb274bbde5002f12b12d": "0x5b5c6bacfcaa186167a4345af4ba4facedb0bb7693daa623b9db75f06b89c13f", "0x8dabf7c769c996b5b33b4da1013d93b9daeeb7cf468d179804c9130fd7eaa891": "0x71072df633972dfa166196430a104dbc30b8dc5997a8b965253ca299fd96feaf", "0xb4128aa3cf1f256d76081a556cbe66c83429e49ce28bca3b2e3b07b926f0bda8": "0xcbac00a3b5465e91d8c65d179de9fa8f52be1c99b8ecfd9ce35b51faa0046232", "0xc8e647c61be9e05b08050eb7d8cfc1102b5328d9540b81891da5783ba25d2978": "0x368c44b5208a15f6292a0ac1246d7d6973d5c919d32cebd2f30da0844356e63a", "0xcd18d417a886a13a14969e2690fc3af13f228e73a02e48d9d4e8a6b3fa61504a": "0x7aa449a66650f30013cfd8021a16640d3489de2246ec5ad62f3ccbe5e84f819a", + "0xd3da57bd92a493efbf623f32c63315442acb0a1519cdeb57c846803150efd238": "0x1ce173dc622d4d68f9b5fbe79de27e376bf66f560df27fb52c56d89fc0c4d66f", "0xed4ba02077e70f78db70ce191509333d2dcccfff136d30dcb011f567305e88ad": "0x2b8bc588174d409692f1bd993942e3806c9a11344dbe674f46aed32a030aacf1" }, "Test_AllocatedMerkleAllowlist": { @@ -98,7 +102,9 @@ "0x48612e5a97a3e434e0158a8ece7bf1c0876f0a82987580936e63084228144cd6": "0xd51382b4a80b7fa68a37f611bf095a15818465788fead6a0a9a0515251cb66e5", "0x57df0bf7cfe081111b36726104f5bf23ec172de0ba96f2fb36c2e41108989b71": "0x7e184f1697deb99d9bc7ba50324c40e98b987f83a14245174e6eacc6ab240330", "0xa4b72411c68147f4439bf4211d12dfbada62d17aba88a86648226a2cb61feff6": "0x18133c11f2fba3e102d2900a469e89202dd55927014a0a4062f21f2444bfcc9e", - "0xcc0cb46859311aa362f48add9ffc284efd8aad3e4ec5a29b68eee7ab1b4cd8c4": "0x99628f6902caaf046d171a8754943a29a3906a9b32f3ee471a12b470363999c7" + "0xcc0cb46859311aa362f48add9ffc284efd8aad3e4ec5a29b68eee7ab1b4cd8c4": "0x99628f6902caaf046d171a8754943a29a3906a9b32f3ee471a12b470363999c7", + "0xcc3bdd1460c690d76ecd2a6068b712cac53eb622458a6246e13a9f22114c33ea": "0x69c7006142e7b85d6c199c18ab3274df41e776aede6923972c1434b4dcc0931c", + "0xdf5415e95420bc8deaf38312453772d847f73c7131a11dcd4bb9b5abdd289d13": "0x0ceea63bb6cc59164b6cabb6605bef340f456cc0e5ce5eca62ec5d981c97afd6" }, "UniswapV2DirectToLiquidity": { "0x2952f587868594ee4aed1e483cdbb653d4ef61c9c662a737fc6ae8f271225fe1": "0x000174bce07575898f52c13859450718eea202638a7089ff3d358a023b48bbfb", @@ -109,11 +115,13 @@ "0x8b4463835dc772630989c2d09011d747347fc03f6cdf5b4e820ed1ef05f26942": "0xc3a15bdea9242368d2db15a46055a9bf88b551562eda6217f0a02f1d6a93f73b", "0xd1807b8e8fef23d2bd5acb7fe74e7dab661f1ef2f7aaaa66e286398a6d9e8011": "0xec56a79198c3d690cad3e6e39521bd7dd90dc8692cf50a7ab027408d139bd189", "0xe8242d2e1eae0d89d0ca278cea284cd4056496fb12fd0405237827e252efdfea": "0x65a71869dd1c30cc12ac786991b9492a5286c8cd942161d738ca34b3e0e29053", - "0xf40b0b3a6c36f510d58633db604bcd978fe1e804891ce9792ac9bbb064cbe97a": "0x4fdd82a331ef80cde3af5905bd2b39c5b1d2f1da38e059fc7e077a355f4caa92" + "0xf40b0b3a6c36f510d58633db604bcd978fe1e804891ce9792ac9bbb064cbe97a": "0x4fdd82a331ef80cde3af5905bd2b39c5b1d2f1da38e059fc7e077a355f4caa92", + "0xfbaca62f01c99e602fa7ba74d5be6deb601550f6e77659246f80fec8fa9c8170": "0x729c4bdbdea56155220a562d0e398c08e3273ac5bafe974f18e9fa7148f23f46" }, "UniswapV3DirectToLiquidity": { "0x076b93782e37198c2a62c801267d4971c0da2276424f4232d380714790b596fa": "0xb61cd26ee29ace89139c3ac9f8bc6a81a77449e35a3e1929e1bcf58963784719", "0x7994e3c9afaffb722300f0aaa71ebeeceab756245e82e981180edb84fc0896c6": "0xb8ca51788fb6f83a631aa3f288f8976542c83998f4249a948cc9d6cb9eee227f", + "0x8d22341b4d62cede70950a3665bf0dbf6d26f2f06155bc07e1520b6f8a479b57": "0x4a13f3bb700e88e4d4d98f1d78fc5c8b0f2e112ed4ec1fe9efbaa2e72dcb03e9", "0x9e46c4894fb34752211ed50d65bd9d28c0bc64b05efbfa8bc2016985dcf8c854": "0xe14c04ae17c798f930e1d15f488a9d97d6aab2ad2f031779d332c6e533cd6531", "0xa05e45a45cfefb72dfa29ad3818c1cf08e0bd7fddc447d6c999a8e59249958de": "0xad19f43b52bb1d7c2ed09a095ed50eb1f97d17caaa52965932c0eaeabd38cfeb", "0xa6f487fc2314140d65433ac5c4c88db938b3c5060d2f6606ad5385635960b7df": "0xd6d8d35d364012dc5356867ae1e611cb49a52ff044b669b74038801dc8d38c25", From 0f9b20985d1cf3fa14b288f2953b311c4a759a19 Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 8 Jul 2024 10:52:34 -0400 Subject: [PATCH 63/82] test: update salts --- script/salts/salts.json | 52 ++++++++++++++++----------------- script/salts/test/test_salts.sh | 2 +- test/Constants.sol | 6 ++-- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/script/salts/salts.json b/script/salts/salts.json index f432329d..0aed9186 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -46,48 +46,48 @@ "0xed4ba02077e70f78db70ce191509333d2dcccfff136d30dcb011f567305e88ad": "0x2b8bc588174d409692f1bd993942e3806c9a11344dbe674f46aed32a030aacf1" }, "Test_AllocatedMerkleAllowlist": { - "0xb17794250569bcd64aae2ec1312399120db92167bf0a2602821e0ee953dd3d31": "0xa02d6206d785bdc9bbd57caa7aa2b429fbd68af9dbe938981c3f3419a13a5b07", - "0xecbee26b3d0e662be84e4cef678b23166957f507ca68f32eaa49e60ceb567981": "0xea67755fb850eb33ee6a98ac48fc23e3b350b139f37c1a47d1926e7a2499db92" + "0xcfdfa17ea3c652946a677d4e1deae9e4d81aebac558c9a09534990088eeb64dc": "0xbce5a6c3c26bb17118e8a5153ad0b1588dfbc6fe0583a807dcbb5eb168ac6943", + "0xf6f21b4d7f14954f7e75956ce5e6802fc12c8d669b5cea2ea4964771459ec352": "0xfe6864d2a108533e0731225b3922c175bfabc1b575f999f52c3b9bd582f1f7ca" }, "Test_CappedMerkleAllowlist": { - "0xa0ed568f98efa2efd4e93f21a5445970919a333349a8f5369a28ae93271d9cca": "0xc4351be38848fc345a2cd1a3310714a677cb6c758df2a5f568e7fd437465f086", - "0xfd2c28cb6c38931a1f784078c41d21d7bf8fc3653231edca225a5fbbc50529dc": "0x866fb81efae6aba7b5d8052e5fb11fb0f3b61dc2d268d8bd7a89c74876cd03e0" + "0x6b091d4260ebfae017cb94fae51b8e407617e1e2f13ccaff7108bb2bad92406d": "0x96425519ee18b3c55fe5f526b600afcaca7d6a9db588462ae2ec59bdce78f722", + "0xb661789d95ab95e7a68b21564176fc7bac46ba3b396a2bc01c86fb9c8a5004f1": "0xa4f8699f69bb7fa6a94563fd89813c122429dd1fae5a584459e15c1513f82328" }, "Test_GUniFactory": { "0x3bf0e882023640f31bf861e1f13d306fd4fbb7afb7860e21a489062cbefcf885": "0x397acf3db4cc9c81f8c1975a5505e392e6b5f8eb3b22efcc094b3e0f39f6739b" }, "Test_MockCallback": { - "0x052a304d0a4a19a819c4e1501b45b4f1b49f73d1a7cac910386fe5fc509633a4": "0xc6065a07239f2cc5e6815da442bbf20235a73b478a6d54a79ac6821b5b7a7d28", - "0x211f0c56d141fbeca1844d250c6a356beb00eaecc7afef8cd01797aa6b730ba6": "0xaeda83a2eea09230a231bd9a2093f719daa9593150bab530dee4f47330e1842b", - "0x409bf08f08583ee56edee5cf91c507ce0ee7cd3a33d6b176505cde7e6fab5212": "0xbc0cb39903b09af940cd22dc5f6207da850b245d901c62ebf414758fea9264d5", - "0x42425e602c9c169d71be77da2f8ca1fc0718c859fc8a1a8940e010485b9b2db4": "0xb597983520eee34eafda0ae6bfa0a7c42e583b88622823df7bd25d9e8033805f", - "0x4eb19888c437940923b0c1e78a04f1afe2a75dae78812574ba219f022fc5395a": "0x157f746e00d6600ba3e3bc8b98cb16484284fd6c3426f6aa878e65acd7543d4e", - "0x65861ca173680f85c64b5ecb1041d69eba8addf2e4f3acde8ae4b0ec5f2625f5": "0x95e40ccfc1f2780e7e330d505120ad53a5e1b8afefc82ac0fda94ded13d54cf0", - "0x732ffa915e7dee8ddde1f40a62d2a275e439a4fc180fa652b48e733b460fdd52": "0x86fcfcc51aab2585740af207f84ee1ae17991659e8f6e2a26e79fb9bc43f9c7c", - "0x819496f5a9c8dd326fdaaafa185159c136315d5abee91896f192dbdf2212768d": "0x09888a22ba81aa1f63d141c9218847b04500dee5b8b05b4a3767b23a67f9b75c", - "0x9df1908fad57611d75eb1b9d9a581ddc43baeaa767a14f5ddd26fe371bbcf06b": "0x210df33b039e970b195f2ba4b002fc5cce1e5089f4b78fd0310893c77c412c33", - "0xb10e85dc047de055ec7bcc8d8933f859c8c220aa1540e8d61f36e6391d5975fd": "0x073f19736c18bba81ab00dd1400230e8dddf5001c99c808358d54b133d290b31", - "0xb262c3f41c3ffc3d264c72a40f60b02c497017ed75f73524e008f3ead803a998": "0xc3b61e79be00bdae71d3390cb7dcfff107f49890d7637e84f34e0019cf39fd20", - "0xb582fee2a3f0fd5f455d98b1278099ceadb1a7c9d46e93e5100c8cc86aa4a388": "0x4ff0921c566e6c8335243cca9493d936237c15432cd2b46cacedc924c6a74ab3", - "0xbcd87b9a1206b37ef12053cbcac10515fbf400962837441462e04daa9e2ddc98": "0xeae313d76511fda576544873c1f194d360835d89b3fa6ac8f0eaa3720e460d37", - "0xc9ae4a5f6e1baf9009493d9068d9f61f8461a99a23532a7f8ed98393106ef560": "0x2cf765c5239f65fd7a6320f9ced82f781250c95e63477b37a4fc1e505d36245e", - "0xd3e19abee55b3295d081f5777c0e642f7c7023552b5ae035ecc53f706fd90e63": "0x2642e226f3dcbd86a5529864ef200f96cb803ec643fa32a91734ad69b5ce41b4", - "0xf12ef8015ea1ab65c40a62ad74a87c7a97bbc2736afd3f81f1cec73bc2290b45": "0x123243bb40017d592cf768072714268a81fb8533b0379837981687b10e125828", - "0xf36332cb1efc8bc6ea44da0a8971f853fc081b8487c5d4d3e09c1de201a68bc5": "0x8d8fa796b3ed9d941ceead4834fc24113e199f13bf7af2328388b9bf01884177", - "0xf745ee60388fc42e05923e38f1c09237e8514387e3a4b328c576a52aaa29c9b3": "0x1ade095069cfbe0debff4e5cee60edaab45631d39b2215cd1ba359fcf8b68858" + "0x07785d4b2ae1b255ef1281d610b53951dcfc278e783f5faf525667984aef7582": "0x87475ff0d302d7aeae979b8b48e7b222ce2c08d91956deb7847819f2f87a9d02", + "0x0da4e4acf9924c5dbfc4641eaa40c4b17945fa3d3f4216d692fb95809268f0ea": "0x79d403336e7face22b4fbb8c240736bb8691cd0d8559a994522e5d527745a5c3", + "0x0dc3acba159da41fb15fa2e46fe9b10a863a03db11b8a4d9fdcabdfb84611bd0": "0xb28c428ad61b3c4d691ccfc87561b8e70011ef5e12f024faba5c3f06874e6649", + "0x1294aaf5165e39282b6196adb858fa4ec1ddfa9dd9a9aa0cb7ea5c6ae2b219f5": "0x1c9c4daeecb7db952ab79700a97832fb5931ee77ce9290a79b4467ad1a58480c", + "0x21401c5b7ed81d03a6763db3ada0846a9c73cf3b1b8db7ad42be5c5afc316a61": "0x0eb68484dac7484ad21a2ae565d8d6a0cc342b9e82b5b1bb19c22012769c76e5", + "0x3cc5dccfaa51a594a98c757db172177023597c5a25c341441f643c6a78442666": "0x4f0f2732d274e33c823716e724b17fa28aa0e1a1a8c5bab7402ea936ea6f67d6", + "0x6137abf5c778257b1f9e0eac71322701aaf476877e1fa64dc13b60df2af70ec0": "0xd2149de3d14098d177589a36ca8e34accc93208491acd8b031a773a3e7384c8e", + "0x72c007e938c8d83a5b5fa39c4b6f292f728a2e8e215ee06b86566a7b45247d3e": "0xedb0da2b38218c07207e6a3daa4e7d551d6abc58dd2ee6449092674d612801b4", + "0x730fc2d6dc93a91f3d8481edacbe9e488f827d2262b6f87399a7d9fe8cac37bb": "0x8d0d6029cd9265a216e21b79d6f6ed9e38c997996b51f9d37eda0c3fab08d30b", + "0x771b0fa64bc3497dc2bc940eae6c0ed257ea6f2e4e1c6fe104ac834c67bfce7e": "0x184a8afefcf997c79a8f328f9051adc621055328c454cdb1a559e74f05c8a601", + "0xa2c1b476ed443a59268347cece6621d8c87ec9255e8f6cab8d7d8f85027e0b1b": "0x34d3ddb11ed0fe779f11eab3629d433c280c3da4414d8f2a32d9b34a6abcac31", + "0xabb629e8835ff8ff0eb6e979402cedd18cf5537213521b3d9b315675b1a4c30b": "0x054148f3c2b9a3c7af4cf865876428c755916fa953a7af8c042fb010f7341bea", + "0xd7024804d414bcb2b9675b443769f117382e6d8aed6b7d29ff30ef4539c8c618": "0x712f4ffae12a07fa88fce797df7dc07825e81c86d85496eb4ffdec821dea73f0", + "0xdad6191147c84c1589b20903da48351a48346b46a91471e16c1faef48cbb59d3": "0x3634e8596023fafce0dafbffff2e096ee737a5431ef59392d1ef9ea395c8fac0", + "0xeac722758221d1f6fca4cd523f7805b3130e05b32c5a392fe73018e57a4d48c9": "0x269bff74c0ec2956d16c9a3f46e712765d3af4b6599c601a35521d4b7083cf13", + "0xf8b645286581f00439dfe98e7c9f56056859e7d292f1da6f9dea45e4b83c6fd1": "0x0e9f4cacb61983331f287d22b4e90b3b57a5a355dab4f76ffe5261730f46760d", + "0xf985360ed7bd4f84804f1d897cc4354928d65d63bda05705cb6313af1a6fef61": "0x39e1abda549b0a2efc8c2d27029e71f82f1e6c7cfcc6929bd03c480fae8e6e65", + "0xff5d078f4fd3ef6563148d27e3a5c874aa042c6ef2dc0cacd662af92273d4296": "0xeeeff7e37496d2234df86788a42e05da088e1f15642c9b7eea18fc60625efa12" }, "Test_TokenAllowlist": { - "0x11e024c2f0ada4ce2ce048af08354dfa64f38ad959564c55e6bbf48d2ed3822e": "0x36081349bdb172b741f01d750be52416888c2083ea791863109f709f33f3eebd", - "0x78a7c23f669f5df656575693f45f928b7af2ed4bc981cf6dec77bef2c03bb081": "0x2f45234bfc47c4383d3d83a27019a523b0e94986d6f7ed632b7041de70b8ba63" + "0x63d09b76a33540f4079f5fd7ba159ef61b164049ae7784485e0608aa4ca5fe19": "0x4576d179fc1007882d4d0a37532755d0f80957b466a74f0a1168ff3b31ebb178", + "0x8f8e3042f262f394e8758732620875e10a5a30249eae787dd5a75f3dc5b38325": "0x976531e4ccef5be13b2190ff185476a3ef186d5be92309db625c9dbd6411e672" }, "Test_UniswapV2DirectToLiquidity": { - "0xf77179ebee72718ef1a17438d512b323bf27d54fa684e08eb2c0e04db5e4b6e8": "0x5333b99e4591f981322477a49d3b7dfd74d9b40682587c45844dc8204742976b" + "0xf8665a9732361b98d40108e8013cea182f7278fa5a2f642d5d1de6a7fe387c7f": "0xa3d0d5aaf29937aea447648f79af9f00f0e51022fa68b7a527ed61dc21408d0c" }, "Test_UniswapV2Router": { "0xe6204aa211921628df345ff0b909c863298684cd8ca65de5479af6b70662e622": "0xf508fd71ff40f5d0640b01b9384f98d35db43c7ddb0d4abe274d61fdf1ea967f" }, "Test_UniswapV3DirectToLiquidity": { - "0x9fba41d9fa6e37d4d48a3e2740f19cab37f9e6cabd831d34d70987f6047d7cfa": "0xbf8d53d0e9ac87c66fc640508db3d175f7242666b9a014facf35776234c78246" + "0x799f2c9a1e4fcda638e3941c22b7fc8df48e034c1227c8ffaf39386506f210dc": "0x9c5e27c13c39a22836351f77dd1e7eb1c476c0d9fb9be1f256a1b98254f08953" }, "Test_UniswapV3Factory": { "0xbcd657c3390ecd2e1782b6473400c51fa124922eb98b69f1b5192eb0f8e3d3df": "0x3448ebb18cb03fae2e9153c621d46f1b9b8941cc66e7063b587fe4a284490b01" diff --git a/script/salts/test/test_salts.sh b/script/salts/test/test_salts.sh index 24cc0836..f1dacaca 100755 --- a/script/salts/test/test_salts.sh +++ b/script/salts/test/test_salts.sh @@ -33,7 +33,7 @@ fi # Check if saltKey is specified if [ -z "$saltKey" ] then - echo "No salt key specified. Provide the salt key after the --key flag." + echo "No salt key specified. Provide the salt key after the --saltKey flag." exit 1 fi diff --git a/test/Constants.sol b/test/Constants.sol index 04b9f4fe..e651a223 100644 --- a/test/Constants.sol +++ b/test/Constants.sol @@ -7,10 +7,10 @@ abstract contract TestConstants { address internal constant _UNISWAP_V2_FACTORY = address(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); address internal constant _UNISWAP_V2_ROUTER = - address(0xAA9E6CDA232112EBc0FC2Ca14B3178567a410224); + address(0xC5287E5F413C8e620e5Dc2fEbdaBE4ccCbf96669); address internal constant _UNISWAP_V3_FACTORY = - address(0xAA6E2347940f38546B6a1b804070899Ccb75c558); - address internal constant _GUNI_FACTORY = address(0xAA426C06A7D084E79bFa5B8cd0A15aeebA7693f1); + address(0x1702DD7e80bA99600C7007e519267FB853BBe923); + address internal constant _GUNI_FACTORY = address(0xfd55d1Beb11E49AeEeaE8AE3499c8cB761A0EdE7); address internal constant _BASELINE_KERNEL = address(0xBB); address internal constant _BASELINE_QUOTE_TOKEN = address(0xAA58516d932C482469914260268EEA7611BF0eb4); From e0e8539962f79b1cfeaac7b70b1f8006e944b9c1 Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 8 Jul 2024 10:53:31 -0400 Subject: [PATCH 64/82] chore: bump pnpm action version --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6da63fe4..43a30bd5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/setup-node@v2 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: 8 From d5e8d578ed8ffd891ec51ba248f5f4bb9990d50b Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 8 Jul 2024 11:30:37 -0400 Subject: [PATCH 65/82] chore: update CI action to use install script --- .github/workflows/test.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 43a30bd5..474f9cf1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,18 +14,16 @@ jobs: name: Foundry project runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - uses: actions/setup-node@v2 + - name: Install Node.js + uses: actions/setup-node@v2 - - uses: pnpm/action-setup@v4 + - name: Install pnpm + uses: pnpm/action-setup@v4 with: version: 8 - - name: Install Node dependencies - run: pnpm install + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 # From: https://www.uffizzi.com/blog/optimizing-rust-builds-for-faster-github-actions-pipelines - name: Install Rust @@ -51,8 +49,12 @@ jobs: - name: Build local ecies-cli for use with testing run: cd crates/ecies-cli && cargo build && cd ../.. - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 + - name: Repo Install Script + uses: actions/checkout@v4 + run: | + chmod +x ./install.sh + ./install.sh + shell: bash - name: Run lint check run: pnpm run lint:check From fb1973e279a37d133e32338dc422794320f2960c Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 8 Jul 2024 11:32:00 -0400 Subject: [PATCH 66/82] chore: update lock file with fresh install --- pnpm-lock.yaml | 534 ++++++++++++++++++++++++++++--------------------- 1 file changed, 304 insertions(+), 230 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 401011e5..32e61419 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,162 +1,105 @@ -lockfileVersion: '6.0' +lockfileVersion: '9.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false -dependencies: - solhint-community: - specifier: ^3.7.0 - version: 3.7.0 +importers: + + .: + dependencies: + solhint-community: + specifier: ^3.7.0 + version: 3.7.0 packages: - /@babel/code-frame@7.23.5: + '@babel/code-frame@7.23.5': resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} engines: {node: '>=6.9.0'} - dependencies: - '@babel/highlight': 7.23.4 - chalk: 2.4.2 - dev: false - /@babel/helper-validator-identifier@7.22.20: + '@babel/helper-validator-identifier@7.22.20': resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} - dev: false - /@babel/highlight@7.23.4: + '@babel/highlight@7.23.4': resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-validator-identifier': 7.22.20 - chalk: 2.4.2 - js-tokens: 4.0.0 - dev: false - /@solidity-parser/parser@0.16.2: + '@solidity-parser/parser@0.16.2': resolution: {integrity: sha512-PI9NfoA3P8XK2VBkK5oIfRgKDsicwDZfkVq9ZTBCQYGOP1N2owgY2dyLGyU5/J/hQs8KRk55kdmvTLjy3Mu3vg==} - dependencies: - antlr4ts: 0.5.0-alpha.4 - dev: false - /ajv@6.12.6: + ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - dependencies: - fast-deep-equal: 3.1.3 - fast-json-stable-stringify: 2.1.0 - json-schema-traverse: 0.4.1 - uri-js: 4.4.1 - dev: false - /ajv@8.12.0: + ajv@8.12.0: resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} - dependencies: - fast-deep-equal: 3.1.3 - json-schema-traverse: 1.0.0 - require-from-string: 2.0.2 - uri-js: 4.4.1 - dev: false - /ansi-regex@5.0.1: + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - dev: false - /ansi-styles@3.2.1: + ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} - dependencies: - color-convert: 1.9.3 - dev: false - /ansi-styles@4.3.0: + ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} - dependencies: - color-convert: 2.0.1 - dev: false - /antlr4@4.13.1: + antlr4@4.13.1: resolution: {integrity: sha512-kiXTspaRYvnIArgE97z5YVVf/cDVQABr3abFRR6mE7yesLMkgu4ujuyV/sgxafQ8wgve0DJQUJ38Z8tkgA2izA==} engines: {node: '>=16'} - dev: false - /antlr4ts@0.5.0-alpha.4: + antlr4ts@0.5.0-alpha.4: resolution: {integrity: sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==} - dev: false - /argparse@2.0.1: + argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - dev: false - /ast-parents@0.0.1: + ast-parents@0.0.1: resolution: {integrity: sha512-XHusKxKz3zoYk1ic8Un640joHbFMhbqneyoZfoKnEGtf2ey9Uh/IdpcQplODdO/kENaMIWsD0nJm4+wX3UNLHA==} - dev: false - /astral-regex@2.0.0: + astral-regex@2.0.0: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} - dev: false - /balanced-match@1.0.2: + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - dev: false - /brace-expansion@2.0.1: + brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} - dependencies: - balanced-match: 1.0.2 - dev: false - /callsites@3.1.0: + callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - dev: false - /chalk@2.4.2: + chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} - dependencies: - ansi-styles: 3.2.1 - escape-string-regexp: 1.0.5 - supports-color: 5.5.0 - dev: false - /chalk@4.1.2: + chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - dev: false - /color-convert@1.9.3: + color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} - dependencies: - color-name: 1.1.3 - dev: false - /color-convert@2.0.1: + color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} - dependencies: - color-name: 1.1.4 - dev: false - /color-name@1.1.3: + color-name@1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} - dev: false - /color-name@1.1.4: + color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - dev: false - /commander@11.1.0: + commander@11.1.0: resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} engines: {node: '>=16'} - dev: false - /cosmiconfig@8.3.6: + cosmiconfig@8.3.6: resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} engines: {node: '>=14'} peerDependencies: @@ -164,213 +107,366 @@ packages: peerDependenciesMeta: typescript: optional: true - dependencies: - import-fresh: 3.3.0 - js-yaml: 4.1.0 - parse-json: 5.2.0 - path-type: 4.0.0 - dev: false - /emoji-regex@8.0.0: + emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - dev: false - /error-ex@1.3.2: + error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} - dependencies: - is-arrayish: 0.2.1 - dev: false - /escape-string-regexp@1.0.5: + escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} - dev: false - /fast-deep-equal@3.1.3: + fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - dev: false - /fast-diff@1.3.0: + fast-diff@1.3.0: resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - dev: false - /fast-json-stable-stringify@2.1.0: + fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - dev: false - /fs.realpath@1.0.0: + fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - dev: false - /glob@8.1.0: + glob@8.1.0: resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} engines: {node: '>=12'} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 5.1.6 - once: 1.4.0 - dev: false - /has-flag@3.0.0: + has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} - dev: false - /has-flag@4.0.0: + has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} - dev: false - /ignore@5.3.0: + ignore@5.3.0: resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} engines: {node: '>= 4'} - dev: false - /import-fresh@3.3.0: + import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} - dependencies: - parent-module: 1.0.1 - resolve-from: 4.0.0 - dev: false - /inflight@1.0.6: + inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - dev: false - /inherits@2.0.4: + inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: false - /is-arrayish@0.2.1: + is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - dev: false - /is-fullwidth-code-point@3.0.0: + is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - dev: false - /js-tokens@4.0.0: + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: false - /js-yaml@4.1.0: + js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true - dependencies: - argparse: 2.0.1 - dev: false - /json-parse-even-better-errors@2.3.1: + json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - dev: false - /json-schema-traverse@0.4.1: + json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - dev: false - /json-schema-traverse@1.0.0: + json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} - dev: false - /lines-and-columns@1.2.4: + lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - dev: false - /lodash.truncate@4.4.2: + lodash.truncate@4.4.2: resolution: {integrity: sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==} - dev: false - /lodash@4.17.21: + lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - dev: false - /minimatch@5.1.6: + minimatch@5.1.6: resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} engines: {node: '>=10'} - dependencies: - brace-expansion: 2.0.1 - dev: false - /once@1.4.0: + once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - dependencies: - wrappy: 1.0.2 - dev: false - /parent-module@1.0.1: + parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} - dependencies: - callsites: 3.1.0 - dev: false - /parse-json@5.2.0: + parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} - dependencies: - '@babel/code-frame': 7.23.5 - error-ex: 1.3.2 - json-parse-even-better-errors: 2.3.1 - lines-and-columns: 1.2.4 - dev: false - /path-type@4.0.0: + path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} - dev: false - /pluralize@8.0.0: + pluralize@8.0.0: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} - dev: false - /prettier@2.8.8: + prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} hasBin: true - requiresBuild: true - dev: false - optional: true - /punycode@2.3.1: + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - dev: false - /require-from-string@2.0.2: + require-from-string@2.0.2: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} - dev: false - /resolve-from@4.0.0: + resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} - dev: false - /semver@6.3.1: + semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - dev: false - /slice-ansi@4.0.0: + slice-ansi@4.0.0: resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} engines: {node: '>=10'} + + solhint-community@3.7.0: + resolution: {integrity: sha512-8nfdaxVll+IIaEBHFz3CzagIZNNTGp4Mrr+6O4m7c9Bs/L8OcgR/xzZJFwROkGAhV8Nbiv4gqJ42nEXZPYl3Qw==} + hasBin: true + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + + table@6.8.1: + resolution: {integrity: sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==} + engines: {node: '>=10.0.0'} + + text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + +snapshots: + + '@babel/code-frame@7.23.5': + dependencies: + '@babel/highlight': 7.23.4 + chalk: 2.4.2 + + '@babel/helper-validator-identifier@7.22.20': {} + + '@babel/highlight@7.23.4': + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + chalk: 2.4.2 + js-tokens: 4.0.0 + + '@solidity-parser/parser@0.16.2': + dependencies: + antlr4ts: 0.5.0-alpha.4 + + ajv@6.12.6: + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + + ajv@8.12.0: + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + + ansi-regex@5.0.1: {} + + ansi-styles@3.2.1: + dependencies: + color-convert: 1.9.3 + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + antlr4@4.13.1: {} + + antlr4ts@0.5.0-alpha.4: {} + + argparse@2.0.1: {} + + ast-parents@0.0.1: {} + + astral-regex@2.0.0: {} + + balanced-match@1.0.2: {} + + brace-expansion@2.0.1: + dependencies: + balanced-match: 1.0.2 + + callsites@3.1.0: {} + + chalk@2.4.2: + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + + chalk@4.1.2: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + + color-convert@1.9.3: + dependencies: + color-name: 1.1.3 + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.3: {} + + color-name@1.1.4: {} + + commander@11.1.0: {} + + cosmiconfig@8.3.6: + dependencies: + import-fresh: 3.3.0 + js-yaml: 4.1.0 + parse-json: 5.2.0 + path-type: 4.0.0 + + emoji-regex@8.0.0: {} + + error-ex@1.3.2: + dependencies: + is-arrayish: 0.2.1 + + escape-string-regexp@1.0.5: {} + + fast-deep-equal@3.1.3: {} + + fast-diff@1.3.0: {} + + fast-json-stable-stringify@2.1.0: {} + + fs.realpath@1.0.0: {} + + glob@8.1.0: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.6 + once: 1.4.0 + + has-flag@3.0.0: {} + + has-flag@4.0.0: {} + + ignore@5.3.0: {} + + import-fresh@3.3.0: + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + + inflight@1.0.6: + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + + inherits@2.0.4: {} + + is-arrayish@0.2.1: {} + + is-fullwidth-code-point@3.0.0: {} + + js-tokens@4.0.0: {} + + js-yaml@4.1.0: + dependencies: + argparse: 2.0.1 + + json-parse-even-better-errors@2.3.1: {} + + json-schema-traverse@0.4.1: {} + + json-schema-traverse@1.0.0: {} + + lines-and-columns@1.2.4: {} + + lodash.truncate@4.4.2: {} + + lodash@4.17.21: {} + + minimatch@5.1.6: + dependencies: + brace-expansion: 2.0.1 + + once@1.4.0: + dependencies: + wrappy: 1.0.2 + + parent-module@1.0.1: + dependencies: + callsites: 3.1.0 + + parse-json@5.2.0: + dependencies: + '@babel/code-frame': 7.23.5 + error-ex: 1.3.2 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + + path-type@4.0.0: {} + + pluralize@8.0.0: {} + + prettier@2.8.8: + optional: true + + punycode@2.3.1: {} + + require-from-string@2.0.2: {} + + resolve-from@4.0.0: {} + + semver@6.3.1: {} + + slice-ansi@4.0.0: dependencies: ansi-styles: 4.3.0 astral-regex: 2.0.0 is-fullwidth-code-point: 3.0.0 - dev: false - /solhint-community@3.7.0: - resolution: {integrity: sha512-8nfdaxVll+IIaEBHFz3CzagIZNNTGp4Mrr+6O4m7c9Bs/L8OcgR/xzZJFwROkGAhV8Nbiv4gqJ42nEXZPYl3Qw==} - hasBin: true + solhint-community@3.7.0: dependencies: '@solidity-parser/parser': 0.16.2 ajv: 6.12.6 @@ -393,59 +489,37 @@ packages: prettier: 2.8.8 transitivePeerDependencies: - typescript - dev: false - /string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - dev: false - /strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} + strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 - dev: false - /supports-color@5.5.0: - resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} - engines: {node: '>=4'} + supports-color@5.5.0: dependencies: has-flag: 3.0.0 - dev: false - /supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} + supports-color@7.2.0: dependencies: has-flag: 4.0.0 - dev: false - /table@6.8.1: - resolution: {integrity: sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==} - engines: {node: '>=10.0.0'} + table@6.8.1: dependencies: ajv: 8.12.0 lodash.truncate: 4.4.2 slice-ansi: 4.0.0 string-width: 4.2.3 strip-ansi: 6.0.1 - dev: false - /text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - dev: false + text-table@0.2.0: {} - /uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + uri-js@4.4.1: dependencies: punycode: 2.3.1 - dev: false - /wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - dev: false + wrappy@1.0.2: {} From 964f4bfe21a15415e11e68e59e57c124c6d00ec7 Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 8 Jul 2024 11:36:21 -0400 Subject: [PATCH 67/82] test: update salts --- script/salts/salts.json | 52 ++++++++++++++++++++--------------------- test/Constants.sol | 6 ++--- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/script/salts/salts.json b/script/salts/salts.json index f9e01de8..caaf5dee 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -50,48 +50,48 @@ "0xed4ba02077e70f78db70ce191509333d2dcccfff136d30dcb011f567305e88ad": "0x2b8bc588174d409692f1bd993942e3806c9a11344dbe674f46aed32a030aacf1" }, "Test_AllocatedMerkleAllowlist": { - "0x1242d528fb3d9259e7192f83e1faf95370bfd8d7f2b1bae5d3ea350d3d9c563c": "0x0ec2c9d910490e897c952a3210e5915006080f59a14a022b941a8c8cef2886e3", - "0x7cca57da19a5847b2b87641c1b721a32d4778e3e58641d6771cd14ed112b3bc3": "0xe0631d27a3d241774729d8c3ee1d9efae407f1073f89fa0956b2d308bd3adec4" + "0x45f122f7acac9ed91811650b3c82832717d513261edf3b7d0cc58ed3a05758d3": "0x715170bfdb1926fc086c188ffa8e70e68e49ea4d5c9b13ce79b38cca89f01ff4", + "0x7c9807f1115c3fa2796e18082a2391a1f0805230b4ff8ced38a0c61f3c22dbed": "0x77a8437b20faf564ad607165d6362a6defb893573d3f06ddf0200b0cc8845404" }, "Test_CappedMerkleAllowlist": { - "0x2e55fe4d6c3005f7bf152a42653bd234155cdac7f621582ba16b664c115ba76b": "0xcebb750afb8a132bc3cb37d32494b7ff18eddfb4b5359d69324660cb723e32e3", - "0xbd19b648b51fb3fe1bd9e42ad4018b839966abea0f4e25a9149dffdc7cc86a4e": "0x40034a34b97aef1a7635ee0f34b06951512b57d37bc0baa1be879a5144895d08" + "0x581a670fce95fe7e4a3d8a475a7bea74164920b52f6beef8f9002e95028591a7": "0x1c45cc72f97ae2ced71bf3eb4da51011480fad8b0d49fc9d90b33b3d195c297e", + "0x76db28e6ab8dcd404db77dcc96b77cdda9efb80f6aee441f14d1730a21532b7b": "0x71c32abbeeb586396fe26ac83a01b0fd2fe3a02030a2b5d4c2f99831e92b9c4b" }, "Test_GUniFactory": { "0x3bf0e882023640f31bf861e1f13d306fd4fbb7afb7860e21a489062cbefcf885": "0x397acf3db4cc9c81f8c1975a5505e392e6b5f8eb3b22efcc094b3e0f39f6739b" }, "Test_MockCallback": { - "0x0825d99059fe0dc95e0b5cd7b853a5f3f50b58f25c5812fc7fd01d69ff4ec679": "0x222b47fd0259b3eacfbc04b9dddf5bb5ba060245c2c3c3673672ad4d815d01df", - "0x51526251ca3003df174c65f2fb581f61820ce57c14720e0d67480ed8c8b77925": "0xd25a3174b866cae4f78f513123ffebf33114f3df0093e06159010b3d9fbadff3", - "0x6206c9845f35f3006fc507c15aaaf4a719380265cf472773a270ffe6d5eb5299": "0xe9943f7c46c50e34e5f91da14d0ca6c58b5504172e156e19108bf2844fdaec63", - "0x6b7fa77ae82f95cc8c5fe53dca64702ea0dc8e3dad74749dc8cd77de2884e704": "0x600196a40f70c0b91ab3ace5873750bc77d14dddf6b1093b03def43f31ddb4c3", - "0x7310243dabd76344326f3659aabda0b846a9c8e9e7d50b990261c14f2b44d560": "0x86d15e2125c36574017c86d4fcd04bb470225e835b76e3cbe63c5908da46ab8c", - "0x7602309c05771de8281f2f3f08e74ec9f19f1bfdaac8cd970d9f7a8d62173b6e": "0xd28f39fd2d2e1a378b0fe177abc5ac22a4642634847865a096a5e96bd04c6411", - "0x892e1120a976151ae5375dca978040abe705c8cbdd3c7b64b41ff1087ee01c22": "0x748af80730f660a2400a4d6f8f4f41d21cca1cc117fc2f1c51e131e16fa43ce3", - "0x8a69dcb863773a3bb971a969233286e75cba80abf6ec8d881cada7ea0ad674b0": "0xd7bacad37fd5e507c6bc424ed88ae37e8d4935b54d7e41cf1306d46c37eaebb4", - "0x8d8681a539f3b359e94a05239187dc55cb9cb2dcfe01726d3053573206efe25f": "0x6f209918e9619b620b306b2014e6aabe3688c4a4043117b6835ab17bd70bf004", - "0x918d87a20c837fa93ce3089d2cb6386b66f79bbfd0f09bd6784bc52108b69938": "0x64473a26214c7b928ff6c08104e3b18ae36918097eefb554aa17c2b9347fd7f2", - "0x9569f58e5e127ceb73049eea8119bb21f8c4328d3b4770da5a67075be3f77c12": "0x2123580432d5ece19c5e099d5156a9598f2c49fdcbcc1029f7d21276ccab2ba3", - "0x96f0481f00eeec717fa8c0d41efd04b6e3fdccbebbaa223ee2118449ebea2406": "0x6bc41d5bab2740be84e43b053ed3b46acb6f3ac1cb9031fb3203edd92a833a07", - "0x9c35a3189126603f4b187149f54e09082403dac10b3e899a503e28e897edd6f9": "0xa35f7a6870564c7a14d71310c87a6816c3ef4f80eb0a5ac43d56235e075ae162", - "0x9db4bc605469ede684fbaa475d320b3fbe6a707deaa953ee1ba29ecb3c1125fb": "0x67f66566dfb091aeeb776b692eba5f570f5a310cf25e94f0e06120cf64737a9d", - "0xb8e0b3cbd7273e83cfdbcb8269e5c3510a28892e815fe28bc0f515be0df2c8f9": "0x17f7fbab547a6a69119fee8820b0ff11a8da7a1f9902a19d8f3917a6c8aff2da", - "0xc38bb4813ebdb9978d2485ae5ad92e1152f8a955430a63210b69b2277eed9477": "0x9bf9b60e2afb2faf561385c61d5c3f5b6b910c97bdd3bb4af59d193140215a31", - "0xd75e639b43b1d29e1703abcd2616b6b67f3ae232d53915d472f3a5b6aae6083c": "0xa45904df2431729c77de44b4b88e032130e12dcbc735f0f72a29af686e15f3ed", - "0xf2644573f57aea10dffac6e7215b409fa19236ae57b735b20b9fac9834391850": "0x3a824c912eb7f08b82a8d936c2e29cb2b6fdde7e33ea9af18d9ccbde9c454161" + "0x0292f11feedba71470bec5d64e63ce3fc8264fdf8afbc612ff30f05c378715d9": "0x29d54d314716159b9500b3654b9a0cefef23cceff8f1e927a782a108f2dd665f", + "0x1de2a5597856d096b736ce7dc2d319b0a5b7a684c13389fdf6e457c9c90214fb": "0x7e67e6febafa7cd9ccab4a8b12e7c429465aef925ecbf3da87c07eefed01e2ae", + "0x50c11fc2cd89485e70f8efa6fde9be37a6d38321a60a68c54d5120223bace7a9": "0xcb6c92aeee719218eb6cd8bbb1509ef80d281c280e19c09c487abccdeb06a1d4", + "0x5b95347fbbc3f07ab9d5479ac37a1b90c6faab9447597cdc7658c5d0dfa9f282": "0x3be39559fec94ad804f3bacd70b353bef40c6c6fa0a16ff1256b66f1adb95eff", + "0x6e2aabb3152820d75be49c9015c214ff9cb446c24236c582fe609776624f7e02": "0x72d5b90c41c154f22d9cac343b5f7973b1484e2aff886b5110144ded05982cba", + "0x7031cc1db083ab38787974aecb4110c3d9b90be0f4f6100c2d3fd71882efa006": "0xb42b03945ccf8e46c8258eed4e7c8753d0d8119a0df6b26e2d94b74b5e4137a9", + "0x71586e15027e9300f69cd748c3978b2895cc60c75e1da758965522b3ba4094a5": "0x7a65d237577457b1416b55bc86f925060da38ad2c6c1985d3497c670f311679d", + "0x75c5ccb3a9d652c0ee9f3ff80450c3642fb4051365877ed001dd40f11459642e": "0x2996b7e27c21a587bda0dafb755dfe1d25757cea710a65bfe1ec2b76e65b9842", + "0x84cf8d6389a683a3491be6f92bc24c0eab804373610d5831a88a1b4dba04a8f2": "0x14cdd69c8ef7e35840a186969d7b52b65fc43c3fd25b915ccb5636c7958d10df", + "0x906d15feb6bc4ec71cdc7a1591950e1c9f4e85437e1a1a75552360908d5c0be4": "0x114aef689a62b34429432fbdf930b0d1b5db759abf85e85547b9b672a9c14d3f", + "0x980e581f6d53c2836e0811bf60907af8fc262e6ed24c22068a755a40ff4939ac": "0x4165c6fe0d9bed05871d70ccd51cebad4a43661ebddcac35d4db65ec8d3e5683", + "0xa289110cf10f63814b2f56f2504faacf3d9fc25b9422987377c4ceccc422594a": "0x080dc9b12470e8eca2118aa949f025f85391af21904adb7b7ce052135e9b98f6", + "0xae701a6e57cfc23ac94b95e11c6af02bc6fcebf44517e77fd0fb7ad68d76ef5d": "0x3f4b3ceba4aa86ba3a03c882681e7ad788ad043dd9f398eb6c2c615711512dc8", + "0xb2819ef15777e6d234863480af5c99c30116346b6ffdbddfcc8317313ea5d58d": "0x2453b488795f4fad47cf14c45af3a9f2576e51fe5254584c12490470bceef8f1", + "0xb566f44afa573034186bee699bcc6f7f2d40982d1dd31bb27335f20f35a87041": "0x827ce160c0e387b471eed6539ccb79a2db437e22602d3b59245b102046f591c1", + "0xbd4ceec59115b5cdd4b37c9485ab1c4ce4626ed59e5cb169cf5869cbf8ce8319": "0x0efd137aec19a83e71b973b3496a638be09aac3aa998b234376887785461e6e8", + "0xd1c5e9171a5aaddc37bd1443137989748b01a500abc2834bd60920c0a0ae50bb": "0x3aa7ef24d9583573e426f02cdff5d81f756fb62ad1928f74aef0b2d48a9d9c82", + "0xe10dcccb933d6f19d1932c609db896016864d0897dd2be8944c60ebd4522d41d": "0xeb800af3ab5e61ede7c9f40eb637289840a4eb6d43c9f1e54e12826ce8c13ce4" }, "Test_TokenAllowlist": { - "0x11e024c2f0ada4ce2ce048af08354dfa64f38ad959564c55e6bbf48d2ed3822e": "0x36081349bdb172b741f01d750be52416888c2083ea791863109f709f33f3eebd", - "0x78a7c23f669f5df656575693f45f928b7af2ed4bc981cf6dec77bef2c03bb081": "0x2f45234bfc47c4383d3d83a27019a523b0e94986d6f7ed632b7041de70b8ba63" + "0x63d09b76a33540f4079f5fd7ba159ef61b164049ae7784485e0608aa4ca5fe19": "0x8bb40c1cf4fc6553c121e62a1cfb5a23eec8d39a437af4e788ef7409506003d3", + "0x8f8e3042f262f394e8758732620875e10a5a30249eae787dd5a75f3dc5b38325": "0xc15504baa18fdae17653ff37f9e98b6a895d733e8d87e0033c089daadf009c57" }, "Test_UniswapV2DirectToLiquidity": { - "0xbce774b5c75ce6af2b000bd157d0966753042aba6fde38f5ea2eca76b585791f": "0x4a96efe15db180328cfc5296e72ceed9e7e3a10213a9c34d69b500733afc2d21" + "0x9e35f9f464e25b8613795373a234790cd117c9d9486e2471c30fd8a5bd30d1f4": "0x9cc78899343b16cdafd1cd09bc2806f9e8e47694811b839745fb5f26d27542c1" }, "Test_UniswapV2Router": { "0xe6204aa211921628df345ff0b909c863298684cd8ca65de5479af6b70662e622": "0xf508fd71ff40f5d0640b01b9384f98d35db43c7ddb0d4abe274d61fdf1ea967f" }, "Test_UniswapV3DirectToLiquidity": { - "0x58b7674df101688da4f68d9cfad65390f1f35abe1c999bd0a251069b8883f528": "0xee9c953ecdad99f7aab8e6812d8b023c11ca7978a5324739a9e8987c44ac2e96" + "0xe61cce73d173e9eccefcf8c521ce407a58ae717c98a7b05aaa5ceebb266e9dac": "0x9c19f7e8cf5be14bcb0649becb52c288f740a82acb505004a84a0092c4cf2248" }, "Test_UniswapV3Factory": { "0xbcd657c3390ecd2e1782b6473400c51fa124922eb98b69f1b5192eb0f8e3d3df": "0x3448ebb18cb03fae2e9153c621d46f1b9b8941cc66e7063b587fe4a284490b01" diff --git a/test/Constants.sol b/test/Constants.sol index 04b9f4fe..e651a223 100644 --- a/test/Constants.sol +++ b/test/Constants.sol @@ -7,10 +7,10 @@ abstract contract TestConstants { address internal constant _UNISWAP_V2_FACTORY = address(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); address internal constant _UNISWAP_V2_ROUTER = - address(0xAA9E6CDA232112EBc0FC2Ca14B3178567a410224); + address(0xC5287E5F413C8e620e5Dc2fEbdaBE4ccCbf96669); address internal constant _UNISWAP_V3_FACTORY = - address(0xAA6E2347940f38546B6a1b804070899Ccb75c558); - address internal constant _GUNI_FACTORY = address(0xAA426C06A7D084E79bFa5B8cd0A15aeebA7693f1); + address(0x1702DD7e80bA99600C7007e519267FB853BBe923); + address internal constant _GUNI_FACTORY = address(0xfd55d1Beb11E49AeEeaE8AE3499c8cB761A0EdE7); address internal constant _BASELINE_KERNEL = address(0xBB); address internal constant _BASELINE_QUOTE_TOKEN = address(0xAA58516d932C482469914260268EEA7611BF0eb4); From e7b9188c35351adcb47a6fe49608e65f7c5300d9 Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 8 Jul 2024 11:46:41 -0400 Subject: [PATCH 68/82] chore: try install script without checkout action --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 474f9cf1..b38a467d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,7 +50,6 @@ jobs: run: cd crates/ecies-cli && cargo build && cd ../.. - name: Repo Install Script - uses: actions/checkout@v4 run: | chmod +x ./install.sh ./install.sh From b5e0b53f580f9ef88826e0c0b50c3e2c5a617f09 Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 8 Jul 2024 11:49:02 -0400 Subject: [PATCH 69/82] chore: add checkout at beginning of CI --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b38a467d..6a98ffe2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,6 +14,8 @@ jobs: name: Foundry project runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + - name: Install Node.js uses: actions/setup-node@v2 From 7e65af6bbcd76ee1c526cc7a5fa18de7f94c6dba Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 8 Jul 2024 12:22:19 -0400 Subject: [PATCH 70/82] test: revert constant changes and update salts --- script/salts/salts.json | 52 ++++++++++++++++++++--------------------- test/Constants.sol | 6 ++--- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/script/salts/salts.json b/script/salts/salts.json index caaf5dee..2a60bcea 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -50,48 +50,48 @@ "0xed4ba02077e70f78db70ce191509333d2dcccfff136d30dcb011f567305e88ad": "0x2b8bc588174d409692f1bd993942e3806c9a11344dbe674f46aed32a030aacf1" }, "Test_AllocatedMerkleAllowlist": { - "0x45f122f7acac9ed91811650b3c82832717d513261edf3b7d0cc58ed3a05758d3": "0x715170bfdb1926fc086c188ffa8e70e68e49ea4d5c9b13ce79b38cca89f01ff4", - "0x7c9807f1115c3fa2796e18082a2391a1f0805230b4ff8ced38a0c61f3c22dbed": "0x77a8437b20faf564ad607165d6362a6defb893573d3f06ddf0200b0cc8845404" + "0x1242d528fb3d9259e7192f83e1faf95370bfd8d7f2b1bae5d3ea350d3d9c563c": "0x28e7327bdc82ee44449f42101aa212b1e74f2a93096f042ff8e37b4241f6f6bc", + "0x7cca57da19a5847b2b87641c1b721a32d4778e3e58641d6771cd14ed112b3bc3": "0x29bd6d7f6b3a5ddb3bf649b30def344e7f58341330dd7a9a790c796c50a1389e" }, "Test_CappedMerkleAllowlist": { - "0x581a670fce95fe7e4a3d8a475a7bea74164920b52f6beef8f9002e95028591a7": "0x1c45cc72f97ae2ced71bf3eb4da51011480fad8b0d49fc9d90b33b3d195c297e", - "0x76db28e6ab8dcd404db77dcc96b77cdda9efb80f6aee441f14d1730a21532b7b": "0x71c32abbeeb586396fe26ac83a01b0fd2fe3a02030a2b5d4c2f99831e92b9c4b" + "0x2e55fe4d6c3005f7bf152a42653bd234155cdac7f621582ba16b664c115ba76b": "0xc961b67b98b4a302830734a6b25bbfd43e1588d7dc8864ef0cbec61eae24ea6b", + "0xbd19b648b51fb3fe1bd9e42ad4018b839966abea0f4e25a9149dffdc7cc86a4e": "0x224b2bdc957fe4361ef23a7f6f187185518d32edb7b74298665c5f67b6252b88" }, "Test_GUniFactory": { "0x3bf0e882023640f31bf861e1f13d306fd4fbb7afb7860e21a489062cbefcf885": "0x397acf3db4cc9c81f8c1975a5505e392e6b5f8eb3b22efcc094b3e0f39f6739b" }, "Test_MockCallback": { - "0x0292f11feedba71470bec5d64e63ce3fc8264fdf8afbc612ff30f05c378715d9": "0x29d54d314716159b9500b3654b9a0cefef23cceff8f1e927a782a108f2dd665f", - "0x1de2a5597856d096b736ce7dc2d319b0a5b7a684c13389fdf6e457c9c90214fb": "0x7e67e6febafa7cd9ccab4a8b12e7c429465aef925ecbf3da87c07eefed01e2ae", - "0x50c11fc2cd89485e70f8efa6fde9be37a6d38321a60a68c54d5120223bace7a9": "0xcb6c92aeee719218eb6cd8bbb1509ef80d281c280e19c09c487abccdeb06a1d4", - "0x5b95347fbbc3f07ab9d5479ac37a1b90c6faab9447597cdc7658c5d0dfa9f282": "0x3be39559fec94ad804f3bacd70b353bef40c6c6fa0a16ff1256b66f1adb95eff", - "0x6e2aabb3152820d75be49c9015c214ff9cb446c24236c582fe609776624f7e02": "0x72d5b90c41c154f22d9cac343b5f7973b1484e2aff886b5110144ded05982cba", - "0x7031cc1db083ab38787974aecb4110c3d9b90be0f4f6100c2d3fd71882efa006": "0xb42b03945ccf8e46c8258eed4e7c8753d0d8119a0df6b26e2d94b74b5e4137a9", - "0x71586e15027e9300f69cd748c3978b2895cc60c75e1da758965522b3ba4094a5": "0x7a65d237577457b1416b55bc86f925060da38ad2c6c1985d3497c670f311679d", - "0x75c5ccb3a9d652c0ee9f3ff80450c3642fb4051365877ed001dd40f11459642e": "0x2996b7e27c21a587bda0dafb755dfe1d25757cea710a65bfe1ec2b76e65b9842", - "0x84cf8d6389a683a3491be6f92bc24c0eab804373610d5831a88a1b4dba04a8f2": "0x14cdd69c8ef7e35840a186969d7b52b65fc43c3fd25b915ccb5636c7958d10df", - "0x906d15feb6bc4ec71cdc7a1591950e1c9f4e85437e1a1a75552360908d5c0be4": "0x114aef689a62b34429432fbdf930b0d1b5db759abf85e85547b9b672a9c14d3f", - "0x980e581f6d53c2836e0811bf60907af8fc262e6ed24c22068a755a40ff4939ac": "0x4165c6fe0d9bed05871d70ccd51cebad4a43661ebddcac35d4db65ec8d3e5683", - "0xa289110cf10f63814b2f56f2504faacf3d9fc25b9422987377c4ceccc422594a": "0x080dc9b12470e8eca2118aa949f025f85391af21904adb7b7ce052135e9b98f6", - "0xae701a6e57cfc23ac94b95e11c6af02bc6fcebf44517e77fd0fb7ad68d76ef5d": "0x3f4b3ceba4aa86ba3a03c882681e7ad788ad043dd9f398eb6c2c615711512dc8", - "0xb2819ef15777e6d234863480af5c99c30116346b6ffdbddfcc8317313ea5d58d": "0x2453b488795f4fad47cf14c45af3a9f2576e51fe5254584c12490470bceef8f1", - "0xb566f44afa573034186bee699bcc6f7f2d40982d1dd31bb27335f20f35a87041": "0x827ce160c0e387b471eed6539ccb79a2db437e22602d3b59245b102046f591c1", - "0xbd4ceec59115b5cdd4b37c9485ab1c4ce4626ed59e5cb169cf5869cbf8ce8319": "0x0efd137aec19a83e71b973b3496a638be09aac3aa998b234376887785461e6e8", - "0xd1c5e9171a5aaddc37bd1443137989748b01a500abc2834bd60920c0a0ae50bb": "0x3aa7ef24d9583573e426f02cdff5d81f756fb62ad1928f74aef0b2d48a9d9c82", - "0xe10dcccb933d6f19d1932c609db896016864d0897dd2be8944c60ebd4522d41d": "0xeb800af3ab5e61ede7c9f40eb637289840a4eb6d43c9f1e54e12826ce8c13ce4" + "0x0825d99059fe0dc95e0b5cd7b853a5f3f50b58f25c5812fc7fd01d69ff4ec679": "0xb7a4a5d87212f8332bfc341e299c38bad62191c76db3d8908bc03edf21619f3a", + "0x51526251ca3003df174c65f2fb581f61820ce57c14720e0d67480ed8c8b77925": "0x546f04b8a6c02b7020fdd76e00b310c3cd6529edbf16df4bba15bd1cf87c1ebb", + "0x6206c9845f35f3006fc507c15aaaf4a719380265cf472773a270ffe6d5eb5299": "0xf2a3e0322592715d20bb1488f7c78a951b042efe6dc00626c72a93a5ce6d71ca", + "0x6b7fa77ae82f95cc8c5fe53dca64702ea0dc8e3dad74749dc8cd77de2884e704": "0x36031ea9a844fbdcd342bbe4ecfdfe4fa11bcc9cb101f3e7ad066817d6885c5e", + "0x7310243dabd76344326f3659aabda0b846a9c8e9e7d50b990261c14f2b44d560": "0x87cb2e6062af84c8c97bb3a862450588e07e9e5f4524dd4533b97fd5558681af", + "0x7602309c05771de8281f2f3f08e74ec9f19f1bfdaac8cd970d9f7a8d62173b6e": "0xc79ce4088cc3768ea80f75cf09382e910a6a3bda6820425f59a135d904d19e7a", + "0x892e1120a976151ae5375dca978040abe705c8cbdd3c7b64b41ff1087ee01c22": "0x827a5abbfe10744fb2b7996f5fcd778e5ec24b1b66842b508404ab88e0482ffb", + "0x8a69dcb863773a3bb971a969233286e75cba80abf6ec8d881cada7ea0ad674b0": "0x961da2f1f56f28f5f611b28eaee534e4ab9fb97f667c87c206b17c318950b3a6", + "0x8d8681a539f3b359e94a05239187dc55cb9cb2dcfe01726d3053573206efe25f": "0xd12e9def75c53f609c70b267b8559f101b03bb58050adf7f3e812e34782e4e88", + "0x918d87a20c837fa93ce3089d2cb6386b66f79bbfd0f09bd6784bc52108b69938": "0x1fabbf534809aa468599d96ffc3c1611bd4458f987f1acec148c357e57337016", + "0x9569f58e5e127ceb73049eea8119bb21f8c4328d3b4770da5a67075be3f77c12": "0x20e7f82882d05c6863060ca2595a71559399f6dc1385df42614b05abc3eff00f", + "0x96f0481f00eeec717fa8c0d41efd04b6e3fdccbebbaa223ee2118449ebea2406": "0xbc9e61c0cdccc55ffd76261116dfb060ac0fcd0b31ff2a2ea72514203c0a3827", + "0x9c35a3189126603f4b187149f54e09082403dac10b3e899a503e28e897edd6f9": "0x1fecf5b8fd3291d3880a530457a7bc463de1bdb81f68fd83758b4ecfbd5c3659", + "0x9db4bc605469ede684fbaa475d320b3fbe6a707deaa953ee1ba29ecb3c1125fb": "0xda4a90b47357900f3e1c38792de6662d56ece5aed01c3f3ac5020ff32e08032c", + "0xb8e0b3cbd7273e83cfdbcb8269e5c3510a28892e815fe28bc0f515be0df2c8f9": "0xe8492376ab5a5d642160463b00d38a9b5b87e2fc8afce127983dc6d1dc97d776", + "0xc38bb4813ebdb9978d2485ae5ad92e1152f8a955430a63210b69b2277eed9477": "0xcedce64703d22ccb65bdc86d9fe6d0abea6ec29792c91b423152594bd5336976", + "0xd75e639b43b1d29e1703abcd2616b6b67f3ae232d53915d472f3a5b6aae6083c": "0x521b594ba447613faa8fb22609d92fc85fe3d1644b8d5804b23fffa496e30317", + "0xf2644573f57aea10dffac6e7215b409fa19236ae57b735b20b9fac9834391850": "0x2cd20318c8db20614867990e6284ceff46a54997d19f3213179292f7f2922e47" }, "Test_TokenAllowlist": { - "0x63d09b76a33540f4079f5fd7ba159ef61b164049ae7784485e0608aa4ca5fe19": "0x8bb40c1cf4fc6553c121e62a1cfb5a23eec8d39a437af4e788ef7409506003d3", - "0x8f8e3042f262f394e8758732620875e10a5a30249eae787dd5a75f3dc5b38325": "0xc15504baa18fdae17653ff37f9e98b6a895d733e8d87e0033c089daadf009c57" + "0x11e024c2f0ada4ce2ce048af08354dfa64f38ad959564c55e6bbf48d2ed3822e": "0x8f58340cfc39502e9dc50b771cdb06a14b3204f685adf563f2f5020d483feacf", + "0x78a7c23f669f5df656575693f45f928b7af2ed4bc981cf6dec77bef2c03bb081": "0xd06371a3e80e11b111e5c68c712d696aa236bf4d29808847295a7a6324af4f84" }, "Test_UniswapV2DirectToLiquidity": { - "0x9e35f9f464e25b8613795373a234790cd117c9d9486e2471c30fd8a5bd30d1f4": "0x9cc78899343b16cdafd1cd09bc2806f9e8e47694811b839745fb5f26d27542c1" + "0xbce774b5c75ce6af2b000bd157d0966753042aba6fde38f5ea2eca76b585791f": "0x55208611cec0a88da835309df48d0102dbdb45baa128b2555052f0a2fcd526d8" }, "Test_UniswapV2Router": { "0xe6204aa211921628df345ff0b909c863298684cd8ca65de5479af6b70662e622": "0xf508fd71ff40f5d0640b01b9384f98d35db43c7ddb0d4abe274d61fdf1ea967f" }, "Test_UniswapV3DirectToLiquidity": { - "0xe61cce73d173e9eccefcf8c521ce407a58ae717c98a7b05aaa5ceebb266e9dac": "0x9c19f7e8cf5be14bcb0649becb52c288f740a82acb505004a84a0092c4cf2248" + "0x58b7674df101688da4f68d9cfad65390f1f35abe1c999bd0a251069b8883f528": "0x6382557258b960eca0a5069b80205235e370fb2ce399d29ec5a9307e66799c49" }, "Test_UniswapV3Factory": { "0xbcd657c3390ecd2e1782b6473400c51fa124922eb98b69f1b5192eb0f8e3d3df": "0x3448ebb18cb03fae2e9153c621d46f1b9b8941cc66e7063b587fe4a284490b01" diff --git a/test/Constants.sol b/test/Constants.sol index e651a223..04b9f4fe 100644 --- a/test/Constants.sol +++ b/test/Constants.sol @@ -7,10 +7,10 @@ abstract contract TestConstants { address internal constant _UNISWAP_V2_FACTORY = address(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); address internal constant _UNISWAP_V2_ROUTER = - address(0xC5287E5F413C8e620e5Dc2fEbdaBE4ccCbf96669); + address(0xAA9E6CDA232112EBc0FC2Ca14B3178567a410224); address internal constant _UNISWAP_V3_FACTORY = - address(0x1702DD7e80bA99600C7007e519267FB853BBe923); - address internal constant _GUNI_FACTORY = address(0xfd55d1Beb11E49AeEeaE8AE3499c8cB761A0EdE7); + address(0xAA6E2347940f38546B6a1b804070899Ccb75c558); + address internal constant _GUNI_FACTORY = address(0xAA426C06A7D084E79bFa5B8cd0A15aeebA7693f1); address internal constant _BASELINE_KERNEL = address(0xBB); address internal constant _BASELINE_QUOTE_TOKEN = address(0xAA58516d932C482469914260268EEA7611BF0eb4); From 084617ef8bab29bfbcccdd8641f53f53aa6e1b19 Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 8 Jul 2024 12:44:20 -0400 Subject: [PATCH 71/82] chore: update pnpm test to not include longrunning settlement tests --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4149b275..90ed32b1 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "solhint:all": "solhint --fix --config ./.solhint.json 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'", "solhint:check": "solhint --config ./.solhint.json 'src/**/*.sol'", "solhint": "solhint --fix --config ./.solhint.json 'src/**/*.sol'", - "test": "forge test --nmt optimal -vvv" + "test": "forge test --nmt largeNumberOf -vvv" }, "keywords": [], "author": "", From b91ecd35a06559d09dbd66c22aa37e7fd4712c28 Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 8 Jul 2024 13:06:23 -0400 Subject: [PATCH 72/82] test: update salts (again) --- script/salts/salts.json | 58 ++++++++++++++++++++--------------------- test/Constants.sol | 6 ++--- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/script/salts/salts.json b/script/salts/salts.json index 2a60bcea..a776f567 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -50,51 +50,51 @@ "0xed4ba02077e70f78db70ce191509333d2dcccfff136d30dcb011f567305e88ad": "0x2b8bc588174d409692f1bd993942e3806c9a11344dbe674f46aed32a030aacf1" }, "Test_AllocatedMerkleAllowlist": { - "0x1242d528fb3d9259e7192f83e1faf95370bfd8d7f2b1bae5d3ea350d3d9c563c": "0x28e7327bdc82ee44449f42101aa212b1e74f2a93096f042ff8e37b4241f6f6bc", - "0x7cca57da19a5847b2b87641c1b721a32d4778e3e58641d6771cd14ed112b3bc3": "0x29bd6d7f6b3a5ddb3bf649b30def344e7f58341330dd7a9a790c796c50a1389e" + "0xb17794250569bcd64aae2ec1312399120db92167bf0a2602821e0ee953dd3d31": "0xa8a4fc4fb8d721bdce27342cdd381eb510362146f49e56698a8bcb6c639306ff", + "0xecbee26b3d0e662be84e4cef678b23166957f507ca68f32eaa49e60ceb567981": "0x1598e58155ab6f6f2d8b2813c5c763f04ab980c3e65dffe2b3a312e8ccba4ae7" }, "Test_CappedMerkleAllowlist": { - "0x2e55fe4d6c3005f7bf152a42653bd234155cdac7f621582ba16b664c115ba76b": "0xc961b67b98b4a302830734a6b25bbfd43e1588d7dc8864ef0cbec61eae24ea6b", - "0xbd19b648b51fb3fe1bd9e42ad4018b839966abea0f4e25a9149dffdc7cc86a4e": "0x224b2bdc957fe4361ef23a7f6f187185518d32edb7b74298665c5f67b6252b88" + "0xa0ed568f98efa2efd4e93f21a5445970919a333349a8f5369a28ae93271d9cca": "0x6fb3e2a45254801d17269019f8afcadbd132d417f4dde1bfc65dd8f440256a56", + "0xfd2c28cb6c38931a1f784078c41d21d7bf8fc3653231edca225a5fbbc50529dc": "0x88a482ab0eacd2d6c1fc7b3858bfba29aa92b8abfc6239e02e6952640c3ebdf7" }, "Test_GUniFactory": { - "0x3bf0e882023640f31bf861e1f13d306fd4fbb7afb7860e21a489062cbefcf885": "0x397acf3db4cc9c81f8c1975a5505e392e6b5f8eb3b22efcc094b3e0f39f6739b" + "0xa8ee5069b769099da4dbc8c5d4c95cb74d416554203119678be4d0eba33f5962": "0x767e6faad4f8e62d6ab897930a0eb497cb71ebc75f90856dc13996fb00b907d3" }, "Test_MockCallback": { - "0x0825d99059fe0dc95e0b5cd7b853a5f3f50b58f25c5812fc7fd01d69ff4ec679": "0xb7a4a5d87212f8332bfc341e299c38bad62191c76db3d8908bc03edf21619f3a", - "0x51526251ca3003df174c65f2fb581f61820ce57c14720e0d67480ed8c8b77925": "0x546f04b8a6c02b7020fdd76e00b310c3cd6529edbf16df4bba15bd1cf87c1ebb", - "0x6206c9845f35f3006fc507c15aaaf4a719380265cf472773a270ffe6d5eb5299": "0xf2a3e0322592715d20bb1488f7c78a951b042efe6dc00626c72a93a5ce6d71ca", - "0x6b7fa77ae82f95cc8c5fe53dca64702ea0dc8e3dad74749dc8cd77de2884e704": "0x36031ea9a844fbdcd342bbe4ecfdfe4fa11bcc9cb101f3e7ad066817d6885c5e", - "0x7310243dabd76344326f3659aabda0b846a9c8e9e7d50b990261c14f2b44d560": "0x87cb2e6062af84c8c97bb3a862450588e07e9e5f4524dd4533b97fd5558681af", - "0x7602309c05771de8281f2f3f08e74ec9f19f1bfdaac8cd970d9f7a8d62173b6e": "0xc79ce4088cc3768ea80f75cf09382e910a6a3bda6820425f59a135d904d19e7a", - "0x892e1120a976151ae5375dca978040abe705c8cbdd3c7b64b41ff1087ee01c22": "0x827a5abbfe10744fb2b7996f5fcd778e5ec24b1b66842b508404ab88e0482ffb", - "0x8a69dcb863773a3bb971a969233286e75cba80abf6ec8d881cada7ea0ad674b0": "0x961da2f1f56f28f5f611b28eaee534e4ab9fb97f667c87c206b17c318950b3a6", - "0x8d8681a539f3b359e94a05239187dc55cb9cb2dcfe01726d3053573206efe25f": "0xd12e9def75c53f609c70b267b8559f101b03bb58050adf7f3e812e34782e4e88", - "0x918d87a20c837fa93ce3089d2cb6386b66f79bbfd0f09bd6784bc52108b69938": "0x1fabbf534809aa468599d96ffc3c1611bd4458f987f1acec148c357e57337016", - "0x9569f58e5e127ceb73049eea8119bb21f8c4328d3b4770da5a67075be3f77c12": "0x20e7f82882d05c6863060ca2595a71559399f6dc1385df42614b05abc3eff00f", - "0x96f0481f00eeec717fa8c0d41efd04b6e3fdccbebbaa223ee2118449ebea2406": "0xbc9e61c0cdccc55ffd76261116dfb060ac0fcd0b31ff2a2ea72514203c0a3827", - "0x9c35a3189126603f4b187149f54e09082403dac10b3e899a503e28e897edd6f9": "0x1fecf5b8fd3291d3880a530457a7bc463de1bdb81f68fd83758b4ecfbd5c3659", - "0x9db4bc605469ede684fbaa475d320b3fbe6a707deaa953ee1ba29ecb3c1125fb": "0xda4a90b47357900f3e1c38792de6662d56ece5aed01c3f3ac5020ff32e08032c", - "0xb8e0b3cbd7273e83cfdbcb8269e5c3510a28892e815fe28bc0f515be0df2c8f9": "0xe8492376ab5a5d642160463b00d38a9b5b87e2fc8afce127983dc6d1dc97d776", - "0xc38bb4813ebdb9978d2485ae5ad92e1152f8a955430a63210b69b2277eed9477": "0xcedce64703d22ccb65bdc86d9fe6d0abea6ec29792c91b423152594bd5336976", - "0xd75e639b43b1d29e1703abcd2616b6b67f3ae232d53915d472f3a5b6aae6083c": "0x521b594ba447613faa8fb22609d92fc85fe3d1644b8d5804b23fffa496e30317", - "0xf2644573f57aea10dffac6e7215b409fa19236ae57b735b20b9fac9834391850": "0x2cd20318c8db20614867990e6284ceff46a54997d19f3213179292f7f2922e47" + "0x052a304d0a4a19a819c4e1501b45b4f1b49f73d1a7cac910386fe5fc509633a4": "0x1416c5dbf5cb95f1d5793df295de71f9fd1f46cf6e2cbdf08863e720fa750dbb", + "0x211f0c56d141fbeca1844d250c6a356beb00eaecc7afef8cd01797aa6b730ba6": "0x3370640c5c28a175b894e158639b0f4816d1e4bcf325f5f89a4050de8ccf411e", + "0x409bf08f08583ee56edee5cf91c507ce0ee7cd3a33d6b176505cde7e6fab5212": "0x81186eaf6b4b0d7f71f87e99e0aaeafcde574f4e20f864336048af6101a7a659", + "0x42425e602c9c169d71be77da2f8ca1fc0718c859fc8a1a8940e010485b9b2db4": "0xce98aa80db26c48c509f9d86fdf44077cd284e0baf845ed61ea1e54ff438faf3", + "0x4eb19888c437940923b0c1e78a04f1afe2a75dae78812574ba219f022fc5395a": "0x092aa8eb4b28032933998f30facb211484b12b7207ce3f676234b237acbe4c4f", + "0x65861ca173680f85c64b5ecb1041d69eba8addf2e4f3acde8ae4b0ec5f2625f5": "0xf3606e9e86d1e343eaf312d9bb5d5d7257ae7c4ee4dea7b6144be39404ae7566", + "0x732ffa915e7dee8ddde1f40a62d2a275e439a4fc180fa652b48e733b460fdd52": "0xf0b1ff5d2cc49cf228765a5ad0047c9029db01c999dc9139fc0c080c971ec3ad", + "0x819496f5a9c8dd326fdaaafa185159c136315d5abee91896f192dbdf2212768d": "0x1d38cc38fc757c41118353c34f871675a39b3843c62020f07e63f2dcaa267b7f", + "0x9df1908fad57611d75eb1b9d9a581ddc43baeaa767a14f5ddd26fe371bbcf06b": "0xfac5b6eb0f88cdab581445b9cb6f317d8ad097e988541ab3ab74334638e247e1", + "0xb10e85dc047de055ec7bcc8d8933f859c8c220aa1540e8d61f36e6391d5975fd": "0x30087b2a5b449b4fb632f6858e86243c9476b6521991f8256527f621a8a8af81", + "0xb262c3f41c3ffc3d264c72a40f60b02c497017ed75f73524e008f3ead803a998": "0xc4fb6028a62a1ebb3e33910ba5f875777b3e1877daa1fd1a465b075a8dc3548e", + "0xb582fee2a3f0fd5f455d98b1278099ceadb1a7c9d46e93e5100c8cc86aa4a388": "0xa34430ed6623eef78717e4bcb59843758b68c7ea37ef50bb4ba472534a156bda", + "0xbcd87b9a1206b37ef12053cbcac10515fbf400962837441462e04daa9e2ddc98": "0x7e913e29cef66a3db4d682a778c4db37601378be8d4144f9a5be8f5430f7cf62", + "0xc9ae4a5f6e1baf9009493d9068d9f61f8461a99a23532a7f8ed98393106ef560": "0x2200c04638ed027c9286c69d17b96121b7b182997133e3a68460cfd38cc1b2b4", + "0xd3e19abee55b3295d081f5777c0e642f7c7023552b5ae035ecc53f706fd90e63": "0x44747a53705f7f43c295715c328bf7e7b6ba483a82a77c644a35545c078c4e22", + "0xf12ef8015ea1ab65c40a62ad74a87c7a97bbc2736afd3f81f1cec73bc2290b45": "0xfa7bd314eaf70ba7c05504a7fc24ad5d4e5277d6852a6e357580a234fa7dd999", + "0xf36332cb1efc8bc6ea44da0a8971f853fc081b8487c5d4d3e09c1de201a68bc5": "0xa1a3bbe1723fe51343e379b98391874b47fa2b0a932ea45167f2416b400cb845", + "0xf745ee60388fc42e05923e38f1c09237e8514387e3a4b328c576a52aaa29c9b3": "0xa8370ffde74fd9bb4b68b57ffbf14b5957a28f1d86f7a8ae87242469ffee9f6d" }, "Test_TokenAllowlist": { - "0x11e024c2f0ada4ce2ce048af08354dfa64f38ad959564c55e6bbf48d2ed3822e": "0x8f58340cfc39502e9dc50b771cdb06a14b3204f685adf563f2f5020d483feacf", - "0x78a7c23f669f5df656575693f45f928b7af2ed4bc981cf6dec77bef2c03bb081": "0xd06371a3e80e11b111e5c68c712d696aa236bf4d29808847295a7a6324af4f84" + "0x11e024c2f0ada4ce2ce048af08354dfa64f38ad959564c55e6bbf48d2ed3822e": "0xc763d91027e5243c9d7020f419199d114f74f8e8c2e2e668a0e25ff5bb66c6e8", + "0x78a7c23f669f5df656575693f45f928b7af2ed4bc981cf6dec77bef2c03bb081": "0xf0bc4482fcf2593df36fb9fb83ee5d273e7ee6a3caa9414d9c24eeee96567b6f" }, "Test_UniswapV2DirectToLiquidity": { - "0xbce774b5c75ce6af2b000bd157d0966753042aba6fde38f5ea2eca76b585791f": "0x55208611cec0a88da835309df48d0102dbdb45baa128b2555052f0a2fcd526d8" + "0x9c33aa54294ebd7a8909181ebd6aed2b967b0eb4b0fb95467495624e6c211a67": "0xba73f6582c497ae5c4d38c53ba8bfb98266aa3566aaafef6d00f65d327effd66" }, "Test_UniswapV2Router": { - "0xe6204aa211921628df345ff0b909c863298684cd8ca65de5479af6b70662e622": "0xf508fd71ff40f5d0640b01b9384f98d35db43c7ddb0d4abe274d61fdf1ea967f" + "0xe6204aa211921628df345ff0b909c863298684cd8ca65de5479af6b70662e622": "0xf5700f795856223d45b9e1b76fa0f23db9d770b25c44cae8f556ae6d1e7bee5e" }, "Test_UniswapV3DirectToLiquidity": { - "0x58b7674df101688da4f68d9cfad65390f1f35abe1c999bd0a251069b8883f528": "0x6382557258b960eca0a5069b80205235e370fb2ce399d29ec5a9307e66799c49" + "0xca7cd77c52253f2e1eec58c25dbb3b89ccaa938974767ed31217819f71d2db06": "0xdb4b3fa1df0a6205daaeb852a4b456a86df10140fd1d479072f7c62ea9ba7a79" }, "Test_UniswapV3Factory": { - "0xbcd657c3390ecd2e1782b6473400c51fa124922eb98b69f1b5192eb0f8e3d3df": "0x3448ebb18cb03fae2e9153c621d46f1b9b8941cc66e7063b587fe4a284490b01" + "0xbcd657c3390ecd2e1782b6473400c51fa124922eb98b69f1b5192eb0f8e3d3df": "0xfad08a6eaa7974f06cec79e15064de7f6fa17b22ecdb3764988b2c4b1571c613" }, "TokenAllowlist": { "0x09db47d395a68db033a3b222b9d1a212cec8422b03aeafc313aa4d2813c6dd60": "0xe07a005213f35e1f050a4da040d6bc3cae2ad333647b51a6ffa2e7941980043a", diff --git a/test/Constants.sol b/test/Constants.sol index e651a223..08aaf886 100644 --- a/test/Constants.sol +++ b/test/Constants.sol @@ -7,10 +7,10 @@ abstract contract TestConstants { address internal constant _UNISWAP_V2_FACTORY = address(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); address internal constant _UNISWAP_V2_ROUTER = - address(0xC5287E5F413C8e620e5Dc2fEbdaBE4ccCbf96669); + address(0xAAe2b0bEf00E78705673DFc5c3a8Fb39Dba6E3E5); address internal constant _UNISWAP_V3_FACTORY = - address(0x1702DD7e80bA99600C7007e519267FB853BBe923); - address internal constant _GUNI_FACTORY = address(0xfd55d1Beb11E49AeEeaE8AE3499c8cB761A0EdE7); + address(0xAA70C9Ef2969368cE15644696b63b0fcEb93e501); + address internal constant _GUNI_FACTORY = address(0xAAd32E7fC9695dF836C4A454EdB8243F4b62a14E); address internal constant _BASELINE_KERNEL = address(0xBB); address internal constant _BASELINE_QUOTE_TOKEN = address(0xAA58516d932C482469914260268EEA7611BF0eb4); From f4e2388a46f69819abdc2bd68f873949dbf1361d Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 8 Jul 2024 13:37:36 -0400 Subject: [PATCH 73/82] test: update salts --- script/salts/salts.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/script/salts/salts.json b/script/salts/salts.json index a776f567..0f7c1e1e 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -50,12 +50,12 @@ "0xed4ba02077e70f78db70ce191509333d2dcccfff136d30dcb011f567305e88ad": "0x2b8bc588174d409692f1bd993942e3806c9a11344dbe674f46aed32a030aacf1" }, "Test_AllocatedMerkleAllowlist": { - "0xb17794250569bcd64aae2ec1312399120db92167bf0a2602821e0ee953dd3d31": "0xa8a4fc4fb8d721bdce27342cdd381eb510362146f49e56698a8bcb6c639306ff", - "0xecbee26b3d0e662be84e4cef678b23166957f507ca68f32eaa49e60ceb567981": "0x1598e58155ab6f6f2d8b2813c5c763f04ab980c3e65dffe2b3a312e8ccba4ae7" + "0x8de6e7b0b1f6974167a896ad8d377c8c29ad0132dd3f7b26f3aae7d4bb348d2f": "0xbafe0e1369edea3d992723bf3ff6a352dafbbb9f4dd6b81d52da4b538c123bb5", + "0xce7f9e37dca3a16d5c26ba67c9eba2e889ff76c1d27a05ed9ebd75083d46e241": "0x9c9a73570423fffe4c11df49d5434528af493273cd7424ec18e474b7940627ed" }, "Test_CappedMerkleAllowlist": { - "0xa0ed568f98efa2efd4e93f21a5445970919a333349a8f5369a28ae93271d9cca": "0x6fb3e2a45254801d17269019f8afcadbd132d417f4dde1bfc65dd8f440256a56", - "0xfd2c28cb6c38931a1f784078c41d21d7bf8fc3653231edca225a5fbbc50529dc": "0x88a482ab0eacd2d6c1fc7b3858bfba29aa92b8abfc6239e02e6952640c3ebdf7" + "0x5abd4cf6f12f56a1077d607918110659db02bbb5f419e4f4643c926e7c78d701": "0x7e5435b4313ad9ef6d831b39306df989156afac6ebeb1c4644cd7bd63088bfb7", + "0xe577ed57cc6c3ce09f0d1f66fbf3fcb30b35fde4c350c8d515d0f930603c41df": "0x97167e0f92b3e91d6e0fb8637c5ddfa224a3ec191528f46208663258c0cb95c3" }, "Test_GUniFactory": { "0xa8ee5069b769099da4dbc8c5d4c95cb74d416554203119678be4d0eba33f5962": "0x767e6faad4f8e62d6ab897930a0eb497cb71ebc75f90856dc13996fb00b907d3" @@ -85,13 +85,13 @@ "0x78a7c23f669f5df656575693f45f928b7af2ed4bc981cf6dec77bef2c03bb081": "0xf0bc4482fcf2593df36fb9fb83ee5d273e7ee6a3caa9414d9c24eeee96567b6f" }, "Test_UniswapV2DirectToLiquidity": { - "0x9c33aa54294ebd7a8909181ebd6aed2b967b0eb4b0fb95467495624e6c211a67": "0xba73f6582c497ae5c4d38c53ba8bfb98266aa3566aaafef6d00f65d327effd66" + "0xf108beb959acb1e7e41cab1e1a3039f077c572167a9dadf5c31b642d80bc8c3c": "0x776bb071737d0bd3c0c1096a8a9d83574280b883b2681dadffaf6fa94fc669fc" }, "Test_UniswapV2Router": { "0xe6204aa211921628df345ff0b909c863298684cd8ca65de5479af6b70662e622": "0xf5700f795856223d45b9e1b76fa0f23db9d770b25c44cae8f556ae6d1e7bee5e" }, "Test_UniswapV3DirectToLiquidity": { - "0xca7cd77c52253f2e1eec58c25dbb3b89ccaa938974767ed31217819f71d2db06": "0xdb4b3fa1df0a6205daaeb852a4b456a86df10140fd1d479072f7c62ea9ba7a79" + "0x5aec331792b9b995051d0efd683176c0800e527130eb7514f415c4f1a9f09f43": "0x37c69f7eea77a282f753c9ae1505d0272745cd870612e78e4e962285eb0de2d3" }, "Test_UniswapV3Factory": { "0xbcd657c3390ecd2e1782b6473400c51fa124922eb98b69f1b5192eb0f8e3d3df": "0xfad08a6eaa7974f06cec79e15064de7f6fa17b22ecdb3764988b2c4b1571c613" From 5d6d89be290afb683ce50a82785efaf63ff2e455 Mon Sep 17 00:00:00 2001 From: Oighty Date: Mon, 8 Jul 2024 14:20:14 -0400 Subject: [PATCH 74/82] test: update salts --- script/salts/salts.json | 4 ++-- test/Constants.sol | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/salts/salts.json b/script/salts/salts.json index e2e3fa0c..efc15d67 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -58,7 +58,7 @@ "0xe577ed57cc6c3ce09f0d1f66fbf3fcb30b35fde4c350c8d515d0f930603c41df": "0x97167e0f92b3e91d6e0fb8637c5ddfa224a3ec191528f46208663258c0cb95c3" }, "Test_GUniFactory": { - "0xa8ee5069b769099da4dbc8c5d4c95cb74d416554203119678be4d0eba33f5962": "0x767e6faad4f8e62d6ab897930a0eb497cb71ebc75f90856dc13996fb00b907d3" + "0x99fbce18602720731ae027d057bc0e206a620bbb54da7363d32dc149e7aeaa64": "0xf3e2bc8f6351215210664136231cceca0f7c958d3b200eaed4043a316eca22be" }, "Test_MockCallback": { "0x052a304d0a4a19a819c4e1501b45b4f1b49f73d1a7cac910386fe5fc509633a4": "0x1416c5dbf5cb95f1d5793df295de71f9fd1f46cf6e2cbdf08863e720fa750dbb", @@ -91,7 +91,7 @@ "0xe6204aa211921628df345ff0b909c863298684cd8ca65de5479af6b70662e622": "0xf5700f795856223d45b9e1b76fa0f23db9d770b25c44cae8f556ae6d1e7bee5e" }, "Test_UniswapV3DirectToLiquidity": { - "0x5aec331792b9b995051d0efd683176c0800e527130eb7514f415c4f1a9f09f43": "0x37c69f7eea77a282f753c9ae1505d0272745cd870612e78e4e962285eb0de2d3" + "0xc7b7c0717c869c4ea95e40c24731f0e4cb49f7665e8962a2cb2b58e5c46cc46d": "0xe5bda1880e46560490c3388a09b092db47d824b9214ad91150627c5c13c43343" }, "Test_UniswapV3Factory": { "0xbcd657c3390ecd2e1782b6473400c51fa124922eb98b69f1b5192eb0f8e3d3df": "0xfad08a6eaa7974f06cec79e15064de7f6fa17b22ecdb3764988b2c4b1571c613" diff --git a/test/Constants.sol b/test/Constants.sol index 08aaf886..8b9f4608 100644 --- a/test/Constants.sol +++ b/test/Constants.sol @@ -10,7 +10,7 @@ abstract contract TestConstants { address(0xAAe2b0bEf00E78705673DFc5c3a8Fb39Dba6E3E5); address internal constant _UNISWAP_V3_FACTORY = address(0xAA70C9Ef2969368cE15644696b63b0fcEb93e501); - address internal constant _GUNI_FACTORY = address(0xAAd32E7fC9695dF836C4A454EdB8243F4b62a14E); + address internal constant _GUNI_FACTORY = address(0xAA6180e11cf2118E9e9D766D67Bb8Bb9959DF17B); address internal constant _BASELINE_KERNEL = address(0xBB); address internal constant _BASELINE_QUOTE_TOKEN = address(0xAA58516d932C482469914260268EEA7611BF0eb4); From 26c63150fe6008b87dbf99938a169e1d39073842 Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 9 Jul 2024 20:04:26 -0400 Subject: [PATCH 75/82] deploy: testnet v0.5 contracts --- deployments/.arbitrum-sepolia-1719558304.json | 3 - deployments/.arbitrum-sepolia-v0.4.json | 2 +- deployments/.arbitrum-sepolia-v0.5.json | 13 +++ deployments/.base-sepolia-1719558588.json | 3 - deployments/.base-sepolia-v0.4.json | 2 +- deployments/.base-sepolia-v0.5.json | 13 +++ deployments/.blast-sepolia-1719558704.json | 3 - deployments/.blast-sepolia-v0.4.json | 2 +- deployments/.blast-sepolia-v0.5.json | 13 +++ deployments/.mantle-sepolia-v0.5.json | 13 +++ deployments/.mode-sepolia-1719558822.json | 3 - deployments/.mode-sepolia-v0.4.json | 2 +- deployments/.mode-sepolia-v0.5.json | 13 +++ script/deploy/deploy.sh | 4 +- script/env.json | 110 +++++++++--------- script/salts/salts.json | 31 ++++- 16 files changed, 154 insertions(+), 76 deletions(-) delete mode 100644 deployments/.arbitrum-sepolia-1719558304.json create mode 100644 deployments/.arbitrum-sepolia-v0.5.json delete mode 100644 deployments/.base-sepolia-1719558588.json create mode 100644 deployments/.base-sepolia-v0.5.json delete mode 100644 deployments/.blast-sepolia-1719558704.json create mode 100644 deployments/.blast-sepolia-v0.5.json create mode 100644 deployments/.mantle-sepolia-v0.5.json delete mode 100644 deployments/.mode-sepolia-1719558822.json create mode 100644 deployments/.mode-sepolia-v0.5.json diff --git a/deployments/.arbitrum-sepolia-1719558304.json b/deployments/.arbitrum-sepolia-1719558304.json deleted file mode 100644 index 6ae6449c..00000000 --- a/deployments/.arbitrum-sepolia-1719558304.json +++ /dev/null @@ -1,3 +0,0 @@ -{ -"axis.BatchUniswapV2DirectToLiquidity": "0xE676907Fa9a09dC1E3b67De11816665A1313524f" -} diff --git a/deployments/.arbitrum-sepolia-v0.4.json b/deployments/.arbitrum-sepolia-v0.4.json index 8abb16e5..a545ae4e 100644 --- a/deployments/.arbitrum-sepolia-v0.4.json +++ b/deployments/.arbitrum-sepolia-v0.4.json @@ -8,6 +8,6 @@ "axis.BatchMerkleAllowlist": "0x9837cA34C444cEbd07C699036D1D174C6392D9fa", "axis.BatchTokenAllowlist": "0x988c61b36F7898e464a0Bf477d2dc06aC4E95F95", "axis.BatchAllocatedMerkleAllowlist": "0x98B59b4BF62b0316D9B0f89D28A28d5D75BB8B46", -"axis.BatchUniswapV2DirectToLiquidity": "0xE64E0807E5a0d789dB2fABB3345aB763f879521C", +"axis.BatchUniswapV2DirectToLiquidity": "0xE676907Fa9a09dC1E3b67De11816665A1313524f", "axis.BatchUniswapV3DirectToLiquidity": "0xE6ECF0f655E642834c79F30323e7ae941883ac00" } diff --git a/deployments/.arbitrum-sepolia-v0.5.json b/deployments/.arbitrum-sepolia-v0.5.json new file mode 100644 index 00000000..58f7229d --- /dev/null +++ b/deployments/.arbitrum-sepolia-v0.5.json @@ -0,0 +1,13 @@ +{ +"axis.BatchAuctionHouse": "0xBA00003622ee11Ffac8a07cf8D207b19c95F1FFf", +"axis.BatchCatalogue": "0x265aB5FABa5D855CFA46Af61936ca212CEb71146", +"axis.EncryptedMarginalPrice": "0x81661B3CC47218327cE17bAd69d9246FCC321667", +"axis.FixedPriceBatch": "0x0107DeD7dCD989470268eaeae2Aa2711Efa2597c", +"axis.BatchLinearVesting": "0x056ed71c999bDdF489d34eD767a50c608Ae16Bf9", +"axis.BatchCappedMerkleAllowlist": "0x9868c93CDec64f471b1DFf60f5e8249249dBa126", +"axis.BatchMerkleAllowlist": "0x989F7525b5e0c804e5A2707F14d34C523D56B43b", +"axis.BatchTokenAllowlist": "0x982598d92BBB2a2E54EdCd262EeF114a517fEeCE", +"axis.BatchAllocatedMerkleAllowlist": "0x98765dB6F0c4334075FB06d8D2998749b8CF604e", +"axis.BatchUniswapV2DirectToLiquidity": "0xE6c6B510E4b0e442BF01fabDc93d4bf032683C3C", +"axis.BatchUniswapV3DirectToLiquidity": "0xE6f7888cfc8219C93E70Ca528195b4afD80D7894" +} diff --git a/deployments/.base-sepolia-1719558588.json b/deployments/.base-sepolia-1719558588.json deleted file mode 100644 index 2bf7186d..00000000 --- a/deployments/.base-sepolia-1719558588.json +++ /dev/null @@ -1,3 +0,0 @@ -{ -"axis.BatchUniswapV2DirectToLiquidity": "0xE66538D4EEbf830b1Dc791894af4709Af257764d" -} diff --git a/deployments/.base-sepolia-v0.4.json b/deployments/.base-sepolia-v0.4.json index ac8b732e..ba9b87c3 100644 --- a/deployments/.base-sepolia-v0.4.json +++ b/deployments/.base-sepolia-v0.4.json @@ -8,6 +8,6 @@ "axis.BatchMerkleAllowlist": "0x9837cA34C444cEbd07C699036D1D174C6392D9fa", "axis.BatchTokenAllowlist": "0x988c61b36F7898e464a0Bf477d2dc06aC4E95F95", "axis.BatchAllocatedMerkleAllowlist": "0x98B59b4BF62b0316D9B0f89D28A28d5D75BB8B46", -"axis.BatchUniswapV2DirectToLiquidity": "0xE650A43485b89F26FB98ad16811BF45BD52ad014", +"axis.BatchUniswapV2DirectToLiquidity": "0xE66538D4EEbf830b1Dc791894af4709Af257764d", "axis.BatchUniswapV3DirectToLiquidity": "0xE661c46d94c53584095A8240958695bAD6d6fC2F" } diff --git a/deployments/.base-sepolia-v0.5.json b/deployments/.base-sepolia-v0.5.json new file mode 100644 index 00000000..a22db05c --- /dev/null +++ b/deployments/.base-sepolia-v0.5.json @@ -0,0 +1,13 @@ +{ +"axis.BatchAuctionHouse": "0xBA00000D23A0793d5601d1e8E7B32aE88642cbEF", +"axis.BatchCatalogue": "0xcE56d3E3E145b44597B61E99c64cb82FB209Da04", +"axis.EncryptedMarginalPrice": "0xA7413717C633175Bc5B669E94625a4d3FE009870", +"axis.FixedPriceBatch": "0xC818f1f000f9C24D014BCe2c5334e14B1360d9CD", +"axis.BatchLinearVesting": "0x4042D4F2236D055212d485E028E8FE4939252F88", +"axis.BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", +"axis.BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", +"axis.BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", +"axis.BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", +"axis.BatchUniswapV2DirectToLiquidity": "0xE6F478d800e9807efAb601a1CD60BBd7CBA1c0b8", +"axis.BatchUniswapV3DirectToLiquidity": "0xE6BC347aA7Ce46bDb45F938605C5d4b88881bB1c" +} diff --git a/deployments/.blast-sepolia-1719558704.json b/deployments/.blast-sepolia-1719558704.json deleted file mode 100644 index f822c2be..00000000 --- a/deployments/.blast-sepolia-1719558704.json +++ /dev/null @@ -1,3 +0,0 @@ -{ -"axis.BatchUniswapV2DirectToLiquidity": "0xE60007A0721A92f0eb538c360317d4808238700D" -} diff --git a/deployments/.blast-sepolia-v0.4.json b/deployments/.blast-sepolia-v0.4.json index 98b4781a..2fb3d9c1 100644 --- a/deployments/.blast-sepolia-v0.4.json +++ b/deployments/.blast-sepolia-v0.4.json @@ -8,6 +8,6 @@ "axis.BatchMerkleAllowlist": "0x9859c6FA2594e93149bd76415cE3982f39888CCb", "axis.BatchTokenAllowlist": "0x984B6165fC87c682441E81B4aa23A017cdbFba18", "axis.BatchAllocatedMerkleAllowlist": "0x986455Ab4f64303E8F51e72F6BF1789182563F65", -"axis.BatchUniswapV2DirectToLiquidity": "0xE6282DDB61f81F4d769FE511676dC21E570AF815", +"axis.BatchUniswapV2DirectToLiquidity": "0xE60007A0721A92f0eb538c360317d4808238700D", "axis.BatchUniswapV3DirectToLiquidity": "0xE6b1113d108f86Fb7eF662ecF235dB6dB8978Cc3" } diff --git a/deployments/.blast-sepolia-v0.5.json b/deployments/.blast-sepolia-v0.5.json new file mode 100644 index 00000000..88dfe371 --- /dev/null +++ b/deployments/.blast-sepolia-v0.5.json @@ -0,0 +1,13 @@ +{ +"axis.BatchAuctionHouse": "0xBA0000ac450437406583980336fE93AB2752999F", +"axis.BatchCatalogue": "0xCCDF364E4a5D51437FF2885C86205Cfe2d90087a", +"axis.EncryptedMarginalPrice": "0x3ae8dD1ee2752883459C4c33c2f7Aeb8a56669f0", +"axis.FixedPriceBatch": "0x9C5dF80078066a49E77537c4cc728a5e788e671F", +"axis.BatchLinearVesting": "0xAd21cD6Cea90e46436002e79B12247eCe16110B3", +"axis.BatchCappedMerkleAllowlist": "0x98e72F243db7CDfDB015865415A0AE1bFb071507", +"axis.BatchMerkleAllowlist": "0x9824De4B9A917D30a5427813E43e5DF968e19066", +"axis.BatchTokenAllowlist": "0x986e7E24A33Ef6fbDc6C3a94657fBb59d85AbE1C", +"axis.BatchAllocatedMerkleAllowlist": "0x9895D556E8d1be6C909EC88D43Dd0F6Ae6f7f4D7", +"axis.BatchUniswapV2DirectToLiquidity": "0xE6F7049c79AA674D1E7b709C3Dc42C614359956A", +"axis.BatchUniswapV3DirectToLiquidity": "0xE6EDA80884CF4D44841fF33a3162A68EebBa2b7b" +} diff --git a/deployments/.mantle-sepolia-v0.5.json b/deployments/.mantle-sepolia-v0.5.json new file mode 100644 index 00000000..055897d0 --- /dev/null +++ b/deployments/.mantle-sepolia-v0.5.json @@ -0,0 +1,13 @@ +{ +"axis.BatchAuctionHouse": "0xBA00000D23A0793d5601d1e8E7B32aE88642cbEF", +"axis.BatchCatalogue": "0x6c80F20C5C0404a3D5349F71F9B25c0654884092", +"axis.EncryptedMarginalPrice": "0xaC9957282BeA578f371078ddc4cD12A135B105d6", +"axis.FixedPriceBatch": "0x8b7e483d96004ca7893EfB14E049f7648b62322b", +"axis.BatchLinearVesting": "0x16D5Aab9d35f8B3ac7BD086eEDcCe5343682D5F0", +"axis.BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", +"axis.BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", +"axis.BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", +"axis.BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", +"axis.BatchUniswapV2DirectToLiquidity": "0xE6feE7a689Ff7493032Ba48B15fE841c6cC30DB9", +"axis.BatchUniswapV3DirectToLiquidity": "0xE6c1ab82a2b4a194C87e643668bb715619766F0B" +} diff --git a/deployments/.mode-sepolia-1719558822.json b/deployments/.mode-sepolia-1719558822.json deleted file mode 100644 index a656a37d..00000000 --- a/deployments/.mode-sepolia-1719558822.json +++ /dev/null @@ -1,3 +0,0 @@ -{ -"axis.BatchUniswapV2DirectToLiquidity": "0xE60FD6203AF5D5d43433952a033Cb70Ba21784E9" -} diff --git a/deployments/.mode-sepolia-v0.4.json b/deployments/.mode-sepolia-v0.4.json index 0be602e5..a215c1f2 100644 --- a/deployments/.mode-sepolia-v0.4.json +++ b/deployments/.mode-sepolia-v0.4.json @@ -8,6 +8,6 @@ "axis.BatchMerkleAllowlist": "0x9837cA34C444cEbd07C699036D1D174C6392D9fa", "axis.BatchTokenAllowlist": "0x988c61b36F7898e464a0Bf477d2dc06aC4E95F95", "axis.BatchAllocatedMerkleAllowlist": "0x98B59b4BF62b0316D9B0f89D28A28d5D75BB8B46", -"axis.BatchUniswapV2DirectToLiquidity": "0xE60f928d399782836540752Eb3fCfE46b0Cb4E24", +"axis.BatchUniswapV2DirectToLiquidity": "0xE60FD6203AF5D5d43433952a033Cb70Ba21784E9", "axis.BatchUniswapV3DirectToLiquidity": "0xE6ce65C413a5Fc10Fa77B26032B33DCD68F8474a" } diff --git a/deployments/.mode-sepolia-v0.5.json b/deployments/.mode-sepolia-v0.5.json new file mode 100644 index 00000000..efff7cc8 --- /dev/null +++ b/deployments/.mode-sepolia-v0.5.json @@ -0,0 +1,13 @@ +{ +"axis.BatchAuctionHouse": "0xBA00000D23A0793d5601d1e8E7B32aE88642cbEF", +"axis.BatchCatalogue": "0x3fF930D77CD37eB7d4960F5D10ec415978f90aeA", +"axis.EncryptedMarginalPrice": "0x8b47F82a58d8AFBE5167feBf0D3F3Bb509aaf2bd", +"axis.FixedPriceBatch": "0xFB1113E170CA6d95f3a91121BDD2370a822598E9", +"axis.BatchLinearVesting": "0xF170C78a493d9245d125e05bBEc35c98735f5277", +"axis.BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", +"axis.BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", +"axis.BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", +"axis.BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", +"axis.BatchUniswapV2DirectToLiquidity": "0xE6F478d800e9807efAb601a1CD60BBd7CBA1c0b8", +"axis.BatchUniswapV3DirectToLiquidity": "0xE6BB80a6B8628F150E340BdE2e0C49fA17E1e566" +} diff --git a/script/deploy/deploy.sh b/script/deploy/deploy.sh index 3b422574..fd0fc5b0 100755 --- a/script/deploy/deploy.sh +++ b/script/deploy/deploy.sh @@ -141,7 +141,9 @@ fi # Deploy using script forge script $DEPLOY_SCRIPT:$DEPLOY_CONTRACT --sig "deploy(string,string,bool)()" $CHAIN $DEPLOY_FILE $SAVE \ --rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvv \ --g 4000000 --with-gas-price 20000000 --priority-gas-price 10000000 \ $BROADCAST_FLAG \ $VERIFY_FLAG \ $RESUME_FLAG + +# Insert for Mantle deployments +# -g 4000000 --with-gas-price 20000000 --priority-gas-price 10000000 \ \ No newline at end of file diff --git a/script/env.json b/script/env.json index 8eff4203..a045ca9d 100644 --- a/script/env.json +++ b/script/env.json @@ -36,17 +36,17 @@ "AtomicLinearVesting": "0xA7413717C633175Bc5B669E94625a4d3FE009870", "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "BatchAllocatedMerkleAllowlist": "0x98B59b4BF62b0316D9B0f89D28A28d5D75BB8B46", - "BatchAuctionHouse": "0xBA00002999aBfa63cA25B3A7aD4c8F3a578aBe28", - "BatchCappedMerkleAllowlist": "0x9888DbABd5981763697A4433Cb57E3F9DABEcB6a", - "BatchCatalogue": "0x664268B82971D0c9A4F000a7329a057e85361E83", - "BatchLinearVesting": "0xFB1113E170CA6d95f3a91121BDD2370a822598E9", - "BatchMerkleAllowlist": "0x9837cA34C444cEbd07C699036D1D174C6392D9fa", - "BatchTokenAllowlist": "0x988c61b36F7898e464a0Bf477d2dc06aC4E95F95", - "BatchUniswapV2DirectToLiquidity": "0xE676907Fa9a09dC1E3b67De11816665A1313524f", - "BatchUniswapV3DirectToLiquidity": "0xE6ECF0f655E642834c79F30323e7ae941883ac00", - "EncryptedMarginalPrice": "0x2Ca8954B468E2FbfE55240B69db937861c12F0d0", - "FixedPriceBatch": "0x8b47F82a58d8AFBE5167feBf0D3F3Bb509aaf2bd", + "BatchAllocatedMerkleAllowlist": "0x98765dB6F0c4334075FB06d8D2998749b8CF604e", + "BatchAuctionHouse": "0xBA00003622ee11Ffac8a07cf8D207b19c95F1FFf", + "BatchCappedMerkleAllowlist": "0x9868c93CDec64f471b1DFf60f5e8249249dBa126", + "BatchCatalogue": "0x265aB5FABa5D855CFA46Af61936ca212CEb71146", + "BatchLinearVesting": "0x056ed71c999bDdF489d34eD767a50c608Ae16Bf9", + "BatchMerkleAllowlist": "0x989F7525b5e0c804e5A2707F14d34C523D56B43b", + "BatchTokenAllowlist": "0x982598d92BBB2a2E54EdCd262EeF114a517fEeCE", + "BatchUniswapV2DirectToLiquidity": "0xE6c6B510E4b0e442BF01fabDc93d4bf032683C3C", + "BatchUniswapV3DirectToLiquidity": "0xE6f7888cfc8219C93E70Ca528195b4afD80D7894", + "EncryptedMarginalPrice": "0x81661B3CC47218327cE17bAd69d9246FCC321667", + "FixedPriceBatch": "0x0107DeD7dCD989470268eaeae2Aa2711Efa2597c", "FixedPriceSale": "0x0A0BA689D2D72D3f376293c534AF299B3C6Dac85", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", @@ -83,17 +83,17 @@ "AtomicLinearVesting": "0x0000000000000000000000000000000000000000", "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "BatchAllocatedMerkleAllowlist": "0x98B59b4BF62b0316D9B0f89D28A28d5D75BB8B46", - "BatchAuctionHouse": "0xBA00002999aBfa63cA25B3A7aD4c8F3a578aBe28", - "BatchCappedMerkleAllowlist": "0x9888DbABd5981763697A4433Cb57E3F9DABEcB6a", - "BatchCatalogue": "0x408fB738592232372069B592022F03BF3a241613", - "BatchLinearVesting": "0x392C629741a0c7350c7181addD5870dE178eeD94", - "BatchMerkleAllowlist": "0x9837cA34C444cEbd07C699036D1D174C6392D9fa", - "BatchTokenAllowlist": "0x988c61b36F7898e464a0Bf477d2dc06aC4E95F95", - "BatchUniswapV2DirectToLiquidity": "0xE66538D4EEbf830b1Dc791894af4709Af257764d", - "BatchUniswapV3DirectToLiquidity": "0xE661c46d94c53584095A8240958695bAD6d6fC2F", - "EncryptedMarginalPrice": "0x02c63F8aE0a8e9D0F7267AA4d0Af0567858188C2", - "FixedPriceBatch": "0x188Ad428c60eADFB0749B2E3A4836D63489304E3", + "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", + "BatchAuctionHouse": "0xBA00000D23A0793d5601d1e8E7B32aE88642cbEF", + "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", + "BatchCatalogue": "0xcE56d3E3E145b44597B61E99c64cb82FB209Da04", + "BatchLinearVesting": "0x4042D4F2236D055212d485E028E8FE4939252F88", + "BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", + "BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", + "BatchUniswapV2DirectToLiquidity": "0xE6F478d800e9807efAb601a1CD60BBd7CBA1c0b8", + "BatchUniswapV3DirectToLiquidity": "0xE6BC347aA7Ce46bDb45F938605C5d4b88881bB1c", + "EncryptedMarginalPrice": "0xA7413717C633175Bc5B669E94625a4d3FE009870", + "FixedPriceBatch": "0xC818f1f000f9C24D014BCe2c5334e14B1360d9CD", "FixedPriceSale": "0x0000000000000000000000000000000000000000", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", @@ -151,17 +151,17 @@ "AtomicLinearVesting": "0x8270f3e8D874De8b974A0Bf928abDFf92171B1b2", "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "BatchAllocatedMerkleAllowlist": "0x986455Ab4f64303E8F51e72F6BF1789182563F65", - "BatchAuctionHouse": "0xBA00007A1868f4AEFdd39041327CbC4Ba5bF1632", - "BatchCappedMerkleAllowlist": "0x981d6a6997B23C06f4E95862f72B7C06c039a647", - "BatchCatalogue": "0xC6D5E3A1823304D28cdc6dc23b4117b6cA34C98E", - "BatchLinearVesting": "0xBD0474b8e7b65f3dF35d2817BA09aC864a199e31", - "BatchMerkleAllowlist": "0x9859c6FA2594e93149bd76415cE3982f39888CCb", - "BatchTokenAllowlist": "0x984B6165fC87c682441E81B4aa23A017cdbFba18", - "BatchUniswapV2DirectToLiquidity": "0xE60007A0721A92f0eb538c360317d4808238700D", - "BatchUniswapV3DirectToLiquidity": "0xE6b1113d108f86Fb7eF662ecF235dB6dB8978Cc3", - "EncryptedMarginalPrice": "0x8F34bBB3edd28017f826FE7a73eb9297384BF0d8", - "FixedPriceBatch": "0x87ED152099949F870725bD9517A1697d428ddF74", + "BatchAllocatedMerkleAllowlist": "0x9895D556E8d1be6C909EC88D43Dd0F6Ae6f7f4D7", + "BatchAuctionHouse": "0xBA0000ac450437406583980336fE93AB2752999F", + "BatchCappedMerkleAllowlist": "0x98e72F243db7CDfDB015865415A0AE1bFb071507", + "BatchCatalogue": "0xCCDF364E4a5D51437FF2885C86205Cfe2d90087a", + "BatchLinearVesting": "0xAd21cD6Cea90e46436002e79B12247eCe16110B3", + "BatchMerkleAllowlist": "0x9824De4B9A917D30a5427813E43e5DF968e19066", + "BatchTokenAllowlist": "0x986e7E24A33Ef6fbDc6C3a94657fBb59d85AbE1C", + "BatchUniswapV2DirectToLiquidity": "0xE6F7049c79AA674D1E7b709C3Dc42C614359956A", + "BatchUniswapV3DirectToLiquidity": "0xE6EDA80884CF4D44841fF33a3162A68EebBa2b7b", + "EncryptedMarginalPrice": "0x3ae8dD1ee2752883459C4c33c2f7Aeb8a56669f0", + "FixedPriceBatch": "0x9C5dF80078066a49E77537c4cc728a5e788e671F", "FixedPriceSale": "0x3661B7704F7032103B3122C7796B5E03fAC715b5", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", @@ -219,17 +219,17 @@ "AtomicLinearVesting": "0x0000000000000000000000000000000000000000", "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "BatchAllocatedMerkleAllowlist": "0x98fEC87d19AF5e7bda897a644c9A06C0044F2c21", - "BatchAuctionHouse": "0xBA00002999aBfa63cA25B3A7aD4c8F3a578aBe28", - "BatchCappedMerkleAllowlist": "0x98A9b42b2eCF9B1A6de9d2D2fA6929a93A094957", - "BatchCatalogue": "0xb5a822eaA5803Ac5b8Ed2DC4De3D5916b3F46605", - "BatchLinearVesting": "0xA9AEAe1d42bbfa591F4a06945a895d75011bE6e8", - "BatchMerkleAllowlist": "0x982b5C065CE01507aBfEda487FC19275aaF95EB1", - "BatchTokenAllowlist": "0x98E0306bAf959791211f7324A99B5094548aba72", - "BatchUniswapV2DirectToLiquidity": "0xE6F33CdB98B3D249002F2FCd12805Fccf7d78351", - "BatchUniswapV3DirectToLiquidity": "0xE6755a98C6a89331bee40EBbCA35750Daac55aC5", - "EncryptedMarginalPrice": "0x30c356DFBAc808BC62c860A9B285f024b40dF1fc", - "FixedPriceBatch": "0x13B299062c5E613C304145D78dA733bF9711DfC9", + "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", + "BatchAuctionHouse": "0xBA00000D23A0793d5601d1e8E7B32aE88642cbEF", + "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", + "BatchCatalogue": "0x6c80F20C5C0404a3D5349F71F9B25c0654884092", + "BatchLinearVesting": "0x16D5Aab9d35f8B3ac7BD086eEDcCe5343682D5F0", + "BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", + "BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", + "BatchUniswapV2DirectToLiquidity": "0xE6feE7a689Ff7493032Ba48B15fE841c6cC30DB9", + "BatchUniswapV3DirectToLiquidity": "0xE6c1ab82a2b4a194C87e643668bb715619766F0B", + "EncryptedMarginalPrice": "0xaC9957282BeA578f371078ddc4cD12A135B105d6", + "FixedPriceBatch": "0x8b7e483d96004ca7893EfB14E049f7648b62322b", "FixedPriceSale": "0x0000000000000000000000000000000000000000", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", @@ -253,17 +253,17 @@ "AtomicLinearVesting": "0x408fB738592232372069B592022F03BF3a241613", "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "BatchAllocatedMerkleAllowlist": "0x98B59b4BF62b0316D9B0f89D28A28d5D75BB8B46", - "BatchAuctionHouse": "0xBA00002999aBfa63cA25B3A7aD4c8F3a578aBe28", - "BatchCappedMerkleAllowlist": "0x9888DbABd5981763697A4433Cb57E3F9DABEcB6a", - "BatchCatalogue": "0x40Efc944A9bDe7Aea4853b435D5517433D02FfF8", - "BatchLinearVesting": "0x90608F57161aC771b28fb0adCd2434cfa1463201", - "BatchMerkleAllowlist": "0x9837cA34C444cEbd07C699036D1D174C6392D9fa", - "BatchTokenAllowlist": "0x988c61b36F7898e464a0Bf477d2dc06aC4E95F95", - "BatchUniswapV2DirectToLiquidity": "0xE60FD6203AF5D5d43433952a033Cb70Ba21784E9", - "BatchUniswapV3DirectToLiquidity": "0xE6ce65C413a5Fc10Fa77B26032B33DCD68F8474a", - "EncryptedMarginalPrice": "0x1A6Ba70B8e5957bCd03C20f9CF42D9e6D3d9b514", - "FixedPriceBatch": "0x75DA61536510BA0bCa0C9Af21311A1Fc035DCf4e", + "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", + "BatchAuctionHouse": "0xBA00000D23A0793d5601d1e8E7B32aE88642cbEF", + "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", + "BatchCatalogue": "0x3fF930D77CD37eB7d4960F5D10ec415978f90aeA", + "BatchLinearVesting": "0xF170C78a493d9245d125e05bBEc35c98735f5277", + "BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", + "BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", + "BatchUniswapV2DirectToLiquidity": "0xE6F478d800e9807efAb601a1CD60BBd7CBA1c0b8", + "BatchUniswapV3DirectToLiquidity": "0xE6BB80a6B8628F150E340BdE2e0C49fA17E1e566", + "EncryptedMarginalPrice": "0x8b47F82a58d8AFBE5167feBf0D3F3Bb509aaf2bd", + "FixedPriceBatch": "0xFB1113E170CA6d95f3a91121BDD2370a822598E9", "FixedPriceSale": "0xacD10C2B4aA625dd00cba40E4466c8Ff07288a16", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", diff --git a/script/salts/salts.json b/script/salts/salts.json index efc15d67..68f345aa 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -2,7 +2,10 @@ "AllocatedMerkleAllowlist": { "0x109440c1c675388d17f52673a20abbe28dd179642c176d6142dd7f44821be594": "0x5d9938f8fccff4783842cc1c5968240c6d173a447ccf3e11c096c5bb0e7423ec", "0x1330bbebf9210aa32cfa7221ca21157fee8f977c21e2e9bb9d396e02000726b2": "0x8cdbe3133136ece80f286b64a3dabf2a9d1bd5868e8a851a7747048f17e44717", + "0x23a85d2e69471278dd573d17331b360da25418c731483eca071acc91667846fa": "0x775d17e9071a23da2e1bcf5addb052676b2e180f3e69fb810613fa19f203a48f", "0x30b51492b0fefba6189938e77c04874f66af1ae415576b9a0870e3d831af3aeb": "0xb21446946154104802ca94a722f3d9c017dedcf52633e778343e049f558fc5e5", + "0x4db54f4a6df5f03f26f181efffd95909d94800d3b955d3606e12682b9bcbd89a": "0x5438ed572ff2d286c6686cc1ff5ab265f61aa3dc48953f7aa2b2483b84d4cd4e", + "0x6257c89e534c1414806da36437177a5ad7e372d98a2c231396c638f0e3e01986": "0x4d82fff8053192aea9b71c7cbc74250b30c2b870b08016dac5cd40eaf6f0ea68", "0x829a6a78304229812355cc3fd4ffbb383e35120e39942f1547bce97c9156f204": "0x12550234064c7913456e44b288c40022cf5b78c608f5e7f5ef0489157f49478f", "0x940f58c92177218354ef28efcd7056b131053fc33f27336c68af3eda9b7a537f": "0x9471763f5a9abcd58fee06a10aede685e570750ddc1de9f9e742130bb8f6369c", "0xaa5c1bd02f7b04980f0e4ef0778e9165f8404f41c1c2bc372f2902f80dc646b0": "0x3c781e03bd8272c21052708923b6b00b60d976b84bc792a25a8eeb527d166944", @@ -14,7 +17,8 @@ "BatchAuctionHouse": { "0x1d8b7b9cfbd8610a556d5e2e85dcdb25a17d6b5407574aef07970a86e4b0e2c3": "0x06374b73456c869d550c6cb45aff40113752ac3c4dd8efb8185b6da5c898aa82", "0x4c4d86f9737bd18dab3f6dc74d2f5c610b7169459c90a457e0e126ed42ae3bba": "0xbe4a9dc1b73685497c6104df59c2a3d2c1c5039bd48b1b25e9c0a029f3744311", - "0x926c218dfa94c5d70f80d1833ea9d4c6d581119f856d69e8fcc7e62c69773f4f": "0xb009513c506ae5ea1fd7caa71183203e72a2e197a17ac82f9797621fd7e4fa17" + "0x926c218dfa94c5d70f80d1833ea9d4c6d581119f856d69e8fcc7e62c69773f4f": "0xb009513c506ae5ea1fd7caa71183203e72a2e197a17ac82f9797621fd7e4fa17", + "0xf77b6d9024091bb6924c65ea67fb047db889c8f626975bc7222df6d0de23612e": "0xe6da5ed268cad156b2f5f63fb1d5a3a86a8c508e669f385d4a772fd22b87c684" }, "BlastAtomicAuctionHouse": { "0x3d41c1d7705983200681645a648d410d545bba492ad801c3938664a6bf58d882": "0x11f6c4c27a20cd6e6925ddd316451417e2cdf68d28a8bd2be486f9709f89a301" @@ -22,17 +26,21 @@ "BlastBatchAuctionHouse": { "0x830d2c24dcae0fce9215903ca9d54cb6789a2ee37db8bc9b5477fa24a9b72db0": "0x386b0b1e66cea083db3427476295fa70b84f5ceb132b9355d90de9aa7c89051d", "0xc640e527fdcd05d6135de917e29082984847300ec6bf4cf38393f8dbfa742b19": "0x1e7690f0ac2409cb3804ffe443d81e9685d882d4d1804c8bfb1056cc624afee8", - "0xcad29ef747f1a7ad12c1e5e715ac675f8534c0d3682dfddfa39287ae7b7d7f01": "0x761de87b1ea43dc2f84665b59b2ce8498c1a09458e3a89751578be7c72811114" + "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" @@ -41,13 +49,16 @@ "0x00e31f39c32ce8511a5db04dec4a0a92b29eb2cb02a965f107dbeb9549517e6a": "0xcfcc4407dd569ab1e457b9d475420c8d10e7db6751646b5aa84cfacf500947ba", "0x13f8dde16815b53fad1d222ffd783f6ed99b01992a48aac29791352ac7578576": "0x605db39e79afd6a7e67bd3055afc358a69143d97544404d75b8091c2d2c82fa1", "0x2cc37ca69a4e1ef00579453aad3e7dd939350a9b53f3dfa1f20896f0cd1dbddb": "0x87a479d8c7b3a31f53b0ae53979510bcb06d09a2e202432ac40581c6bc37ff08", + "0x48ea0384a799d4ff2b7287d3cf0736171352670aeb2b33bc18c70cbc5abd0fce": "0x179e7c820be6b4a6cfb0ce475443dd900c553322dbd3d38eda34dcfab7b20b81", "0x772e272fd6e30185ccd0d9d485a87d71b47d93ad31dcdb274bbde5002f12b12d": "0x5b5c6bacfcaa186167a4345af4ba4facedb0bb7693daa623b9db75f06b89c13f", "0x8dabf7c769c996b5b33b4da1013d93b9daeeb7cf468d179804c9130fd7eaa891": "0x71072df633972dfa166196430a104dbc30b8dc5997a8b965253ca299fd96feaf", "0xb4128aa3cf1f256d76081a556cbe66c83429e49ce28bca3b2e3b07b926f0bda8": "0xcbac00a3b5465e91d8c65d179de9fa8f52be1c99b8ecfd9ce35b51faa0046232", + "0xc56445d8a92973e5e7a453750ca38da11f04e2c965b3ae42a0f77ccdf2cd5b33": "0xc38225a585e134360208d9f73f4bdfaca9b43cd130f1a6cf0fd631e9877e32a6", "0xc8e647c61be9e05b08050eb7d8cfc1102b5328d9540b81891da5783ba25d2978": "0x368c44b5208a15f6292a0ac1246d7d6973d5c919d32cebd2f30da0844356e63a", "0xcd18d417a886a13a14969e2690fc3af13f228e73a02e48d9d4e8a6b3fa61504a": "0x7aa449a66650f30013cfd8021a16640d3489de2246ec5ad62f3ccbe5e84f819a", "0xd3da57bd92a493efbf623f32c63315442acb0a1519cdeb57c846803150efd238": "0x1ce173dc622d4d68f9b5fbe79de27e376bf66f560df27fb52c56d89fc0c4d66f", - "0xed4ba02077e70f78db70ce191509333d2dcccfff136d30dcb011f567305e88ad": "0x2b8bc588174d409692f1bd993942e3806c9a11344dbe674f46aed32a030aacf1" + "0xed4ba02077e70f78db70ce191509333d2dcccfff136d30dcb011f567305e88ad": "0x2b8bc588174d409692f1bd993942e3806c9a11344dbe674f46aed32a030aacf1", + "0xf758779927a94ce49a1ea7e126142cca8472adf8cc3133234411737bb193ce41": "0xe826d67a09b7f9d1da2beacf436b833ae46aae40524c788fd02a10b5c3258c9a" }, "Test_AllocatedMerkleAllowlist": { "0x8de6e7b0b1f6974167a896ad8d377c8c29ad0132dd3f7b26f3aae7d4bb348d2f": "0xbafe0e1369edea3d992723bf3ff6a352dafbbb9f4dd6b81d52da4b538c123bb5", @@ -101,10 +112,13 @@ "0x30d8cf89cc8c815884740dc27e72a1f8b5dacbbe39f3d1e35deb436176390b20": "0xaa12d3f9826fbc3d54f789bfc36030a3dfe0ea0a538d4968716e10eecc2b91b2", "0x48612e5a97a3e434e0158a8ece7bf1c0876f0a82987580936e63084228144cd6": "0xd51382b4a80b7fa68a37f611bf095a15818465788fead6a0a9a0515251cb66e5", "0x57df0bf7cfe081111b36726104f5bf23ec172de0ba96f2fb36c2e41108989b71": "0x7e184f1697deb99d9bc7ba50324c40e98b987f83a14245174e6eacc6ab240330", + "0x90da485cf65fddc4badddf32cea25b4bd9bb73886c8c43efd9bd24023ae5ae3e": "0xde52518303adaeab837dbb64e6ef884ef3e1851f659e52795c375a465f400799", + "0x9c02e32281bdc5e8d243f1888eca0f993061ed7f21f28cd90582d59b1c3b0b67": "0xa139dbe82632af667302739d6a4ff8f87b7c235a0cfc2a677865264cc7154507", "0xa4b72411c68147f4439bf4211d12dfbada62d17aba88a86648226a2cb61feff6": "0x18133c11f2fba3e102d2900a469e89202dd55927014a0a4062f21f2444bfcc9e", "0xcc0cb46859311aa362f48add9ffc284efd8aad3e4ec5a29b68eee7ab1b4cd8c4": "0x99628f6902caaf046d171a8754943a29a3906a9b32f3ee471a12b470363999c7", "0xcc3bdd1460c690d76ecd2a6068b712cac53eb622458a6246e13a9f22114c33ea": "0x69c7006142e7b85d6c199c18ab3274df41e776aede6923972c1434b4dcc0931c", - "0xdf5415e95420bc8deaf38312453772d847f73c7131a11dcd4bb9b5abdd289d13": "0x0ceea63bb6cc59164b6cabb6605bef340f456cc0e5ce5eca62ec5d981c97afd6" + "0xdf5415e95420bc8deaf38312453772d847f73c7131a11dcd4bb9b5abdd289d13": "0x0ceea63bb6cc59164b6cabb6605bef340f456cc0e5ce5eca62ec5d981c97afd6", + "0xf30f7c9cc7b51f335e23d73e1aca7e8b8a9bbc357c580d7cf4deb34209d2fd2e": "0xeb55ef52a3b1f1dd0a1afeac73957dffa2d091fe2356f9a53393cf4df3c7d103" }, "UniswapV2DirectToLiquidity": { "0x2952f587868594ee4aed1e483cdbb653d4ef61c9c662a737fc6ae8f271225fe1": "0x000174bce07575898f52c13859450718eea202638a7089ff3d358a023b48bbfb", @@ -114,23 +128,32 @@ "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" } } From 947dd4bb68b97152b16742a1913af51051707baa Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 10 Jul 2024 16:46:40 +0400 Subject: [PATCH 76/82] Fix typo --- src/AtomicAuctionHouse.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AtomicAuctionHouse.sol b/src/AtomicAuctionHouse.sol index 334bdb13..a87d4d50 100644 --- a/src/AtomicAuctionHouse.sol +++ b/src/AtomicAuctionHouse.sol @@ -77,7 +77,7 @@ contract AtomicAuctionHouse is IAtomicAuctionHouse, AuctionHouse { // ========== PURCHASE ========== // - /// @dev This fuction handles the following: + /// @dev This function handles the following: /// 1. Calculates the fees for the purchase /// 2. Obtains the payout from the auction module /// 3. Transfers the purchase amount (quote token) from the caller From be60eabe14b9c67431d0f2bbd75b5deebc0e1783 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 11 Jul 2024 12:37:46 +0400 Subject: [PATCH 77/82] Remove unused values for atomic deployments in env.json --- script/env.json | 68 ++----------------------------------------------- 1 file changed, 2 insertions(+), 66 deletions(-) diff --git a/script/env.json b/script/env.json index a045ca9d..7db93fe7 100644 --- a/script/env.json +++ b/script/env.json @@ -2,18 +2,13 @@ "current": { "arbitrum": { "axis": { - "AtomicAuctionHouse": "0x0000000000000000000000000000000000000000", - "AtomicCatalogue": "0x0000000000000000000000000000000000000000", - "AtomicLinearVesting": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", "BatchAuctionHouse": "0x0000000000000000000000000000000000000000", "BatchCatalogue": "0x0000000000000000000000000000000000000000", "BatchLinearVesting": "0x0000000000000000000000000000000000000000", "BatchUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", "BatchUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", "EncryptedMarginalPrice": "0x0000000000000000000000000000000000000000", - "FixedPriceSale": "0x0000000000000000000000000000000000000000", + "FixedPriceBatch": "0x0000000000000000000000000000000000000000", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" @@ -31,11 +26,6 @@ }, "arbitrum-sepolia": { "axis": { - "AtomicAuctionHouse": "0xAA0000A0F9FF55d5F00aB9cc8d05eF78DE4f9E8f", - "AtomicCatalogue": "0xD223Ae37b01Fe549f3D5b1901e4B15053540540F", - "AtomicLinearVesting": "0xA7413717C633175Bc5B669E94625a4d3FE009870", - "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", "BatchAllocatedMerkleAllowlist": "0x98765dB6F0c4334075FB06d8D2998749b8CF604e", "BatchAuctionHouse": "0xBA00003622ee11Ffac8a07cf8D207b19c95F1FFf", "BatchCappedMerkleAllowlist": "0x9868c93CDec64f471b1DFf60f5e8249249dBa126", @@ -47,7 +37,6 @@ "BatchUniswapV3DirectToLiquidity": "0xE6f7888cfc8219C93E70Ca528195b4afD80D7894", "EncryptedMarginalPrice": "0x81661B3CC47218327cE17bAd69d9246FCC321667", "FixedPriceBatch": "0x0107DeD7dCD989470268eaeae2Aa2711Efa2597c", - "FixedPriceSale": "0x0A0BA689D2D72D3f376293c534AF299B3C6Dac85", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" @@ -78,11 +67,6 @@ }, "base-sepolia": { "axis": { - "AtomicAuctionHouse": "0x0000000000000000000000000000000000000000", - "AtomicCatalogue": "0x0000000000000000000000000000000000000000", - "AtomicLinearVesting": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", "BatchAuctionHouse": "0xBA00000D23A0793d5601d1e8E7B32aE88642cbEF", "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", @@ -94,7 +78,6 @@ "BatchUniswapV3DirectToLiquidity": "0xE6BC347aA7Ce46bDb45F938605C5d4b88881bB1c", "EncryptedMarginalPrice": "0xA7413717C633175Bc5B669E94625a4d3FE009870", "FixedPriceBatch": "0xC818f1f000f9C24D014BCe2c5334e14B1360d9CD", - "FixedPriceSale": "0x0000000000000000000000000000000000000000", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" @@ -112,18 +95,13 @@ }, "blast": { "axis": { - "AtomicAuctionHouse": "0x0000000000000000000000000000000000000000", - "AtomicCatalogue": "0x0000000000000000000000000000000000000000", - "AtomicLinearVesting": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", "BatchAuctionHouse": "0x0000000000000000000000000000000000000000", "BatchCatalogue": "0x0000000000000000000000000000000000000000", "BatchLinearVesting": "0x0000000000000000000000000000000000000000", "BatchUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", "BatchUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", "EncryptedMarginalPrice": "0x0000000000000000000000000000000000000000", - "FixedPriceSale": "0x0000000000000000000000000000000000000000", + "FixedPriceBatch": "0x0000000000000000000000000000000000000000", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" @@ -146,11 +124,6 @@ }, "blast-sepolia": { "axis": { - "AtomicAuctionHouse": "0xAA0000E35F2042621ff29B2f3d0F89665f896502", - "AtomicCatalogue": "0x5Ec85e475B3BeDE1280907B0ac568b406fBC543A", - "AtomicLinearVesting": "0x8270f3e8D874De8b974A0Bf928abDFf92171B1b2", - "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", "BatchAllocatedMerkleAllowlist": "0x9895D556E8d1be6C909EC88D43Dd0F6Ae6f7f4D7", "BatchAuctionHouse": "0xBA0000ac450437406583980336fE93AB2752999F", "BatchCappedMerkleAllowlist": "0x98e72F243db7CDfDB015865415A0AE1bFb071507", @@ -162,7 +135,6 @@ "BatchUniswapV3DirectToLiquidity": "0xE6EDA80884CF4D44841fF33a3162A68EebBa2b7b", "EncryptedMarginalPrice": "0x3ae8dD1ee2752883459C4c33c2f7Aeb8a56669f0", "FixedPriceBatch": "0x9C5dF80078066a49E77537c4cc728a5e788e671F", - "FixedPriceSale": "0x3661B7704F7032103B3122C7796B5E03fAC715b5", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" @@ -185,18 +157,6 @@ }, "mainnet": { "axis": { - "AtomicAuctionHouse": "0x0000000000000000000000000000000000000000", - "AtomicCatalogue": "0x0000000000000000000000000000000000000000", - "AtomicLinearVesting": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "BatchAuctionHouse": "0x0000000000000000000000000000000000000000", - "BatchCatalogue": "0x0000000000000000000000000000000000000000", - "BatchLinearVesting": "0x0000000000000000000000000000000000000000", - "BatchUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "BatchUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "EncryptedMarginalPrice": "0x0000000000000000000000000000000000000000", - "FixedPriceSale": "0x0000000000000000000000000000000000000000", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" @@ -214,11 +174,6 @@ }, "mantle-sepolia": { "axis": { - "AtomicAuctionHouse": "0x0000000000000000000000000000000000000000", - "AtomicCatalogue": "0x0000000000000000000000000000000000000000", - "AtomicLinearVesting": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", "BatchAuctionHouse": "0xBA00000D23A0793d5601d1e8E7B32aE88642cbEF", "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", @@ -230,7 +185,6 @@ "BatchUniswapV3DirectToLiquidity": "0xE6c1ab82a2b4a194C87e643668bb715619766F0B", "EncryptedMarginalPrice": "0xaC9957282BeA578f371078ddc4cD12A135B105d6", "FixedPriceBatch": "0x8b7e483d96004ca7893EfB14E049f7648b62322b", - "FixedPriceSale": "0x0000000000000000000000000000000000000000", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" @@ -248,11 +202,6 @@ }, "mode-sepolia": { "axis": { - "AtomicAuctionHouse": "0xAA0000A0F9FF55d5F00aB9cc8d05eF78DE4f9E8f", - "AtomicCatalogue": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b", - "AtomicLinearVesting": "0x408fB738592232372069B592022F03BF3a241613", - "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", "BatchAuctionHouse": "0xBA00000D23A0793d5601d1e8E7B32aE88642cbEF", "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", @@ -264,7 +213,6 @@ "BatchUniswapV3DirectToLiquidity": "0xE6BB80a6B8628F150E340BdE2e0C49fA17E1e566", "EncryptedMarginalPrice": "0x8b47F82a58d8AFBE5167feBf0D3F3Bb509aaf2bd", "FixedPriceBatch": "0xFB1113E170CA6d95f3a91121BDD2370a822598E9", - "FixedPriceSale": "0xacD10C2B4aA625dd00cba40E4466c8Ff07288a16", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" @@ -282,18 +230,6 @@ }, "sepolia": { "axis": { - "AtomicAuctionHouse": "0x0000000000000000000000000000000000000000", - "AtomicCatalogue": "0x0000000000000000000000000000000000000000", - "AtomicLinearVesting": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "AtomicUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "BatchAuctionHouse": "0x0000000000000000000000000000000000000000", - "BatchCatalogue": "0x0000000000000000000000000000000000000000", - "BatchLinearVesting": "0x0000000000000000000000000000000000000000", - "BatchUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "BatchUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "EncryptedMarginalPrice": "0x0000000000000000000000000000000000000000", - "FixedPriceSale": "0x0000000000000000000000000000000000000000", "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" From 215920105b85924645b4586144ee72bdb8c3b2c2 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 11 Jul 2024 13:05:10 +0400 Subject: [PATCH 78/82] Amend scripts to have separate keys for constants and deployments --- script/deploy/Deploy.s.sol | 117 ++--- script/deploy/DeployBlast.s.sol | 44 +- script/env.json | 460 ++++++++++-------- .../FixedPriceBatch-BaseDTL/TestData.s.sol | 8 +- .../ops/test/FixedPriceBatch/TestData.s.sol | 8 +- script/salts/allowlist/AllowlistSalts.s.sol | 4 +- .../auctionHouse/AuctionHouseSalts.s.sol | 6 +- .../auctionHouse/AuctionHouseSaltsBlast.s.sol | 12 +- .../salts/dtl-uniswap/UniswapDTLSalts.s.sol | 12 +- 9 files changed, 362 insertions(+), 309 deletions(-) diff --git a/script/deploy/Deploy.s.sol b/script/deploy/Deploy.s.sol index eaa2d385..c508110e 100644 --- a/script/deploy/Deploy.s.sol +++ b/script/deploy/Deploy.s.sol @@ -36,12 +36,15 @@ import {AllocatedMerkleAllowlist} from "src/callbacks/allowlists/AllocatedMerkle contract Deploy is Script, WithEnvironment, WithSalts { using stdJson for string; - string internal constant _PREFIX_AXIS = "axis"; + 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"; bytes internal constant _ATOMIC_AUCTION_HOUSE_NAME = "AtomicAuctionHouse"; bytes internal constant _BATCH_AUCTION_HOUSE_NAME = "BatchAuctionHouse"; bytes internal constant _BLAST_ATOMIC_AUCTION_HOUSE_NAME = "BlastAtomicAuctionHouse"; - bytes internal constant _BLAST_BATCH_AUCTION_HOUSE_NAME = "BlasBatchAuctionHouse"; + bytes internal constant _BLAST_BATCH_AUCTION_HOUSE_NAME = "BlastBatchAuctionHouse"; // Deploy system storage uint256[] public auctionHouseIndexes; @@ -110,7 +113,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { for (uint256 i; i < ahLen; i++) { uint256 index = auctionHouseIndexes[i]; string memory name = deployments[index]; - string memory deploymentKey = string.concat(_PREFIX_AXIS, ".", name); + string memory deploymentKey = string.concat(_PREFIX_DEPLOYMENT_ROOT, ".", name); deployedToKeys.push(deploymentKey); if (_isAtomicAuctionHouse(name)) { @@ -151,7 +154,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { if (installAtomicAuctionHouseMap[name]) { console2.log(""); AtomicAuctionHouse atomicAuctionHouse = - AtomicAuctionHouse(_getAddressNotZero("axis.AtomicAuctionHouse")); + AtomicAuctionHouse(_getAddressNotZero("deployments.AtomicAuctionHouse")); console2.log(""); console2.log(" Installing in AtomicAuctionHouse"); @@ -164,7 +167,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { if (installBatchAuctionHouseMap[name]) { console2.log(""); BatchAuctionHouse batchAuctionHouse = - BatchAuctionHouse(_getAddressNotZero("axis.BatchAuctionHouse")); + BatchAuctionHouse(_getAddressNotZero("deployments.BatchAuctionHouse")); console2.log(""); console2.log(" Installing in BatchAuctionHouse"); @@ -245,9 +248,9 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying AtomicAuctionHouse"); - address owner = _getAddressNotZero("axis.OWNER"); - address protocol = _getAddressNotZero("axis.PROTOCOL"); - address permit2 = _getAddressNotZero("axis.PERMIT2"); + address owner = _getAddressNotZero("constants.axis.OWNER"); + address protocol = _getAddressNotZero("constants.axis.PROTOCOL"); + address permit2 = _getAddressNotZero("constants.axis.PERMIT2"); // Get the salt bytes32 salt_ = _getSalt( @@ -277,9 +280,9 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying BatchAuctionHouse"); - address owner = _getAddressNotZero("axis.OWNER"); - address protocol = _getAddressNotZero("axis.PROTOCOL"); - address permit2 = _getAddressNotZero("axis.PERMIT2"); + address owner = _getAddressNotZero("constants.axis.OWNER"); + address protocol = _getAddressNotZero("constants.axis.PROTOCOL"); + address permit2 = _getAddressNotZero("constants.axis.PERMIT2"); // Get the salt bytes32 salt_ = _getSalt( @@ -311,7 +314,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying AtomicCatalogue"); - address atomicAuctionHouse = _getAddressNotZero("axis.AtomicAuctionHouse"); + address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); // Get the salt bytes32 salt_ = _getSalt( @@ -332,7 +335,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log(" AtomicCatalogue deployed at:", address(atomicCatalogue)); - return (address(atomicCatalogue), _PREFIX_AXIS); + return (address(atomicCatalogue), _PREFIX_DEPLOYMENT_ROOT); } function deployBatchCatalogue(bytes memory) public virtual returns (address, string memory) { @@ -340,7 +343,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying BatchCatalogue"); - address batchAuctionHouse = _getAddressNotZero("axis.BatchAuctionHouse"); + address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); // Get the salt bytes32 salt_ = _getSalt( @@ -361,7 +364,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log(" BatchCatalogue deployed at:", address(batchCatalogue)); - return (address(batchCatalogue), _PREFIX_AXIS); + return (address(batchCatalogue), _PREFIX_DEPLOYMENT_ROOT); } // ========== AUCTION MODULE DEPLOYMENTS ========== // @@ -375,7 +378,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying EncryptedMarginalPrice"); - address batchAuctionHouse = _getAddressNotZero("axis.BatchAuctionHouse"); + address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); // Get the salt bytes32 salt_ = _getSalt( @@ -398,7 +401,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log(" EncryptedMarginalPrice deployed at:", address(amEmp)); - return (address(amEmp), _PREFIX_AXIS); + return (address(amEmp), _PREFIX_AUCTION_MODULES); } function deployFixedPriceSale(bytes memory) public virtual returns (address, string memory) { @@ -406,7 +409,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying FixedPriceSale"); - address atomicAuctionHouse = _getAddressNotZero("axis.AtomicAuctionHouse"); + address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); // Get the salt bytes32 salt_ = _getSalt( @@ -427,7 +430,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log(" FixedPriceSale deployed at:", address(amFps)); - return (address(amFps), _PREFIX_AXIS); + return (address(amFps), _PREFIX_AUCTION_MODULES); } function deployFixedPriceBatch(bytes memory) public virtual returns (address, string memory) { @@ -435,7 +438,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying FixedPriceBatch"); - address batchAuctionHouse = _getAddressNotZero("axis.BatchAuctionHouse"); + address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); // Get the salt bytes32 salt_ = _getSalt( @@ -456,7 +459,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log(" FixedPriceBatch deployed at:", address(amFpb)); - return (address(amFpb), _PREFIX_AXIS); + return (address(amFpb), _PREFIX_AUCTION_MODULES); } // ========== DERIVATIVE MODULE DEPLOYMENTS ========== // @@ -470,7 +473,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying LinearVesting (Atomic)"); - address atomicAuctionHouse = _getAddressNotZero("axis.AtomicAuctionHouse"); + address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); // Get the salt bytes32 salt_ = _getSalt( @@ -491,7 +494,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log(" LinearVesting (Atomic) deployed at:", address(dmAtomicLinearVesting)); - return (address(dmAtomicLinearVesting), _PREFIX_AXIS); + return (address(dmAtomicLinearVesting), _PREFIX_DERIVATIVE_MODULES); } function deployBatchLinearVesting(bytes memory) @@ -503,7 +506,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying LinearVesting (Batch)"); - address batchAuctionHouse = _getAddressNotZero("axis.BatchAuctionHouse"); + address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); // Get the salt bytes32 salt_ = _getSalt( @@ -524,7 +527,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log(" LinearVesting (Batch) deployed at:", address(dmBatchLinearVesting)); - return (address(dmBatchLinearVesting), _PREFIX_AXIS); + return (address(dmBatchLinearVesting), _PREFIX_DERIVATIVE_MODULES); } // ========== MODULE DEPLOYMENTS ========== // @@ -537,9 +540,9 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying UniswapV2DirectToLiquidity (Atomic)"); - address atomicAuctionHouse = _getAddressNotZero("axis.AtomicAuctionHouse"); - address uniswapV2Factory = _getAddressNotZero("uniswapV2.factory"); - address uniswapV2Router = _getAddressNotZero("uniswapV2.router"); + address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); + address uniswapV2Factory = _getAddressNotZero("constants.uniswapV2.factory"); + address uniswapV2Router = _getAddressNotZero("constants.uniswapV2.router"); // Get the salt bytes32 salt_ = _getSalt( @@ -563,7 +566,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { " UniswapV2DirectToLiquidity (Atomic) deployed at:", address(cbAtomicUniswapV2Dtl) ); - return (address(cbAtomicUniswapV2Dtl), _PREFIX_AXIS); + return (address(cbAtomicUniswapV2Dtl), _PREFIX_CALLBACKS); } function deployBatchUniswapV2DirectToLiquidity(bytes memory) @@ -574,9 +577,9 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying UniswapV2DirectToLiquidity (Batch)"); - address batchAuctionHouse = _getAddressNotZero("axis.BatchAuctionHouse"); - address uniswapV2Factory = _getAddressNotZero("uniswapV2.factory"); - address uniswapV2Router = _getAddressNotZero("uniswapV2.router"); + address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); + address uniswapV2Factory = _getAddressNotZero("constants.uniswapV2.factory"); + address uniswapV2Router = _getAddressNotZero("constants.uniswapV2.router"); // Get the salt bytes32 salt_ = _getSalt( @@ -600,7 +603,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { " UniswapV2DirectToLiquidity (Batch) deployed at:", address(cbBatchUniswapV2Dtl) ); - return (address(cbBatchUniswapV2Dtl), _PREFIX_AXIS); + return (address(cbBatchUniswapV2Dtl), _PREFIX_CALLBACKS); } function deployAtomicUniswapV3DirectToLiquidity(bytes memory) @@ -611,9 +614,9 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying UniswapV3DirectToLiquidity (Atomic)"); - address atomicAuctionHouse = _getAddressNotZero("axis.AtomicAuctionHouse"); - address uniswapV3Factory = _getAddressNotZero("uniswapV3.factory"); - address gUniFactory = _getAddressNotZero("gUni.factory"); + address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); + address uniswapV3Factory = _getAddressNotZero("constants.uniswapV3.factory"); + address gUniFactory = _getAddressNotZero("constants.gUni.factory"); // Get the salt bytes32 salt_ = _getSalt( @@ -637,7 +640,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { " UniswapV3DirectToLiquidity (Atomic) deployed at:", address(cbAtomicUniswapV3Dtl) ); - return (address(cbAtomicUniswapV3Dtl), _PREFIX_AXIS); + return (address(cbAtomicUniswapV3Dtl), _PREFIX_CALLBACKS); } function deployBatchUniswapV3DirectToLiquidity(bytes memory) @@ -648,9 +651,9 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying UniswapV3DirectToLiquidity (Batch)"); - address batchAuctionHouse = _getAddressNotZero("axis.BatchAuctionHouse"); - address uniswapV3Factory = _getAddressNotZero("uniswapV3.factory"); - address gUniFactory = _getAddressNotZero("gUni.factory"); + address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); + address uniswapV3Factory = _getAddressNotZero("constants.uniswapV3.factory"); + address gUniFactory = _getAddressNotZero("constants.gUni.factory"); // Get the salt bytes32 salt_ = _getSalt( @@ -674,7 +677,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { " UniswapV3DirectToLiquidity (Batch) deployed at:", address(cbBatchUniswapV3Dtl) ); - return (address(cbBatchUniswapV3Dtl), _PREFIX_AXIS); + return (address(cbBatchUniswapV3Dtl), _PREFIX_CALLBACKS); } function deployAtomicCappedMerkleAllowlist(bytes memory) @@ -685,7 +688,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying CappedMerkleAllowlist (Atomic)"); - address atomicAuctionHouse = _getAddressNotZero("axis.AtomicAuctionHouse"); + address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); Callbacks.Permissions memory permissions = Callbacks.Permissions({ onCreate: true, onCancel: false, @@ -719,7 +722,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { address(cbAtomicCappedMerkleAllowlist) ); - return (address(cbAtomicCappedMerkleAllowlist), _PREFIX_AXIS); + return (address(cbAtomicCappedMerkleAllowlist), _PREFIX_CALLBACKS); } function deployBatchCappedMerkleAllowlist(bytes memory) @@ -730,7 +733,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying CappedMerkleAllowlist (Batch)"); - address batchAuctionHouse = _getAddressNotZero("axis.BatchAuctionHouse"); + address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); Callbacks.Permissions memory permissions = Callbacks.Permissions({ onCreate: true, onCancel: false, @@ -763,7 +766,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { " CappedMerkleAllowlist (Batch) deployed at:", address(cbBatchCappedMerkleAllowlist) ); - return (address(cbBatchCappedMerkleAllowlist), _PREFIX_AXIS); + return (address(cbBatchCappedMerkleAllowlist), _PREFIX_CALLBACKS); } function deployAtomicMerkleAllowlist(bytes memory) public returns (address, string memory) { @@ -771,7 +774,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying MerkleAllowlist (Atomic)"); - address atomicAuctionHouse = _getAddressNotZero("axis.AtomicAuctionHouse"); + address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); Callbacks.Permissions memory permissions = Callbacks.Permissions({ onCreate: true, onCancel: false, @@ -802,7 +805,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log(" MerkleAllowlist (Atomic) deployed at:", address(cbAtomicMerkleAllowlist)); - return (address(cbAtomicMerkleAllowlist), _PREFIX_AXIS); + return (address(cbAtomicMerkleAllowlist), _PREFIX_CALLBACKS); } function deployBatchMerkleAllowlist(bytes memory) public returns (address, string memory) { @@ -810,7 +813,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying MerkleAllowlist (Batch)"); - address batchAuctionHouse = _getAddressNotZero("axis.BatchAuctionHouse"); + address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); Callbacks.Permissions memory permissions = Callbacks.Permissions({ onCreate: true, onCancel: false, @@ -841,7 +844,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log(" MerkleAllowlist (Batch) deployed at:", address(cbBatchMerkleAllowlist)); - return (address(cbBatchMerkleAllowlist), _PREFIX_AXIS); + return (address(cbBatchMerkleAllowlist), _PREFIX_CALLBACKS); } function deployAtomicTokenAllowlist(bytes memory) public returns (address, string memory) { @@ -849,7 +852,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying TokenAllowlist (Atomic)"); - address atomicAuctionHouse = _getAddressNotZero("axis.AtomicAuctionHouse"); + address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); Callbacks.Permissions memory permissions = Callbacks.Permissions({ onCreate: true, onCancel: false, @@ -880,7 +883,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log(" TokenAllowlist (Atomic) deployed at:", address(cbAtomicTokenAllowlist)); - return (address(cbAtomicTokenAllowlist), _PREFIX_AXIS); + return (address(cbAtomicTokenAllowlist), _PREFIX_CALLBACKS); } function deployBatchTokenAllowlist(bytes memory) public returns (address, string memory) { @@ -888,7 +891,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying TokenAllowlist (Batch)"); - address batchAuctionHouse = _getAddressNotZero("axis.BatchAuctionHouse"); + address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); Callbacks.Permissions memory permissions = Callbacks.Permissions({ onCreate: true, onCancel: false, @@ -919,7 +922,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log(" TokenAllowlist (Batch) deployed at:", address(cbBatchTokenAllowlist)); - return (address(cbBatchTokenAllowlist), _PREFIX_AXIS); + return (address(cbBatchTokenAllowlist), _PREFIX_CALLBACKS); } function deployAtomicAllocatedMerkleAllowlist(bytes memory) @@ -930,7 +933,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying AllocatedMerkleAllowlist (Atomic)"); - address atomicAuctionHouse = _getAddressNotZero("axis.AtomicAuctionHouse"); + address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); Callbacks.Permissions memory permissions = Callbacks.Permissions({ onCreate: true, onCancel: false, @@ -964,7 +967,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { address(cbAtomicAllocatedMerkleAllowlist) ); - return (address(cbAtomicAllocatedMerkleAllowlist), _PREFIX_AXIS); + return (address(cbAtomicAllocatedMerkleAllowlist), _PREFIX_CALLBACKS); } function deployBatchAllocatedMerkleAllowlist(bytes memory) @@ -975,7 +978,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log("Deploying AllocatedMerkleAllowlist (Batch)"); - address batchAuctionHouse = _getAddressNotZero("axis.BatchAuctionHouse"); + address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); Callbacks.Permissions memory permissions = Callbacks.Permissions({ onCreate: true, onCancel: false, @@ -1009,7 +1012,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { address(cbBatchAllocatedMerkleAllowlist) ); - return (address(cbBatchAllocatedMerkleAllowlist), _PREFIX_AXIS); + return (address(cbBatchAllocatedMerkleAllowlist), _PREFIX_CALLBACKS); } // ========== HELPER FUNCTIONS ========== // diff --git a/script/deploy/DeployBlast.s.sol b/script/deploy/DeployBlast.s.sol index 74fb6b69..25d6a697 100644 --- a/script/deploy/DeployBlast.s.sol +++ b/script/deploy/DeployBlast.s.sol @@ -23,12 +23,12 @@ contract DeployBlast is Deploy { console2.log(""); console2.log("Deploying BlastAtomicAuctionHouse"); - address owner = _getAddressNotZero("axis.OWNER"); - address protocol = _getAddressNotZero("axis.PROTOCOL"); - address permit2 = _getAddressNotZero("axis.PERMIT2"); - address blast = _getAddressNotZero("blast.blast"); - address blastWeth = _getAddressNotZero("blast.weth"); - address blastUsdb = _getAddressNotZero("blast.usdb"); + address owner = _getAddressNotZero("constants.axis.OWNER"); + address protocol = _getAddressNotZero("constants.axis.PROTOCOL"); + address permit2 = _getAddressNotZero("constants.axis.PERMIT2"); + address blast = _getAddressNotZero("constants.blast.blast"); + address blastWeth = _getAddressNotZero("constants.blast.weth"); + address blastUsdb = _getAddressNotZero("constants.blast.usdb"); // Get the salt bytes32 salt_ = _getSalt( @@ -60,12 +60,12 @@ contract DeployBlast is Deploy { console2.log(""); console2.log("Deploying BlastBatchAuctionHouse"); - address owner = _getAddressNotZero("axis.OWNER"); - address protocol = _getAddressNotZero("axis.PROTOCOL"); - address permit2 = _getAddressNotZero("axis.PERMIT2"); - address blast = _getAddressNotZero("blast.blast"); - address blastWeth = _getAddressNotZero("blast.weth"); - address blastUsdb = _getAddressNotZero("blast.usdb"); + address owner = _getAddressNotZero("constants.axis.OWNER"); + address protocol = _getAddressNotZero("constants.axis.PROTOCOL"); + address permit2 = _getAddressNotZero("constants.axis.PERMIT2"); + address blast = _getAddressNotZero("constants.blast.blast"); + address blastWeth = _getAddressNotZero("constants.blast.weth"); + address blastUsdb = _getAddressNotZero("constants.blast.usdb"); // Get the salt bytes32 salt_ = _getSalt( @@ -103,8 +103,8 @@ contract DeployBlast is Deploy { console2.log(""); console2.log("Deploying BlastEMP (Encrypted Marginal Price)"); - address batchAuctionHouse = _getAddressNotZero("axis.BatchAuctionHouse"); - address blast = _getAddressNotZero("blast.blast"); + address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); + address blast = _getAddressNotZero("constants.blast.blast"); // Get the salt bytes32 salt_ = @@ -131,8 +131,8 @@ contract DeployBlast is Deploy { console2.log(""); console2.log("Deploying BlastFPS (Fixed Price Sale)"); - address atomicAuctionHouse = _getAddressNotZero("axis.AtomicAuctionHouse"); - address blast = _getAddressNotZero("blast.blast"); + address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); + address blast = _getAddressNotZero("constants.blast.blast"); // Get the salt bytes32 salt_ = @@ -159,8 +159,8 @@ contract DeployBlast is Deploy { console2.log(""); console2.log("Deploying BlastFPB (Fixed Price Batch)"); - address batchAuctionHouse = _getAddressNotZero("axis.BatchAuctionHouse"); - address blast = _getAddressNotZero("blast.blast"); + address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); + address blast = _getAddressNotZero("constants.blast.blast"); // Get the salt bytes32 salt_ = @@ -191,8 +191,8 @@ contract DeployBlast is Deploy { console2.log(""); console2.log("Deploying BlastLinearVesting (Atomic)"); - address atomicAuctionHouse = _getAddressNotZero("axis.AtomicAuctionHouse"); - address blast = _getAddressNotZero("blast.blast"); + address atomicAuctionHouse = _getAddressNotZero("deployments.AtomicAuctionHouse"); + address blast = _getAddressNotZero("constants.blast.blast"); // Get the salt bytes32 salt_ = _getSalt( @@ -226,8 +226,8 @@ contract DeployBlast is Deploy { console2.log(""); console2.log("Deploying LinearVesting (Batch)"); - address batchAuctionHouse = _getAddressNotZero("axis.BatchAuctionHouse"); - address blast = _getAddressNotZero("blast.blast"); + address batchAuctionHouse = _getAddressNotZero("deployments.BatchAuctionHouse"); + address blast = _getAddressNotZero("constants.blast.blast"); // Get the salt bytes32 salt_ = _getSalt( diff --git a/script/env.json b/script/env.json index 7db93fe7..b10ad4b8 100644 --- a/script/env.json +++ b/script/env.json @@ -1,248 +1,298 @@ { "current": { "arbitrum": { - "axis": { - "BatchAuctionHouse": "0x0000000000000000000000000000000000000000", - "BatchCatalogue": "0x0000000000000000000000000000000000000000", - "BatchLinearVesting": "0x0000000000000000000000000000000000000000", - "BatchUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "BatchUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "EncryptedMarginalPrice": "0x0000000000000000000000000000000000000000", - "FixedPriceBatch": "0x0000000000000000000000000000000000000000", - "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", - "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x0000000000000000000000000000000000000000" - }, - "uniswapV2": { - "factory": "0xf1D7CC64Fb4452F05c498126312eBE29f30Fbcf9", - "router": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" - }, - "uniswapV3": { - "factory": "0x1F98431c8aD98523631AE4a59f267346ea31F984" + "constants": { + "axis": { + "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", + "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" + }, + "gUni": { + "factory": "0x0000000000000000000000000000000000000000" + }, + "uniswapV2": { + "factory": "0xf1D7CC64Fb4452F05c498126312eBE29f30Fbcf9", + "router": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" + }, + "uniswapV3": { + "factory": "0x1F98431c8aD98523631AE4a59f267346ea31F984" + } } }, "arbitrum-sepolia": { - "axis": { - "BatchAllocatedMerkleAllowlist": "0x98765dB6F0c4334075FB06d8D2998749b8CF604e", + "constants": { + "axis": { + "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", + "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" + }, + "gUni": { + "factory": "0x39AC4439e6CB9427C073259e5742529cE46DD663" + }, + "uniswapV2": { + "factory": "0xeA68f4B82D43979c42E1Fc8E80BDA27BF54C9651", + "router": "0x706f328cdE340522149821FC249c2ad321070212" + }, + "uniswapV3": { + "factory": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" + } + }, + "deployments": { "BatchAuctionHouse": "0xBA00003622ee11Ffac8a07cf8D207b19c95F1FFf", - "BatchCappedMerkleAllowlist": "0x9868c93CDec64f471b1DFf60f5e8249249dBa126", "BatchCatalogue": "0x265aB5FABa5D855CFA46Af61936ca212CEb71146", - "BatchLinearVesting": "0x056ed71c999bDdF489d34eD767a50c608Ae16Bf9", - "BatchMerkleAllowlist": "0x989F7525b5e0c804e5A2707F14d34C523D56B43b", - "BatchTokenAllowlist": "0x982598d92BBB2a2E54EdCd262EeF114a517fEeCE", - "BatchUniswapV2DirectToLiquidity": "0xE6c6B510E4b0e442BF01fabDc93d4bf032683C3C", - "BatchUniswapV3DirectToLiquidity": "0xE6f7888cfc8219C93E70Ca528195b4afD80D7894", - "EncryptedMarginalPrice": "0x81661B3CC47218327cE17bAd69d9246FCC321667", - "FixedPriceBatch": "0x0107DeD7dCD989470268eaeae2Aa2711Efa2597c", - "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", - "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x39AC4439e6CB9427C073259e5742529cE46DD663" - }, - "uniswapV2": { - "factory": "0xeA68f4B82D43979c42E1Fc8E80BDA27BF54C9651", - "router": "0x706f328cdE340522149821FC249c2ad321070212" - }, - "uniswapV3": { - "factory": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" + "auctionModules": { + "EncryptedMarginalPrice": "0x81661B3CC47218327cE17bAd69d9246FCC321667", + "FixedPriceBatch": "0x0107DeD7dCD989470268eaeae2Aa2711Efa2597c" + }, + "callbacks": { + "BatchAllocatedMerkleAllowlist": "0x98765dB6F0c4334075FB06d8D2998749b8CF604e", + "BatchCappedMerkleAllowlist": "0x9868c93CDec64f471b1DFf60f5e8249249dBa126", + "BatchMerkleAllowlist": "0x989F7525b5e0c804e5A2707F14d34C523D56B43b", + "BatchTokenAllowlist": "0x982598d92BBB2a2E54EdCd262EeF114a517fEeCE", + "BatchUniswapV2DirectToLiquidity": "0xE6c6B510E4b0e442BF01fabDc93d4bf032683C3C", + "BatchUniswapV3DirectToLiquidity": "0xE6f7888cfc8219C93E70Ca528195b4afD80D7894" + }, + "derivativeModules": { + "BatchLinearVesting": "0x056ed71c999bDdF489d34eD767a50c608Ae16Bf9" + } } }, "base": { - "axis": {}, - "gUni": { - "factory": "0x0000000000000000000000000000000000000000" - }, - "uniswapV2": { - "factory": "0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6", - "router": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" - }, - "uniswapV3": { - "factory": "0x33128a8fC17869897dcE68Ed026d694621f6FDfD" + "constants": { + "axis": { + "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", + "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" + }, + "gUni": { + "factory": "0x0000000000000000000000000000000000000000" + }, + "uniswapV2": { + "factory": "0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6", + "router": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" + }, + "uniswapV3": { + "factory": "0x33128a8fC17869897dcE68Ed026d694621f6FDfD" + } } }, "base-sepolia": { - "axis": { - "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", + "constants": { + "axis": { + "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", + "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" + }, + "gUni": { + "factory": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b" + }, + "uniswapV2": { + "factory": "0xFFa262a1FaDaEd0CE863792CE7A57cC329d7492e", + "router": "0xFA41988c6D1B095826Bea02dbcD124661305dAE7" + }, + "uniswapV3": { + "factory": "0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24" + } + }, + "deployments": { "BatchAuctionHouse": "0xBA00000D23A0793d5601d1e8E7B32aE88642cbEF", - "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", "BatchCatalogue": "0xcE56d3E3E145b44597B61E99c64cb82FB209Da04", - "BatchLinearVesting": "0x4042D4F2236D055212d485E028E8FE4939252F88", - "BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", - "BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", - "BatchUniswapV2DirectToLiquidity": "0xE6F478d800e9807efAb601a1CD60BBd7CBA1c0b8", - "BatchUniswapV3DirectToLiquidity": "0xE6BC347aA7Ce46bDb45F938605C5d4b88881bB1c", - "EncryptedMarginalPrice": "0xA7413717C633175Bc5B669E94625a4d3FE009870", - "FixedPriceBatch": "0xC818f1f000f9C24D014BCe2c5334e14B1360d9CD", - "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", - "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x04974BcFC715c148818724d9Caab3Fe8d0391b8b" - }, - "uniswapV2": { - "factory": "0xFFa262a1FaDaEd0CE863792CE7A57cC329d7492e", - "router": "0xFA41988c6D1B095826Bea02dbcD124661305dAE7" - }, - "uniswapV3": { - "factory": "0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24" + "auctionModules": { + "EncryptedMarginalPrice": "0xA7413717C633175Bc5B669E94625a4d3FE009870", + "FixedPriceBatch": "0xC818f1f000f9C24D014BCe2c5334e14B1360d9CD" + }, + "callbacks": { + "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", + "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", + "BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", + "BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", + "BatchUniswapV2DirectToLiquidity": "0xE6F478d800e9807efAb601a1CD60BBd7CBA1c0b8", + "BatchUniswapV3DirectToLiquidity": "0xE6BC347aA7Ce46bDb45F938605C5d4b88881bB1c" + }, + "derivativeModules": { + "BatchLinearVesting": "0x4042D4F2236D055212d485E028E8FE4939252F88" + } } }, "blast": { - "axis": { - "BatchAuctionHouse": "0x0000000000000000000000000000000000000000", - "BatchCatalogue": "0x0000000000000000000000000000000000000000", - "BatchLinearVesting": "0x0000000000000000000000000000000000000000", - "BatchUniswapV2DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "BatchUniswapV3DirectToLiquidity": "0x0000000000000000000000000000000000000000", - "EncryptedMarginalPrice": "0x0000000000000000000000000000000000000000", - "FixedPriceBatch": "0x0000000000000000000000000000000000000000", - "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", - "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "blast": { - "blast": "0x4300000000000000000000000000000000000002", - "usdb": "0x4300000000000000000000000000000000000003", - "weth": "0x4300000000000000000000000000000000000004" - }, - "gUni": { - "factory": "0x0000000000000000000000000000000000000000" - }, - "uniswapV2": { - "factory": "0x5C346464d33F90bABaf70dB6388507CC889C1070", - "router": "0xBB66Eb1c5e875933D44DAe661dbD80e5D9B03035" - }, - "uniswapV3": { - "factory": "0x792edAdE80af5fC680d96a2eD80A44247D2Cf6Fd" + "constants": { + "axis": { + "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", + "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" + }, + "blast": { + "blast": "0x4300000000000000000000000000000000000002", + "usdb": "0x4300000000000000000000000000000000000003", + "weth": "0x4300000000000000000000000000000000000004" + }, + "gUni": { + "factory": "0x0000000000000000000000000000000000000000" + }, + "uniswapV2": { + "factory": "0x5C346464d33F90bABaf70dB6388507CC889C1070", + "router": "0xBB66Eb1c5e875933D44DAe661dbD80e5D9B03035" + }, + "uniswapV3": { + "factory": "0x792edAdE80af5fC680d96a2eD80A44247D2Cf6Fd" + } } }, "blast-sepolia": { - "axis": { - "BatchAllocatedMerkleAllowlist": "0x9895D556E8d1be6C909EC88D43Dd0F6Ae6f7f4D7", + "constants": { + "axis": { + "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", + "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" + }, + "blast": { + "blast": "0x4300000000000000000000000000000000000002", + "usdb": "0x4200000000000000000000000000000000000022", + "weth": "0x4200000000000000000000000000000000000023" + }, + "gUni": { + "factory": "0xED28E5230E934cf9C843C08818D0639176040297" + }, + "uniswapV2": { + "factory": "0x8823062F9406f31cc52cc24A70a8415d982E245b", + "router": "0xF3711CaF818d6932da1e31aACF27167c989cD886" + }, + "uniswapV3": { + "factory": "0x84fF29e6321c9dd328B8B383b08dd2815b121243" + } + }, + "deployments": { "BatchAuctionHouse": "0xBA0000ac450437406583980336fE93AB2752999F", - "BatchCappedMerkleAllowlist": "0x98e72F243db7CDfDB015865415A0AE1bFb071507", "BatchCatalogue": "0xCCDF364E4a5D51437FF2885C86205Cfe2d90087a", - "BatchLinearVesting": "0xAd21cD6Cea90e46436002e79B12247eCe16110B3", - "BatchMerkleAllowlist": "0x9824De4B9A917D30a5427813E43e5DF968e19066", - "BatchTokenAllowlist": "0x986e7E24A33Ef6fbDc6C3a94657fBb59d85AbE1C", - "BatchUniswapV2DirectToLiquidity": "0xE6F7049c79AA674D1E7b709C3Dc42C614359956A", - "BatchUniswapV3DirectToLiquidity": "0xE6EDA80884CF4D44841fF33a3162A68EebBa2b7b", - "EncryptedMarginalPrice": "0x3ae8dD1ee2752883459C4c33c2f7Aeb8a56669f0", - "FixedPriceBatch": "0x9C5dF80078066a49E77537c4cc728a5e788e671F", - "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", - "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "blast": { - "blast": "0x4300000000000000000000000000000000000002", - "usdb": "0x4200000000000000000000000000000000000022", - "weth": "0x4200000000000000000000000000000000000023" - }, - "gUni": { - "factory": "0xED28E5230E934cf9C843C08818D0639176040297" - }, - "uniswapV2": { - "factory": "0x8823062F9406f31cc52cc24A70a8415d982E245b", - "router": "0xF3711CaF818d6932da1e31aACF27167c989cD886" - }, - "uniswapV3": { - "factory": "0x84fF29e6321c9dd328B8B383b08dd2815b121243" + "auctionModules": { + "EncryptedMarginalPrice": "0x3ae8dD1ee2752883459C4c33c2f7Aeb8a56669f0", + "FixedPriceBatch": "0x9C5dF80078066a49E77537c4cc728a5e788e671F" + }, + "callbacks": { + "BatchAllocatedMerkleAllowlist": "0x9895D556E8d1be6C909EC88D43Dd0F6Ae6f7f4D7", + "BatchCappedMerkleAllowlist": "0x98e72F243db7CDfDB015865415A0AE1bFb071507", + "BatchMerkleAllowlist": "0x9824De4B9A917D30a5427813E43e5DF968e19066", + "BatchTokenAllowlist": "0x986e7E24A33Ef6fbDc6C3a94657fBb59d85AbE1C", + "BatchUniswapV2DirectToLiquidity": "0xE6F7049c79AA674D1E7b709C3Dc42C614359956A", + "BatchUniswapV3DirectToLiquidity": "0xE6EDA80884CF4D44841fF33a3162A68EebBa2b7b" + }, + "derivativeModules": { + "BatchLinearVesting": "0xAd21cD6Cea90e46436002e79B12247eCe16110B3" + } } }, "mainnet": { - "axis": { - "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", - "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x0000000000000000000000000000000000000000" - }, - "uniswapV2": { - "factory": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", - "router": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" - }, - "uniswapV3": { - "factory": "0x1F98431c8aD98523631AE4a59f267346ea31F984" + "constants": { + "axis": { + "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", + "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" + }, + "gUni": { + "factory": "0x0000000000000000000000000000000000000000" + }, + "uniswapV2": { + "factory": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", + "router": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" + }, + "uniswapV3": { + "factory": "0x1F98431c8aD98523631AE4a59f267346ea31F984" + } } }, "mantle-sepolia": { - "axis": { - "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", + "constants": { + "axis": { + "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", + "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" + }, + "gUni": { + "factory": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706" + }, + "uniswapV2": { + "factory": "0x63Fb97Dd80060cFd70c87Aa54F594F3988B6Fc66", + "router": "0x884E32d3c9D60962EF1A005f3d5365a41CDE38b8" + }, + "uniswapV3": { + "factory": "0xE292cF4e316191CbFEbD74909356DF3cd9455e96" + } + }, + "deployments": { "BatchAuctionHouse": "0xBA00000D23A0793d5601d1e8E7B32aE88642cbEF", - "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", "BatchCatalogue": "0x6c80F20C5C0404a3D5349F71F9B25c0654884092", - "BatchLinearVesting": "0x16D5Aab9d35f8B3ac7BD086eEDcCe5343682D5F0", - "BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", - "BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", - "BatchUniswapV2DirectToLiquidity": "0xE6feE7a689Ff7493032Ba48B15fE841c6cC30DB9", - "BatchUniswapV3DirectToLiquidity": "0xE6c1ab82a2b4a194C87e643668bb715619766F0B", - "EncryptedMarginalPrice": "0xaC9957282BeA578f371078ddc4cD12A135B105d6", - "FixedPriceBatch": "0x8b7e483d96004ca7893EfB14E049f7648b62322b", - "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", - "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x08B87749b379f5BCA1d74A7B3d4e9f3DeD41C706" - }, - "uniswapV2": { - "factory": "0x63Fb97Dd80060cFd70c87Aa54F594F3988B6Fc66", - "router": "0x884E32d3c9D60962EF1A005f3d5365a41CDE38b8" - }, - "uniswapV3": { - "factory": "0xE292cF4e316191CbFEbD74909356DF3cd9455e96" + "auctionModules": { + "EncryptedMarginalPrice": "0xaC9957282BeA578f371078ddc4cD12A135B105d6", + "FixedPriceBatch": "0x8b7e483d96004ca7893EfB14E049f7648b62322b" + }, + "callbacks": { + "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", + "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", + "BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", + "BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", + "BatchUniswapV2DirectToLiquidity": "0xE6feE7a689Ff7493032Ba48B15fE841c6cC30DB9", + "BatchUniswapV3DirectToLiquidity": "0xE6c1ab82a2b4a194C87e643668bb715619766F0B" + }, + "derivativeModules": { + "BatchLinearVesting": "0x16D5Aab9d35f8B3ac7BD086eEDcCe5343682D5F0" + } } }, "mode-sepolia": { - "axis": { - "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", + "constants": { + "axis": { + "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", + "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" + }, + "gUni": { + "factory": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" + }, + "uniswapV2": { + "factory": "0xFFa262a1FaDaEd0CE863792CE7A57cC329d7492e", + "router": "0xFA41988c6D1B095826Bea02dbcD124661305dAE7" + }, + "uniswapV3": { + "factory": "0x0f88f3f5108eB3BD1A2D411E9a1fD41997811D88" + } + }, + "deployments": { "BatchAuctionHouse": "0xBA00000D23A0793d5601d1e8E7B32aE88642cbEF", - "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", "BatchCatalogue": "0x3fF930D77CD37eB7d4960F5D10ec415978f90aeA", - "BatchLinearVesting": "0xF170C78a493d9245d125e05bBEc35c98735f5277", - "BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", - "BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", - "BatchUniswapV2DirectToLiquidity": "0xE6F478d800e9807efAb601a1CD60BBd7CBA1c0b8", - "BatchUniswapV3DirectToLiquidity": "0xE6BB80a6B8628F150E340BdE2e0C49fA17E1e566", - "EncryptedMarginalPrice": "0x8b47F82a58d8AFBE5167feBf0D3F3Bb509aaf2bd", - "FixedPriceBatch": "0xFB1113E170CA6d95f3a91121BDD2370a822598E9", - "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", - "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x2dCC5a88A861FB73613153F82CF801cd09E72a5F" - }, - "uniswapV2": { - "factory": "0xFFa262a1FaDaEd0CE863792CE7A57cC329d7492e", - "router": "0xFA41988c6D1B095826Bea02dbcD124661305dAE7" - }, - "uniswapV3": { - "factory": "0x0f88f3f5108eB3BD1A2D411E9a1fD41997811D88" + "auctionModules": { + "EncryptedMarginalPrice": "0x8b47F82a58d8AFBE5167feBf0D3F3Bb509aaf2bd", + "FixedPriceBatch": "0xFB1113E170CA6d95f3a91121BDD2370a822598E9" + }, + "callbacks": { + "BatchAllocatedMerkleAllowlist": "0x987E2DB8E83c57Ad9aDf808e5394d77f72b49ab4", + "BatchCappedMerkleAllowlist": "0x98a27160E2879334AaE4415E24C1feaa3D111392", + "BatchMerkleAllowlist": "0x987e7515985887092582Cc4ea94be837a99C0b02", + "BatchTokenAllowlist": "0x989a21D82D86e4934D3B8E94043F13Fb1C312F8a", + "BatchUniswapV2DirectToLiquidity": "0xE6F478d800e9807efAb601a1CD60BBd7CBA1c0b8", + "BatchUniswapV3DirectToLiquidity": "0xE6BB80a6B8628F150E340BdE2e0C49fA17E1e566" + }, + "derivativeModules": { + "BatchLinearVesting": "0xF170C78a493d9245d125e05bBEc35c98735f5277" + } } }, "sepolia": { - "axis": { - "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", - "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", - "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" - }, - "gUni": { - "factory": "0x0000000000000000000000000000000000000000" - }, - "uniswapV2": { - "factory": "0xB7f907f7A9eBC822a80BD25E224be42Ce0A698A0", - "router": "0x425141165d3DE9FEC831896C016617a52363b687" - }, - "uniswapV3": { - "factory": "0x0227628f3F023bb0B980b67D528571c95c6DaC1c" + "constants": { + "axis": { + "OWNER": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e", + "PERMIT2": "0x000000000022D473030F116dDEE9F6B43aC78BA3", + "PROTOCOL": "0xB47C8e4bEb28af80eDe5E5bF474927b110Ef2c0e" + }, + "gUni": { + "factory": "0x0000000000000000000000000000000000000000" + }, + "uniswapV2": { + "factory": "0xB7f907f7A9eBC822a80BD25E224be42Ce0A698A0", + "router": "0x425141165d3DE9FEC831896C016617a52363b687" + }, + "uniswapV3": { + "factory": "0x0227628f3F023bb0B980b67D528571c95c6DaC1c" + } } } } diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol index 80eddd9d..2424fbed 100644 --- a/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol +++ b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol @@ -40,7 +40,7 @@ contract TestData is Script, WithEnvironment { ) public returns (uint96) { // Load addresses from .env _loadEnv(chain_); - auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("deployments.BatchAuctionHouse")); vm.startBroadcast(); @@ -110,14 +110,14 @@ contract TestData is Script, WithEnvironment { function cancelAuction(string calldata chain_, uint96 lotId_) public { _loadEnv(chain_); - auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("deployments.BatchAuctionHouse")); vm.broadcast(); auctionHouse.cancel(lotId_, bytes("")); } function placeBid(string calldata chain_, uint96 lotId_, uint256 amount_) public { _loadEnv(chain_); - auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("deployments.BatchAuctionHouse")); // Approve spending of the quote token { @@ -147,7 +147,7 @@ contract TestData is Script, WithEnvironment { function settleAuction(string calldata chain_, uint96 lotId_) public { _loadEnv(chain_); - auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("deployments.BatchAuctionHouse")); console2.log("Timestamp is", block.timestamp); diff --git a/script/ops/test/FixedPriceBatch/TestData.s.sol b/script/ops/test/FixedPriceBatch/TestData.s.sol index 70834a6c..5fdfea10 100644 --- a/script/ops/test/FixedPriceBatch/TestData.s.sol +++ b/script/ops/test/FixedPriceBatch/TestData.s.sol @@ -39,7 +39,7 @@ contract TestData is Script, WithEnvironment { ) public returns (uint96) { // Load addresses from .env _loadEnv(chain_); - auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("deployments.BatchAuctionHouse")); vm.startBroadcast(); @@ -98,7 +98,7 @@ contract TestData is Script, WithEnvironment { function cancelAuction(string calldata chain_, uint96 lotId_) public { _loadEnv(chain_); - auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("deployments.BatchAuctionHouse")); vm.broadcast(); auctionHouse.cancel(lotId_, bytes("")); } @@ -111,7 +111,7 @@ contract TestData is Script, WithEnvironment { uint256 allocatedAmount_ ) public { _loadEnv(chain_); - auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("deployments.BatchAuctionHouse")); // Approve spending of the quote token { @@ -144,7 +144,7 @@ contract TestData is Script, WithEnvironment { function settleAuction(string calldata chain_, uint96 lotId_) public { _loadEnv(chain_); - auctionHouse = BatchAuctionHouse(_envAddressNotZero("axis.BatchAuctionHouse")); + auctionHouse = BatchAuctionHouse(_envAddressNotZero("deployments.BatchAuctionHouse")); console2.log("Timestamp is", block.timestamp); diff --git a/script/salts/allowlist/AllowlistSalts.s.sol b/script/salts/allowlist/AllowlistSalts.s.sol index 5534ddf6..2826dc0e 100644 --- a/script/salts/allowlist/AllowlistSalts.s.sol +++ b/script/salts/allowlist/AllowlistSalts.s.sol @@ -23,9 +23,9 @@ contract AllowlistSalts is Script, WithEnvironment, WithSalts { _createBytecodeDirectory(); // Cache auction houses - _envAtomicAuctionHouse = _envAddress("axis.AtomicAuctionHouse"); + _envAtomicAuctionHouse = _envAddress("deployments.AtomicAuctionHouse"); console2.log("AtomicAuctionHouse:", _envAtomicAuctionHouse); - _envBatchAuctionHouse = _envAddress("axis.BatchAuctionHouse"); + _envBatchAuctionHouse = _envAddress("deployments.BatchAuctionHouse"); console2.log("BatchAuctionHouse:", _envBatchAuctionHouse); } diff --git a/script/salts/auctionHouse/AuctionHouseSalts.s.sol b/script/salts/auctionHouse/AuctionHouseSalts.s.sol index db134a4b..814e258f 100644 --- a/script/salts/auctionHouse/AuctionHouseSalts.s.sol +++ b/script/salts/auctionHouse/AuctionHouseSalts.s.sol @@ -19,11 +19,11 @@ contract AuctionHouseSalts is Script, WithEnvironment, WithSalts { _createBytecodeDirectory(); // Cache required variables - _envOwner = _envAddressNotZero("axis.OWNER"); + _envOwner = _envAddressNotZero("constants.axis.OWNER"); console2.log("Owner:", _envOwner); - _envPermit2 = _envAddressNotZero("axis.PERMIT2"); + _envPermit2 = _envAddressNotZero("constants.axis.PERMIT2"); console2.log("Permit2:", _envPermit2); - _envProtocol = _envAddressNotZero("axis.PROTOCOL"); + _envProtocol = _envAddressNotZero("constants.axis.PROTOCOL"); console2.log("Protocol:", _envProtocol); } diff --git a/script/salts/auctionHouse/AuctionHouseSaltsBlast.s.sol b/script/salts/auctionHouse/AuctionHouseSaltsBlast.s.sol index e7fdbd31..db5aabd7 100644 --- a/script/salts/auctionHouse/AuctionHouseSaltsBlast.s.sol +++ b/script/salts/auctionHouse/AuctionHouseSaltsBlast.s.sol @@ -21,17 +21,17 @@ contract AuctionHouseSaltsBlast is Script, WithEnvironment, WithSalts { _loadEnv(chain_); // Cache required variables - _envOwner = _envAddressNotZero("axis.OWNER"); + _envOwner = _envAddressNotZero("constants.axis.OWNER"); console2.log("Owner:", _envOwner); - _envPermit2 = _envAddressNotZero("axis.PERMIT2"); + _envPermit2 = _envAddressNotZero("constants.axis.PERMIT2"); console2.log("Permit2:", _envPermit2); - _envProtocol = _envAddressNotZero("axis.PROTOCOL"); + _envProtocol = _envAddressNotZero("constants.axis.PROTOCOL"); console2.log("Protocol:", _envProtocol); - _envBlast = _envAddressNotZero("blast.blast"); + _envBlast = _envAddressNotZero("constants.blast.blast"); console2.log("Blast:", _envBlast); - _envWeth = _envAddressNotZero("blast.weth"); + _envWeth = _envAddressNotZero("constants.blast.weth"); console2.log("WETH:", _envWeth); - _envUsdb = _envAddressNotZero("blast.usdb"); + _envUsdb = _envAddressNotZero("constants.blast.usdb"); console2.log("USDB:", _envUsdb); } diff --git a/script/salts/dtl-uniswap/UniswapDTLSalts.s.sol b/script/salts/dtl-uniswap/UniswapDTLSalts.s.sol index 5d926cf3..0121229d 100644 --- a/script/salts/dtl-uniswap/UniswapDTLSalts.s.sol +++ b/script/salts/dtl-uniswap/UniswapDTLSalts.s.sol @@ -25,19 +25,19 @@ contract UniswapDTLSalts is Script, WithEnvironment, WithSalts { _createBytecodeDirectory(); // Cache Uniswap factories - _envUniswapV2Factory = _envAddressNotZero("uniswapV2.factory"); + _envUniswapV2Factory = _envAddressNotZero("constants.uniswapV2.factory"); console2.log("UniswapV2Factory:", _envUniswapV2Factory); - _envUniswapV2Router = _envAddressNotZero("uniswapV2.router"); + _envUniswapV2Router = _envAddressNotZero("constants.uniswapV2.router"); console2.log("UniswapV2Router:", _envUniswapV2Router); - _envUniswapV3Factory = _envAddressNotZero("uniswapV3.factory"); + _envUniswapV3Factory = _envAddressNotZero("constants.uniswapV3.factory"); console2.log("UniswapV3Factory:", _envUniswapV3Factory); - _envGUniFactory = _envAddressNotZero("gUni.factory"); + _envGUniFactory = _envAddressNotZero("constants.gUni.factory"); console2.log("GUniFactory:", _envGUniFactory); // Cache auction houses - _envAtomicAuctionHouse = _envAddress("axis.AtomicAuctionHouse"); + _envAtomicAuctionHouse = _envAddress("deployments.AtomicAuctionHouse"); console2.log("AtomicAuctionHouse:", _envAtomicAuctionHouse); - _envBatchAuctionHouse = _envAddress("axis.BatchAuctionHouse"); + _envBatchAuctionHouse = _envAddress("deployments.BatchAuctionHouse"); console2.log("BatchAuctionHouse:", _envBatchAuctionHouse); } From 1aa1b0f104ac8ed10f73186fc18878cd0782f71e Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 11 Jul 2024 13:16:20 +0400 Subject: [PATCH 79/82] Amend salt scripts to work without AtomicAuctionHouse deployment --- script/salts/allowlist/AllowlistSalts.s.sol | 19 ++++----- script/salts/allowlist/allowlist_salts.sh | 41 ++++++++++++++----- .../salts/dtl-uniswap/UniswapDTLSalts.s.sol | 21 ++++++---- 3 files changed, 51 insertions(+), 30 deletions(-) diff --git a/script/salts/allowlist/AllowlistSalts.s.sol b/script/salts/allowlist/AllowlistSalts.s.sol index 2826dc0e..f10dc13a 100644 --- a/script/salts/allowlist/AllowlistSalts.s.sol +++ b/script/salts/allowlist/AllowlistSalts.s.sol @@ -15,24 +15,23 @@ import {Callbacks} from "src/lib/Callbacks.sol"; contract AllowlistSalts is Script, WithEnvironment, WithSalts { string internal constant _ADDRESS_PREFIX = "98"; - address internal _envAtomicAuctionHouse; - address internal _envBatchAuctionHouse; - function _setUp(string calldata chain_) internal { _loadEnv(chain_); _createBytecodeDirectory(); - - // Cache auction houses - _envAtomicAuctionHouse = _envAddress("deployments.AtomicAuctionHouse"); - console2.log("AtomicAuctionHouse:", _envAtomicAuctionHouse); - _envBatchAuctionHouse = _envAddress("deployments.BatchAuctionHouse"); - console2.log("BatchAuctionHouse:", _envBatchAuctionHouse); } function generate(string calldata chain_, bool atomic_) public { _setUp(chain_); - address auctionHouse = atomic_ ? _envAtomicAuctionHouse : _envBatchAuctionHouse; + 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"; diff --git a/script/salts/allowlist/allowlist_salts.sh b/script/salts/allowlist/allowlist_salts.sh index 7262aad1..d2dfbe0c 100755 --- a/script/salts/allowlist/allowlist_salts.sh +++ b/script/salts/allowlist/allowlist_salts.sh @@ -1,31 +1,50 @@ #!/bin/bash # Usage: -# ./allowlist_salts.sh +# ./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. -# Load environment variables, but respect overrides -curenv=$(declare -p -x) -source .env -eval "$curenv" +# Iterate through named arguments +# Source: https://unix.stackexchange.com/a/388038 +while [ $# -gt 0 ]; do + if [[ $1 == *"--"* ]]; then + v="${1/--/}" + declare $v="$2" + fi -# Get command-line arguments -MODE=$1 + 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 [ "$MODE" != "atomic" ] && [ "$MODE" != "batch" ] +if [ "$type" != "atomic" ] && [ "$type" != "batch" ] then - echo "Invalid mode specified. Provide 'atomic' or 'batch' after the command as argument 2." + echo "Invalid type specified. Provide 'atomic' or 'batch' after the --type flag." exit 1 fi # Set flag for atomic or batch auction -ATOMIC=$( if [ "$MODE" == "atomic" ]; then echo "true"; else echo "false"; fi ) +ATOMIC=$( if [ "$type" == "atomic" ]; then echo "true"; else echo "false"; fi ) echo "Using RPC at URL: $RPC_URL" echo "Using chain: $CHAIN" -echo "Using variant: $MODE" +echo "Using type: $type" forge script ./script/salts/allowlist/AllowListSalts.s.sol:AllowlistSalts --sig "generate(string,bool)()" $CHAIN $ATOMIC diff --git a/script/salts/dtl-uniswap/UniswapDTLSalts.s.sol b/script/salts/dtl-uniswap/UniswapDTLSalts.s.sol index 0121229d..1eec7b8d 100644 --- a/script/salts/dtl-uniswap/UniswapDTLSalts.s.sol +++ b/script/salts/dtl-uniswap/UniswapDTLSalts.s.sol @@ -17,9 +17,6 @@ contract UniswapDTLSalts is Script, WithEnvironment, WithSalts { address internal _envUniswapV3Factory; address internal _envGUniFactory; - address internal _envAtomicAuctionHouse; - address internal _envBatchAuctionHouse; - function _setUp(string calldata chain_) internal { _loadEnv(chain_); _createBytecodeDirectory(); @@ -33,12 +30,6 @@ contract UniswapDTLSalts is Script, WithEnvironment, WithSalts { console2.log("UniswapV3Factory:", _envUniswapV3Factory); _envGUniFactory = _envAddressNotZero("constants.gUni.factory"); console2.log("GUniFactory:", _envGUniFactory); - - // Cache auction houses - _envAtomicAuctionHouse = _envAddress("deployments.AtomicAuctionHouse"); - console2.log("AtomicAuctionHouse:", _envAtomicAuctionHouse); - _envBatchAuctionHouse = _envAddress("deployments.BatchAuctionHouse"); - console2.log("BatchAuctionHouse:", _envBatchAuctionHouse); } function generate( @@ -60,6 +51,9 @@ contract UniswapDTLSalts is Script, WithEnvironment, WithSalts { 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( @@ -69,6 +63,9 @@ contract UniswapDTLSalts is Script, WithEnvironment, WithSalts { ); _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( @@ -82,6 +79,9 @@ contract UniswapDTLSalts is Script, WithEnvironment, WithSalts { 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( @@ -91,6 +91,9 @@ contract UniswapDTLSalts is Script, WithEnvironment, WithSalts { ); _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( From beebd549474c339980df16ebb3214fb0a2ac2a21 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 11 Jul 2024 13:35:13 +0400 Subject: [PATCH 80/82] Fix compiler error --- script/deploy/DeployBlast.s.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/deploy/DeployBlast.s.sol b/script/deploy/DeployBlast.s.sol index 25d6a697..6d01d428 100644 --- a/script/deploy/DeployBlast.s.sol +++ b/script/deploy/DeployBlast.s.sol @@ -123,7 +123,7 @@ contract DeployBlast is Deploy { } console2.log(" BlastEMP deployed at:", address(amEmp)); - return (address(amEmp), _PREFIX_AXIS); + return (address(amEmp), _PREFIX_AUCTION_MODULES); } function deployFixedPriceSale(bytes memory) public override returns (address, string memory) { @@ -151,7 +151,7 @@ contract DeployBlast is Deploy { } console2.log(" BlastFPS deployed at:", address(amFps)); - return (address(amFps), _PREFIX_AXIS); + return (address(amFps), _PREFIX_AUCTION_MODULES); } function deployFixedPriceBatch(bytes memory) public override returns (address, string memory) { @@ -179,7 +179,7 @@ contract DeployBlast is Deploy { } console2.log(" BlastFPB deployed at:", address(amFpb)); - return (address(amFpb), _PREFIX_AXIS); + return (address(amFpb), _PREFIX_AUCTION_MODULES); } function deployAtomicLinearVesting(bytes memory) @@ -214,7 +214,7 @@ contract DeployBlast is Deploy { } console2.log(" LinearVesting (Atomic) deployed at:", address(dmAtomicLinearVesting)); - return (address(dmAtomicLinearVesting), _PREFIX_AXIS); + return (address(dmAtomicLinearVesting), _PREFIX_DERIVATIVE_MODULES); } function deployBatchLinearVesting(bytes memory) @@ -249,6 +249,6 @@ contract DeployBlast is Deploy { } console2.log(" LinearVesting (Batch) deployed at:", address(dmBatchLinearVesting)); - return (address(dmBatchLinearVesting), _PREFIX_AXIS); + return (address(dmBatchLinearVesting), _PREFIX_DERIVATIVE_MODULES); } } From 16985e49e5e73aec05ab3e6d12b3d6226aee45b2 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 11 Jul 2024 13:35:20 +0400 Subject: [PATCH 81/82] chore: linting --- script/salts/allowlist/AllowlistSalts.s.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/script/salts/allowlist/AllowlistSalts.s.sol b/script/salts/allowlist/AllowlistSalts.s.sol index f10dc13a..c7a72848 100644 --- a/script/salts/allowlist/AllowlistSalts.s.sol +++ b/script/salts/allowlist/AllowlistSalts.s.sol @@ -27,8 +27,7 @@ contract AllowlistSalts is Script, WithEnvironment, WithSalts { if (atomic_) { auctionHouse = _envAddress("deployments.AtomicAuctionHouse"); console2.log("AtomicAuctionHouse:", auctionHouse); - } - else { + } else { auctionHouse = _envAddress("deployments.BatchAuctionHouse"); console2.log("BatchAuctionHouse:", auctionHouse); } From 497979bb04a45b03ebc6190bb3dc01a0aa1fa98b Mon Sep 17 00:00:00 2001 From: Oighty Date: Thu, 11 Jul 2024 11:35:35 -0400 Subject: [PATCH 82/82] script: add option to set max fees on auction module deployment --- script/deploy/Deploy.s.sol | 73 +++++++++++++++++++++++++++-- script/deploy/sequences/origin.json | 8 +++- 2 files changed, 75 insertions(+), 6 deletions(-) diff --git a/script/deploy/Deploy.s.sol b/script/deploy/Deploy.s.sol index c508110e..e9ecc83c 100644 --- a/script/deploy/Deploy.s.sol +++ b/script/deploy/Deploy.s.sol @@ -12,8 +12,9 @@ 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} from "src/modules/Modules.sol"; +import {Module, Keycode, keycodeFromVeecode} from "src/modules/Modules.sol"; import {Callbacks} from "src/lib/Callbacks.sol"; +import {IFeeManager} from "src/interfaces/IFeeManager.sol"; // Auction modules import {EncryptedMarginalPrice} from "src/modules/auctions/batch/EMP.sol"; @@ -51,6 +52,7 @@ contract Deploy is Script, WithEnvironment, WithSalts { mapping(string => bytes) public argsMap; mapping(string => bool) public installAtomicAuctionHouseMap; mapping(string => bool) public installBatchAuctionHouseMap; + mapping(string => uint48[2]) public maxFeesMap; // [maxReferrerFee, maxCuratorFee] string[] public deployments; string[] public deployedToKeys; @@ -149,9 +151,11 @@ contract Deploy is Script, WithEnvironment, WithSalts { deployedToKeys.push(deployedToKey); deployedTo[deployedToKey] = deploymentAddress; - // If required, install in the AtomicAuctionHouse + // If required, install in the AtomicAuctionHouse and initialize max fees // For this to work, the deployer address must be the same as the owner of the AuctionHouse (`_envOwner`) if (installAtomicAuctionHouseMap[name]) { + Module module = Module(deploymentAddress); + console2.log(""); AtomicAuctionHouse atomicAuctionHouse = AtomicAuctionHouse(_getAddressNotZero("deployments.AtomicAuctionHouse")); @@ -159,12 +163,36 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log(" Installing in AtomicAuctionHouse"); vm.broadcast(); - atomicAuctionHouse.installModule(Module(deploymentAddress)); + atomicAuctionHouse.installModule(module); + + // Check if module is an auction module, if so, set max fees if required + if (module.TYPE() == Module.Type.Auction) { + // Get keycode + Keycode keycode = keycodeFromVeecode(module.VEECODE()); + + // If required, set max fees + uint48[2] memory maxFees = maxFeesMap[name]; + if (maxFees[0] != 0 || maxFees[1] != 0) { + console2.log(""); + console2.log(" Setting max fees"); + vm.broadcast(); + atomicAuctionHouse.setFee( + keycode, IFeeManager.FeeType.MaxReferrer, maxFees[0] + ); + + vm.broadcast(); + atomicAuctionHouse.setFee( + keycode, IFeeManager.FeeType.MaxCurator, maxFees[1] + ); + } + } } // If required, install in the BatchAuctionHouse // For this to work, the deployer address must be the same as the owner of the AuctionHouse (`_envOwner`) if (installBatchAuctionHouseMap[name]) { + Module module = Module(deploymentAddress); + console2.log(""); BatchAuctionHouse batchAuctionHouse = BatchAuctionHouse(_getAddressNotZero("deployments.BatchAuctionHouse")); @@ -172,7 +200,29 @@ contract Deploy is Script, WithEnvironment, WithSalts { console2.log(""); console2.log(" Installing in BatchAuctionHouse"); vm.broadcast(); - batchAuctionHouse.installModule(Module(deploymentAddress)); + batchAuctionHouse.installModule(module); + + // Check if module is an auction module, if so, set max fees if required + if (module.TYPE() == Module.Type.Auction) { + // Get keycode + Keycode keycode = keycodeFromVeecode(module.VEECODE()); + + // If required, set max fees + uint48[2] memory maxFees = maxFeesMap[name]; + if (maxFees[0] != 0 || maxFees[1] != 0) { + console2.log(""); + console2.log(" Setting max fees"); + vm.broadcast(); + batchAuctionHouse.setFee( + keycode, IFeeManager.FeeType.MaxReferrer, maxFees[0] + ); + + vm.broadcast(); + batchAuctionHouse.setFee( + keycode, IFeeManager.FeeType.MaxCurator, maxFees[1] + ); + } + } } } @@ -1048,6 +1098,21 @@ contract Deploy is Script, WithEnvironment, WithSalts { if (_readDataBoolean(data_, name_, "installBatchAuctionHouse")) { installBatchAuctionHouseMap[name_] = true; } + + // Check if max fees need to be initialized + uint48[2] memory maxFees; + bytes memory maxReferrerFee = _readDataValue(data_, name_, "maxReferrerFee"); + bytes memory maxCuratorFee = _readDataValue(data_, name_, "maxCuratorFee"); + maxFees[0] = maxReferrerFee.length > 0 + ? abi.decode(_readDataValue(data_, name_, "maxReferrerFee"), (uint48)) + : 0; + maxFees[1] = maxCuratorFee.length > 0 + ? abi.decode(_readDataValue(data_, name_, "maxCuratorFee"), (uint48)) + : 0; + + if (maxFees[0] != 0 || maxFees[1] != 0) { + maxFeesMap[name_] = maxFees; + } } /// @notice Get an address for a given key diff --git a/script/deploy/sequences/origin.json b/script/deploy/sequences/origin.json index 6ed808b7..58c7c894 100644 --- a/script/deploy/sequences/origin.json +++ b/script/deploy/sequences/origin.json @@ -8,11 +8,15 @@ }, { "name": "EncryptedMarginalPrice", - "installBatchAuctionHouse": true + "installBatchAuctionHouse": true, + "maxReferrerFee": 1000, + "maxCuratorFee": 1000 }, { "name": "FixedPriceBatch", - "installBatchAuctionHouse": true + "installBatchAuctionHouse": true, + "maxReferrerFee": 1000, + "maxCuratorFee": 1000 }, { "name": "BatchLinearVesting",