diff --git a/.gitmodules b/.gitmodules index 15144cd0..f3b1890d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,30 +1,24 @@ [submodule "lib/forge-std"] - path = lib/forge-std - url = https://github.com/brockelmore/forge-std +path = lib/forge-std +url = https://github.com/brockelmore/forge-std [submodule "lib/openzeppelin-contracts-upgradeable"] - path = lib/openzeppelin-contracts-upgradeable - url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable +path = lib/openzeppelin-contracts-upgradeable +url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable [submodule "lib/solmate"] - path = lib/solmate - url = https://github.com/rari-capital/solmate -[submodule "lib/fuse-flywheel"] - path = lib/fuse-flywheel - url = https://github.com/fei-protocol/fuse-flywheel +path = lib/solmate +url = https://github.com/rari-capital/solmate [submodule "lib/openzeppelin-contracts"] - path = lib/openzeppelin-contracts - url = https://github.com/OpenZeppelin/openzeppelin-contracts +path = lib/openzeppelin-contracts +url = https://github.com/OpenZeppelin/openzeppelin-contracts [submodule "lib/pyth-sdk-solidity"] - path = lib/pyth-sdk-solidity - url = https://github.com/pyth-network/pyth-sdk-solidity +path = lib/pyth-sdk-solidity +url = https://github.com/pyth-network/pyth-sdk-solidity [submodule "lib/solidity-bytes-utils"] - path = lib/solidity-bytes-utils - url = https://github.com/GNSPS/solidity-bytes-utils +path = lib/solidity-bytes-utils +url = https://github.com/GNSPS/solidity-bytes-utils [submodule "lib/ops"] - path = lib/ops - url = https://github.com/gelatodigital/ops +path = lib/ops +url = https://github.com/gelatodigital/ops [submodule "lib/adrastia-periphery"] - path = lib/adrastia-periphery - url = https://github.com/adrastia-oracle/adrastia-periphery -[submodule "lib/flywheel-v2"] - path = lib/flywheel-v2 - url = https://github.com/ionicprotocol/flywheel-v2 +path = lib/adrastia-periphery +url = https://github.com/adrastia-oracle/adrastia-periphery diff --git a/contracts/ionic/strategies/flywheel/LooplessFlywheelBooster.sol b/contracts/ionic/strategies/flywheel/LooplessFlywheelBooster.sol index 354851b7..25324472 100644 --- a/contracts/ionic/strategies/flywheel/LooplessFlywheelBooster.sol +++ b/contracts/ionic/strategies/flywheel/LooplessFlywheelBooster.sol @@ -1,8 +1,9 @@ // SPDX-License-Identifier: AGPL-3.0-only pragma solidity ^0.8.10; -import "./IFlywheelBooster.sol"; +import {IFlywheelBooster} from "./IFlywheelBooster.sol"; import { ICErc20 } from "../../../compound/CTokenInterfaces.sol"; +import {ERC20} from "solmate/tokens/ERC20.sol"; contract LooplessFlywheelBooster is IFlywheelBooster { string public constant BOOSTER_TYPE = "LooplessFlywheelBooster"; diff --git a/contracts/ionic/strategies/flywheel/rewards/FlywheelDynamicRewards.sol b/contracts/ionic/strategies/flywheel/rewards/FlywheelDynamicRewards.sol index ecc66ada..68025bec 100644 --- a/contracts/ionic/strategies/flywheel/rewards/FlywheelDynamicRewards.sol +++ b/contracts/ionic/strategies/flywheel/rewards/FlywheelDynamicRewards.sol @@ -1,7 +1,9 @@ // SPDX-License-Identifier: AGPL-3.0-only pragma solidity ^0.8.10; -import "./BaseFlywheelRewards.sol"; +import {BaseFlywheelRewards} from "./BaseFlywheelRewards.sol"; +import {IonicFlywheelCore} from "../IonicFlywheelCore.sol"; +import {SafeTransferLib, ERC20} from "solmate/utils/SafeTransferLib.sol"; import {SafeCastLib} from "solmate/utils/SafeCastLib.sol"; /** diff --git a/contracts/ionic/strategies/flywheel/rewards/FlywheelStaticRewards.sol b/contracts/ionic/strategies/flywheel/rewards/FlywheelStaticRewards.sol index 1e7c6a69..a0c42724 100644 --- a/contracts/ionic/strategies/flywheel/rewards/FlywheelStaticRewards.sol +++ b/contracts/ionic/strategies/flywheel/rewards/FlywheelStaticRewards.sol @@ -2,7 +2,9 @@ pragma solidity ^0.8.10; import {Auth, Authority} from "solmate/auth/Auth.sol"; -import "./BaseFlywheelRewards.sol"; +import {BaseFlywheelRewards} from "./BaseFlywheelRewards.sol"; +import {ERC20} from "solmate/utils/SafeTransferLib.sol"; +import {IonicFlywheelCore} from "../IonicFlywheelCore.sol"; /** @title Flywheel Static Reward Stream diff --git a/contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewardsPlugin.sol b/contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewardsPlugin.sol index 3a61ca87..1afbf3af 100644 --- a/contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewardsPlugin.sol +++ b/contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewardsPlugin.sol @@ -7,7 +7,7 @@ interface ICERC20 { function plugin() external returns (address); } -interface IPlugin { +interface IPlugin_FDR { function claimRewards() external; } @@ -28,7 +28,7 @@ contract IonicFlywheelDynamicRewardsPlugin is FlywheelDynamicRewards { override returns (uint192) { - IPlugin plugin = IPlugin(ICERC20(address(strategy)).plugin()); + IPlugin_FDR plugin = IPlugin_FDR(ICERC20(address(strategy)).plugin()); try plugin.claimRewards() {} catch {} uint256 rewardAmount = rewardToken.balanceOf(address(strategy)); diff --git a/contracts/ionic/strategies/flywheel/rewards/ReplacingFlywheelDynamicRewards.sol b/contracts/ionic/strategies/flywheel/rewards/ReplacingFlywheelDynamicRewards.sol index 66f9781b..5c7fa296 100644 --- a/contracts/ionic/strategies/flywheel/rewards/ReplacingFlywheelDynamicRewards.sol +++ b/contracts/ionic/strategies/flywheel/rewards/ReplacingFlywheelDynamicRewards.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.10; import { FlywheelDynamicRewards } from "./FlywheelDynamicRewards.sol"; -import { BaseFlywheelRewards } from "./BaseFlywheelRewards.sol"; import { IonicFlywheelCore } from "../IonicFlywheelCore.sol"; import { Auth, Authority } from "solmate/auth/Auth.sol"; import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol"; diff --git a/contracts/ionic/strategies/flywheel/rewards/ReplacingFlywheelStaticRewards.sol b/contracts/ionic/strategies/flywheel/rewards/ReplacingFlywheelStaticRewards.sol index 3ebf8663..738a8a1c 100644 --- a/contracts/ionic/strategies/flywheel/rewards/ReplacingFlywheelStaticRewards.sol +++ b/contracts/ionic/strategies/flywheel/rewards/ReplacingFlywheelStaticRewards.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.10; import { FlywheelStaticRewards } from "./FlywheelStaticRewards.sol"; -import { BaseFlywheelRewards } from "./BaseFlywheelRewards.sol"; import { IonicFlywheelCore } from "../IonicFlywheelCore.sol"; import { Auth, Authority } from "solmate/auth/Auth.sol"; import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol"; diff --git a/contracts/ionic/strategies/flywheel/rewards/WithdrawableFlywheelStaticRewards.sol b/contracts/ionic/strategies/flywheel/rewards/WithdrawableFlywheelStaticRewards.sol index 28f10c4b..525dd24e 100644 --- a/contracts/ionic/strategies/flywheel/rewards/WithdrawableFlywheelStaticRewards.sol +++ b/contracts/ionic/strategies/flywheel/rewards/WithdrawableFlywheelStaticRewards.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.10; import { FlywheelStaticRewards } from "./FlywheelStaticRewards.sol"; -import { BaseFlywheelRewards } from "./BaseFlywheelRewards.sol"; import { IonicFlywheelCore } from "../IonicFlywheelCore.sol"; import { Auth, Authority } from "solmate/auth/Auth.sol"; import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol"; diff --git a/contracts/test/DeployMarkets.t.sol b/contracts/test/DeployMarkets.t.sol index 72a78798..78eaf59c 100644 --- a/contracts/test/DeployMarkets.t.sol +++ b/contracts/test/DeployMarkets.t.sol @@ -7,7 +7,6 @@ import { ERC20 } from "solmate/tokens/ERC20.sol"; import { Auth, Authority } from "solmate/auth/Auth.sol"; import { MockERC20 } from "solmate/test/utils/mocks/MockERC20.sol"; import { IonicFlywheelDynamicRewardsPlugin } from "../ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewardsPlugin.sol"; -import { FlywheelCore } from "flywheel/FlywheelCore.sol"; import { IFlywheelBooster } from "../ionic/strategies/flywheel/IFlywheelBooster.sol"; import { IFlywheelRewards } from "../ionic/strategies/flywheel/rewards/IFlywheelRewards.sol"; import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; diff --git a/contracts/test/FLRTest.t.sol b/contracts/test/FLRTest.t.sol index 97f5f201..c9208f87 100644 --- a/contracts/test/FLRTest.t.sol +++ b/contracts/test/FLRTest.t.sol @@ -1,160 +1,160 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.0; - -import "forge-std/Vm.sol"; - -import "./config/BaseTest.t.sol"; - -import { ERC20 } from "solmate/tokens/ERC20.sol"; -import { Authority } from "solmate/auth/Auth.sol"; -import { MockERC20 } from "solmate/test/utils/mocks/MockERC20.sol"; -import { IERC20MetadataUpgradeable, IERC20Upgradeable } from "openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; - -import { IFlywheelBooster } from "../ionic/strategies/flywheel/IFlywheelBooster.sol"; -import { FlywheelStaticRewards } from "../ionic/strategies/flywheel/rewards/FlywheelStaticRewards.sol"; -import { FuseFlywheelCore } from "fuse-flywheel/FuseFlywheelCore.sol"; - -import { CErc20 } from "../compound/CToken.sol"; -import { IonicFlywheelLensRouter, IonicComptroller, ICErc20, ERC20, IPriceOracle_IFLR } from "../ionic/strategies/flywheel/IonicFlywheelLensRouter.sol"; -import { IonicFlywheel } from "../ionic/strategies/flywheel/IonicFlywheel.sol"; -import { PoolDirectory } from "../PoolDirectory.sol"; -import { IonicFlywheelCore } from "../ionic/strategies/flywheel/IonicFlywheelCore.sol"; - -contract FLRTest is BaseTest { - address rewardToken; - - IonicFlywheel flywheel; - FlywheelStaticRewards rewards; - IonicFlywheelLensRouter lensRouter; - - PoolDirectory internal fpd; - - function afterForkSetUp() internal override { - fpd = PoolDirectory(ap.getAddress("PoolDirectory")); - lensRouter = new IonicFlywheelLensRouter(fpd); - } - - function setUpFlywheel( - address _rewardToken, - address mkt, - IonicComptroller comptroller, - address admin - ) public { - flywheel = new IonicFlywheel(); - flywheel.initialize( - ERC20(_rewardToken), - FlywheelStaticRewards(address(0)), - IFlywheelBooster(address(0)), - address(this) - ); - - rewards = new FlywheelStaticRewards(IonicFlywheelCore(address(flywheel)), address(this), Authority(address(0))); - flywheel.setFlywheelRewards(rewards); - - flywheel.addStrategyForRewards(ERC20(mkt)); - - // add flywheel as rewardsDistributor to call flywheelPreBorrowAction / flywheelPreSupplyAction - vm.prank(admin); - require(comptroller._addRewardsDistributor(address(flywheel)) == 0); - - // seed rewards to flywheel - deal(_rewardToken, address(rewards), 1_000_000 * (10**ERC20(_rewardToken).decimals())); - - // Start reward distribution at 1 token per second - rewards.setRewardsInfo( - ERC20(mkt), - FlywheelStaticRewards.RewardsInfo({ - rewardsPerSecond: uint224(789 * 10**ERC20(_rewardToken).decimals()), - rewardsEndTimestamp: 0 - }) - ); - } - - function testFuseFlywheelLensRouterBsc() public debuggingOnly fork(BSC_MAINNET) { - rewardToken = address(0x71be881e9C5d4465B3FfF61e89c6f3651E69B5bb); // BRZ - emit log_named_address("rewardToken", address(rewardToken)); - address mkt = 0x159A529c00CD4f91b65C54E77703EDb67B4942e4; - setUpFlywheel(rewardToken, mkt, IonicComptroller(0x5EB884651F50abc72648447dCeabF2db091e4117), ap.owner()); - emit log_named_uint("mkt dec", ERC20(mkt).decimals()); - - (uint224 index, uint32 lastUpdatedTimestamp) = flywheel.strategyState(ERC20(mkt)); - - emit log_named_uint("index", index); - emit log_named_uint("lastUpdatedTimestamp", lastUpdatedTimestamp); - emit log_named_uint("block.timestamp", block.timestamp); - emit log_named_uint( - "underlying price", - IPriceOracle_IFLR(address(IonicComptroller(0x5EB884651F50abc72648447dCeabF2db091e4117).oracle())).price( - address(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c) - ) - ); - - vm.warp(block.timestamp + 10); - - (uint224 rewardsPerSecond, uint32 rewardsEndTimestamp) = rewards.rewardsInfo(ERC20(mkt)); - - vm.prank(address(flywheel)); - uint256 accrued = rewards.getAccruedRewards(ERC20(mkt), lastUpdatedTimestamp); - - emit log_named_uint("accrued", accrued); - emit log_named_uint("rewardsPerSecond", rewardsPerSecond); - emit log_named_uint("rewardsEndTimestamp", rewardsEndTimestamp); - emit log_named_uint("mkt ts", ERC20(mkt).totalSupply()); - - IonicFlywheelLensRouter.MarketRewardsInfo[] memory marketRewardsInfos = lensRouter.getPoolMarketRewardsInfo( - IonicComptroller(0x5EB884651F50abc72648447dCeabF2db091e4117) - ); - for (uint256 i = 0; i < marketRewardsInfos.length; i++) { - if (address(marketRewardsInfos[i].market) != mkt) { - emit log("NO REWARDS INFO"); - continue; - } - - emit log(""); - emit log_named_address("RUNNING FOR MARKET", address(marketRewardsInfos[i].market)); - for (uint256 j = 0; j < marketRewardsInfos[i].rewardsInfo.length; j++) { - emit log_named_uint( - "rewardSpeedPerSecondPerToken", - marketRewardsInfos[i].rewardsInfo[j].rewardSpeedPerSecondPerToken - ); - emit log_named_uint("rewardTokenPrice", marketRewardsInfos[i].rewardsInfo[j].rewardTokenPrice); - emit log_named_uint("formattedAPR", marketRewardsInfos[i].rewardsInfo[j].formattedAPR); - emit log_named_address("rewardToken", address(marketRewardsInfos[i].rewardsInfo[j].rewardToken)); - } - } - } - - function testBscLensRouter() public fork(BSC_MAINNET) { - IonicComptroller pool = IonicComptroller(0x1851e32F34565cb95754310b031C5a2Fc0a8a905); - address user = 0x927d81b91c41D1961e3A7d24847b95484e60C626; - IonicFlywheelLensRouter router = IonicFlywheelLensRouter(ap.getAddress("IonicFlywheelLensRouter")); - - router.claimRewardsForPool(user, pool); - } - - function testChapelRouter() public fork(BSC_CHAPEL) { - IonicFlywheelLensRouter router = IonicFlywheelLensRouter(0x3391ed1C5203168337Fa827cB5Ac8BB8B60D93B7); - router.getPoolMarketRewardsInfo(IonicComptroller(0x044c436b2f3EF29D30f89c121f9240cf0a08Ca4b)); - } - - function testNetAprPolygon() public fork(POLYGON_MAINNET) { - address user = 0x8982aa50bb919E42e9204f12e5b59D053Eb2A602; - int256 blocks = 26 * 24 * 365 * 60; - int256 apr = lensRouter.getUserNetApr(user, blocks); - emit log_named_int("apr", apr); - } - - function testNetAprMode() public fork(MODE_MAINNET) { - address user = 0x8982aa50bb919E42e9204f12e5b59D053Eb2A602; - int256 blocks = 30 * 24 * 365 * 60; - int256 apr = lensRouter.getUserNetApr(user, blocks); - emit log_named_int("apr", apr); - } - - function testNetAprChapel() public fork(BSC_CHAPEL) { - address user = 0x8982aa50bb919E42e9204f12e5b59D053Eb2A602; - int256 blocks = 26 * 24 * 365 * 60; - int256 apr = lensRouter.getUserNetApr(user, blocks); - emit log_named_int("apr", apr); - } -} +// // SPDX-License-Identifier: UNLICENSED +// pragma solidity >=0.8.0; + +// import "forge-std/Vm.sol"; + +// import "./config/BaseTest.t.sol"; + +// import { ERC20 } from "solmate/tokens/ERC20.sol"; +// import { Authority } from "solmate/auth/Auth.sol"; +// import { MockERC20 } from "solmate/test/utils/mocks/MockERC20.sol"; +// import { IERC20MetadataUpgradeable, IERC20Upgradeable } from "openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; + +// import { IFlywheelBooster } from "../ionic/strategies/flywheel/IFlywheelBooster.sol"; +// import { FlywheelStaticRewards } from "../ionic/strategies/flywheel/rewards/FlywheelStaticRewards.sol"; +// import { FuseFlywheelCore } from "fuse-flywheel/FuseFlywheelCore.sol"; + +// import { CErc20 } from "../compound/CToken.sol"; +// import { IonicFlywheelLensRouter, IonicComptroller, ICErc20, ERC20, IPriceOracle_IFLR } from "../ionic/strategies/flywheel/IonicFlywheelLensRouter.sol"; +// import { IonicFlywheel } from "../ionic/strategies/flywheel/IonicFlywheel.sol"; +// import { PoolDirectory } from "../PoolDirectory.sol"; +// import { IonicFlywheelCore } from "../ionic/strategies/flywheel/IonicFlywheelCore.sol"; + +// contract FLRTest is BaseTest { +// address rewardToken; + +// IonicFlywheel flywheel; +// FlywheelStaticRewards rewards; +// IonicFlywheelLensRouter lensRouter; + +// PoolDirectory internal fpd; + +// function afterForkSetUp() internal override { +// fpd = PoolDirectory(ap.getAddress("PoolDirectory")); +// lensRouter = new IonicFlywheelLensRouter(fpd); +// } + +// function setUpFlywheel( +// address _rewardToken, +// address mkt, +// IonicComptroller comptroller, +// address admin +// ) public { +// flywheel = new IonicFlywheel(); +// flywheel.initialize( +// ERC20(_rewardToken), +// FlywheelStaticRewards(address(0)), +// IFlywheelBooster(address(0)), +// address(this) +// ); + +// rewards = new FlywheelStaticRewards(IonicFlywheelCore(address(flywheel)), address(this), Authority(address(0))); +// flywheel.setFlywheelRewards(rewards); + +// flywheel.addStrategyForRewards(ERC20(mkt)); + +// // add flywheel as rewardsDistributor to call flywheelPreBorrowAction / flywheelPreSupplyAction +// vm.prank(admin); +// require(comptroller._addRewardsDistributor(address(flywheel)) == 0); + +// // seed rewards to flywheel +// deal(_rewardToken, address(rewards), 1_000_000 * (10**ERC20(_rewardToken).decimals())); + +// // Start reward distribution at 1 token per second +// rewards.setRewardsInfo( +// ERC20(mkt), +// FlywheelStaticRewards.RewardsInfo({ +// rewardsPerSecond: uint224(789 * 10**ERC20(_rewardToken).decimals()), +// rewardsEndTimestamp: 0 +// }) +// ); +// } + +// function testFuseFlywheelLensRouterBsc() public debuggingOnly fork(BSC_MAINNET) { +// rewardToken = address(0x71be881e9C5d4465B3FfF61e89c6f3651E69B5bb); // BRZ +// emit log_named_address("rewardToken", address(rewardToken)); +// address mkt = 0x159A529c00CD4f91b65C54E77703EDb67B4942e4; +// setUpFlywheel(rewardToken, mkt, IonicComptroller(0x5EB884651F50abc72648447dCeabF2db091e4117), ap.owner()); +// emit log_named_uint("mkt dec", ERC20(mkt).decimals()); + +// (uint224 index, uint32 lastUpdatedTimestamp) = flywheel.strategyState(ERC20(mkt)); + +// emit log_named_uint("index", index); +// emit log_named_uint("lastUpdatedTimestamp", lastUpdatedTimestamp); +// emit log_named_uint("block.timestamp", block.timestamp); +// emit log_named_uint( +// "underlying price", +// IPriceOracle_IFLR(address(IonicComptroller(0x5EB884651F50abc72648447dCeabF2db091e4117).oracle())).price( +// address(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c) +// ) +// ); + +// vm.warp(block.timestamp + 10); + +// (uint224 rewardsPerSecond, uint32 rewardsEndTimestamp) = rewards.rewardsInfo(ERC20(mkt)); + +// vm.prank(address(flywheel)); +// uint256 accrued = rewards.getAccruedRewards(ERC20(mkt), lastUpdatedTimestamp); + +// emit log_named_uint("accrued", accrued); +// emit log_named_uint("rewardsPerSecond", rewardsPerSecond); +// emit log_named_uint("rewardsEndTimestamp", rewardsEndTimestamp); +// emit log_named_uint("mkt ts", ERC20(mkt).totalSupply()); + +// IonicFlywheelLensRouter.MarketRewardsInfo[] memory marketRewardsInfos = lensRouter.getPoolMarketRewardsInfo( +// IonicComptroller(0x5EB884651F50abc72648447dCeabF2db091e4117) +// ); +// for (uint256 i = 0; i < marketRewardsInfos.length; i++) { +// if (address(marketRewardsInfos[i].market) != mkt) { +// emit log("NO REWARDS INFO"); +// continue; +// } + +// emit log(""); +// emit log_named_address("RUNNING FOR MARKET", address(marketRewardsInfos[i].market)); +// for (uint256 j = 0; j < marketRewardsInfos[i].rewardsInfo.length; j++) { +// emit log_named_uint( +// "rewardSpeedPerSecondPerToken", +// marketRewardsInfos[i].rewardsInfo[j].rewardSpeedPerSecondPerToken +// ); +// emit log_named_uint("rewardTokenPrice", marketRewardsInfos[i].rewardsInfo[j].rewardTokenPrice); +// emit log_named_uint("formattedAPR", marketRewardsInfos[i].rewardsInfo[j].formattedAPR); +// emit log_named_address("rewardToken", address(marketRewardsInfos[i].rewardsInfo[j].rewardToken)); +// } +// } +// } + +// function testBscLensRouter() public fork(BSC_MAINNET) { +// IonicComptroller pool = IonicComptroller(0x1851e32F34565cb95754310b031C5a2Fc0a8a905); +// address user = 0x927d81b91c41D1961e3A7d24847b95484e60C626; +// IonicFlywheelLensRouter router = IonicFlywheelLensRouter(ap.getAddress("IonicFlywheelLensRouter")); + +// router.claimRewardsForPool(user, pool); +// } + +// function testChapelRouter() public fork(BSC_CHAPEL) { +// IonicFlywheelLensRouter router = IonicFlywheelLensRouter(0x3391ed1C5203168337Fa827cB5Ac8BB8B60D93B7); +// router.getPoolMarketRewardsInfo(IonicComptroller(0x044c436b2f3EF29D30f89c121f9240cf0a08Ca4b)); +// } + +// function testNetAprPolygon() public fork(POLYGON_MAINNET) { +// address user = 0x8982aa50bb919E42e9204f12e5b59D053Eb2A602; +// int256 blocks = 26 * 24 * 365 * 60; +// int256 apr = lensRouter.getUserNetApr(user, blocks); +// emit log_named_int("apr", apr); +// } + +// function testNetAprMode() public fork(MODE_MAINNET) { +// address user = 0x8982aa50bb919E42e9204f12e5b59D053Eb2A602; +// int256 blocks = 30 * 24 * 365 * 60; +// int256 apr = lensRouter.getUserNetApr(user, blocks); +// emit log_named_int("apr", apr); +// } + +// function testNetAprChapel() public fork(BSC_CHAPEL) { +// address user = 0x8982aa50bb919E42e9204f12e5b59D053Eb2A602; +// int256 blocks = 26 * 24 * 365 * 60; +// int256 apr = lensRouter.getUserNetApr(user, blocks); +// emit log_named_int("apr", apr); +// } +// } diff --git a/contracts/test/FlywheelUpgradesTest.t.sol b/contracts/test/FlywheelUpgradesTest.t.sol index bafd27de..4e325f6f 100644 --- a/contracts/test/FlywheelUpgradesTest.t.sol +++ b/contracts/test/FlywheelUpgradesTest.t.sol @@ -1,135 +1,134 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.0; - -import { BaseTest } from "./config/BaseTest.t.sol"; - -import { PoolDirectory } from "../PoolDirectory.sol"; -import { IonicComptroller } from "../compound/ComptrollerInterface.sol"; -import { IonicFlywheelCore } from "../ionic/strategies/flywheel/IonicFlywheelCore.sol"; -import { IonicReplacingFlywheel } from "../ionic/strategies/flywheel/IonicReplacingFlywheel.sol"; -import { ReplacingFlywheelDynamicRewards } from "../ionic/strategies/flywheel/rewards/ReplacingFlywheelDynamicRewards.sol"; -import { IonicFlywheelLensRouter } from "../ionic/strategies/flywheel/IonicFlywheelLensRouter.sol"; -import { CErc20PluginRewardsDelegate } from "../compound/CErc20PluginRewardsDelegate.sol"; -import { ComptrollerFirstExtension } from "../compound/ComptrollerFirstExtension.sol"; -import { ICErc20 } from "../compound/CTokenInterfaces.sol"; -import { Comptroller } from "../compound/Comptroller.sol"; - -import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import { ERC20 } from "solmate/tokens/ERC20.sol"; -import { IFlywheelRewards } from "flywheel/interfaces/IFlywheelRewards.sol"; -import { FlywheelCore } from "flywheel/FlywheelCore.sol"; -import { FlywheelDynamicRewards } from "flywheel/rewards/FlywheelDynamicRewards.sol"; - -contract FlywheelUpgradesTest is BaseTest { - PoolDirectory internal fpd; - - function afterForkSetUp() internal override { - fpd = PoolDirectory(ap.getAddress("PoolDirectory")); - } - - function testFlywheelUpgradeBsc() public fork(BSC_MAINNET) { - _testFlywheelUpgrade(); - } - - function testFlywheelUpgradePolygon() public fork(POLYGON_MAINNET) { - _testFlywheelUpgrade(); - } - - function _testFlywheelUpgrade() internal { - IonicFlywheelCore newImpl = new IonicFlywheelCore(); - - (, PoolDirectory.Pool[] memory pools) = fpd.getActivePools(); - - for (uint8 i = 0; i < pools.length; i++) { - IonicComptroller pool = IonicComptroller(pools[i].comptroller); - - ICErc20[] memory markets = pool.getAllMarkets(); - - address[] memory flywheels = pool.getRewardsDistributors(); - if (flywheels.length > 0) { - emit log(""); - emit log_named_address("pool", address(pool)); - } - for (uint8 j = 0; j < flywheels.length; j++) { - IonicFlywheelCore flywheel = IonicFlywheelCore(flywheels[j]); - - // upgrade - TransparentUpgradeableProxy proxy = TransparentUpgradeableProxy(payable(flywheels[j])); - bytes32 bytesAtSlot = vm.load(address(proxy), _ADMIN_SLOT); - address admin = address(uint160(uint256(bytesAtSlot))); - - if (admin != address(0)) { - //vm.prank(admin); - //proxy.upgradeTo(address(newImpl)); - //emit log_named_address("upgradable flywheel", address(flywheel)); - - bool anyStrategyHasPositiveIndex = false; - - for (uint8 k = 0; k < markets.length; k++) { - ERC20 strategy = ERC20(address(markets[k])); - (uint224 index, uint32 ts) = flywheel.strategyState(strategy); - if (index > 0) { - anyStrategyHasPositiveIndex = true; - break; - } - } - - if (!anyStrategyHasPositiveIndex) { - emit log_named_address("all zero index strategies flywheel", address(flywheel)); - //assertTrue(anyStrategyHasPositiveIndex, "!flywheel has no strategies added or is broken"); - } - } else { - emit log_named_address("not upgradable flywheel", address(flywheel)); - assertTrue(false, "flywheel proxy admin 0"); - } - } - } - } - - function testPolygonFlywheelAllowance() public fork(POLYGON_MAINNET) { - _testAllPoolsMarketsAllowance(); - } - - function testBscFlywheelAllowance() public fork(BSC_MAINNET) { - _testAllPoolsMarketsAllowance(); - } - - function _testAllPoolsMarketsAllowance() internal { - (, PoolDirectory.Pool[] memory pools) = fpd.getActivePools(); - - for (uint8 i = 0; i < pools.length; i++) { - _testMarketsAllowance(pools[i].comptroller); - } - } - - function _testMarketsAllowance(address poolAddress) internal { - ComptrollerFirstExtension poolExt = ComptrollerFirstExtension(poolAddress); - address[] memory fws = poolExt.getRewardsDistributors(); - - ICErc20[] memory markets = poolExt.getAllMarkets(); - - for (uint8 j = 0; j < markets.length; j++) { - string memory contractType = CErc20PluginRewardsDelegate(address(markets[j])).contractType(); - // check it only for dynamic rewards flywheels - if (compareStrings(contractType, "CErc20PluginRewardsDelegate")) { - for (uint8 i = 0; i < fws.length; i++) { - ERC20 asStrategy = ERC20(address(markets[j])); - IonicFlywheelCore flywheel = IonicFlywheelCore(fws[i]); - (uint224 index, ) = flywheel.strategyState(asStrategy); - ERC20 rewToken = flywheel.rewardToken(); - address rewardsContractAddress = address(flywheel.flywheelRewards()); - if (index > 0) { - uint256 allowance = rewToken.allowance(address(asStrategy), rewardsContractAddress); - if (allowance == 0) { - assertGt(allowance, 0, "!approved"); - emit log_named_address("flywheel rewards", rewardsContractAddress); - emit log_named_address("strategy", address(asStrategy)); - emit log_named_address("rwtoken", address(rewToken)); - break; - } - } - } - } - } - } -} +// // SPDX-License-Identifier: UNLICENSED +// pragma solidity >=0.8.0; + +// import { BaseTest } from "./config/BaseTest.t.sol"; + +// import { PoolDirectory } from "../PoolDirectory.sol"; +// import { IonicComptroller } from "../compound/ComptrollerInterface.sol"; +// import { IonicFlywheelCore } from "../ionic/strategies/flywheel/IonicFlywheelCore.sol"; +// import { IonicReplacingFlywheel } from "../ionic/strategies/flywheel/IonicReplacingFlywheel.sol"; +// import { ReplacingFlywheelDynamicRewards } from "../ionic/strategies/flywheel/rewards/ReplacingFlywheelDynamicRewards.sol"; +// import { IonicFlywheelLensRouter } from "../ionic/strategies/flywheel/IonicFlywheelLensRouter.sol"; +// import { CErc20PluginRewardsDelegate } from "../compound/CErc20PluginRewardsDelegate.sol"; +// import { ComptrollerFirstExtension } from "../compound/ComptrollerFirstExtension.sol"; +// import { ICErc20 } from "../compound/CTokenInterfaces.sol"; +// import { Comptroller } from "../compound/Comptroller.sol"; + +// import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +// import { ERC20 } from "solmate/tokens/ERC20.sol"; +// import { IFlywheelRewards } from "flywheel/interfaces/IFlywheelRewards.sol"; +// import { FlywheelDynamicRewards } from "flywheel/rewards/FlywheelDynamicRewards.sol"; + +// contract FlywheelUpgradesTest is BaseTest { +// PoolDirectory internal fpd; + +// function afterForkSetUp() internal override { +// fpd = PoolDirectory(ap.getAddress("PoolDirectory")); +// } + +// function testFlywheelUpgradeBsc() public fork(BSC_MAINNET) { +// _testFlywheelUpgrade(); +// } + +// function testFlywheelUpgradePolygon() public fork(POLYGON_MAINNET) { +// _testFlywheelUpgrade(); +// } + +// function _testFlywheelUpgrade() internal { +// IonicFlywheelCore newImpl = new IonicFlywheelCore(); + +// (, PoolDirectory.Pool[] memory pools) = fpd.getActivePools(); + +// for (uint8 i = 0; i < pools.length; i++) { +// IonicComptroller pool = IonicComptroller(pools[i].comptroller); + +// ICErc20[] memory markets = pool.getAllMarkets(); + +// address[] memory flywheels = pool.getRewardsDistributors(); +// if (flywheels.length > 0) { +// emit log(""); +// emit log_named_address("pool", address(pool)); +// } +// for (uint8 j = 0; j < flywheels.length; j++) { +// IonicFlywheelCore flywheel = IonicFlywheelCore(flywheels[j]); + +// // upgrade +// TransparentUpgradeableProxy proxy = TransparentUpgradeableProxy(payable(flywheels[j])); +// bytes32 bytesAtSlot = vm.load(address(proxy), _ADMIN_SLOT); +// address admin = address(uint160(uint256(bytesAtSlot))); + +// if (admin != address(0)) { +// //vm.prank(admin); +// //proxy.upgradeTo(address(newImpl)); +// //emit log_named_address("upgradable flywheel", address(flywheel)); + +// bool anyStrategyHasPositiveIndex = false; + +// for (uint8 k = 0; k < markets.length; k++) { +// ERC20 strategy = ERC20(address(markets[k])); +// (uint224 index, uint32 ts) = flywheel.strategyState(strategy); +// if (index > 0) { +// anyStrategyHasPositiveIndex = true; +// break; +// } +// } + +// if (!anyStrategyHasPositiveIndex) { +// emit log_named_address("all zero index strategies flywheel", address(flywheel)); +// //assertTrue(anyStrategyHasPositiveIndex, "!flywheel has no strategies added or is broken"); +// } +// } else { +// emit log_named_address("not upgradable flywheel", address(flywheel)); +// assertTrue(false, "flywheel proxy admin 0"); +// } +// } +// } +// } + +// function testPolygonFlywheelAllowance() public fork(POLYGON_MAINNET) { +// _testAllPoolsMarketsAllowance(); +// } + +// function testBscFlywheelAllowance() public fork(BSC_MAINNET) { +// _testAllPoolsMarketsAllowance(); +// } + +// function _testAllPoolsMarketsAllowance() internal { +// (, PoolDirectory.Pool[] memory pools) = fpd.getActivePools(); + +// for (uint8 i = 0; i < pools.length; i++) { +// _testMarketsAllowance(pools[i].comptroller); +// } +// } + +// function _testMarketsAllowance(address poolAddress) internal { +// ComptrollerFirstExtension poolExt = ComptrollerFirstExtension(poolAddress); +// address[] memory fws = poolExt.getRewardsDistributors(); + +// ICErc20[] memory markets = poolExt.getAllMarkets(); + +// for (uint8 j = 0; j < markets.length; j++) { +// string memory contractType = CErc20PluginRewardsDelegate(address(markets[j])).contractType(); +// // check it only for dynamic rewards flywheels +// if (compareStrings(contractType, "CErc20PluginRewardsDelegate")) { +// for (uint8 i = 0; i < fws.length; i++) { +// ERC20 asStrategy = ERC20(address(markets[j])); +// IonicFlywheelCore flywheel = IonicFlywheelCore(fws[i]); +// (uint224 index, ) = flywheel.strategyState(asStrategy); +// ERC20 rewToken = flywheel.rewardToken(); +// address rewardsContractAddress = address(flywheel.flywheelRewards()); +// if (index > 0) { +// uint256 allowance = rewToken.allowance(address(asStrategy), rewardsContractAddress); +// if (allowance == 0) { +// assertGt(allowance, 0, "!approved"); +// emit log_named_address("flywheel rewards", rewardsContractAddress); +// emit log_named_address("strategy", address(asStrategy)); +// emit log_named_address("rwtoken", address(rewToken)); +// break; +// } +// } +// } +// } +// } +// } +// } diff --git a/contracts/test/MaxWithdrawTest.t.sol b/contracts/test/MaxWithdrawTest.t.sol index a89d5947..3d9dafc4 100644 --- a/contracts/test/MaxWithdrawTest.t.sol +++ b/contracts/test/MaxWithdrawTest.t.sol @@ -1,247 +1,247 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.0; - -import "./helpers/WithPool.sol"; -import { BaseTest } from "./config/BaseTest.t.sol"; -import "forge-std/Test.sol"; - -import { ERC20 } from "solmate/tokens/ERC20.sol"; -import { FuseFlywheelDynamicRewards } from "fuse-flywheel/rewards/FuseFlywheelDynamicRewards.sol"; -import { MockERC20 } from "solmate/test/utils/mocks/MockERC20.sol"; -import { MasterPriceOracle } from "../oracles/MasterPriceOracle.sol"; -import { IRedemptionStrategy } from "../liquidators/IRedemptionStrategy.sol"; -import { IFundsConversionStrategy } from "../liquidators/IFundsConversionStrategy.sol"; -import { IUniswapV2Router02 } from "../external/uniswap/IUniswapV2Router02.sol"; -import { PoolLensSecondary } from "../PoolLensSecondary.sol"; -import { UniswapLpTokenLiquidator } from "../liquidators/UniswapLpTokenLiquidator.sol"; -import { IUniswapV2Pair } from "../external/uniswap/IUniswapV2Pair.sol"; -import { IUniswapV2Factory } from "../external/uniswap/IUniswapV2Factory.sol"; -import { ICErc20 } from "../compound/CTokenInterfaces.sol"; - -contract MockAsset is MockERC20 { - constructor() MockERC20("test", "test", 8) {} - - function deposit() external payable {} -} - -contract MaxWithdrawTest is WithPool { - struct LiquidationData { - address[] cTokens; - ICErc20[] allMarkets; - MockAsset bnb; - MockAsset mimo; - MockAsset usdc; - } - - function afterForkSetUp() internal override { - super.setUpWithPool( - MasterPriceOracle(ap.getAddress("MasterPriceOracle")), - ERC20Upgradeable(ap.getAddress("wtoken")) - ); - - deal(address(underlyingToken), address(this), 100e18); - setUpPool("bsc-test", false, 0.1e18, 1.1e18); - } - - function testMaxWithdrawBsc() public fork(BSC_MAINNET) { - PoolLensSecondary poolLensSecondary = new PoolLensSecondary(); - poolLensSecondary.initialize(poolDirectory); - - LiquidationData memory vars; - vm.roll(1); - vars.bnb = MockAsset(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c); - vars.usdc = MockAsset(0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d); - - deployCErc20Delegate(address(vars.bnb), "BNB", "bnb", 0.9e18); - deployCErc20Delegate(address(vars.usdc), "USDC", "usdc", 0.9e18); - - // TODO no need to upgrade after the next deploy - upgradePool(address(comptroller)); - - vars.allMarkets = comptroller.getAllMarkets(); - CErc20Delegate cBnbToken = CErc20Delegate(address(vars.allMarkets[0])); - - CErc20Delegate cUSDC = CErc20Delegate(address(vars.allMarkets[1])); - - vars.cTokens = new address[](1); - vars.cTokens[0] = address(cBnbToken); - - address accountOne = address(1); - address accountTwo = address(2); - address accountThree = address(3); - - { - address comptrollerAddress = address(comptroller); - AuthoritiesRegistry ar = ionicAdmin.authoritiesRegistry(); - PoolRolesAuthority poolAuth = ar.poolsAuthorities(comptrollerAddress); - ar.setUserRole(comptrollerAddress, accountOne, poolAuth.BORROWER_ROLE(), true); - ar.setUserRole(comptrollerAddress, accountTwo, poolAuth.BORROWER_ROLE(), true); - ar.setUserRole(comptrollerAddress, accountThree, poolAuth.BORROWER_ROLE(), true); - } - - // Account One Supply - deal(address(vars.bnb), accountOne, 5000000000e18); - deal(address(vars.bnb), accountThree, 5000000000e18); - deal(address(vars.usdc), accountTwo, 10000e18); - - // Account One Supply - { - emit log("Account One Supply"); - vm.startPrank(accountOne); - vars.bnb.approve(address(cBnbToken), 1e36); - assertEq(cBnbToken.mint(1e18), 0, "!cbnb mint acc 1"); - comptroller.enterMarkets(vars.cTokens); - vm.stopPrank(); - } - - // Account Three Supply - { - emit log("Account Three Supply"); - vm.startPrank(accountThree); - vars.bnb.approve(address(cBnbToken), 1e36); - assertEq(cBnbToken.mint(1e18), 0, "!cbnb mint acc 3"); - comptroller.enterMarkets(vars.cTokens); - vm.stopPrank(); - } - - // Account Two Supply - { - emit log("Account Two Supply"); - vm.startPrank(accountTwo); - vars.usdc.approve(address(cUSDC), 1e36); - assertEq(cUSDC.mint(1000e18), 0, "!cusdc mint acc 2"); - vars.cTokens[0] = address(cUSDC); - comptroller.enterMarkets(vars.cTokens); - vm.stopPrank(); - assertEq(cUSDC.totalSupply(), 1000e18 * 5, "!cUSDC total supply"); - assertEq(cBnbToken.totalSupply(), 1e18 * 5 * 2, "!cBNB total supply"); - } - - // Account Two Borrow - { - emit log("Account Two Borrow"); - vm.startPrank(accountTwo); - assertEq(cBnbToken.borrow(0.5e18), 0, "!cbnb borrow acc 2"); - vm.stopPrank(); - } - - // Account One Borrow - { - emit log("Account One Borrow"); - vm.startPrank(accountOne); - assertEq(cUSDC.borrow(110e18), 0, "!cusdc borrow acc 1"); - assertEq(cUSDC.totalBorrows(), 110e18, "!total borrows"); - - uint256 maxWithdraw = poolLensSecondary.getMaxRedeem(accountOne, ICErc20(address(cBnbToken))); - - uint256 beforeBnbBalance = vars.bnb.balanceOf(accountOne); - cBnbToken.redeemUnderlying(type(uint256).max); - uint256 afterBnbBalance = vars.bnb.balanceOf(accountOne); - - assertEq(afterBnbBalance - beforeBnbBalance, maxWithdraw, "!bnb diff"); - vm.stopPrank(); - } - } - - function testMIIMOMaxWithdraw() public fork(POLYGON_MAINNET) { - PoolLensSecondary poolLensSecondary = new PoolLensSecondary(); - poolLensSecondary.initialize(poolDirectory); - - LiquidationData memory vars; - vm.roll(1); - vars.mimo = MockAsset(0xADAC33f543267c4D59a8c299cF804c303BC3e4aC); - vars.usdc = MockAsset(0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174); - - deployCErc20Delegate(address(vars.mimo), "MIMO", "mimo", 0.9e18); - deployCErc20Delegate(address(vars.usdc), "USDC", "usdc", 0.9e18); - - vars.allMarkets = comptroller.getAllMarkets(); - CErc20Delegate cMimoToken = CErc20Delegate(address(vars.allMarkets[0])); - - CErc20Delegate cUSDC = CErc20Delegate(address(vars.allMarkets[1])); - - vars.cTokens = new address[](1); - - address accountOne = address(1); - address accountTwo = address(2); - address accountThree = address(3); - - { - address comptrollerAddress = address(comptroller); - AuthoritiesRegistry ar = ionicAdmin.authoritiesRegistry(); - PoolRolesAuthority poolAuth = ar.poolsAuthorities(comptrollerAddress); - ar.setUserRole(comptrollerAddress, accountOne, poolAuth.BORROWER_ROLE(), true); - ar.setUserRole(comptrollerAddress, accountTwo, poolAuth.BORROWER_ROLE(), true); - ar.setUserRole(comptrollerAddress, accountThree, poolAuth.BORROWER_ROLE(), true); - } - - deal(address(vars.mimo), accountOne, 5e27); - deal(address(vars.mimo), accountThree, 5e27); - deal(address(vars.usdc), accountTwo, 10000e6); - - // Account One Supply - { - emit log("Account One Supply"); - vm.startPrank(accountOne); - vars.mimo.approve(address(cMimoToken), 1e36); - assertEq(cMimoToken.mint(10e24), 0, "!cmimo mint acc 1"); - vars.cTokens[0] = address(cMimoToken); - comptroller.enterMarkets(vars.cTokens); - vm.stopPrank(); - } - - // Account Three Supply - { - emit log("Account Three Supply"); - vm.startPrank(accountThree); - vars.mimo.approve(address(cMimoToken), 1e36); - assertEq(cMimoToken.mint(10e24), 0, "!cmimo mint acc 3"); - vars.cTokens[0] = address(cMimoToken); - comptroller.enterMarkets(vars.cTokens); - vm.stopPrank(); - } - - // Account Two Supply - { - emit log("Account Two Supply"); - vm.startPrank(accountTwo); - vars.usdc.approve(address(cUSDC), 1e36); - assertEq(cUSDC.mint(1000e6), 0, "!cusdc mint acc 2"); - vars.cTokens[0] = address(cUSDC); - comptroller.enterMarkets(vars.cTokens); - vm.stopPrank(); - assertEq(cUSDC.totalSupply(), 1000e6 * 5, "!cUSDC total supply"); - assertEq(cMimoToken.totalSupply(), 10000000e18 * 5 * 2, "!cMimo total supply"); - } - - // Account Two Borrow - { - emit log("Account Two Borrow"); - vm.startPrank(accountTwo); - uint256 maxBorrow = poolLensSecondary.getMaxBorrow(accountTwo, ICErc20(address(cMimoToken))); - emit log_uint(maxBorrow); - assertEq(cMimoToken.borrow(maxBorrow), 0, "!cmimo borrow acc 2"); - assertEq(cMimoToken.totalBorrows(), maxBorrow, "!cMimo total borrows"); - - vm.stopPrank(); - } - - // Account One Borrow - { - emit log("Account One Borrow"); - vm.startPrank(accountOne); - vars.usdc.approve(address(cUSDC), 1e36); - assertEq(cUSDC.borrow(150e6), 0, "!cusdc borrow acc 1"); - assertEq(cUSDC.totalBorrows(), 150e6, "!cUSDC total borrows"); - - uint256 maxWithdraw = poolLensSecondary.getMaxRedeem(accountOne, ICErc20(address(cMimoToken))); - - uint256 beforeMimoBalance = vars.mimo.balanceOf(accountOne); - cMimoToken.redeemUnderlying(type(uint256).max); - uint256 afterMimoBalance = vars.mimo.balanceOf(accountOne); - - assertEq(afterMimoBalance - beforeMimoBalance, maxWithdraw, "!mimo diff"); - vm.stopPrank(); - } - } -} +// // SPDX-License-Identifier: UNLICENSED +// pragma solidity >=0.8.0; + +// import "./helpers/WithPool.sol"; +// import { BaseTest } from "./config/BaseTest.t.sol"; +// import "forge-std/Test.sol"; + +// import { ERC20 } from "solmate/tokens/ERC20.sol"; +// import { FuseFlywheelDynamicRewards } from "fuse-flywheel/rewards/FuseFlywheelDynamicRewards.sol"; +// import { MockERC20 } from "solmate/test/utils/mocks/MockERC20.sol"; +// import { MasterPriceOracle } from "../oracles/MasterPriceOracle.sol"; +// import { IRedemptionStrategy } from "../liquidators/IRedemptionStrategy.sol"; +// import { IFundsConversionStrategy } from "../liquidators/IFundsConversionStrategy.sol"; +// import { IUniswapV2Router02 } from "../external/uniswap/IUniswapV2Router02.sol"; +// import { PoolLensSecondary } from "../PoolLensSecondary.sol"; +// import { UniswapLpTokenLiquidator } from "../liquidators/UniswapLpTokenLiquidator.sol"; +// import { IUniswapV2Pair } from "../external/uniswap/IUniswapV2Pair.sol"; +// import { IUniswapV2Factory } from "../external/uniswap/IUniswapV2Factory.sol"; +// import { ICErc20 } from "../compound/CTokenInterfaces.sol"; + +// contract MockAsset is MockERC20 { +// constructor() MockERC20("test", "test", 8) {} + +// function deposit() external payable {} +// } + +// contract MaxWithdrawTest is WithPool { +// struct LiquidationData { +// address[] cTokens; +// ICErc20[] allMarkets; +// MockAsset bnb; +// MockAsset mimo; +// MockAsset usdc; +// } + +// function afterForkSetUp() internal override { +// super.setUpWithPool( +// MasterPriceOracle(ap.getAddress("MasterPriceOracle")), +// ERC20Upgradeable(ap.getAddress("wtoken")) +// ); + +// deal(address(underlyingToken), address(this), 100e18); +// setUpPool("bsc-test", false, 0.1e18, 1.1e18); +// } + +// function testMaxWithdrawBsc() public fork(BSC_MAINNET) { +// PoolLensSecondary poolLensSecondary = new PoolLensSecondary(); +// poolLensSecondary.initialize(poolDirectory); + +// LiquidationData memory vars; +// vm.roll(1); +// vars.bnb = MockAsset(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c); +// vars.usdc = MockAsset(0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d); + +// deployCErc20Delegate(address(vars.bnb), "BNB", "bnb", 0.9e18); +// deployCErc20Delegate(address(vars.usdc), "USDC", "usdc", 0.9e18); + +// // TODO no need to upgrade after the next deploy +// upgradePool(address(comptroller)); + +// vars.allMarkets = comptroller.getAllMarkets(); +// CErc20Delegate cBnbToken = CErc20Delegate(address(vars.allMarkets[0])); + +// CErc20Delegate cUSDC = CErc20Delegate(address(vars.allMarkets[1])); + +// vars.cTokens = new address[](1); +// vars.cTokens[0] = address(cBnbToken); + +// address accountOne = address(1); +// address accountTwo = address(2); +// address accountThree = address(3); + +// { +// address comptrollerAddress = address(comptroller); +// AuthoritiesRegistry ar = ionicAdmin.authoritiesRegistry(); +// PoolRolesAuthority poolAuth = ar.poolsAuthorities(comptrollerAddress); +// ar.setUserRole(comptrollerAddress, accountOne, poolAuth.BORROWER_ROLE(), true); +// ar.setUserRole(comptrollerAddress, accountTwo, poolAuth.BORROWER_ROLE(), true); +// ar.setUserRole(comptrollerAddress, accountThree, poolAuth.BORROWER_ROLE(), true); +// } + +// // Account One Supply +// deal(address(vars.bnb), accountOne, 5000000000e18); +// deal(address(vars.bnb), accountThree, 5000000000e18); +// deal(address(vars.usdc), accountTwo, 10000e18); + +// // Account One Supply +// { +// emit log("Account One Supply"); +// vm.startPrank(accountOne); +// vars.bnb.approve(address(cBnbToken), 1e36); +// assertEq(cBnbToken.mint(1e18), 0, "!cbnb mint acc 1"); +// comptroller.enterMarkets(vars.cTokens); +// vm.stopPrank(); +// } + +// // Account Three Supply +// { +// emit log("Account Three Supply"); +// vm.startPrank(accountThree); +// vars.bnb.approve(address(cBnbToken), 1e36); +// assertEq(cBnbToken.mint(1e18), 0, "!cbnb mint acc 3"); +// comptroller.enterMarkets(vars.cTokens); +// vm.stopPrank(); +// } + +// // Account Two Supply +// { +// emit log("Account Two Supply"); +// vm.startPrank(accountTwo); +// vars.usdc.approve(address(cUSDC), 1e36); +// assertEq(cUSDC.mint(1000e18), 0, "!cusdc mint acc 2"); +// vars.cTokens[0] = address(cUSDC); +// comptroller.enterMarkets(vars.cTokens); +// vm.stopPrank(); +// assertEq(cUSDC.totalSupply(), 1000e18 * 5, "!cUSDC total supply"); +// assertEq(cBnbToken.totalSupply(), 1e18 * 5 * 2, "!cBNB total supply"); +// } + +// // Account Two Borrow +// { +// emit log("Account Two Borrow"); +// vm.startPrank(accountTwo); +// assertEq(cBnbToken.borrow(0.5e18), 0, "!cbnb borrow acc 2"); +// vm.stopPrank(); +// } + +// // Account One Borrow +// { +// emit log("Account One Borrow"); +// vm.startPrank(accountOne); +// assertEq(cUSDC.borrow(110e18), 0, "!cusdc borrow acc 1"); +// assertEq(cUSDC.totalBorrows(), 110e18, "!total borrows"); + +// uint256 maxWithdraw = poolLensSecondary.getMaxRedeem(accountOne, ICErc20(address(cBnbToken))); + +// uint256 beforeBnbBalance = vars.bnb.balanceOf(accountOne); +// cBnbToken.redeemUnderlying(type(uint256).max); +// uint256 afterBnbBalance = vars.bnb.balanceOf(accountOne); + +// assertEq(afterBnbBalance - beforeBnbBalance, maxWithdraw, "!bnb diff"); +// vm.stopPrank(); +// } +// } + +// function testMIIMOMaxWithdraw() public fork(POLYGON_MAINNET) { +// PoolLensSecondary poolLensSecondary = new PoolLensSecondary(); +// poolLensSecondary.initialize(poolDirectory); + +// LiquidationData memory vars; +// vm.roll(1); +// vars.mimo = MockAsset(0xADAC33f543267c4D59a8c299cF804c303BC3e4aC); +// vars.usdc = MockAsset(0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174); + +// deployCErc20Delegate(address(vars.mimo), "MIMO", "mimo", 0.9e18); +// deployCErc20Delegate(address(vars.usdc), "USDC", "usdc", 0.9e18); + +// vars.allMarkets = comptroller.getAllMarkets(); +// CErc20Delegate cMimoToken = CErc20Delegate(address(vars.allMarkets[0])); + +// CErc20Delegate cUSDC = CErc20Delegate(address(vars.allMarkets[1])); + +// vars.cTokens = new address[](1); + +// address accountOne = address(1); +// address accountTwo = address(2); +// address accountThree = address(3); + +// { +// address comptrollerAddress = address(comptroller); +// AuthoritiesRegistry ar = ionicAdmin.authoritiesRegistry(); +// PoolRolesAuthority poolAuth = ar.poolsAuthorities(comptrollerAddress); +// ar.setUserRole(comptrollerAddress, accountOne, poolAuth.BORROWER_ROLE(), true); +// ar.setUserRole(comptrollerAddress, accountTwo, poolAuth.BORROWER_ROLE(), true); +// ar.setUserRole(comptrollerAddress, accountThree, poolAuth.BORROWER_ROLE(), true); +// } + +// deal(address(vars.mimo), accountOne, 5e27); +// deal(address(vars.mimo), accountThree, 5e27); +// deal(address(vars.usdc), accountTwo, 10000e6); + +// // Account One Supply +// { +// emit log("Account One Supply"); +// vm.startPrank(accountOne); +// vars.mimo.approve(address(cMimoToken), 1e36); +// assertEq(cMimoToken.mint(10e24), 0, "!cmimo mint acc 1"); +// vars.cTokens[0] = address(cMimoToken); +// comptroller.enterMarkets(vars.cTokens); +// vm.stopPrank(); +// } + +// // Account Three Supply +// { +// emit log("Account Three Supply"); +// vm.startPrank(accountThree); +// vars.mimo.approve(address(cMimoToken), 1e36); +// assertEq(cMimoToken.mint(10e24), 0, "!cmimo mint acc 3"); +// vars.cTokens[0] = address(cMimoToken); +// comptroller.enterMarkets(vars.cTokens); +// vm.stopPrank(); +// } + +// // Account Two Supply +// { +// emit log("Account Two Supply"); +// vm.startPrank(accountTwo); +// vars.usdc.approve(address(cUSDC), 1e36); +// assertEq(cUSDC.mint(1000e6), 0, "!cusdc mint acc 2"); +// vars.cTokens[0] = address(cUSDC); +// comptroller.enterMarkets(vars.cTokens); +// vm.stopPrank(); +// assertEq(cUSDC.totalSupply(), 1000e6 * 5, "!cUSDC total supply"); +// assertEq(cMimoToken.totalSupply(), 10000000e18 * 5 * 2, "!cMimo total supply"); +// } + +// // Account Two Borrow +// { +// emit log("Account Two Borrow"); +// vm.startPrank(accountTwo); +// uint256 maxBorrow = poolLensSecondary.getMaxBorrow(accountTwo, ICErc20(address(cMimoToken))); +// emit log_uint(maxBorrow); +// assertEq(cMimoToken.borrow(maxBorrow), 0, "!cmimo borrow acc 2"); +// assertEq(cMimoToken.totalBorrows(), maxBorrow, "!cMimo total borrows"); + +// vm.stopPrank(); +// } + +// // Account One Borrow +// { +// emit log("Account One Borrow"); +// vm.startPrank(accountOne); +// vars.usdc.approve(address(cUSDC), 1e36); +// assertEq(cUSDC.borrow(150e6), 0, "!cusdc borrow acc 1"); +// assertEq(cUSDC.totalBorrows(), 150e6, "!cUSDC total borrows"); + +// uint256 maxWithdraw = poolLensSecondary.getMaxRedeem(accountOne, ICErc20(address(cMimoToken))); + +// uint256 beforeMimoBalance = vars.mimo.balanceOf(accountOne); +// cMimoToken.redeemUnderlying(type(uint256).max); +// uint256 afterMimoBalance = vars.mimo.balanceOf(accountOne); + +// assertEq(afterMimoBalance - beforeMimoBalance, maxWithdraw, "!mimo diff"); +// vm.stopPrank(); +// } +// } +// } diff --git a/contracts/test/caps/AdrastiaPrudentiaCapsTest.t.sol b/contracts/test/caps/AdrastiaPrudentiaCapsTest.t.sol index 419ce89b..d041ec43 100644 --- a/contracts/test/caps/AdrastiaPrudentiaCapsTest.t.sol +++ b/contracts/test/caps/AdrastiaPrudentiaCapsTest.t.sol @@ -20,9 +20,8 @@ import { AuthoritiesRegistry } from "../../ionic/AuthoritiesRegistry.sol"; import { PoolRolesAuthority } from "../../ionic/PoolRolesAuthority.sol"; import { PrudentiaLib } from "../../adrastia/PrudentiaLib.sol"; import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import {IFlywheelBooster} from "../../ionic/strategies/flywheel/IFlywheelBooster.sol"; -import { IFlywheelBooster } from "flywheel-v2/interfaces/IFlywheelBooster.sol"; -import { IFlywheelRewards } from "flywheel-v2/interfaces/IFlywheelRewards.sol"; import { ERC20 } from "solmate/tokens/ERC20.sol"; import { MockERC20 } from "solmate/test/utils/mocks/MockERC20.sol"; import { MockPriceOracle } from "../../oracles/1337/MockPriceOracle.sol"; diff --git a/generated.ts b/generated.ts index 429fa46c..1cbe0898 100644 --- a/generated.ts +++ b/generated.ts @@ -2508,6 +2508,34 @@ export const adjustableJumpRateModelAbi = [ }, ] as const +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// AerodromePriceOracle +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const aerodromePriceOracleAbi = [ + { + type: 'constructor', + inputs: [{ name: '_prices', internalType: 'address', type: 'address' }], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'cToken', internalType: 'contract ICErc20', type: 'address' }, + ], + name: 'getUnderlyingPrice', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'underlying', internalType: 'address', type: 'address' }], + name: 'price', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, +] as const + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // AggregatorInterface ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -5318,7 +5346,7 @@ export const baseFlywheelRewardsAbi = [ inputs: [], name: 'flywheel', outputs: [ - { name: '', internalType: 'contract FlywheelCore', type: 'address' }, + { name: '', internalType: 'contract IonicFlywheelCore', type: 'address' }, ], stateMutability: 'view', }, @@ -5365,6 +5393,23 @@ export const basePriceOracleAbi = [ }, ] as const +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// BasePrices +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const basePricesAbi = [ + { + type: 'function', + inputs: [ + { name: 'src_len', internalType: 'uint8', type: 'uint8' }, + { name: 'connectors', internalType: 'address[]', type: 'address[]' }, + ], + name: 'getManyRatesWithConnectors', + outputs: [{ name: 'rates', internalType: 'uint256[]', type: 'uint256[]' }], + stateMutability: 'view', + }, +] as const + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // BaseUniswapV2Liquidator ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -5515,6 +5560,15 @@ export const cErc20Abi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'ap', + outputs: [ + { name: '', internalType: 'contract AddressesProvider', type: 'address' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [ @@ -6150,6 +6204,15 @@ export const cErc20AdminBaseAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'ap', + outputs: [ + { name: '', internalType: 'contract AddressesProvider', type: 'address' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -6328,6 +6391,15 @@ export const cErc20DelegateAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'ap', + outputs: [ + { name: '', internalType: 'contract AddressesProvider', type: 'address' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [ @@ -7036,6 +7108,15 @@ export const cErc20DelegatorAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'ap', + outputs: [ + { name: '', internalType: 'contract AddressesProvider', type: 'address' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -7594,6 +7675,15 @@ export const cErc20DelegatorBaseAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'ap', + outputs: [ + { name: '', internalType: 'contract AddressesProvider', type: 'address' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -8149,6 +8239,15 @@ export const cErc20FirstExtensionBaseAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'ap', + outputs: [ + { name: '', internalType: 'contract AddressesProvider', type: 'address' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [ @@ -8684,6 +8783,15 @@ export const cErc20PluginDelegateAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'ap', + outputs: [ + { name: '', internalType: 'contract AddressesProvider', type: 'address' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [ @@ -9386,6 +9494,15 @@ export const cErc20PluginRewardsDelegateAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'ap', + outputs: [ + { name: '', internalType: 'contract AddressesProvider', type: 'address' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [ @@ -10448,6 +10565,15 @@ export const cErc20RewardsDelegateAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'ap', + outputs: [ + { name: '', internalType: 'contract AddressesProvider', type: 'address' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [ @@ -11103,161 +11229,170 @@ export const cErc20StorageAbi = [ { type: 'function', inputs: [], - name: 'borrowIndex', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'comptroller', - outputs: [ - { name: '', internalType: 'contract IonicComptroller', type: 'address' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'decimals', - outputs: [{ name: '', internalType: 'uint8', type: 'uint8' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'feeSeizeShareMantissa', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'interestRateModel', + name: 'ap', outputs: [ - { name: '', internalType: 'contract InterestRateModel', type: 'address' }, + { name: '', internalType: 'contract AddressesProvider', type: 'address' }, ], stateMutability: 'view', }, - { - type: 'function', - inputs: [], - name: 'ionicAdmin', - outputs: [{ name: '', internalType: 'address payable', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'ionicFeeMantissa', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'name', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'protocolSeizeShareMantissa', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'reserveFactorMantissa', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'symbol', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'totalAdminFees', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'totalBorrows', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'totalIonicFees', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'totalReserves', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'totalSupply', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'underlying', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - stateMutability: 'view', - }, -] as const - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// CErc20StorageInterface -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const cErc20StorageInterfaceAbi = [ - { - type: 'function', - inputs: [], - name: 'accrualBlockNumber', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'admin', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'adminFeeMantissa', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'adminHasRights', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, + { + type: 'function', + inputs: [], + name: 'borrowIndex', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'comptroller', + outputs: [ + { name: '', internalType: 'contract IonicComptroller', type: 'address' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'decimals', + outputs: [{ name: '', internalType: 'uint8', type: 'uint8' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'feeSeizeShareMantissa', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'interestRateModel', + outputs: [ + { name: '', internalType: 'contract InterestRateModel', type: 'address' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'ionicAdmin', + outputs: [{ name: '', internalType: 'address payable', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'ionicFeeMantissa', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'name', + outputs: [{ name: '', internalType: 'string', type: 'string' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'protocolSeizeShareMantissa', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'reserveFactorMantissa', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'symbol', + outputs: [{ name: '', internalType: 'string', type: 'string' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'totalAdminFees', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'totalBorrows', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'totalIonicFees', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'totalReserves', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'totalSupply', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'underlying', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, +] as const + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CErc20StorageInterface +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const cErc20StorageInterfaceAbi = [ + { + type: 'function', + inputs: [], + name: 'accrualBlockNumber', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'admin', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'adminFeeMantissa', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'adminHasRights', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -11568,6 +11703,13 @@ export const cTokenFirstExtensionAbi = [ outputs: [{ name: '', internalType: 'bytes4[]', type: 'bytes4[]' }], stateMutability: 'pure', }, + { + type: 'function', + inputs: [{ name: '_ap', internalType: 'address', type: 'address' }], + name: '_setAddressesProvider', + outputs: [], + stateMutability: 'nonpayable', + }, { type: 'function', inputs: [ @@ -11644,6 +11786,15 @@ export const cTokenFirstExtensionAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'ap', + outputs: [ + { name: '', internalType: 'contract AddressesProvider', type: 'address' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [ @@ -12532,6 +12683,15 @@ export const cTokenSecondExtensionBaseAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'ap', + outputs: [ + { name: '', internalType: 'contract AddressesProvider', type: 'address' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [ @@ -14070,6 +14230,20 @@ export const comptrollerAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'effectiveBorrowCaps', + outputs: [{ name: 'borrowCap', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'effectiveSupplyCaps', + outputs: [{ name: 'supplyCap', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -14687,6 +14861,20 @@ export const comptrollerBaseAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'effectiveBorrowCaps', + outputs: [{ name: 'borrowCap', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'effectiveSupplyCaps', + outputs: [{ name: 'supplyCap', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -15480,6 +15668,20 @@ export const comptrollerFirstExtensionAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'effectiveBorrowCaps', + outputs: [{ name: 'borrowCap', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'effectiveSupplyCaps', + outputs: [{ name: 'supplyCap', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -16072,6 +16274,20 @@ export const comptrollerInterfaceAbi = [ outputs: [{ name: '', internalType: 'bool', type: 'bool' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'effectiveBorrowCaps', + outputs: [{ name: 'borrowCap', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'effectiveSupplyCaps', + outputs: [{ name: 'supplyCap', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, { type: 'function', inputs: [{ name: 'cTokens', internalType: 'address[]', type: 'address[]' }], @@ -16258,10 +16474,67 @@ export const comptrollerInterfaceAbi = [ ] as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ComptrollerStorageInterface +// ComptrollerPrudentiaCapsExt ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -export const comptrollerStorageInterfaceAbi = [ +export const comptrollerPrudentiaCapsExtAbi = [ + { + type: 'function', + inputs: [], + name: '_borrowGuardianPaused', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: '_getExtensionFunctions', + outputs: [{ name: '', internalType: 'bytes4[]', type: 'bytes4[]' }], + stateMutability: 'pure', + }, + { + type: 'function', + inputs: [], + name: '_mintGuardianPaused', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { + name: 'newConfig', + internalType: 'struct PrudentiaLib.PrudentiaConfig', + type: 'tuple', + components: [ + { name: 'controller', internalType: 'address', type: 'address' }, + { name: 'offset', internalType: 'uint8', type: 'uint8' }, + { name: 'decimalShift', internalType: 'int8', type: 'int8' }, + ], + }, + ], + name: '_setBorrowCapConfig', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { + name: 'newConfig', + internalType: 'struct PrudentiaLib.PrudentiaConfig', + type: 'tuple', + components: [ + { name: 'controller', internalType: 'address', type: 'address' }, + { name: 'offset', internalType: 'uint8', type: 'uint8' }, + { name: 'decimalShift', internalType: 'int8', type: 'int8' }, + ], + }, + ], + name: '_setSupplyCapConfig', + outputs: [], + stateMutability: 'nonpayable', + }, { type: 'function', inputs: [ @@ -16269,7 +16542,7 @@ export const comptrollerStorageInterfaceAbi = [ { name: '', internalType: 'uint256', type: 'uint256' }, ], name: 'accountAssets', - outputs: [{ name: '', internalType: 'address', type: 'address' }], + outputs: [{ name: '', internalType: 'contract ICErc20', type: 'address' }], stateMutability: 'view', }, { @@ -16286,11 +16559,25 @@ export const comptrollerStorageInterfaceAbi = [ outputs: [{ name: '', internalType: 'bool', type: 'bool' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'allBorrowers', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'allMarkets', + outputs: [{ name: '', internalType: 'contract ICErc20', type: 'address' }], + stateMutability: 'view', + }, { type: 'function', inputs: [ - { name: 'borrowed', internalType: 'address', type: 'address' }, - { name: 'collateral', internalType: 'address', type: 'address' }, + { name: '', internalType: 'address', type: 'address' }, + { name: '', internalType: 'address', type: 'address' }, ], name: 'borrowCapForCollateral', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], @@ -16298,14 +16585,21 @@ export const comptrollerStorageInterfaceAbi = [ }, { type: 'function', - inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + inputs: [], + name: 'borrowCapGuardian', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'address', type: 'address' }], name: 'borrowCaps', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, { type: 'function', - inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + inputs: [{ name: '', internalType: 'address', type: 'address' }], name: 'borrowGuardianPaused', outputs: [{ name: '', internalType: 'bool', type: 'bool' }], stateMutability: 'view', @@ -16313,8 +16607,8 @@ export const comptrollerStorageInterfaceAbi = [ { type: 'function', inputs: [ - { name: 'borrowed', internalType: 'address', type: 'address' }, - { name: 'collateral', internalType: 'address', type: 'address' }, + { name: '', internalType: 'address', type: 'address' }, + { name: '', internalType: 'address', type: 'address' }, ], name: 'borrowingAgainstCollateralBlacklist', outputs: [{ name: '', internalType: 'bool', type: 'bool' }], @@ -16324,7 +16618,7 @@ export const comptrollerStorageInterfaceAbi = [ type: 'function', inputs: [{ name: '', internalType: 'address', type: 'address' }], name: 'cTokensByUnderlying', - outputs: [{ name: '', internalType: 'address', type: 'address' }], + outputs: [{ name: '', internalType: 'contract ICErc20', type: 'address' }], stateMutability: 'view', }, { @@ -16334,6 +16628,20 @@ export const comptrollerStorageInterfaceAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'effectiveBorrowCaps', + outputs: [{ name: 'borrowCap', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'effectiveSupplyCaps', + outputs: [{ name: 'supplyCap', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -16341,11 +16649,47 @@ export const comptrollerStorageInterfaceAbi = [ outputs: [{ name: '', internalType: 'bool', type: 'bool' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'getBorrowCapConfig', + outputs: [ + { + name: '', + internalType: 'struct PrudentiaLib.PrudentiaConfig', + type: 'tuple', + components: [ + { name: 'controller', internalType: 'address', type: 'address' }, + { name: 'offset', internalType: 'uint8', type: 'uint8' }, + { name: 'decimalShift', internalType: 'int8', type: 'int8' }, + ], + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'getSupplyCapConfig', + outputs: [ + { + name: '', + internalType: 'struct PrudentiaLib.PrudentiaConfig', + type: 'tuple', + components: [ + { name: 'controller', internalType: 'address', type: 'address' }, + { name: 'offset', internalType: 'uint8', type: 'uint8' }, + { name: 'decimalShift', internalType: 'int8', type: 'int8' }, + ], + }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [], name: 'ionicAdmin', - outputs: [{ name: '', internalType: 'address', type: 'address' }], + outputs: [{ name: '', internalType: 'address payable', type: 'address' }], stateMutability: 'view', }, { @@ -16357,8 +16701,8 @@ export const comptrollerStorageInterfaceAbi = [ }, { type: 'function', - inputs: [{ name: 'user', internalType: 'address', type: 'address' }], - name: 'isUserOfPool', + inputs: [], + name: 'isComptroller', outputs: [{ name: '', internalType: 'bool', type: 'bool' }], stateMutability: 'view', }, @@ -16371,17 +16715,368 @@ export const comptrollerStorageInterfaceAbi = [ }, { type: 'function', - inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + inputs: [{ name: '', internalType: 'address', type: 'address' }], name: 'markets', outputs: [ - { name: '', internalType: 'bool', type: 'bool' }, - { name: '', internalType: 'uint256', type: 'uint256' }, + { name: 'isListed', internalType: 'bool', type: 'bool' }, + { + name: 'collateralFactorMantissa', + internalType: 'uint256', + type: 'uint256', + }, ], stateMutability: 'view', }, { type: 'function', - inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'mintGuardianPaused', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'nonAccruingRewardsDistributors', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'oracle', + outputs: [ + { name: '', internalType: 'contract BasePriceOracle', type: 'address' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'pauseGuardian', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'pendingAdmin', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'rewardsDistributors', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'seizeGuardianPaused', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'suppliers', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'supplyCaps', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'transferGuardianPaused', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'whitelist', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'whitelistArray', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { + name: 'oldConfig', + internalType: 'struct PrudentiaLib.PrudentiaConfig', + type: 'tuple', + components: [ + { name: 'controller', internalType: 'address', type: 'address' }, + { name: 'offset', internalType: 'uint8', type: 'uint8' }, + { name: 'decimalShift', internalType: 'int8', type: 'int8' }, + ], + indexed: false, + }, + { + name: 'newConfig', + internalType: 'struct PrudentiaLib.PrudentiaConfig', + type: 'tuple', + components: [ + { name: 'controller', internalType: 'address', type: 'address' }, + { name: 'offset', internalType: 'uint8', type: 'uint8' }, + { name: 'decimalShift', internalType: 'int8', type: 'int8' }, + ], + indexed: false, + }, + ], + name: 'NewBorrowCapConfig', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { + name: 'oldConfig', + internalType: 'struct PrudentiaLib.PrudentiaConfig', + type: 'tuple', + components: [ + { name: 'controller', internalType: 'address', type: 'address' }, + { name: 'offset', internalType: 'uint8', type: 'uint8' }, + { name: 'decimalShift', internalType: 'int8', type: 'int8' }, + ], + indexed: false, + }, + { + name: 'newConfig', + internalType: 'struct PrudentiaLib.PrudentiaConfig', + type: 'tuple', + components: [ + { name: 'controller', internalType: 'address', type: 'address' }, + { name: 'offset', internalType: 'uint8', type: 'uint8' }, + { name: 'decimalShift', internalType: 'int8', type: 'int8' }, + ], + indexed: false, + }, + ], + name: 'NewSupplyCapConfig', + }, +] as const + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// ComptrollerPrudentiaCapsExtInterface +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const comptrollerPrudentiaCapsExtInterfaceAbi = [ + { + type: 'function', + inputs: [ + { + name: 'newConfig', + internalType: 'struct PrudentiaLib.PrudentiaConfig', + type: 'tuple', + components: [ + { name: 'controller', internalType: 'address', type: 'address' }, + { name: 'offset', internalType: 'uint8', type: 'uint8' }, + { name: 'decimalShift', internalType: 'int8', type: 'int8' }, + ], + }, + ], + name: '_setBorrowCapConfig', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { + name: 'newConfig', + internalType: 'struct PrudentiaLib.PrudentiaConfig', + type: 'tuple', + components: [ + { name: 'controller', internalType: 'address', type: 'address' }, + { name: 'offset', internalType: 'uint8', type: 'uint8' }, + { name: 'decimalShift', internalType: 'int8', type: 'int8' }, + ], + }, + ], + name: '_setSupplyCapConfig', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [], + name: 'getBorrowCapConfig', + outputs: [ + { + name: '', + internalType: 'struct PrudentiaLib.PrudentiaConfig', + type: 'tuple', + components: [ + { name: 'controller', internalType: 'address', type: 'address' }, + { name: 'offset', internalType: 'uint8', type: 'uint8' }, + { name: 'decimalShift', internalType: 'int8', type: 'int8' }, + ], + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'getSupplyCapConfig', + outputs: [ + { + name: '', + internalType: 'struct PrudentiaLib.PrudentiaConfig', + type: 'tuple', + components: [ + { name: 'controller', internalType: 'address', type: 'address' }, + { name: 'offset', internalType: 'uint8', type: 'uint8' }, + { name: 'decimalShift', internalType: 'int8', type: 'int8' }, + ], + }, + ], + stateMutability: 'view', + }, +] as const + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// ComptrollerStorageInterface +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const comptrollerStorageInterfaceAbi = [ + { + type: 'function', + inputs: [ + { name: '', internalType: 'address', type: 'address' }, + { name: '', internalType: 'uint256', type: 'uint256' }, + ], + name: 'accountAssets', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'admin', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'adminHasRights', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'borrowed', internalType: 'address', type: 'address' }, + { name: 'collateral', internalType: 'address', type: 'address' }, + ], + name: 'borrowCapForCollateral', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'borrowCaps', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'borrowGuardianPaused', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'borrowed', internalType: 'address', type: 'address' }, + { name: 'collateral', internalType: 'address', type: 'address' }, + ], + name: 'borrowingAgainstCollateralBlacklist', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'cTokensByUnderlying', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'closeFactorMantissa', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'enforceWhitelist', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'ionicAdmin', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'ionicAdminHasRights', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'user', internalType: 'address', type: 'address' }], + name: 'isUserOfPool', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'liquidationIncentiveMantissa', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'markets', + outputs: [ + { name: '', internalType: 'bool', type: 'bool' }, + { name: '', internalType: 'uint256', type: 'uint256' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], name: 'mintGuardianPaused', outputs: [{ name: '', internalType: 'bool', type: 'bool' }], stateMutability: 'view', @@ -16944,180 +17639,422 @@ export const comptrollerV3StorageAbi = [ ] as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ConcentratedLiquidityBasePriceOracle +// ComptrollerV4Storage ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -export const concentratedLiquidityBasePriceOracleAbi = [ +export const comptrollerV4StorageAbi = [ { type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'SUPPORTED_BASE_TOKENS', - outputs: [{ name: '', internalType: 'address', type: 'address' }], + inputs: [], + name: '_borrowGuardianPaused', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], stateMutability: 'view', }, { type: 'function', inputs: [], - name: 'WTOKEN', + name: '_mintGuardianPaused', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: '', internalType: 'address', type: 'address' }, + { name: '', internalType: 'uint256', type: 'uint256' }, + ], + name: 'accountAssets', + outputs: [{ name: '', internalType: 'contract ICErc20', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'admin', outputs: [{ name: '', internalType: 'address', type: 'address' }], stateMutability: 'view', }, { type: 'function', inputs: [], - name: '_acceptOwner', - outputs: [], - stateMutability: 'nonpayable', + name: 'adminHasRights', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', }, { type: 'function', - inputs: [ - { name: 'newPendingOwner', internalType: 'address', type: 'address' }, - ], - name: '_setPendingOwner', - outputs: [], - stateMutability: 'nonpayable', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'allBorrowers', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'allMarkets', + outputs: [{ name: '', internalType: 'contract ICErc20', type: 'address' }], + stateMutability: 'view', }, { type: 'function', inputs: [ - { - name: '_supportedBaseTokens', - internalType: 'address[]', - type: 'address[]', - }, + { name: '', internalType: 'address', type: 'address' }, + { name: '', internalType: 'address', type: 'address' }, ], - name: '_setSupportedBaseTokens', - outputs: [], - stateMutability: 'nonpayable', + name: 'borrowCapForCollateral', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', }, { type: 'function', inputs: [], - name: 'canAdminOverwrite', + name: 'borrowCapGuardian', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'borrowCaps', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'borrowGuardianPaused', outputs: [{ name: '', internalType: 'bool', type: 'bool' }], stateMutability: 'view', }, { type: 'function', inputs: [ - { name: 'token0', internalType: 'address', type: 'address' }, - { name: 'priceToken', internalType: 'address', type: 'address' }, - { name: 'sqrtPriceX96', internalType: 'uint160', type: 'uint160' }, + { name: '', internalType: 'address', type: 'address' }, + { name: '', internalType: 'address', type: 'address' }, ], - name: 'getPriceX96FromSqrtPriceX96', - outputs: [{ name: 'price_', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'pure', + name: 'borrowingAgainstCollateralBlacklist', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'cTokensByUnderlying', + outputs: [{ name: '', internalType: 'contract ICErc20', type: 'address' }], + stateMutability: 'view', }, { type: 'function', inputs: [], - name: 'getSupportedBaseTokens', - outputs: [{ name: '', internalType: 'address[]', type: 'address[]' }], + name: 'closeFactorMantissa', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, { type: 'function', - inputs: [ - { name: 'cToken', internalType: 'contract ICErc20', type: 'address' }, - ], - name: 'getUnderlyingPrice', + inputs: [], + name: 'enforceWhitelist', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'ionicAdmin', + outputs: [{ name: '', internalType: 'address payable', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'ionicAdminHasRights', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'liquidationIncentiveMantissa', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', }, { type: 'function', - inputs: [ - { name: '_wtoken', internalType: 'address', type: 'address' }, + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'markets', + outputs: [ + { name: 'isListed', internalType: 'bool', type: 'bool' }, { - name: '_supportedBaseTokens', - internalType: 'address[]', - type: 'address[]', + name: 'collateralFactorMantissa', + internalType: 'uint256', + type: 'uint256', }, ], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', + stateMutability: 'view', }, { type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'mintGuardianPaused', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], stateMutability: 'view', }, { type: 'function', - inputs: [], - name: 'pendingOwner', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'nonAccruingRewardsDistributors', outputs: [{ name: '', internalType: 'address', type: 'address' }], stateMutability: 'view', }, { type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'poolFeeds', + inputs: [], + name: 'oracle', outputs: [ - { name: 'poolAddress', internalType: 'address', type: 'address' }, - { name: 'twapWindow', internalType: 'uint256', type: 'uint256' }, - { name: 'baseToken', internalType: 'address', type: 'address' }, + { name: '', internalType: 'contract BasePriceOracle', type: 'address' }, ], stateMutability: 'view', }, { type: 'function', - inputs: [{ name: 'underlying', internalType: 'address', type: 'address' }], - name: 'price', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + inputs: [], + name: 'pauseGuardian', + outputs: [{ name: '', internalType: 'address', type: 'address' }], stateMutability: 'view', }, { type: 'function', inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', + name: 'pendingAdmin', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', }, { type: 'function', - inputs: [ - { name: 'underlyings', internalType: 'address[]', type: 'address[]' }, - { - name: 'assetConfig', - internalType: - 'struct ConcentratedLiquidityBasePriceOracle.AssetConfig[]', - type: 'tuple[]', - components: [ - { name: 'poolAddress', internalType: 'address', type: 'address' }, - { name: 'twapWindow', internalType: 'uint256', type: 'uint256' }, - { name: 'baseToken', internalType: 'address', type: 'address' }, - ], - }, - ], - name: 'setPoolFeeds', - outputs: [], - stateMutability: 'nonpayable', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'rewardsDistributors', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', }, { type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', + inputs: [], + name: 'seizeGuardianPaused', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', }, { - type: 'event', - anonymous: false, - inputs: [ - { name: 'version', internalType: 'uint8', type: 'uint8', indexed: false }, - ], - name: 'Initialized', + type: 'function', + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'suppliers', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', }, { - type: 'event', - anonymous: false, - inputs: [ - { + type: 'function', + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'supplyCaps', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'transferGuardianPaused', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'whitelist', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'whitelistArray', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, +] as const + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// ConcentratedLiquidityBasePriceOracle +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const concentratedLiquidityBasePriceOracleAbi = [ + { + type: 'function', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'SUPPORTED_BASE_TOKENS', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'WTOKEN', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: '_acceptOwner', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'newPendingOwner', internalType: 'address', type: 'address' }, + ], + name: '_setPendingOwner', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { + name: '_supportedBaseTokens', + internalType: 'address[]', + type: 'address[]', + }, + ], + name: '_setSupportedBaseTokens', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [], + name: 'canAdminOverwrite', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'token0', internalType: 'address', type: 'address' }, + { name: 'priceToken', internalType: 'address', type: 'address' }, + { name: 'sqrtPriceX96', internalType: 'uint160', type: 'uint160' }, + ], + name: 'getPriceX96FromSqrtPriceX96', + outputs: [{ name: 'price_', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'pure', + }, + { + type: 'function', + inputs: [], + name: 'getSupportedBaseTokens', + outputs: [{ name: '', internalType: 'address[]', type: 'address[]' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'cToken', internalType: 'contract ICErc20', type: 'address' }, + ], + name: 'getUnderlyingPrice', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: '_wtoken', internalType: 'address', type: 'address' }, + { + name: '_supportedBaseTokens', + internalType: 'address[]', + type: 'address[]', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [], + name: 'owner', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'pendingOwner', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'poolFeeds', + outputs: [ + { name: 'poolAddress', internalType: 'address', type: 'address' }, + { name: 'twapWindow', internalType: 'uint256', type: 'uint256' }, + { name: 'baseToken', internalType: 'address', type: 'address' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'underlying', internalType: 'address', type: 'address' }], + name: 'price', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'underlyings', internalType: 'address[]', type: 'address[]' }, + { + name: 'assetConfig', + internalType: + 'struct ConcentratedLiquidityBasePriceOracle.AssetConfig[]', + type: 'tuple[]', + components: [ + { name: 'poolAddress', internalType: 'address', type: 'address' }, + { name: 'twapWindow', internalType: 'uint256', type: 'uint256' }, + { name: 'baseToken', internalType: 'address', type: 'address' }, + ], + }, + ], + name: 'setPoolFeeds', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'version', internalType: 'uint8', type: 'uint8', indexed: false }, + ], + name: 'Initialized', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'oldOwner', internalType: 'address', type: 'address', @@ -23152,669 +24089,16 @@ export const flywheelCoreAbi = [ ] as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// FlywheelDynamicRewards -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const flywheelDynamicRewardsAbi = [ - { - type: 'function', - inputs: [], - name: 'flywheel', - outputs: [ - { name: '', internalType: 'contract FlywheelCore', type: 'address' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, - { name: 'lastUpdatedTimestamp', internalType: 'uint32', type: 'uint32' }, - ], - name: 'getAccruedRewards', - outputs: [{ name: 'amount', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'rewardToken', - outputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], - name: 'rewardsCycle', - outputs: [ - { name: 'start', internalType: 'uint32', type: 'uint32' }, - { name: 'end', internalType: 'uint32', type: 'uint32' }, - { name: 'reward', internalType: 'uint192', type: 'uint192' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'rewardsCycleLength', - outputs: [{ name: '', internalType: 'uint32', type: 'uint32' }], - stateMutability: 'view', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'start', internalType: 'uint32', type: 'uint32', indexed: true }, - { name: 'end', internalType: 'uint32', type: 'uint32', indexed: true }, - { - name: 'reward', - internalType: 'uint192', - type: 'uint192', - indexed: false, - }, - ], - name: 'NewRewardsCycle', - }, - { type: 'error', inputs: [], name: 'FlywheelError' }, -] as const - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// FlywheelStaticRewards -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const flywheelStaticRewardsAbi = [ - { - type: 'constructor', - inputs: [ - { - name: '_flywheel', - internalType: 'contract FlywheelCore', - type: 'address', - }, - { name: '_owner', internalType: 'address', type: 'address' }, - { - name: '_authority', - internalType: 'contract Authority', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'authority', - outputs: [ - { name: '', internalType: 'contract Authority', type: 'address' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'flywheel', - outputs: [ - { name: '', internalType: 'contract FlywheelCore', type: 'address' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, - { name: 'lastUpdatedTimestamp', internalType: 'uint32', type: 'uint32' }, - ], - name: 'getAccruedRewards', - outputs: [{ name: 'amount', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'rewardToken', - outputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], - name: 'rewardsInfo', - outputs: [ - { name: 'rewardsPerSecond', internalType: 'uint224', type: 'uint224' }, - { name: 'rewardsEndTimestamp', internalType: 'uint32', type: 'uint32' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { - name: 'newAuthority', - internalType: 'contract Authority', - type: 'address', - }, - ], - name: 'setAuthority', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, - { - name: 'rewards', - internalType: 'struct FlywheelStaticRewards.RewardsInfo', - type: 'tuple', - components: [ - { - name: 'rewardsPerSecond', - internalType: 'uint224', - type: 'uint224', - }, - { - name: 'rewardsEndTimestamp', - internalType: 'uint32', - type: 'uint32', - }, - ], - }, - ], - name: 'setRewardsInfo', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'user', internalType: 'address', type: 'address', indexed: true }, - { - name: 'newAuthority', - internalType: 'contract Authority', - type: 'address', - indexed: true, - }, - ], - name: 'AuthorityUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'user', internalType: 'address', type: 'address', indexed: true }, - { - name: 'newOwner', - internalType: 'address', - type: 'address', - indexed: true, - }, - ], - name: 'OwnerUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'strategy', - internalType: 'contract ERC20', - type: 'address', - indexed: true, - }, - { - name: 'rewardsPerSecond', - internalType: 'uint224', - type: 'uint224', - indexed: false, - }, - { - name: 'rewardsEndTimestamp', - internalType: 'uint32', - type: 'uint32', - indexed: false, - }, - ], - name: 'RewardsInfoUpdate', - }, - { type: 'error', inputs: [], name: 'FlywheelError' }, -] as const - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// FuseFlywheelCore -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const fuseFlywheelCoreAbi = [ - { - type: 'constructor', - inputs: [ - { name: '_rewardToken', internalType: 'contract ERC20', type: 'address' }, - { - name: '_flywheelRewards', - internalType: 'contract IFlywheelRewards', - type: 'address', - }, - { - name: '_flywheelBooster', - internalType: 'contract IFlywheelBooster', - type: 'address', - }, - { name: '_owner', internalType: 'address', type: 'address' }, - { - name: '_authority', - internalType: 'contract Authority', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'ONE', - outputs: [{ name: '', internalType: 'uint224', type: 'uint224' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, - { name: 'user', internalType: 'address', type: 'address' }, - ], - name: 'accrue', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, - { name: 'user', internalType: 'address', type: 'address' }, - { name: 'secondUser', internalType: 'address', type: 'address' }, - ], - name: 'accrue', - outputs: [ - { name: '', internalType: 'uint256', type: 'uint256' }, - { name: '', internalType: 'uint256', type: 'uint256' }, - ], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, - ], - name: 'addMarketForRewards', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, - ], - name: 'addStrategyForRewards', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'allStrategies', - outputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'authority', - outputs: [ - { name: '', internalType: 'contract Authority', type: 'address' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'user', internalType: 'address', type: 'address' }], - name: 'claimRewards', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: 'user', internalType: 'address', type: 'address' }], - name: 'compAccrued', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'flywheelBooster', - outputs: [ - { name: '', internalType: 'contract IFlywheelBooster', type: 'address' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'market', internalType: 'contract ERC20', type: 'address' }, - { name: 'borrower', internalType: 'address', type: 'address' }, - ], - name: 'flywheelPreBorrowerAction', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'market', internalType: 'contract ERC20', type: 'address' }, - { name: 'supplier', internalType: 'address', type: 'address' }, - ], - name: 'flywheelPreSupplierAction', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'market', internalType: 'contract ERC20', type: 'address' }, - { name: 'src', internalType: 'address', type: 'address' }, - { name: 'dst', internalType: 'address', type: 'address' }, - ], - name: 'flywheelPreTransferAction', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'flywheelRewards', - outputs: [ - { name: '', internalType: 'contract IFlywheelRewards', type: 'address' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'getAllStrategies', - outputs: [ - { name: '', internalType: 'contract ERC20[]', type: 'address[]' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'isFlywheel', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'isRewardsDistributor', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, - ], - name: 'marketState', - outputs: [ - { - name: '', - internalType: 'struct FlywheelCore.RewardsState', - type: 'tuple', - components: [ - { name: 'index', internalType: 'uint224', type: 'uint224' }, - { - name: 'lastUpdatedTimestamp', - internalType: 'uint32', - type: 'uint32', - }, - ], - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'rewardToken', - outputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'rewardsAccrued', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { - name: 'newAuthority', - internalType: 'contract Authority', - type: 'address', - }, - ], - name: 'setAuthority', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { - name: 'newBooster', - internalType: 'contract IFlywheelBooster', - type: 'address', - }, - ], - name: 'setBooster', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { - name: 'newFlywheelRewards', - internalType: 'contract IFlywheelRewards', - type: 'address', - }, - ], - name: 'setFlywheelRewards', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'setOwner', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], - name: 'strategyState', - outputs: [ - { name: 'index', internalType: 'uint224', type: 'uint224' }, - { name: 'lastUpdatedTimestamp', internalType: 'uint32', type: 'uint32' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: '', internalType: 'contract ERC20', type: 'address' }, - { name: '', internalType: 'address', type: 'address' }, - ], - name: 'userIndex', - outputs: [{ name: '', internalType: 'uint224', type: 'uint224' }], - stateMutability: 'view', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'strategy', - internalType: 'contract ERC20', - type: 'address', - indexed: true, - }, - { name: 'user', internalType: 'address', type: 'address', indexed: true }, - { - name: 'rewardsDelta', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'rewardsIndex', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'AccrueRewards', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'newStrategy', - internalType: 'address', - type: 'address', - indexed: true, - }, - ], - name: 'AddStrategy', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'user', internalType: 'address', type: 'address', indexed: true }, - { - name: 'newAuthority', - internalType: 'contract Authority', - type: 'address', - indexed: true, - }, - ], - name: 'AuthorityUpdated', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'user', internalType: 'address', type: 'address', indexed: true }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'ClaimRewards', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'newBooster', - internalType: 'address', - type: 'address', - indexed: true, - }, - ], - name: 'FlywheelBoosterUpdate', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'newFlywheelRewards', - internalType: 'address', - type: 'address', - indexed: true, - }, - ], - name: 'FlywheelRewardsUpdate', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'user', internalType: 'address', type: 'address', indexed: true }, - { - name: 'newOwner', - internalType: 'address', - type: 'address', - indexed: true, - }, - ], - name: 'OwnerUpdated', - }, -] as const - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// FuseFlywheelDynamicRewards +// FlywheelDynamicRewards ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -export const fuseFlywheelDynamicRewardsAbi = [ - { - type: 'constructor', - inputs: [ - { - name: '_flywheel', - internalType: 'contract FlywheelCore', - type: 'address', - }, - { name: '_cycleLength', internalType: 'uint32', type: 'uint32' }, - ], - stateMutability: 'nonpayable', - }, +export const flywheelDynamicRewardsAbi = [ { type: 'function', inputs: [], name: 'flywheel', outputs: [ - { name: '', internalType: 'contract FlywheelCore', type: 'address' }, + { name: '', internalType: 'contract IonicFlywheelCore', type: 'address' }, ], stateMutability: 'view', }, @@ -23872,28 +24156,42 @@ export const fuseFlywheelDynamicRewardsAbi = [ ] as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// FuseFlywheelDynamicRewardsPlugin +// FlywheelStaticRewards ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -export const fuseFlywheelDynamicRewardsPluginAbi = [ +export const flywheelStaticRewardsAbi = [ { type: 'constructor', inputs: [ { name: '_flywheel', - internalType: 'contract FlywheelCore', + internalType: 'contract IonicFlywheelCore', + type: 'address', + }, + { name: '_owner', internalType: 'address', type: 'address' }, + { + name: '_authority', + internalType: 'contract Authority', type: 'address', }, - { name: '_cycleLength', internalType: 'uint32', type: 'uint32' }, ], stateMutability: 'nonpayable', }, + { + type: 'function', + inputs: [], + name: 'authority', + outputs: [ + { name: '', internalType: 'contract Authority', type: 'address' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [], name: 'flywheel', outputs: [ - { name: '', internalType: 'contract FlywheelCore', type: 'address' }, + { name: '', internalType: 'contract IonicFlywheelCore', type: 'address' }, ], stateMutability: 'view', }, @@ -23905,7 +24203,14 @@ export const fuseFlywheelDynamicRewardsPluginAbi = [ ], name: 'getAccruedRewards', outputs: [{ name: 'amount', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'nonpayable', + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'owner', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', }, { type: 'function', @@ -23917,35 +24222,111 @@ export const fuseFlywheelDynamicRewardsPluginAbi = [ { type: 'function', inputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], - name: 'rewardsCycle', + name: 'rewardsInfo', outputs: [ - { name: 'start', internalType: 'uint32', type: 'uint32' }, - { name: 'end', internalType: 'uint32', type: 'uint32' }, - { name: 'reward', internalType: 'uint192', type: 'uint192' }, + { name: 'rewardsPerSecond', internalType: 'uint224', type: 'uint224' }, + { name: 'rewardsEndTimestamp', internalType: 'uint32', type: 'uint32' }, ], stateMutability: 'view', }, { type: 'function', - inputs: [], - name: 'rewardsCycleLength', - outputs: [{ name: '', internalType: 'uint32', type: 'uint32' }], - stateMutability: 'view', + inputs: [ + { + name: 'newAuthority', + internalType: 'contract Authority', + type: 'address', + }, + ], + name: 'setAuthority', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], + name: 'setOwner', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, + { + name: 'rewards', + internalType: 'struct FlywheelStaticRewards.RewardsInfo', + type: 'tuple', + components: [ + { + name: 'rewardsPerSecond', + internalType: 'uint224', + type: 'uint224', + }, + { + name: 'rewardsEndTimestamp', + internalType: 'uint32', + type: 'uint32', + }, + ], + }, + ], + name: 'setRewardsInfo', + outputs: [], + stateMutability: 'nonpayable', }, { type: 'event', anonymous: false, inputs: [ - { name: 'start', internalType: 'uint32', type: 'uint32', indexed: true }, - { name: 'end', internalType: 'uint32', type: 'uint32', indexed: true }, + { name: 'user', internalType: 'address', type: 'address', indexed: true }, { - name: 'reward', - internalType: 'uint192', - type: 'uint192', + name: 'newAuthority', + internalType: 'contract Authority', + type: 'address', + indexed: true, + }, + ], + name: 'AuthorityUpdated', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'user', internalType: 'address', type: 'address', indexed: true }, + { + name: 'newOwner', + internalType: 'address', + type: 'address', + indexed: true, + }, + ], + name: 'OwnerUpdated', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { + name: 'strategy', + internalType: 'contract ERC20', + type: 'address', + indexed: true, + }, + { + name: 'rewardsPerSecond', + internalType: 'uint224', + type: 'uint224', + indexed: false, + }, + { + name: 'rewardsEndTimestamp', + internalType: 'uint32', + type: 'uint32', indexed: false, }, ], - name: 'NewRewardsCycle', + name: 'RewardsInfoUpdate', }, { type: 'error', inputs: [], name: 'FlywheelError' }, ] as const @@ -26565,10 +26946,10 @@ export const iBeaconAbi = [ ] as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ICERC20_FFDR +// ICERC20 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -export const icerc20FfdrAbi = [ +export const icerc20Abi = [ { type: 'function', inputs: [], @@ -31416,7 +31797,7 @@ export const iFlywheelRewardsAbi = [ inputs: [], name: 'flywheel', outputs: [ - { name: '', internalType: 'contract FlywheelCore', type: 'address' }, + { name: '', internalType: 'contract IonicFlywheelCore', type: 'address' }, ], stateMutability: 'view', }, @@ -31580,6 +31961,102 @@ export const iGenericLenderAbi = [ }, ] as const +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// IHistoricalRates +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const iHistoricalRatesAbi = [ + { + type: 'function', + inputs: [ + { name: 'token', internalType: 'address', type: 'address' }, + { name: 'index', internalType: 'uint256', type: 'uint256' }, + ], + name: 'getRateAt', + outputs: [ + { + name: '', + internalType: 'struct RateLibrary.Rate', + type: 'tuple', + components: [ + { name: 'target', internalType: 'uint64', type: 'uint64' }, + { name: 'current', internalType: 'uint64', type: 'uint64' }, + { name: 'timestamp', internalType: 'uint32', type: 'uint32' }, + ], + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'token', internalType: 'address', type: 'address' }, + { name: 'amount', internalType: 'uint256', type: 'uint256' }, + { name: 'offset', internalType: 'uint256', type: 'uint256' }, + { name: 'increment', internalType: 'uint256', type: 'uint256' }, + ], + name: 'getRates', + outputs: [ + { + name: '', + internalType: 'struct RateLibrary.Rate[]', + type: 'tuple[]', + components: [ + { name: 'target', internalType: 'uint64', type: 'uint64' }, + { name: 'current', internalType: 'uint64', type: 'uint64' }, + { name: 'timestamp', internalType: 'uint32', type: 'uint32' }, + ], + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'token', internalType: 'address', type: 'address' }, + { name: 'amount', internalType: 'uint256', type: 'uint256' }, + ], + name: 'getRates', + outputs: [ + { + name: '', + internalType: 'struct RateLibrary.Rate[]', + type: 'tuple[]', + components: [ + { name: 'target', internalType: 'uint64', type: 'uint64' }, + { name: 'current', internalType: 'uint64', type: 'uint64' }, + { name: 'timestamp', internalType: 'uint32', type: 'uint32' }, + ], + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'token', internalType: 'address', type: 'address' }], + name: 'getRatesCapacity', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'token', internalType: 'address', type: 'address' }], + name: 'getRatesCount', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'token', internalType: 'address', type: 'address' }, + { name: 'amount', internalType: 'uint256', type: 'uint256' }, + ], + name: 'setRatesCapacity', + outputs: [], + stateMutability: 'nonpayable', + }, +] as const + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // IHypervisor ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -31895,6 +32372,32 @@ export const iIonicFlywheelAbi = [ }, ] as const +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// IIonicFlywheelBorrowBooster +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const iIonicFlywheelBorrowBoosterAbi = [ + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ICErc20', type: 'address' }, + { name: 'user', internalType: 'address', type: 'address' }, + ], + name: 'boostedBalanceOf', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ICErc20', type: 'address' }, + ], + name: 'boostedTotalSupply', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, +] as const + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ILendingPool ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -35856,10 +36359,10 @@ export const iPluginAbi = [ ] as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// IPlugin_FFDR +// IPlugin_FDR ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -export const iPluginFfdrAbi = [ +export const iPluginFdrAbi = [ { type: 'function', inputs: [], @@ -36590,6 +37093,20 @@ export const iQuoterAbi = [ }, ] as const +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// IRateComputer +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const iRateComputerAbi = [ + { + type: 'function', + inputs: [{ name: 'token', internalType: 'address', type: 'address' }], + name: 'computeRate', + outputs: [{ name: '', internalType: 'uint64', type: 'uint64' }], + stateMutability: 'view', + }, +] as const + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // IRateProvider ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -41120,6 +41637,20 @@ export const ionicComptrollerAbi = [ outputs: [{ name: '', internalType: 'address', type: 'address' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'effectiveBorrowCaps', + outputs: [{ name: 'borrowCap', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'cToken', internalType: 'address', type: 'address' }], + name: 'effectiveSupplyCaps', + outputs: [{ name: 'supplyCap', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -42603,6 +43134,518 @@ export const ionicFlywheelAbi = [ }, ] as const +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// IonicFlywheelBorrow +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const ionicFlywheelBorrowAbi = [ + { + type: 'function', + inputs: [], + name: '_acceptOwner', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'newPendingOwner', internalType: 'address', type: 'address' }, + ], + name: '_setPendingOwner', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, + { name: 'user', internalType: 'address', type: 'address' }, + ], + name: 'accrue', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, + { name: 'user', internalType: 'address', type: 'address' }, + { name: 'secondUser', internalType: 'address', type: 'address' }, + ], + name: 'accrue', + outputs: [ + { name: '', internalType: 'uint256', type: 'uint256' }, + { name: '', internalType: 'uint256', type: 'uint256' }, + ], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, + ], + name: 'addMarketForRewards', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, + ], + name: 'addStrategyForRewards', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'allStrategies', + outputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'user', internalType: 'address', type: 'address' }], + name: 'claimRewards', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [{ name: 'user', internalType: 'address', type: 'address' }], + name: 'compAccrued', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'feeRecipient', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'flywheelBooster', + outputs: [ + { name: '', internalType: 'contract IFlywheelBooster', type: 'address' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'market', internalType: 'address', type: 'address' }, + { name: 'borrower', internalType: 'address', type: 'address' }, + ], + name: 'flywheelPreBorrowerAction', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'market', internalType: 'address', type: 'address' }, + { name: 'supplier', internalType: 'address', type: 'address' }, + ], + name: 'flywheelPreSupplierAction', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'market', internalType: 'address', type: 'address' }, + { name: 'src', internalType: 'address', type: 'address' }, + { name: 'dst', internalType: 'address', type: 'address' }, + ], + name: 'flywheelPreTransferAction', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [], + name: 'flywheelRewards', + outputs: [ + { name: '', internalType: 'contract IFlywheelRewards', type: 'address' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'getAllStrategies', + outputs: [ + { name: '', internalType: 'contract ERC20[]', type: 'address[]' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: '_rewardToken', internalType: 'contract ERC20', type: 'address' }, + { + name: '_flywheelRewards', + internalType: 'contract IFlywheelRewards', + type: 'address', + }, + { + name: '_flywheelBooster', + internalType: 'contract IFlywheelBooster', + type: 'address', + }, + { name: '_owner', internalType: 'address', type: 'address' }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [], + name: 'isFlywheel', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'isRewardsDistributor', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, + ], + name: 'marketState', + outputs: [ + { name: '', internalType: 'uint224', type: 'uint224' }, + { name: '', internalType: 'uint32', type: 'uint32' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'owner', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'pendingOwner', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'performanceFee', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [], + name: 'rewardToken', + outputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'user', internalType: 'address', type: 'address' }], + name: 'rewardsAccrued', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { + name: 'newBooster', + internalType: 'contract IFlywheelBooster', + type: 'address', + }, + ], + name: 'setBooster', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { + name: 'newFlywheelRewards', + internalType: 'contract IFlywheelRewards', + type: 'address', + }, + ], + name: 'setFlywheelRewards', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, + ], + name: 'strategyState', + outputs: [ + { name: 'index', internalType: 'uint224', type: 'uint224' }, + { name: 'lastUpdatedTimestamp', internalType: 'uint32', type: 'uint32' }, + ], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: '_performanceFee', internalType: 'uint256', type: 'uint256' }, + { name: '_feeRecipient', internalType: 'address', type: 'address' }, + ], + name: 'updateFeeSettings', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, + { name: 'user', internalType: 'address', type: 'address' }, + ], + name: 'userIndex', + outputs: [{ name: '', internalType: 'uint224', type: 'uint224' }], + stateMutability: 'nonpayable', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { + name: 'strategy', + internalType: 'contract ERC20', + type: 'address', + indexed: true, + }, + { name: 'user', internalType: 'address', type: 'address', indexed: true }, + { + name: 'rewardsDelta', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'rewardsIndex', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + ], + name: 'AccrueRewards', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { + name: 'newStrategy', + internalType: 'address', + type: 'address', + indexed: true, + }, + ], + name: 'AddStrategy', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'user', internalType: 'address', type: 'address', indexed: true }, + { + name: 'amount', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + ], + name: 'ClaimRewards', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { + name: 'newBooster', + internalType: 'address', + type: 'address', + indexed: true, + }, + ], + name: 'FlywheelBoosterUpdate', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { + name: 'newFlywheelRewards', + internalType: 'address', + type: 'address', + indexed: true, + }, + ], + name: 'FlywheelRewardsUpdate', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'version', internalType: 'uint8', type: 'uint8', indexed: false }, + ], + name: 'Initialized', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { + name: 'oldOwner', + internalType: 'address', + type: 'address', + indexed: false, + }, + { + name: 'newOwner', + internalType: 'address', + type: 'address', + indexed: false, + }, + ], + name: 'NewOwner', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { + name: 'oldPendingOwner', + internalType: 'address', + type: 'address', + indexed: false, + }, + { + name: 'newPendingOwner', + internalType: 'address', + type: 'address', + indexed: false, + }, + ], + name: 'NewPendingOwner', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { + name: 'previousOwner', + internalType: 'address', + type: 'address', + indexed: true, + }, + { + name: 'newOwner', + internalType: 'address', + type: 'address', + indexed: true, + }, + ], + name: 'OwnershipTransferred', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { + name: 'oldPerformanceFee', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'newPerformanceFee', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'oldFeeRecipient', + internalType: 'address', + type: 'address', + indexed: false, + }, + { + name: 'newFeeRecipient', + internalType: 'address', + type: 'address', + indexed: false, + }, + ], + name: 'UpdatedFeeSettings', + }, +] as const + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// IonicFlywheelBorrowBooster +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const ionicFlywheelBorrowBoosterAbi = [ + { + type: 'function', + inputs: [], + name: 'BOOSTER_TYPE', + outputs: [{ name: '', internalType: 'string', type: 'string' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ICErc20', type: 'address' }, + { name: 'user', internalType: 'address', type: 'address' }, + ], + name: 'boostedBalanceOf', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ICErc20', type: 'address' }, + ], + name: 'boostedTotalSupply', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, +] as const + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // IonicFlywheelCore ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -43010,6 +44053,164 @@ export const ionicFlywheelCoreAbi = [ }, ] as const +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// IonicFlywheelDynamicRewards +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const ionicFlywheelDynamicRewardsAbi = [ + { + type: 'constructor', + inputs: [ + { + name: '_flywheel', + internalType: 'contract IonicFlywheelCore', + type: 'address', + }, + { name: '_cycleLength', internalType: 'uint32', type: 'uint32' }, + ], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [], + name: 'flywheel', + outputs: [ + { name: '', internalType: 'contract IonicFlywheelCore', type: 'address' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, + { name: 'lastUpdatedTimestamp', internalType: 'uint32', type: 'uint32' }, + ], + name: 'getAccruedRewards', + outputs: [{ name: 'amount', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [], + name: 'rewardToken', + outputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], + name: 'rewardsCycle', + outputs: [ + { name: 'start', internalType: 'uint32', type: 'uint32' }, + { name: 'end', internalType: 'uint32', type: 'uint32' }, + { name: 'reward', internalType: 'uint192', type: 'uint192' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'rewardsCycleLength', + outputs: [{ name: '', internalType: 'uint32', type: 'uint32' }], + stateMutability: 'view', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'start', internalType: 'uint32', type: 'uint32', indexed: true }, + { name: 'end', internalType: 'uint32', type: 'uint32', indexed: true }, + { + name: 'reward', + internalType: 'uint192', + type: 'uint192', + indexed: false, + }, + ], + name: 'NewRewardsCycle', + }, + { type: 'error', inputs: [], name: 'FlywheelError' }, +] as const + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// IonicFlywheelDynamicRewardsPlugin +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const ionicFlywheelDynamicRewardsPluginAbi = [ + { + type: 'constructor', + inputs: [ + { + name: '_flywheel', + internalType: 'contract IonicFlywheelCore', + type: 'address', + }, + { name: '_cycleLength', internalType: 'uint32', type: 'uint32' }, + ], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [], + name: 'flywheel', + outputs: [ + { name: '', internalType: 'contract IonicFlywheelCore', type: 'address' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'strategy', internalType: 'contract ERC20', type: 'address' }, + { name: 'lastUpdatedTimestamp', internalType: 'uint32', type: 'uint32' }, + ], + name: 'getAccruedRewards', + outputs: [{ name: 'amount', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [], + name: 'rewardToken', + outputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: '', internalType: 'contract ERC20', type: 'address' }], + name: 'rewardsCycle', + outputs: [ + { name: 'start', internalType: 'uint32', type: 'uint32' }, + { name: 'end', internalType: 'uint32', type: 'uint32' }, + { name: 'reward', internalType: 'uint192', type: 'uint192' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'rewardsCycleLength', + outputs: [{ name: '', internalType: 'uint32', type: 'uint32' }], + stateMutability: 'view', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'start', internalType: 'uint32', type: 'uint32', indexed: true }, + { name: 'end', internalType: 'uint32', type: 'uint32', indexed: true }, + { + name: 'reward', + internalType: 'uint192', + type: 'uint192', + indexed: false, + }, + ], + name: 'NewRewardsCycle', + }, + { type: 'error', inputs: [], name: 'FlywheelError' }, +] as const + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // IonicFlywheelLensRouter ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -43433,6 +44634,23 @@ export const ionicLiquidatorAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'nonpayable', }, + { + type: 'function', + inputs: [ + { name: 'borrower', internalType: 'address', type: 'address' }, + { name: 'repayAmount', internalType: 'uint256', type: 'uint256' }, + { name: 'cErc20', internalType: 'contract ICErc20', type: 'address' }, + { + name: 'cTokenCollateral', + internalType: 'contract ICErc20', + type: 'address', + }, + { name: 'minOutputAmount', internalType: 'uint256', type: 'uint256' }, + ], + name: 'safeLiquidatePyth', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'nonpayable', + }, { type: 'function', inputs: [ @@ -43847,6 +45065,13 @@ export const ionicLiquidatorTestAbi = [ outputs: [], stateMutability: 'nonpayable', }, + { + type: 'function', + inputs: [], + name: 'testLiquidateAfterUpgradeLiquidatorExpressRelay', + outputs: [], + stateMutability: 'nonpayable', + }, { type: 'function', inputs: [], @@ -44748,6 +45973,23 @@ export const ionicUniV3LiquidatorAbi = [ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'nonpayable', }, + { + type: 'function', + inputs: [ + { name: 'borrower', internalType: 'address', type: 'address' }, + { name: 'repayAmount', internalType: 'uint256', type: 'uint256' }, + { name: 'cErc20', internalType: 'contract ICErc20', type: 'address' }, + { + name: 'cTokenCollateral', + internalType: 'contract ICErc20', + type: 'address', + }, + { name: 'minOutputAmount', internalType: 'uint256', type: 'uint256' }, + ], + name: 'safeLiquidatePyth', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'nonpayable', + }, { type: 'function', inputs: [ @@ -48798,7 +50040,7 @@ export const mockErc4626DynamicAbi = [ { name: '_asset', internalType: 'contract ERC20', type: 'address' }, { name: '_flywheel', - internalType: 'contract FlywheelCore', + internalType: 'contract IonicFlywheelCore', type: 'address', }, ], @@ -48888,7 +50130,7 @@ export const mockErc4626DynamicAbi = [ inputs: [], name: 'flywheel', outputs: [ - { name: '', internalType: 'contract FlywheelCore', type: 'address' }, + { name: '', internalType: 'contract IonicFlywheelCore', type: 'address' }, ], stateMutability: 'view', }, @@ -52519,6 +53761,25 @@ export const priceOracleAbi = [ }, ] as const +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Prices +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const pricesAbi = [ + { + type: 'function', + inputs: [ + { name: 'srcToken', internalType: 'address', type: 'address' }, + { name: 'useSrcWrappers', internalType: 'bool', type: 'bool' }, + ], + name: 'getRateToEth', + outputs: [ + { name: 'weightedRate', internalType: 'uint256', type: 'uint256' }, + ], + stateMutability: 'view', + }, +] as const + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Proxy ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -52644,6 +53905,94 @@ export const proxyAdminAbi = [ }, ] as const +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// PrudentiaInterestRateModel +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const prudentiaInterestRateModelAbi = [ + { + type: 'constructor', + inputs: [ + { name: 'blocksPerYear_', internalType: 'uint256', type: 'uint256' }, + { name: 'underlyingToken_', internalType: 'address', type: 'address' }, + { + name: 'rateController_', + internalType: 'contract IRateComputer', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [], + name: 'blocksPerYear', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'cash', internalType: 'uint256', type: 'uint256' }, + { name: 'borrows', internalType: 'uint256', type: 'uint256' }, + { name: 'reserves', internalType: 'uint256', type: 'uint256' }, + ], + name: 'getBorrowRate', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'cash', internalType: 'uint256', type: 'uint256' }, + { name: 'borrows', internalType: 'uint256', type: 'uint256' }, + { name: 'reserves', internalType: 'uint256', type: 'uint256' }, + { + name: 'reserveFactorMantissa', + internalType: 'uint256', + type: 'uint256', + }, + ], + name: 'getSupplyRate', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'isInterestRateModel', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'rateController', + outputs: [ + { name: '', internalType: 'contract IRateComputer', type: 'address' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [], + name: 'underlyingToken', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { name: 'cash', internalType: 'uint256', type: 'uint256' }, + { name: 'borrows', internalType: 'uint256', type: 'uint256' }, + { name: 'reserves', internalType: 'uint256', type: 'uint256' }, + ], + name: 'utilizationRate', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'pure', + }, +] as const + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // PythErrors ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -53047,12 +54396,12 @@ export const replacingFlywheelDynamicRewardsAbi = [ inputs: [ { name: '_replacedFlywheel', - internalType: 'contract FlywheelCore', + internalType: 'contract IonicFlywheelCore', type: 'address', }, { name: '_flywheel', - internalType: 'contract FlywheelCore', + internalType: 'contract IonicFlywheelCore', type: 'address', }, { name: '_cycleLength', internalType: 'uint32', type: 'uint32' }, @@ -53064,7 +54413,7 @@ export const replacingFlywheelDynamicRewardsAbi = [ inputs: [], name: 'flywheel', outputs: [ - { name: '', internalType: 'contract FlywheelCore', type: 'address' }, + { name: '', internalType: 'contract IonicFlywheelCore', type: 'address' }, ], stateMutability: 'view', }, @@ -53083,7 +54432,7 @@ export const replacingFlywheelDynamicRewardsAbi = [ inputs: [], name: 'replacedFlywheel', outputs: [ - { name: '', internalType: 'contract FlywheelCore', type: 'address' }, + { name: '', internalType: 'contract IonicFlywheelCore', type: 'address' }, ], stateMutability: 'view', }, @@ -53140,12 +54489,12 @@ export const replacingFlywheelStaticRewardsAbi = [ inputs: [ { name: '_replacedFlywheel', - internalType: 'contract FlywheelCore', + internalType: 'contract IonicFlywheelCore', type: 'address', }, { name: '_flywheel', - internalType: 'contract FlywheelCore', + internalType: 'contract IonicFlywheelCore', type: 'address', }, { name: '_owner', internalType: 'address', type: 'address' }, @@ -53171,7 +54520,7 @@ export const replacingFlywheelStaticRewardsAbi = [ inputs: [], name: 'flywheel', outputs: [ - { name: '', internalType: 'contract FlywheelCore', type: 'address' }, + { name: '', internalType: 'contract IonicFlywheelCore', type: 'address' }, ], stateMutability: 'view', }, @@ -53197,7 +54546,7 @@ export const replacingFlywheelStaticRewardsAbi = [ inputs: [], name: 'replacedFlywheel', outputs: [ - { name: '', internalType: 'contract FlywheelCore', type: 'address' }, + { name: '', internalType: 'contract IonicFlywheelCore', type: 'address' }, ], stateMutability: 'view', }, @@ -59742,6 +61091,34 @@ export const upgradesBaseTestAbi = [ }, ] as const +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// VelodromePriceOracle +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const velodromePriceOracleAbi = [ + { + type: 'constructor', + inputs: [{ name: '_prices', internalType: 'address', type: 'address' }], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [ + { name: 'cToken', internalType: 'contract ICErc20', type: 'address' }, + ], + name: 'getUnderlyingPrice', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'underlying', internalType: 'address', type: 'address' }], + name: 'price', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'view', + }, +] as const + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // WETH ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -61170,7 +62547,7 @@ export const withdrawableFlywheelStaticRewardsAbi = [ inputs: [ { name: '_flywheel', - internalType: 'contract FlywheelCore', + internalType: 'contract IonicFlywheelCore', type: 'address', }, { name: '_owner', internalType: 'address', type: 'address' }, @@ -61196,7 +62573,7 @@ export const withdrawableFlywheelStaticRewardsAbi = [ inputs: [], name: 'flywheel', outputs: [ - { name: '', internalType: 'contract FlywheelCore', type: 'address' }, + { name: '', internalType: 'contract IonicFlywheelCore', type: 'address' }, ], stateMutability: 'view', }, diff --git a/lib/flywheel-v2 b/lib/flywheel-v2 deleted file mode 160000 index 5ac5d314..00000000 --- a/lib/flywheel-v2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5ac5d314362188e3ece31a9db7deba529f4e8cc7 diff --git a/lib/fuse-flywheel b/lib/fuse-flywheel deleted file mode 160000 index cd16a2ed..00000000 --- a/lib/fuse-flywheel +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cd16a2ed23851d4158c4c98733afcea5db76cb13 diff --git a/package.json b/package.json index a8cdd039..cd05d277 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "export:optimism": "hardhat export --network optimism --export ./deploymentsBrief/optimism.json && node ./scripts/prune.js ./deploymentsBrief/optimism.json", "export:fraxtal": "hardhat export --network fraxtal --export ./deploymentsBrief/fraxtal.json && node ./scripts/prune.js ./deploymentsBrief/fraxtal.json", "prune": "node ./scripts/prune.js ./deploymentsBrief/*.json", - "monorepo:setup": "bash ./scripts/move-to-monorepo.sh" + "monorepo:setup": "bash ./scripts/move-to-monorepo.sh", + "generate": "forge clean && forge build && wagmi generate" }, "files": [ "contracts"