From 0422031c5cda0b12069b2a40dbdbe6487b3b6595 Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 24 Nov 2025 15:51:25 -0400 Subject: [PATCH] ExercisePOC; removed 31337 from liqp-deployments.json; updated launch list --- deployment/liqp-deployments.json | 6 ------ doc/launch_list.md | 1 + script/ExercisePOC.sol | 35 ++++++++++++++++++++++++-------- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/deployment/liqp-deployments.json b/deployment/liqp-deployments.json index 6807370..18cd857 100644 --- a/deployment/liqp-deployments.json +++ b/deployment/liqp-deployments.json @@ -9,12 +9,6 @@ "PartyPoolBalancedPairInitCode": "0x8Ba095488f9DaB4E52d98330F7929a463Ee2dF2A" } }, - "31337": { - "v1": { - "PartyInfo": "0xbbf13f6e19c3fd22a32710D02766F292B1c04162", - "PartyPlanner": "0xFc18426b71EDa3dC001dcc36ADC9C67bC6f38747" - } - }, "11155111": { "v1": { "PartyPlanner": "0x1071097336Fd33298975efeC9C0bbc0bfB669da6", diff --git a/doc/launch_list.md b/doc/launch_list.md index 636c64f..6ea61e7 100644 --- a/doc/launch_list.md +++ b/doc/launch_list.md @@ -22,6 +22,7 @@ | WDOGE | `0x35a532d376FFd9a705d0Bb319532837337A398E7` | <= Yobit WDOGE | PEPE | `0x6982508145454Ce325dDbE47a25d4ec3d2311933` | | SHIB | `0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE` | +| SEI | `0xbdF43ecAdC5ceF51B7D1772F722E40596BC1788B` | # BLOCKLIST diff --git a/script/ExercisePOC.sol b/script/ExercisePOC.sol index 82de239..26d9eb0 100644 --- a/script/ExercisePOC.sol +++ b/script/ExercisePOC.sol @@ -2,18 +2,31 @@ pragma solidity ^0.8.30; import "forge-std/console2.sol"; +import {CommonBase} from "../lib/forge-std/src/Base.sol"; import {Script} from "../lib/forge-std/src/Script.sol"; +import {StdChains} from "../lib/forge-std/src/StdChains.sol"; +import {StdCheatsSafe} from "../lib/forge-std/src/StdCheats.sol"; +import {stdJson} from "../lib/forge-std/src/StdJson.sol"; +import {StdUtils} from "../lib/forge-std/src/StdUtils.sol"; import {IERC3156FlashBorrower} from "../lib/openzeppelin-contracts/contracts/interfaces/IERC3156FlashBorrower.sol"; import {IERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; import {IPartyInfo} from "../src/IPartyInfo.sol"; +import {IPartyPlanner} from "../src/IPartyPlanner.sol"; import {IPartyPool} from "../src/IPartyPool.sol"; import {MockFlashBorrower} from "../test/MockFlashBorrower.sol"; -import {stdJson} from "forge-std/StdJson.sol"; -import {IPartyPlanner} from "../src/IPartyPlanner.sol"; contract ExercisePOC is Script { - + // Successful on mainnet POC pool in blocks 23849608 and 23849609 + // mint 0x59fd174ba3230aba2a29ee31d9c5ea24cfbfd9b6b732dee5f1ec2d5d3eae2209 + // burn 0x9e4a722a91e04fd9a29010046d1f2122ec5398847ea0d045ca8cffc36dd51c31 + // flash 0x4092966104f79c1406b6c384c3ed06d8d6ae9e458d03e5ef15bc0af09657e0d0 + // swapMint 0x34b5a40babf18ece67696709a0b6d219ca5b1f70a3c6e62c5c5eb6e4e272ba27 + // swap 0x557fec6da56d59502fd1300fb77972ffe8b860c8fbd863acb94eb9db87b684de + // collectProtocolFees 0xc14b99318b71ecb94909d5288191fae1bb3ad6168443c2ed26ebf5816952a624 + // burnSwap 0xd711d357d46d3c861b592ca5a68655a4bb71d8895acd1c25823c3fa128d14b13 + IPartyPlanner private immutable planner; IPartyInfo private immutable info; @@ -29,11 +42,14 @@ contract ExercisePOC is Script { } function run() public { - exercise(planner.getAllPools(0,1)[0]); + IPartyPool pool = IPartyPool(0xfD07d9B82A45C2Cc9eDEb80103441e14801F325d); + console2.log('Exercising pool at', address(pool)); + vm.startBroadcast(); + exercise(pool); + vm.stopBroadcast(); } function exercise(IPartyPool pool) internal { - console2.log('Exercising pool at', address(pool)); uint8 WETH_index = 3; // gather tokens and denominators IERC20[] memory tokens = pool.allTokens(); @@ -43,15 +59,15 @@ contract ExercisePOC is Script { // approve all for (uint256 i=0; i LP) uint256 amountIn = WETH.balanceOf(address(pool)) / 100; // trade 1% of what's in the pool @@ -76,7 +93,7 @@ contract ExercisePOC is Script { WETH.approve(address(pool), amountIn); uint256 inputIndex = WETH_index; uint256 outputIndex = 0; - pool.swap(msg.sender, bytes4(0), msg.sender, WETH_index, outputIndex, amountIn, int128(0), 0, false, ''); + pool.swap(msg.sender, bytes4(0), msg.sender, inputIndex, outputIndex, amountIn, int128(0), 0, false, ''); // 6) Collect protocol fees now (after some swaps) so some will have been moved out pool.collectProtocolFees();