diff --git a/.env b/.env index 4907c8a2..670bf7a4 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ -VITE_INFO_GRAPH=https://api.thegraph.com/subgraphs/name/iliaazhel/integral-core +VITE_INFO_GRAPH=https://api.studio.thegraph.com/query/50593/holesky-analytics/version/latest VITE_LIMIT_ORDERS_GRAPH=https://api.thegraph.com/subgraphs/name/iliaazhel/integral-limit-order VITE_BLOCKS_GRAPH=https://api.thegraph.com/subgraphs/name/iliaazhel/goerli-blocks -VITE_FARMING_GRAPH=https://api.thegraph.com/subgraphs/name/iliaazhel/farming-test -VITE_INFURA_RPC=https://ethereum-holesky-rpc.publicnode.com +VITE_FARMING_GRAPH=https://api.studio.thegraph.com/query/50593/holesky-farming/version/latest +VITE_INFURA_RPC=https://holesky.drpc.org VITE_WALLETCONNECT_PROJECT_ID=79c313a96c99edbc26d06cd97bff1126 \ No newline at end of file diff --git a/codegen.ts b/codegen.ts index a6ff6e8d..5d3a07f4 100644 --- a/codegen.ts +++ b/codegen.ts @@ -1,20 +1,16 @@ -import type { CodegenConfig } from '@graphql-codegen/cli'; +import type { CodegenConfig } from "@graphql-codegen/cli"; const config: CodegenConfig = { overwrite: true, schema: [ - 'https://api.thegraph.com/subgraphs/name/iliaazhel/integral-core', - 'https://api.thegraph.com/subgraphs/name/iliaazhel/goerli-blocks', - 'https://api.thegraph.com/subgraphs/name/iliaazhel/farming-test', + "https://api.studio.thegraph.com/query/50593/holesky-analytics/version/latest", + "https://api.studio.thegraph.com/query/50593/holesky-farming/version/latest", + "https://api.thegraph.com/subgraphs/name/iliaazhel/goerli-blocks", ], - documents: 'src/graphql/queries/!(*.d).{ts,tsx}', + documents: "src/graphql/queries/!(*.d).{ts,tsx}", generates: { - 'src/graphql/generated/graphql.tsx': { - plugins: [ - 'typescript', - 'typescript-operations', - 'typescript-react-apollo', - ], + "src/graphql/generated/graphql.tsx": { + plugins: ["typescript", "typescript-operations", "typescript-react-apollo"], config: { withHooks: true, withResultType: true, diff --git a/package.json b/package.json index 482aa8b7..066303eb 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@apollo/client": "^3.8.4", - "@cryptoalgebra/integral-sdk": "^0.11.22", + "@cryptoalgebra/integral-sdk": "0.12.6-dev", "@radix-ui/react-avatar": "^1.0.4", "@radix-ui/react-dialog": "^1.0.5", "@radix-ui/react-hover-card": "^1.0.7", diff --git a/src/abis/algebraVirtualPool.ts b/src/abis/algebraVirtualPool.ts new file mode 100644 index 00000000..eb9eba75 --- /dev/null +++ b/src/abis/algebraVirtualPool.ts @@ -0,0 +1,542 @@ +export const algebraVirtualPoolABI = [ + { + inputs: [ + { + internalType: "address", + name: "_farmingAddress", + type: "address", + }, + { + internalType: "address", + name: "_plugin", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "invalidFeeWeights", + type: "error", + }, + { + inputs: [], + name: "invalidNewMaxRate", + type: "error", + }, + { + inputs: [], + name: "invalidNewMinRate", + type: "error", + }, + { + inputs: [], + name: "liquidityAdd", + type: "error", + }, + { + inputs: [], + name: "liquidityOverflow", + type: "error", + }, + { + inputs: [], + name: "liquiditySub", + type: "error", + }, + { + inputs: [], + name: "onlyFarming", + type: "error", + }, + { + inputs: [], + name: "onlyPlugin", + type: "error", + }, + { + inputs: [], + name: "tickInvalidLinks", + type: "error", + }, + { + inputs: [], + name: "tickIsNotInitialized", + type: "error", + }, + { + inputs: [], + name: "FEE_WEIGHT_DENOMINATOR", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "RATE_CHANGE_FREQUENCY", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "token0Amount", + type: "uint128", + }, + { + internalType: "uint128", + name: "token1Amount", + type: "uint128", + }, + ], + name: "addRewards", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "int24", + name: "bottomTick", + type: "int24", + }, + { + internalType: "int24", + name: "topTick", + type: "int24", + }, + { + internalType: "int128", + name: "liquidityDelta", + type: "int128", + }, + { + internalType: "int24", + name: "currentTick", + type: "int24", + }, + ], + name: "applyLiquidityDeltaToPosition", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "int24", + name: "targetTick", + type: "int24", + }, + { + internalType: "bool", + name: "zeroToOne", + type: "bool", + }, + { + internalType: "uint128", + name: "feeAmount", + type: "uint128", + }, + ], + name: "crossTo", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "currentLiquidity", + outputs: [ + { + internalType: "uint128", + name: "", + type: "uint128", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "deactivate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "deactivated", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "token0Amount", + type: "uint128", + }, + { + internalType: "uint128", + name: "token1Amount", + type: "uint128", + }, + ], + name: "decreaseRewards", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "distributeRewards", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dynamicRateActivated", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "farmingAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "feeWeights", + outputs: [ + { + internalType: "uint16", + name: "weight0", + type: "uint16", + }, + { + internalType: "uint16", + name: "weight1", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "int24", + name: "bottomTick", + type: "int24", + }, + { + internalType: "int24", + name: "topTick", + type: "int24", + }, + ], + name: "getInnerRewardsGrowth", + outputs: [ + { + internalType: "uint256", + name: "rewardGrowthInside0", + type: "uint256", + }, + { + internalType: "uint256", + name: "rewardGrowthInside1", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "globalTick", + outputs: [ + { + internalType: "int24", + name: "", + type: "int24", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "plugin", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "prevTimestamp", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rateLimits", + outputs: [ + { + internalType: "uint128", + name: "maxRewardRate0", + type: "uint128", + }, + { + internalType: "uint128", + name: "maxRewardRate1", + type: "uint128", + }, + { + internalType: "uint128", + name: "minRewardRate0", + type: "uint128", + }, + { + internalType: "uint128", + name: "minRewardRate1", + type: "uint128", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewardRates", + outputs: [ + { + internalType: "uint128", + name: "rate0", + type: "uint128", + }, + { + internalType: "uint128", + name: "rate1", + type: "uint128", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewardReserves", + outputs: [ + { + internalType: "uint128", + name: "reserve0", + type: "uint128", + }, + { + internalType: "uint128", + name: "reserve1", + type: "uint128", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "_maxRate0", + type: "uint128", + }, + { + internalType: "uint128", + name: "_maxRate1", + type: "uint128", + }, + { + internalType: "uint128", + name: "_minRate0", + type: "uint128", + }, + { + internalType: "uint128", + name: "_minRate1", + type: "uint128", + }, + ], + name: "setDynamicRateLimits", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "rate0", + type: "uint128", + }, + { + internalType: "uint128", + name: "rate1", + type: "uint128", + }, + ], + name: "setRates", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint16", + name: "weight0", + type: "uint16", + }, + { + internalType: "uint16", + name: "weight1", + type: "uint16", + }, + ], + name: "setWeights", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bool", + name: "isActive", + type: "bool", + }, + ], + name: "switchDynamicRate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "int24", + name: "tickId", + type: "int24", + }, + ], + name: "ticks", + outputs: [ + { + internalType: "uint256", + name: "liquidityTotal", + type: "uint256", + }, + { + internalType: "int128", + name: "liquidityDelta", + type: "int128", + }, + { + internalType: "int24", + name: "prevTick", + type: "int24", + }, + { + internalType: "int24", + name: "nextTick", + type: "int24", + }, + { + internalType: "uint256", + name: "outerFeeGrowth0Token", + type: "uint256", + }, + { + internalType: "uint256", + name: "outerFeeGrowth1Token", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalRewardGrowth", + outputs: [ + { + internalType: "uint256", + name: "rewardGrowth0", + type: "uint256", + }, + { + internalType: "uint256", + name: "rewardGrowth1", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; diff --git a/src/abis/farming/algebraEternalFarming.ts b/src/abis/farming/algebraEternalFarming.ts index 254a855c..2f644204 100644 --- a/src/abis/farming/algebraEternalFarming.ts +++ b/src/abis/farming/algebraEternalFarming.ts @@ -1,1141 +1,1348 @@ export const algebraEternalFarmingABI = [ - { - inputs: [ - { - internalType: 'contract IAlgebraPoolDeployer', - name: '_deployer', - type: 'address', - }, - { - internalType: 'contract INonfungiblePositionManager', - name: '_nonfungiblePositionManager', - type: 'address', - }, + { + "inputs": [ + { + "internalType": "contract IAlgebraPoolDeployer", + "name": "_deployer", + "type": "address" + }, + { + "internalType": "contract INonfungiblePositionManager", + "name": "_nonfungiblePositionManager", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "anotherFarmingIsActive", + "type": "error" + }, + { + "inputs": [], + "name": "claimToZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "emergencyActivated", + "type": "error" + }, + { + "inputs": [], + "name": "farmDoesNotExist", + "type": "error" + }, + { + "inputs": [], + "name": "incentiveNotExist", + "type": "error" + }, + { + "inputs": [], + "name": "incentiveStopped", + "type": "error" + }, + { + "inputs": [], + "name": "invalidPool", + "type": "error" + }, + { + "inputs": [], + "name": "invalidTokenAmount", + "type": "error" + }, + { + "inputs": [], + "name": "minimalPositionWidthTooWide", + "type": "error" + }, + { + "inputs": [], + "name": "pluginNotConnected", + "type": "error" + }, + { + "inputs": [], + "name": "poolReentrancyLock", + "type": "error" + }, + { + "inputs": [], + "name": "positionIsTooNarrow", + "type": "error" + }, + { + "inputs": [], + "name": "reentrancyLock", + "type": "error" + }, + { + "inputs": [], + "name": "tokenAlreadyFarmed", + "type": "error" + }, + { + "inputs": [], + "name": "zeroLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "zeroRewardAmount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "newStatus", + "type": "bool" + } + ], + "name": "EmergencyWithdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20Minimal", + "name": "bonusRewardToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IAlgebraPool", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "virtualPool", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bonusReward", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint24", + "name": "minimalAllowedPositionWidth", + "type": "uint24" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "weight0", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "weight1", + "type": "uint16" + } + ], + "name": "EternalFarmingCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "incentiveId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "rewardAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "bonusRewardToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bonusReward", + "type": "uint256" + } + ], + "name": "FarmEnded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "incentiveId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "liquidity", + "type": "uint128" + } + ], + "name": "FarmEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "farmingCenter", + "type": "address" + } + ], + "name": "FarmingCenter", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "weight0", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "weight1", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "incentiveId", + "type": "bytes32" + } + ], + "name": "FeesWeightsChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "incentiveId", + "type": "bytes32" + } + ], + "name": "IncentiveDeactivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "rewardAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bonusRewardAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "incentiveId", + "type": "bytes32" + } + ], + "name": "RewardAmountsDecreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "rewardAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "RewardClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "rewardAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bonusRewardAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "incentiveId", + "type": "bytes32" + } + ], + "name": "RewardsAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "incentiveId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bonusRewardAmount", + "type": "uint256" + } + ], + "name": "RewardsCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "rewardRate", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "bonusRewardRate", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "incentiveId", + "type": "bytes32" + } + ], + "name": "RewardsRatesChanged", + "type": "event" + }, + { + "inputs": [], + "name": "FARMINGS_ADMINISTRATOR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INCENTIVE_MAKER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "contract IERC20Minimal", + "name": "bonusRewardToken", + "type": "address" + }, + { + "internalType": "contract IAlgebraPool", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - inputs: [], - name: 'anotherFarmingIsActive', - type: 'error', - }, - { - inputs: [], - name: 'claimToZeroAddress', - type: 'error', - }, - { - inputs: [], - name: 'emergencyActivated', - type: 'error', - }, - { - inputs: [], - name: 'farmDoesNotExist', - type: 'error', - }, - { - inputs: [], - name: 'incentiveNotExist', - type: 'error', - }, - { - inputs: [], - name: 'incentiveStopped', - type: 'error', - }, - { - inputs: [], - name: 'invalidPool', - type: 'error', - }, - { - inputs: [], - name: 'invalidTokenAmount', - type: 'error', - }, - { - inputs: [], - name: 'minimalPositionWidthTooWide', - type: 'error', - }, - { - inputs: [], - name: 'pluginNotConnected', - type: 'error', - }, - { - inputs: [], - name: 'poolReentrancyLock', - type: 'error', - }, - { - inputs: [], - name: 'positionIsTooNarrow', - type: 'error', - }, - { - inputs: [], - name: 'reentrancyLock', - type: 'error', - }, - { - inputs: [], - name: 'tokenAlreadyFarmed', - type: 'error', - }, - { - inputs: [], - name: 'zeroLiquidity', - type: 'error', - }, - { - inputs: [], - name: 'zeroRewardAmount', - type: 'error', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bool', - name: 'newStatus', - type: 'bool', - }, + "internalType": "struct IncentiveKey", + "name": "key", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "rewardAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "bonusRewardAmount", + "type": "uint128" + } + ], + "name": "addRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountRequested", + "type": "uint256" + } + ], + "name": "claimReward", + "outputs": [ + { + "internalType": "uint256", + "name": "reward", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountRequested", + "type": "uint256" + } + ], + "name": "claimRewardFrom", + "outputs": [ + { + "internalType": "uint256", + "name": "reward", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "contract IERC20Minimal", + "name": "bonusRewardToken", + "type": "address" + }, + { + "internalType": "contract IAlgebraPool", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } ], - name: 'EmergencyWithdraw', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'contract IERC20Minimal', - name: 'rewardToken', - type: 'address', - }, - { - indexed: true, - internalType: 'contract IERC20Minimal', - name: 'bonusRewardToken', - type: 'address', - }, - { - indexed: true, - internalType: 'contract IAlgebraPool', - name: 'pool', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'virtualPool', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'nonce', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'bonusReward', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint24', - name: 'minimalAllowedPositionWidth', - type: 'uint24', - }, + "internalType": "struct IncentiveKey", + "name": "key", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "collectRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bonusReward", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "contract IERC20Minimal", + "name": "bonusRewardToken", + "type": "address" + }, + { + "internalType": "contract IAlgebraPool", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } ], - name: 'EternalFarmingCreated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'incentiveId', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'rewardAddress', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'bonusRewardToken', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'bonusReward', - type: 'uint256', - }, + "internalType": "struct IncentiveKey", + "name": "key", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint128", + "name": "reward", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "bonusReward", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "rewardRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "bonusRewardRate", + "type": "uint128" + }, + { + "internalType": "uint24", + "name": "minimalPositionWidth", + "type": "uint24" + }, + { + "internalType": "uint16", + "name": "weight0", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "weight1", + "type": "uint16" + }, + { + "internalType": "uint128", + "name": "maxRate0", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "maxRate1", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "minRate0", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "minRate1", + "type": "uint128" + } ], - name: 'FarmEnded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'incentiveId', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint128', - name: 'liquidity', - type: 'uint128', - }, + "internalType": "struct IAlgebraEternalFarming.IncentiveParams", + "name": "params", + "type": "tuple" + }, + { + "internalType": "address", + "name": "plugin", + "type": "address" + } + ], + "name": "createEternalFarming", + "outputs": [ + { + "internalType": "address", + "name": "virtualPool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "contract IERC20Minimal", + "name": "bonusRewardToken", + "type": "address" + }, + { + "internalType": "contract IAlgebraPool", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } ], - name: 'FarmEntered', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'farmingCenter', - type: 'address', - }, + "internalType": "struct IncentiveKey", + "name": "key", + "type": "tuple" + } + ], + "name": "deactivateIncentive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "contract IERC20Minimal", + "name": "bonusRewardToken", + "type": "address" + }, + { + "internalType": "contract IAlgebraPool", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } ], - name: 'FarmingCenter', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'incentiveId', - type: 'bytes32', - }, + "internalType": "struct IncentiveKey", + "name": "key", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "rewardAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "bonusRewardAmount", + "type": "uint128" + } + ], + "name": "decreaseRewardsAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "contract IERC20Minimal", + "name": "bonusRewardToken", + "type": "address" + }, + { + "internalType": "contract IAlgebraPool", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } ], - name: 'IncentiveDeactivated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'rewardAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'bonusRewardAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'incentiveId', - type: 'bytes32', - }, + "internalType": "struct IncentiveKey", + "name": "key", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "enterFarming", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "contract IERC20Minimal", + "name": "bonusRewardToken", + "type": "address" + }, + { + "internalType": "contract IAlgebraPool", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } ], - name: 'RewardAmountsDecreased', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'rewardAddress', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, + "internalType": "struct IncentiveKey", + "name": "key", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "exitFarming", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "farmingCenter", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "incentiveId", + "type": "bytes32" + } + ], + "name": "farms", + "outputs": [ + { + "internalType": "uint128", + "name": "liquidity", + "type": "uint128" + }, + { + "internalType": "int24", + "name": "tickLower", + "type": "int24" + }, + { + "internalType": "int24", + "name": "tickUpper", + "type": "int24" + }, + { + "internalType": "uint256", + "name": "innerRewardGrowth0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "innerRewardGrowth1", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "contract IERC20Minimal", + "name": "bonusRewardToken", + "type": "address" + }, + { + "internalType": "contract IAlgebraPool", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } ], - name: 'RewardClaimed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'rewardAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'bonusRewardAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'incentiveId', - type: 'bytes32', - }, + "internalType": "struct IncentiveKey", + "name": "key", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getRewardInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bonusReward", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "incentiveId", + "type": "bytes32" + } + ], + "name": "incentives", + "outputs": [ + { + "internalType": "uint128", + "name": "totalReward", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "bonusReward", + "type": "uint128" + }, + { + "internalType": "address", + "name": "virtualPoolAddress", + "type": "address" + }, + { + "internalType": "uint24", + "name": "minimalPositionWidth", + "type": "uint24" + }, + { + "internalType": "bool", + "name": "deactivated", + "type": "bool" + }, + { + "internalType": "address", + "name": "pluginAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isEmergencyWithdrawActivated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "incentiveId", + "type": "bytes32" + } + ], + "name": "isIncentiveDeactivated", + "outputs": [ + { + "internalType": "bool", + "name": "res", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nonfungiblePositionManager", + "outputs": [ + { + "internalType": "contract INonfungiblePositionManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "numOfIncentives", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + } + ], + "name": "rewards", + "outputs": [ + { + "internalType": "uint256", + "name": "rewardAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "contract IERC20Minimal", + "name": "bonusRewardToken", + "type": "address" + }, + { + "internalType": "contract IAlgebraPool", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } ], - name: 'RewardsAdded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'incentiveId', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'rewardAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'bonusRewardAmount', - type: 'uint256', - }, + "internalType": "struct IncentiveKey", + "name": "key", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "maxRate0", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "maxRate1", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "minRate0", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "minRate1", + "type": "uint128" + } + ], + "name": "setDynamicRateLimits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "newStatus", + "type": "bool" + } + ], + "name": "setEmergencyWithdrawStatus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_farmingCenter", + "type": "address" + } + ], + "name": "setFarmingCenterAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "contract IERC20Minimal", + "name": "bonusRewardToken", + "type": "address" + }, + { + "internalType": "contract IAlgebraPool", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } ], - name: 'RewardsCollected', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint128', - name: 'rewardRate', - type: 'uint128', - }, - { - indexed: false, - internalType: 'uint128', - name: 'bonusRewardRate', - type: 'uint128', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'incentiveId', - type: 'bytes32', - }, + "internalType": "struct IncentiveKey", + "name": "key", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "rewardRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "bonusRewardRate", + "type": "uint128" + } + ], + "name": "setRates", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "contract IERC20Minimal", + "name": "bonusRewardToken", + "type": "address" + }, + { + "internalType": "contract IAlgebraPool", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } ], - name: 'RewardsRatesChanged', - type: 'event', - }, - { - inputs: [], - name: 'FARMINGS_ADMINISTRATOR_ROLE', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, + "internalType": "struct IncentiveKey", + "name": "key", + "type": "tuple" + }, + { + "internalType": "uint16", + "name": "weight0", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "weight1", + "type": "uint16" + } + ], + "name": "setWeights", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20Minimal", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "contract IERC20Minimal", + "name": "bonusRewardToken", + "type": "address" + }, + { + "internalType": "contract IAlgebraPool", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'INCENTIVE_MAKER_ROLE', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'contract IERC20Minimal', - name: 'rewardToken', - type: 'address', - }, - { - internalType: 'contract IERC20Minimal', - name: 'bonusRewardToken', - type: 'address', - }, - { - internalType: 'contract IAlgebraPool', - name: 'pool', - type: 'address', - }, - { - internalType: 'uint256', - name: 'nonce', - type: 'uint256', - }, - ], - internalType: 'struct IncentiveKey', - name: 'key', - type: 'tuple', - }, - { - internalType: 'uint128', - name: 'rewardAmount', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'bonusRewardAmount', - type: 'uint128', - }, - ], - name: 'addRewards', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IERC20Minimal', - name: 'rewardToken', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amountRequested', - type: 'uint256', - }, - ], - name: 'claimReward', - outputs: [ - { - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IERC20Minimal', - name: 'rewardToken', - type: 'address', - }, - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amountRequested', - type: 'uint256', - }, - ], - name: 'claimRewardFrom', - outputs: [ - { - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'contract IERC20Minimal', - name: 'rewardToken', - type: 'address', - }, - { - internalType: 'contract IERC20Minimal', - name: 'bonusRewardToken', - type: 'address', - }, - { - internalType: 'contract IAlgebraPool', - name: 'pool', - type: 'address', - }, - { - internalType: 'uint256', - name: 'nonce', - type: 'uint256', - }, - ], - internalType: 'struct IncentiveKey', - name: 'key', - type: 'tuple', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'collectRewards', - outputs: [ - { - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bonusReward', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'contract IERC20Minimal', - name: 'rewardToken', - type: 'address', - }, - { - internalType: 'contract IERC20Minimal', - name: 'bonusRewardToken', - type: 'address', - }, - { - internalType: 'contract IAlgebraPool', - name: 'pool', - type: 'address', - }, - { - internalType: 'uint256', - name: 'nonce', - type: 'uint256', - }, - ], - internalType: 'struct IncentiveKey', - name: 'key', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint128', - name: 'reward', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'bonusReward', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'rewardRate', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'bonusRewardRate', - type: 'uint128', - }, - { - internalType: 'uint24', - name: 'minimalPositionWidth', - type: 'uint24', - }, - ], - internalType: 'struct IAlgebraEternalFarming.IncentiveParams', - name: 'params', - type: 'tuple', - }, - { - internalType: 'address', - name: 'plugin', - type: 'address', - }, - ], - name: 'createEternalFarming', - outputs: [ - { - internalType: 'address', - name: 'virtualPool', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'contract IERC20Minimal', - name: 'rewardToken', - type: 'address', - }, - { - internalType: 'contract IERC20Minimal', - name: 'bonusRewardToken', - type: 'address', - }, - { - internalType: 'contract IAlgebraPool', - name: 'pool', - type: 'address', - }, - { - internalType: 'uint256', - name: 'nonce', - type: 'uint256', - }, - ], - internalType: 'struct IncentiveKey', - name: 'key', - type: 'tuple', - }, - ], - name: 'deactivateIncentive', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'contract IERC20Minimal', - name: 'rewardToken', - type: 'address', - }, - { - internalType: 'contract IERC20Minimal', - name: 'bonusRewardToken', - type: 'address', - }, - { - internalType: 'contract IAlgebraPool', - name: 'pool', - type: 'address', - }, - { - internalType: 'uint256', - name: 'nonce', - type: 'uint256', - }, - ], - internalType: 'struct IncentiveKey', - name: 'key', - type: 'tuple', - }, - { - internalType: 'uint128', - name: 'rewardAmount', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'bonusRewardAmount', - type: 'uint128', - }, - ], - name: 'decreaseRewardsAmount', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'contract IERC20Minimal', - name: 'rewardToken', - type: 'address', - }, - { - internalType: 'contract IERC20Minimal', - name: 'bonusRewardToken', - type: 'address', - }, - { - internalType: 'contract IAlgebraPool', - name: 'pool', - type: 'address', - }, - { - internalType: 'uint256', - name: 'nonce', - type: 'uint256', - }, - ], - internalType: 'struct IncentiveKey', - name: 'key', - type: 'tuple', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - ], - name: 'enterFarming', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'contract IERC20Minimal', - name: 'rewardToken', - type: 'address', - }, - { - internalType: 'contract IERC20Minimal', - name: 'bonusRewardToken', - type: 'address', - }, - { - internalType: 'contract IAlgebraPool', - name: 'pool', - type: 'address', - }, - { - internalType: 'uint256', - name: 'nonce', - type: 'uint256', - }, - ], - internalType: 'struct IncentiveKey', - name: 'key', - type: 'tuple', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'exitFarming', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'farmingCenter', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'incentiveId', - type: 'bytes32', - }, - ], - name: 'farms', - outputs: [ - { - internalType: 'uint128', - name: 'liquidity', - type: 'uint128', - }, - { - internalType: 'int24', - name: 'tickLower', - type: 'int24', - }, - { - internalType: 'int24', - name: 'tickUpper', - type: 'int24', - }, - { - internalType: 'uint256', - name: 'innerRewardGrowth0', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'innerRewardGrowth1', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'contract IERC20Minimal', - name: 'rewardToken', - type: 'address', - }, - { - internalType: 'contract IERC20Minimal', - name: 'bonusRewardToken', - type: 'address', - }, - { - internalType: 'contract IAlgebraPool', - name: 'pool', - type: 'address', - }, - { - internalType: 'uint256', - name: 'nonce', - type: 'uint256', - }, - ], - internalType: 'struct IncentiveKey', - name: 'key', - type: 'tuple', - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - ], - name: 'getRewardInfo', - outputs: [ - { - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bonusReward', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'incentiveId', - type: 'bytes32', - }, - ], - name: 'incentives', - outputs: [ - { - internalType: 'uint128', - name: 'totalReward', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'bonusReward', - type: 'uint128', - }, - { - internalType: 'address', - name: 'virtualPoolAddress', - type: 'address', - }, - { - internalType: 'uint24', - name: 'minimalPositionWidth', - type: 'uint24', - }, - { - internalType: 'bool', - name: 'deactivated', - type: 'bool', - }, - { - internalType: 'address', - name: 'pluginAddress', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'isEmergencyWithdrawActivated', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'incentiveId', - type: 'bytes32', - }, - ], - name: 'isIncentiveDeactivated', - outputs: [ - { - internalType: 'bool', - name: 'res', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'nonfungiblePositionManager', - outputs: [ - { - internalType: 'contract INonfungiblePositionManager', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'numOfIncentives', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'contract IERC20Minimal', - name: 'rewardToken', - type: 'address', - }, - ], - name: 'rewards', - outputs: [ - { - internalType: 'uint256', - name: 'rewardAmount', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bool', - name: 'newStatus', - type: 'bool', - }, - ], - name: 'setEmergencyWithdrawStatus', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_farmingCenter', - type: 'address', - }, - ], - name: 'setFarmingCenterAddress', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'contract IERC20Minimal', - name: 'rewardToken', - type: 'address', - }, - { - internalType: 'contract IERC20Minimal', - name: 'bonusRewardToken', - type: 'address', - }, - { - internalType: 'contract IAlgebraPool', - name: 'pool', - type: 'address', - }, - { - internalType: 'uint256', - name: 'nonce', - type: 'uint256', - }, - ], - internalType: 'struct IncentiveKey', - name: 'key', - type: 'tuple', - }, - { - internalType: 'uint128', - name: 'rewardRate', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'bonusRewardRate', - type: 'uint128', - }, - ], - name: 'setRates', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, + "internalType": "struct IncentiveKey", + "name": "key", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + } + ], + "name": "switchDynamicRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } ] as const; diff --git a/src/abis/index.ts b/src/abis/index.ts index 8cd87492..48c7fbd3 100644 --- a/src/abis/index.ts +++ b/src/abis/index.ts @@ -4,7 +4,7 @@ export * from './algebraPositionManager'; export * from './algebraQuoter'; export * from './algebraQuoterV2'; export * from './algebraRouter'; +export * from './algebraVirtualPool'; export * from './plugins'; export * from './farming'; export * from './tokens' - diff --git a/src/components/create-pool/CreatePoolForm/index.tsx b/src/components/create-pool/CreatePoolForm/index.tsx index db67521f..95330297 100644 --- a/src/components/create-pool/CreatePoolForm/index.tsx +++ b/src/components/create-pool/CreatePoolForm/index.tsx @@ -1,37 +1,36 @@ -import { Button } from '@/components/ui/button'; -import { useDerivedSwapInfo, useSwapState } from '@/state/swapStore'; -import { useEffect, useMemo } from 'react'; -import { SwapField } from '@/types/swap-field'; -import { - ADDRESS_ZERO, - INITIAL_POOL_FEE, - NonfungiblePositionManager, - computePoolAddress, -} from '@cryptoalgebra/integral-sdk'; -import { usePrepareAlgebraPositionManagerMulticall } from '@/generated'; -import { useTransitionAwait } from '@/hooks/common/useTransactionAwait'; -import { Address, useContractWrite } from 'wagmi'; -import { useDerivedMintInfo, useMintState } from '@/state/mintStore'; -import Loader from '@/components/common/Loader'; -import { PoolState, usePool } from '@/hooks/pools/usePool'; -import Summary from '../Summary'; -import SelectPair from '../SelectPair'; -import { STABLECOINS } from '@/constants/tokens'; +import { Button } from "@/components/ui/button"; +import { useDerivedSwapInfo, useSwapState } from "@/state/swapStore"; +import { useEffect, useMemo } from "react"; +import { SwapField } from "@/types/swap-field"; +import { ADDRESS_ZERO, INITIAL_POOL_FEE, NonfungiblePositionManager, computePoolAddress } from "@cryptoalgebra/integral-sdk"; +import { usePrepareAlgebraPositionManagerMulticall } from "@/generated"; +import { useTransitionAwait } from "@/hooks/common/useTransactionAwait"; +import { Address, useContractWrite } from "wagmi"; +import { useDerivedMintInfo, useMintState } from "@/state/mintStore"; +import Loader from "@/components/common/Loader"; +import { PoolState, usePool } from "@/hooks/pools/usePool"; +import Summary from "../Summary"; +import SelectPair from "../SelectPair"; +import { STABLECOINS } from "@/constants/tokens"; const CreatePoolForm = () => { const { currencies } = useDerivedSwapInfo(); - const { actions: { selectCurrency } } = useSwapState(); + const { + actions: { selectCurrency }, + } = useSwapState(); - const { startPriceTypedValue, actions: { typeStartPriceInput } } = useMintState() + const { + startPriceTypedValue, + actions: { typeStartPriceInput }, + } = useMintState(); const currencyA = currencies[SwapField.INPUT]; const currencyB = currencies[SwapField.OUTPUT]; const areCurrenciesSelected = currencyA && currencyB; - const isSameToken = - areCurrenciesSelected && currencyA.wrapped.equals(currencyB.wrapped); + const isSameToken = areCurrenciesSelected && currencyA.wrapped.equals(currencyB.wrapped); const poolAddress = areCurrenciesSelected && !isSameToken @@ -64,76 +63,52 @@ const CreatePoolForm = () => { return NonfungiblePositionManager.createCallParameters(mintInfo.pool); }, [mintInfo?.pool]); - const { config: createPoolConfig } = - usePrepareAlgebraPositionManagerMulticall({ - args: Array.isArray(calldata) - ? [calldata as Address[]] - : [[calldata] as Address[]], - value: BigInt(value || 0), - enabled: Boolean(calldata), - }); + const { config: createPoolConfig } = usePrepareAlgebraPositionManagerMulticall({ + args: Array.isArray(calldata) ? [calldata as Address[]] : [[calldata] as Address[]], + value: BigInt(value || 0), + enabled: Boolean(calldata), + }); + const { data: createPoolData, write: createPool } = useContractWrite(createPoolConfig); - const { data: createPoolData, write: createPool } = - useContractWrite(createPoolConfig); - - const { isLoading } = useTransitionAwait( - createPoolData?.hash, - 'Create Pool', - '', - '/pools' - ); + const { isLoading } = useTransitionAwait(createPoolData?.hash, "Create Pool", "", "/pools"); useEffect(() => { - selectCurrency(SwapField.INPUT, undefined) - selectCurrency(SwapField.OUTPUT, undefined) - typeStartPriceInput('') + selectCurrency(SwapField.INPUT, undefined); + selectCurrency(SwapField.OUTPUT, undefined); + typeStartPriceInput(""); return () => { - selectCurrency(SwapField.INPUT, ADDRESS_ZERO) - selectCurrency(SwapField.OUTPUT, STABLECOINS.USDT.address as Account) - typeStartPriceInput('') - } - }, []) + selectCurrency(SwapField.INPUT, ADDRESS_ZERO); + selectCurrency(SwapField.OUTPUT, STABLECOINS.USDT.address); + typeStartPriceInput(""); + }; + }, []); return (
{APR}%
${formattedTVL}
+${userTVL}
${farmingRewards}
+${totalEarnedUSD}
- {`${( - rewardRatePerDay + - bonusRewardRatePerDay - ).toFixed(2)} ${ - farming.rewardToken.symbol - } / day`} + {`${formatAmount( + (reverseFormatAmount(rewardRatePerDay) + reverseFormatAmount(bonusRewardRatePerDay)).toString(), + 4 + )} ${farming.rewardToken.symbol} / day`}
> ) : (- {`${ - rewardRatePerDay.toFixed(2) === - '0.00' - ? '<0.01' - : rewardRatePerDay.toFixed( - 2 - ) - } ${ - farming.rewardToken.symbol - } / day`} -
+{`${rewardRatePerDay} ${farming.rewardToken.symbol} / day`}
- {`${ - bonusRewardRatePerDay.toFixed( - 2 - ) === '0.00' - ? '<0.01' - : bonusRewardRatePerDay.toFixed( - 2 - ) - } ${ - farming.bonusRewardToken - ?.symbol - } / day`} -
+{`${bonusRewardRatePerDay} ${farming.bonusRewardToken?.symbol} / day`}