Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration contracts & migration tests #153

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
b49b66c
add migratedInvestmentManager contract
AStox Sep 18, 2023
b439730
wip: working on successfully migrating investmentManager
AStox Sep 20, 2023
dc9e7b4
investmentManager migration working
AStox Sep 21, 2023
3a6964e
cleanup
AStox Sep 21, 2023
b583e1f
wip: add migratedPoolManager.sol
AStox Sep 22, 2023
abf3a6d
Also verify state has been migrated in addition to full invest/redeem…
AStox Sep 27, 2023
0bd8c7b
break up migration into separate functions
AStox Sep 27, 2023
2fd8b00
poolManager state migrating successfully
AStox Sep 27, 2023
bfa8a83
pool manager migration working and clean up
AStox Sep 28, 2023
96e68ff
merge main and update tests accordingly
AStox Sep 28, 2023
2beadb1
Get tests passing again
AStox Sep 28, 2023
c896c7b
update filename
AStox Sep 28, 2023
470c706
merge main
AStox Sep 29, 2023
727614d
clean up
AStox Sep 29, 2023
440b290
remove helper function
AStox Oct 3, 2023
0f19f21
merge main
AStox Oct 3, 2023
089b8e8
add explicit permission checks
AStox Oct 3, 2023
bb03c86
Add migratedGateway and add tests
AStox Oct 3, 2023
a879f5d
add MigratedLiquidityPool
AStox Oct 3, 2023
57e7959
Merge branch 'main' into migration-contracts
AStox Oct 3, 2023
2dfdf3a
Merge branch 'main' into migration-contracts
AStox Oct 5, 2023
a41cb2b
add lpValues.exists
AStox Oct 5, 2023
e3f58e6
reorganize migration tests into separate files
AStox Oct 5, 2023
d200816
add delayedAdmin migration
AStox Oct 5, 2023
400a7e2
use migratedPauseAdmin
AStox Oct 5, 2023
a1a4f00
forge fmt
AStox Oct 5, 2023
5fdeb53
deny old contracts and verify they're denied in permissions checks
AStox Oct 5, 2023
b6330a9
Add restrictionManager migration
AStox Oct 6, 2023
474dff7
merge main
AStox Oct 10, 2023
94ee8ff
Address comments
AStox Oct 10, 2023
9a289df
add invest/redeem flow run to liquidity pool migration
AStox Oct 11, 2023
e587e03
Migrate poolManager along with liquidityPools
AStox Oct 13, 2023
fb9b623
deploy new liquidityPoolFactory
AStox Oct 13, 2023
1207dc9
remove unused helper
AStox Oct 16, 2023
1049450
remove new line
AStox Oct 16, 2023
a52fb6d
fix: add tranche (#180)
ilinzweilin Oct 17, 2023
69aa8b5
Align approval flow and interface with EIP draft (#178)
hieronx Oct 17, 2023
ac440b0
disallow freezing the zero address (#181)
AStox Oct 17, 2023
ade4952
Make restrictionManagerFactory mutable on PoolManager
AStox Oct 17, 2023
100d4a9
group RestrictionManagerFactory with other public vars
AStox Oct 17, 2023
a3b5afd
Merge branch 'tests' into migration-contracts
AStox Oct 17, 2023
fa2ce2a
fix broken tests after merge
AStox Oct 17, 2023
b4b11d2
add migratedFactory contract
AStox Oct 17, 2023
d1bd2dd
Merge branch 'make-restrictionManager-mutable' into migration-contracts
AStox Oct 17, 2023
d797083
clean up, make tests easier to review
AStox Oct 17, 2023
6af024f
Fix permit fr with lower asset amounts (#183)
ilinzweilin Oct 18, 2023
6bfdcea
Make restrictionManagerFactory mutable on PoolManager (#182)
AStox Oct 18, 2023
bda5ba6
Preview methods should revert (#186)
hieronx Oct 18, 2023
378863b
Merge branch 'tests' into migration-contracts
AStox Oct 18, 2023
7c08158
remove unused local variable
AStox Oct 18, 2023
45f3745
Add IERC7540 (#190)
hieronx Oct 19, 2023
411494c
Fix price calculation issue on decrease executions (#184)
hieronx Oct 19, 2023
899a304
Automatically claim deposits on trigger request redeem (#187)
hieronx Oct 19, 2023
17f202a
Fix event callers (#191)
hieronx Oct 23, 2023
f1b721c
Merge branch 'tests' into migration-contracts
AStox Oct 24, 2023
9271bbc
merge main
AStox Nov 9, 2023
46fe028
update for new main branch
AStox Nov 9, 2023
05f5cf6
add updateLiquidityPool function to poolManager
AStox Nov 11, 2023
aa7e514
add unit tests
AStox Nov 11, 2023
183e80b
remove solt generate json
AStox Nov 11, 2023
b3ba524
remove todos
AStox Nov 11, 2023
53bb2c0
merge main
AStox Nov 20, 2023
750430c
fix tests
AStox Nov 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions script/Deployer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ contract Deployer is Script {
PauseAdmin public pauseAdmin;
DelayedAdmin public delayedAdmin;
Gateway public gateway;
address public liquidityPoolFactory;
address public restrictionManagerFactory;
address public trancheTokenFactory;

function deployInvestmentManager(address deployer) public {
// If no salt is provided, a pseudo-random salt is generated,
Expand All @@ -45,9 +48,9 @@ contract Deployer is Script {

investmentManager = new InvestmentManager(address(escrow), address(userEscrow));

address liquidityPoolFactory = address(new LiquidityPoolFactory(address(root)));
address restrictionManagerFactory = address(new RestrictionManagerFactory(address(root)));
address trancheTokenFactory = address(new TrancheTokenFactory{salt: salt}(address(root), deployer));
liquidityPoolFactory = address(new LiquidityPoolFactory(address(root)));
restrictionManagerFactory = address(new RestrictionManagerFactory(address(root)));
trancheTokenFactory = address(new TrancheTokenFactory{salt: salt}(address(root), deployer));
investmentManager = new InvestmentManager(address(escrow), address(userEscrow));
poolManager =
new PoolManager(address(escrow), liquidityPoolFactory, restrictionManagerFactory, trancheTokenFactory);
Expand Down
12 changes: 12 additions & 0 deletions src/PoolManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,18 @@ contract PoolManager is Auth {
}

// --- Helpers ---
function getUndeployedTranche(uint64 poolId, bytes16 trancheId)
AStox marked this conversation as resolved.
Show resolved Hide resolved
public
view
returns (uint8 decimals, string memory tokenName, string memory tokenSymbol)
{
UndeployedTranche storage tranche = undeployedTranches[poolId][trancheId];
uint8 decimals = tranche.decimals;
string memory tokenName = tranche.tokenName;
string memory tokenSymbol = tranche.tokenSymbol;
return (decimals, tokenName, tokenSymbol);
}

function getTrancheToken(uint64 poolId, bytes16 trancheId) public view returns (address) {
Tranche storage tranche = pools[poolId].tranches[trancheId];
return tranche.token;
Expand Down
Loading