rename to PartyInfo; README fees

This commit is contained in:
tim
2025-11-07 16:18:00 -04:00
parent ff9ed674f9
commit a08a928f7f
10 changed files with 84 additions and 73 deletions

View File

@@ -11,7 +11,7 @@ import {StdUtils} from "../lib/forge-std/src/StdUtils.sol";
import {IERC20} from "../lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import {IERC20Metadata} from "../lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {PartyPlanner} from "../src/PartyPlanner.sol";
import {PartyPoolViewer} from "../src/PartyPoolViewer.sol";
import {PartyInfo} from "../src/PartyInfo.sol";
import {Deploy} from "../test/Deploy.sol";
import {MockERC20} from "../test/MockERC20.sol";
@@ -163,7 +163,7 @@ contract DeployMock is Script {
0
);
PartyPoolViewer viewer = Deploy.newViewer();
PartyInfo info = Deploy.newInfo();
// give _tokens to dev7 for later use
mintAll(DEV_ACCOUNT_7, 1_000_000);
@@ -172,9 +172,9 @@ contract DeployMock is Script {
// Set ENV vars
string memory plannerStr = vm.toString(address(planner));
string memory viewerStr = vm.toString(address(viewer));
string memory infoStr = vm.toString(address(info));
vm.setEnv('PLANNER', plannerStr);
vm.setEnv('VIEWER', viewerStr);
vm.setEnv('INFO', infoStr);
vm.setEnv('USXD', vm.toString(address(usxd)));
vm.setEnv('FUSD', vm.toString(address(fusd)));
vm.setEnv('DIVE', vm.toString(address(dive)));
@@ -183,19 +183,19 @@ contract DeployMock is Script {
// Write JSON config file
string memory chainConfigStr = vm.serializeString('config', 'PartyPlanner', plannerStr);
chainConfigStr = vm.serializeString('config', 'PartyPoolViewer', viewerStr);
chainConfigStr = vm.serializeString('config', 'PartyInfo', infoStr);
string memory v1ConfigStr = vm.serializeString('v1', 'v1', chainConfigStr);
string memory configStr = vm.serializeString('chain config', vm.toString(block.chainid), v1ConfigStr);
vm.writeJson(configStr, 'liqp-deployments.json');
console2.log();
console2.log(' PartyPlanner', address(planner));
console2.log('PartyPoolViewer', address(viewer));
console2.log(' USXD', address(usxd));
console2.log(' FUSD', address(fusd));
console2.log(' DIVE', address(dive));
console2.log(' BUTC', address(butc));
console2.log(' WTETH', address(wteth));
console2.log('PartyPlanner', address(planner));
console2.log(' PartyInfo', address(info));
console2.log(' USXD', address(usxd));
console2.log(' FUSD', address(fusd));
console2.log(' DIVE', address(dive));
console2.log(' BUTC', address(butc));
console2.log(' WTETH', address(wteth));
}
MockERC20 private usxd;

View File

@@ -11,14 +11,14 @@ 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 {IPartyPool} from "../src/IPartyPool.sol";
import {IPartyPoolViewer} from "../src/IPartyPoolViewer.sol";
import {IPartyInfo} from "../src/IPartyInfo.sol";
import {LMSRStabilized} from "../src/LMSRStabilized.sol";
import {NativeWrapper} from "../src/NativeWrapper.sol";
import {PartyPlanner} from "../src/PartyPlanner.sol";
import {PartyPoolDeployer, PartyPoolBalancedPairDeployer} from "../src/PartyPoolDeployer.sol";
import {PartyPoolMintImpl} from "../src/PartyPoolMintImpl.sol";
import {PartyPoolSwapImpl} from "../src/PartyPoolSwapImpl.sol";
import {PartyPoolViewer} from "../src/PartyPoolViewer.sol";
import {PartyInfo} from "../src/PartyInfo.sol";
import {MockERC20} from "../test/MockERC20.sol";
import {MockFlashBorrower} from "../test/MockFlashBorrower.sol";
@@ -189,17 +189,17 @@ contract DeploySepolia is Script {
0
);
PartyPoolViewer viewer = new PartyPoolViewer(swapImpl, mintImpl);
PartyInfo info = new PartyInfo(swapImpl, mintImpl);
exercise(exercisePool, viewer);
exercise(exercisePool, info);
vm.stopBroadcast();
// Set ENV vars
string memory plannerStr = vm.toString(address(planner));
string memory viewerStr = vm.toString(address(viewer));
string memory infoStr = vm.toString(address(info));
vm.setEnv('PLANNER', plannerStr);
vm.setEnv('VIEWER', viewerStr);
vm.setEnv('INFO', infoStr);
vm.setEnv('USXD', vm.toString(address(usxd)));
vm.setEnv('FUSD', vm.toString(address(fusd)));
vm.setEnv('DIVE', vm.toString(address(dive)));
@@ -207,18 +207,18 @@ contract DeploySepolia is Script {
vm.setEnv('WTETH', vm.toString(address(wteth)));
console2.log();
console2.log(' PartyPlanner', address(planner));
console2.log('PartyPoolViewer', address(viewer));
console2.log(' SwapImpl', address(swapImpl));
console2.log(' MintImpl', address(mintImpl));
console2.log(' Deployer', address(deployer));
console2.log(' BPair Deployer', address(balancedPairDeployer));
console2.log(' PartyPlanner', address(planner));
console2.log(' PartyInfo', address(info));
console2.log(' SwapImpl', address(swapImpl));
console2.log(' MintImpl', address(mintImpl));
console2.log(' Deployer', address(deployer));
console2.log('BPair Deployer', address(balancedPairDeployer));
console2.log();
console2.log(' USXD', address(usxd));
console2.log(' FUSD', address(fusd));
console2.log(' DIVE', address(dive));
console2.log(' BUTC', address(butc));
console2.log(' WTETH', address(wteth));
console2.log(' USXD', address(usxd));
console2.log(' FUSD', address(fusd));
console2.log(' DIVE', address(dive));
console2.log(' BUTC', address(butc));
console2.log(' WTETH', address(wteth));
}
MockERC20 private usxd;
@@ -243,7 +243,7 @@ contract DeploySepolia is Script {
wteth.approve(spender, type(uint256).max);
}
function exercise( IPartyPool pool, IPartyPoolViewer viewer ) internal {
function exercise( IPartyPool pool, IPartyInfo info) internal {
// gather tokens and denominators
IERC20[] memory tokens = pool.allTokens();
uint256 n = tokens.length;
@@ -263,7 +263,7 @@ contract DeploySepolia is Script {
// deploy a temporary borrower that repays amount + fee back to the pool
MockFlashBorrower borrower = new MockFlashBorrower();
uint256 flashAmt = 53 * 10**6; // arbitrary non-even amount
uint256 flashFee = viewer.flashFee(pool, address(tokens[0]), flashAmt);
uint256 flashFee = info.flashFee(pool, address(tokens[0]), flashAmt);
// Mint enough to cover the flash fee
MockERC20(address(tokens[0])).mint(address(borrower), flashFee);
// pass the pool address in data so borrower can repay back to this pool