-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from stabilitydao/104-irmf-grmf-upgrade-trans…
…mute-oretro Retro strategies upgrade
- Loading branch information
Showing
12 changed files
with
783 additions
and
238 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.23; | ||
|
||
import "forge-std/Script.sol"; | ||
import "../src/strategies/IchiRetroMerklFarmStrategy.sol"; | ||
import "../src/strategies/GammaRetroMerklFarmStrategy.sol"; | ||
|
||
contract DeployUpdateRetroStrategiesPolygon is Script { | ||
address public constant PLATFORM = 0xb2a0737ef27b5Cc474D24c779af612159b1c3e60; | ||
address public constant POOL_RETRO_USDCe_CASH_100 = 0x619259F699839dD1498FFC22297044462483bD27; | ||
address public constant TOKEN_CASH = 0x5D066D022EDE10eFa2717eD3D79f22F949F8C175; | ||
address public constant TOKEN_USDCe = 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174; | ||
|
||
function run() external { | ||
ISwapper swapper = ISwapper(IPlatform(PLATFORM).swapper()); | ||
|
||
// route | ||
ISwapper.AddPoolData[] memory pools = new ISwapper.AddPoolData[](1); | ||
pools[0] = ISwapper.AddPoolData({ | ||
pool: POOL_RETRO_USDCe_CASH_100, | ||
ammAdapterId: AmmAdapterIdLib.UNISWAPV3, | ||
tokenIn: TOKEN_CASH, | ||
tokenOut: TOKEN_USDCe | ||
}); | ||
|
||
uint deployerPrivateKey = vm.envUint("PRIVATE_KEY"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
swapper.addPools(pools, false); | ||
|
||
new IchiRetroMerklFarmStrategy(); | ||
new GammaRetroMerklFarmStrategy(); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
|
||
function testDeployPolygon() external {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.23; | ||
|
||
interface IOToken { | ||
function exercise(uint amount, uint maxPaymentAmount, address recipient) external returns (uint); | ||
|
||
function getDiscountedPrice(uint amount_) external view returns (uint amount); | ||
|
||
function discount() external view returns (uint); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
pragma solidity ^0.8.23; | ||
|
||
/// @title Quoter Interface | ||
/// @notice Supports quoting the calculated amounts from exact input or exact output swaps | ||
/// @dev These functions are not marked view because they rely on calling non-view functions and reverting | ||
/// to compute the result. They are also not gas efficient and should not be called on-chain. | ||
interface IQuoter { | ||
/// @notice Returns the amount out received for a given exact input swap without executing the swap | ||
/// @param path The path of the swap, i.e. each token pair and the pool fee | ||
/// @param amountIn The amount of the first token to swap | ||
/// @return amountOut The amount of the last token that would be received | ||
function quoteExactInput(bytes memory path, uint amountIn) external returns (uint amountOut); | ||
|
||
/// @notice Returns the amount out received for a given exact input but for a swap of a single pool | ||
/// @param tokenIn The token being swapped in | ||
/// @param tokenOut The token being swapped out | ||
/// @param fee The fee of the token pool to consider for the pair | ||
/// @param amountIn The desired input amount | ||
/// @param sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap | ||
/// @return amountOut The amount of `tokenOut` that would be received | ||
function quoteExactInputSingle( | ||
address tokenIn, | ||
address tokenOut, | ||
uint24 fee, | ||
uint amountIn, | ||
uint160 sqrtPriceLimitX96 | ||
) external returns (uint amountOut); | ||
|
||
/// @notice Returns the amount in required for a given exact output swap without executing the swap | ||
/// @param path The path of the swap, i.e. each token pair and the pool fee. Path must be provided in reverse order | ||
/// @param amountOut The amount of the last token to receive | ||
/// @return amountIn The amount of first token required to be paid | ||
function quoteExactOutput(bytes memory path, uint amountOut) external returns (uint amountIn); | ||
|
||
/// @notice Returns the amount in required to receive the given exact output amount but for a swap of a single pool | ||
/// @param tokenIn The token being swapped in | ||
/// @param tokenOut The token being swapped out | ||
/// @param fee The fee of the token pool to consider for the pair | ||
/// @param amountOut The desired output amount | ||
/// @param sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap | ||
/// @return amountIn The amount required as the input for the swap in order to receive `amountOut` | ||
function quoteExactOutputSingle( | ||
address tokenIn, | ||
address tokenOut, | ||
uint24 fee, | ||
uint amountOut, | ||
uint160 sqrtPriceLimitX96 | ||
) external returns (uint amountIn); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.